Skip to content

Commit

Permalink
Use Depth16Unorm
Browse files Browse the repository at this point in the history
  • Loading branch information
HackerFoo committed Apr 25, 2023
1 parent c59b75d commit 0de144f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion crates/bevy_core_pipeline/src/core_3d/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ pub fn prepare_core_3d_depth_textures(
sample_count: msaa.samples(),
dimension: TextureDimension::D2,
// PERF: vulkan docs recommend using 24 bit depth for better performance
format: TextureFormat::Depth32Float,
format: TextureFormat::Depth16Unorm,
usage,
view_formats: &[],
};
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_core_pipeline/src/prepass/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ use bevy_render::{
};
use bevy_utils::FloatOrd;

pub const DEPTH_PREPASS_FORMAT: TextureFormat = TextureFormat::Depth32Float;
pub const DEPTH_PREPASS_FORMAT: TextureFormat = TextureFormat::Depth16Unorm;
pub const NORMAL_PREPASS_FORMAT: TextureFormat = TextureFormat::Rgb10a2Unorm;
pub const MOTION_VECTOR_PREPASS_FORMAT: TextureFormat = TextureFormat::Rg16Float;

Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_pbr/src/render/light.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ pub const MAX_DIRECTIONAL_LIGHTS: usize = 10;
pub const MAX_CASCADES_PER_LIGHT: usize = 4;
#[cfg(feature = "webgl")]
pub const MAX_CASCADES_PER_LIGHT: usize = 1;
pub const SHADOW_FORMAT: TextureFormat = TextureFormat::Depth32Float;
pub const SHADOW_FORMAT: TextureFormat = TextureFormat::Depth16Unorm;

#[derive(Resource, Clone)]
pub struct ShadowSamplers {
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_pbr/src/render/mesh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,7 @@ impl SpecializedMeshPipeline for MeshPipeline {
strip_index_format: None,
},
depth_stencil: Some(DepthStencilState {
format: TextureFormat::Depth32Float,
format: TextureFormat::Depth16Unorm,
depth_write_enabled,
depth_compare: CompareFunction::GreaterEqual,
stencil: StencilState {
Expand Down

0 comments on commit 0de144f

Please sign in to comment.