mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Fix depth textures being bound as float textures
Webgpu defines that a texture depth format can only be sampled as a depth texture or as an "unfilterable-float", however both the clouds and postprocess pipeline were declaring in their bind group that the depth source was a texture with a sample type of float (filterable). This is forbidden by the webgpu specification and should be caught by validation, but the version of wgpu we are using doesn't have that check (older versions have the check), so we can only assume that this is undefined behavior. Relevant sources: - [Bind Group Creation](https://gpuweb.github.io/gpuweb/#bind-group-creation) includes the rules that explicitly forbid this situation - [Depth-stencil formats](https://gpuweb.github.io/gpuweb/#depth-formats) defines which sample types we are allowed to use with depth textures
This commit is contained in:
parent
ba2f51e5e0
commit
277528355b
@ -62,7 +62,7 @@ impl CloudsLayout {
|
|||||||
binding: 2,
|
binding: 2,
|
||||||
visibility: wgpu::ShaderStage::FRAGMENT,
|
visibility: wgpu::ShaderStage::FRAGMENT,
|
||||||
ty: wgpu::BindingType::Texture {
|
ty: wgpu::BindingType::Texture {
|
||||||
sample_type: wgpu::TextureSampleType::Float { filterable: true },
|
sample_type: wgpu::TextureSampleType::Float { filterable: false },
|
||||||
view_dimension: wgpu::TextureViewDimension::D2,
|
view_dimension: wgpu::TextureViewDimension::D2,
|
||||||
multisampled: false,
|
multisampled: false,
|
||||||
},
|
},
|
||||||
@ -72,7 +72,7 @@ impl CloudsLayout {
|
|||||||
binding: 3,
|
binding: 3,
|
||||||
visibility: wgpu::ShaderStage::FRAGMENT,
|
visibility: wgpu::ShaderStage::FRAGMENT,
|
||||||
ty: wgpu::BindingType::Sampler {
|
ty: wgpu::BindingType::Sampler {
|
||||||
filtering: true,
|
filtering: false,
|
||||||
comparison: false,
|
comparison: false,
|
||||||
},
|
},
|
||||||
count: None,
|
count: None,
|
||||||
|
@ -58,7 +58,7 @@ impl PostProcessLayout {
|
|||||||
binding: 2,
|
binding: 2,
|
||||||
visibility: wgpu::ShaderStage::FRAGMENT,
|
visibility: wgpu::ShaderStage::FRAGMENT,
|
||||||
ty: wgpu::BindingType::Texture {
|
ty: wgpu::BindingType::Texture {
|
||||||
sample_type: wgpu::TextureSampleType::Float { filterable: true },
|
sample_type: wgpu::TextureSampleType::Float { filterable: false },
|
||||||
view_dimension: wgpu::TextureViewDimension::D2,
|
view_dimension: wgpu::TextureViewDimension::D2,
|
||||||
multisampled: false,
|
multisampled: false,
|
||||||
},
|
},
|
||||||
@ -68,7 +68,7 @@ impl PostProcessLayout {
|
|||||||
binding: 3,
|
binding: 3,
|
||||||
visibility: wgpu::ShaderStage::FRAGMENT,
|
visibility: wgpu::ShaderStage::FRAGMENT,
|
||||||
ty: wgpu::BindingType::Sampler {
|
ty: wgpu::BindingType::Sampler {
|
||||||
filtering: true,
|
filtering: false,
|
||||||
comparison: false,
|
comparison: false,
|
||||||
},
|
},
|
||||||
count: None,
|
count: None,
|
||||||
|
Loading…
Reference in New Issue
Block a user