bevy_pbr: Apply #![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)]
(#17277)
# Objective - https://github.com/bevyengine/bevy/issues/17111 ## Solution Set the `clippy::allow_attributes` and `clippy::allow_attributes_without_reason` lints to `deny`, and bring `bevy_pbr` in line with the new restrictions. ## Testing `cargo clippy --tests --package bevy_pbr` was run, and no errors were encountered.
This commit is contained in:
parent
8a82a0c83e
commit
df38d1a907
@ -37,7 +37,6 @@ pub trait MaterialExtension: Asset + AsBindGroup + Clone + Sized {
|
||||
|
||||
/// Returns this material's fragment shader. If [`ShaderRef::Default`] is returned, the base material mesh fragment shader
|
||||
/// will be used.
|
||||
#[allow(unused_variables)]
|
||||
fn fragment_shader() -> ShaderRef {
|
||||
ShaderRef::Default
|
||||
}
|
||||
@ -50,7 +49,6 @@ pub trait MaterialExtension: Asset + AsBindGroup + Clone + Sized {
|
||||
|
||||
/// Returns this material's prepass fragment shader. If [`ShaderRef::Default`] is returned, the base material prepass fragment shader
|
||||
/// will be used.
|
||||
#[allow(unused_variables)]
|
||||
fn prepass_fragment_shader() -> ShaderRef {
|
||||
ShaderRef::Default
|
||||
}
|
||||
@ -63,14 +61,12 @@ pub trait MaterialExtension: Asset + AsBindGroup + Clone + Sized {
|
||||
|
||||
/// Returns this material's prepass fragment shader. If [`ShaderRef::Default`] is returned, the base material deferred fragment shader
|
||||
/// will be used.
|
||||
#[allow(unused_variables)]
|
||||
fn deferred_fragment_shader() -> ShaderRef {
|
||||
ShaderRef::Default
|
||||
}
|
||||
|
||||
/// Returns this material's [`crate::meshlet::MeshletMesh`] fragment shader. If [`ShaderRef::Default`] is returned,
|
||||
/// the default meshlet mesh fragment shader will be used.
|
||||
#[allow(unused_variables)]
|
||||
#[cfg(feature = "meshlet")]
|
||||
fn meshlet_mesh_fragment_shader() -> ShaderRef {
|
||||
ShaderRef::Default
|
||||
@ -78,7 +74,6 @@ pub trait MaterialExtension: Asset + AsBindGroup + Clone + Sized {
|
||||
|
||||
/// Returns this material's [`crate::meshlet::MeshletMesh`] prepass fragment shader. If [`ShaderRef::Default`] is returned,
|
||||
/// the default meshlet mesh prepass fragment shader will be used.
|
||||
#[allow(unused_variables)]
|
||||
#[cfg(feature = "meshlet")]
|
||||
fn meshlet_mesh_prepass_fragment_shader() -> ShaderRef {
|
||||
ShaderRef::Default
|
||||
@ -86,7 +81,6 @@ pub trait MaterialExtension: Asset + AsBindGroup + Clone + Sized {
|
||||
|
||||
/// Returns this material's [`crate::meshlet::MeshletMesh`] deferred fragment shader. If [`ShaderRef::Default`] is returned,
|
||||
/// the default meshlet mesh deferred fragment shader will be used.
|
||||
#[allow(unused_variables)]
|
||||
#[cfg(feature = "meshlet")]
|
||||
fn meshlet_mesh_deferred_fragment_shader() -> ShaderRef {
|
||||
ShaderRef::Default
|
||||
@ -95,7 +89,10 @@ pub trait MaterialExtension: Asset + AsBindGroup + Clone + Sized {
|
||||
/// Customizes the default [`RenderPipelineDescriptor`] for a specific entity using the entity's
|
||||
/// [`MaterialPipelineKey`] and [`MeshVertexBufferLayoutRef`] as input.
|
||||
/// Specialization for the base material is applied before this function is called.
|
||||
#[allow(unused_variables)]
|
||||
#[expect(
|
||||
unused_variables,
|
||||
reason = "The parameters here are intentionally unused by the default implementation; however, putting underscores here will result in the underscores being copied by rust-analyzer's tab completion."
|
||||
)]
|
||||
#[inline]
|
||||
fn specialize(
|
||||
pipeline: &MaterialExtensionPipeline,
|
||||
|
@ -1,6 +1,11 @@
|
||||
#![expect(missing_docs, reason = "Not all docs are written yet, see #3492.")]
|
||||
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
|
||||
#![deny(unsafe_code)]
|
||||
#![forbid(unsafe_code)]
|
||||
#![deny(
|
||||
clippy::allow_attributes,
|
||||
clippy::allow_attributes_without_reason,
|
||||
reason = "See #17111; To be removed once all crates are in-line with these attributes"
|
||||
)]
|
||||
#![doc(
|
||||
html_logo_url = "https://bevyengine.org/assets/icon.png",
|
||||
html_favicon_url = "https://bevyengine.org/assets/icon.png"
|
||||
|
@ -185,7 +185,6 @@ pub struct ViewLightProbesUniformOffset(u32);
|
||||
/// This information is parameterized by the [`LightProbeComponent`] type. This
|
||||
/// will either be [`EnvironmentMapLight`] for reflection probes or
|
||||
/// [`IrradianceVolume`] for irradiance volumes.
|
||||
#[allow(dead_code)]
|
||||
struct LightProbeInfo<C>
|
||||
where
|
||||
C: LightProbeComponent,
|
||||
|
@ -124,7 +124,6 @@ pub trait Material: Asset + AsBindGroup + Clone + Sized {
|
||||
|
||||
/// Returns this material's fragment shader. If [`ShaderRef::Default`] is returned, the default mesh fragment shader
|
||||
/// will be used.
|
||||
#[allow(unused_variables)]
|
||||
fn fragment_shader() -> ShaderRef {
|
||||
ShaderRef::Default
|
||||
}
|
||||
@ -174,7 +173,6 @@ pub trait Material: Asset + AsBindGroup + Clone + Sized {
|
||||
///
|
||||
/// This is used for the various [prepasses](bevy_core_pipeline::prepass) as well as for generating the depth maps
|
||||
/// required for shadow mapping.
|
||||
#[allow(unused_variables)]
|
||||
fn prepass_fragment_shader() -> ShaderRef {
|
||||
ShaderRef::Default
|
||||
}
|
||||
@ -187,7 +185,6 @@ pub trait Material: Asset + AsBindGroup + Clone + Sized {
|
||||
|
||||
/// Returns this material's deferred fragment shader. If [`ShaderRef::Default`] is returned, the default deferred fragment shader
|
||||
/// will be used.
|
||||
#[allow(unused_variables)]
|
||||
fn deferred_fragment_shader() -> ShaderRef {
|
||||
ShaderRef::Default
|
||||
}
|
||||
@ -198,7 +195,6 @@ pub trait Material: Asset + AsBindGroup + Clone + Sized {
|
||||
/// This is part of an experimental feature, and is unnecessary to implement unless you are using `MeshletMesh`'s.
|
||||
///
|
||||
/// See [`crate::meshlet::MeshletMesh`] for limitations.
|
||||
#[allow(unused_variables)]
|
||||
#[cfg(feature = "meshlet")]
|
||||
fn meshlet_mesh_fragment_shader() -> ShaderRef {
|
||||
ShaderRef::Default
|
||||
@ -210,7 +206,6 @@ pub trait Material: Asset + AsBindGroup + Clone + Sized {
|
||||
/// This is part of an experimental feature, and is unnecessary to implement unless you are using `MeshletMesh`'s.
|
||||
///
|
||||
/// See [`crate::meshlet::MeshletMesh`] for limitations.
|
||||
#[allow(unused_variables)]
|
||||
#[cfg(feature = "meshlet")]
|
||||
fn meshlet_mesh_prepass_fragment_shader() -> ShaderRef {
|
||||
ShaderRef::Default
|
||||
@ -222,7 +217,6 @@ pub trait Material: Asset + AsBindGroup + Clone + Sized {
|
||||
/// This is part of an experimental feature, and is unnecessary to implement unless you are using `MeshletMesh`'s.
|
||||
///
|
||||
/// See [`crate::meshlet::MeshletMesh`] for limitations.
|
||||
#[allow(unused_variables)]
|
||||
#[cfg(feature = "meshlet")]
|
||||
fn meshlet_mesh_deferred_fragment_shader() -> ShaderRef {
|
||||
ShaderRef::Default
|
||||
@ -230,7 +224,10 @@ pub trait Material: Asset + AsBindGroup + Clone + Sized {
|
||||
|
||||
/// Customizes the default [`RenderPipelineDescriptor`] for a specific entity using the entity's
|
||||
/// [`MaterialPipelineKey`] and [`MeshVertexBufferLayoutRef`] as input.
|
||||
#[allow(unused_variables)]
|
||||
#[expect(
|
||||
unused_variables,
|
||||
reason = "The parameters here are intentionally unused by the default implementation; however, putting underscores here will result in the underscores being copied by rust-analyzer's tab completion."
|
||||
)]
|
||||
#[inline]
|
||||
fn specialize(
|
||||
pipeline: &MaterialPipeline<Self>,
|
||||
|
@ -752,17 +752,9 @@ fn prepare_ssao_bind_groups(
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::needless_range_loop)]
|
||||
fn generate_hilbert_index_lut() -> [[u16; 64]; 64] {
|
||||
let mut t = [[0; 64]; 64];
|
||||
|
||||
for x in 0..64 {
|
||||
for y in 0..64 {
|
||||
t[x][y] = hilbert_index(x as u16, y as u16);
|
||||
}
|
||||
}
|
||||
|
||||
t
|
||||
use core::array::from_fn;
|
||||
from_fn(|x| from_fn(|y| hilbert_index(x as u16, y as u16)))
|
||||
}
|
||||
|
||||
// https://www.shadertoy.com/view/3tB3z3
|
||||
|
Loading…
Reference in New Issue
Block a user