mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-17 08:57:26 +00:00
Deprecate sampling depth textures with float/unfilterable-float
Dawn currently allows sampling depth textures this way, but it is not in the WebGPU spec, and the behavior is not guaranteed with the Metal API. This commit also updates the stencil sampling tests to expect (s, s, s, s) or (s, 0, 0, 1). Bug: dawn:1021 Change-Id: I9210a2a3ff1655747a202a51f46f38faa35c85d4 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/59320 Commit-Queue: Austin Eng <enga@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
@@ -470,9 +470,12 @@ TEST_F(BindGroupValidationTest, TextureSampleType) {
|
||||
DoTest(false, wgpu::TextureFormat::R32Float, wgpu::TextureSampleType::Uint);
|
||||
DoTest(false, wgpu::TextureFormat::R32Float, wgpu::TextureSampleType::Sint);
|
||||
|
||||
// Test that Depth32Float is only compatible with float/unfilterable-float/depth
|
||||
DoTest(true, wgpu::TextureFormat::Depth32Float, wgpu::TextureSampleType::Float);
|
||||
DoTest(true, wgpu::TextureFormat::Depth32Float, wgpu::TextureSampleType::UnfilterableFloat);
|
||||
// Test that Depth32Float is only compatible with depth. float/unfilterable-float is deprecated.
|
||||
// TODO(crbug.com/dawn/1021): Disallow using float/unfilterable-float with depth textures.
|
||||
EXPECT_DEPRECATION_WARNING(
|
||||
DoTest(true, wgpu::TextureFormat::Depth32Float, wgpu::TextureSampleType::Float));
|
||||
EXPECT_DEPRECATION_WARNING(DoTest(true, wgpu::TextureFormat::Depth32Float,
|
||||
wgpu::TextureSampleType::UnfilterableFloat));
|
||||
DoTest(true, wgpu::TextureFormat::Depth32Float, wgpu::TextureSampleType::Depth);
|
||||
DoTest(false, wgpu::TextureFormat::Depth32Float, wgpu::TextureSampleType::Uint);
|
||||
DoTest(false, wgpu::TextureFormat::Depth32Float, wgpu::TextureSampleType::Sint);
|
||||
@@ -495,7 +498,7 @@ TEST_F(BindGroupValidationTest, TextureSampleType) {
|
||||
// Test which depth-stencil formats are allowed to be sampled (all).
|
||||
TEST_F(BindGroupValidationTest, SamplingDepthStencilTexture) {
|
||||
wgpu::BindGroupLayout layout = utils::MakeBindGroupLayout(
|
||||
device, {{0, wgpu::ShaderStage::Fragment, wgpu::TextureSampleType::Float}});
|
||||
device, {{0, wgpu::ShaderStage::Fragment, wgpu::TextureSampleType::Depth}});
|
||||
|
||||
wgpu::TextureDescriptor desc;
|
||||
desc.size = {1, 1, 1};
|
||||
|
||||
Reference in New Issue
Block a user