From 505e1a9368a5fa1d1fb4046bb55bc2a95e32212d Mon Sep 17 00:00:00 2001 From: Austin Eng Date: Fri, 16 Sep 2022 01:14:28 +0000 Subject: [PATCH] Revert "Make it invalid to use sampleType "float" with multisampled textures" This reverts commit 9b2f273d36a2de47d028f34f8e4d46de0a5dae5c. Reason for revert: Breaking change needs deprecation period. Original change's description: > Make it invalid to use sampleType "float" with multisampled textures > > Fixed: dawn:1540 > Change-Id: I31f197d802c20ed7e6ef2ae00d4e107ab6f94278 > Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/102420 > Reviewed-by: Corentin Wallez > Kokoro: Kokoro > Commit-Queue: Austin Eng TBR=cwallez@chromium.org,enga@chromium.org,shrekshao@google.com,noreply+kokoro@google.com,dawn-scoped@luci-project-accounts.iam.gserviceaccount.com Change-Id: I5ac4b5691b0c4fb0ce76223c1997855e1b3485f3 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/102500 Reviewed-by: Austin Eng Commit-Queue: Austin Eng Bot-Commit: rubber-stamper@appspot.gserviceaccount.com --- src/dawn/native/BindGroupLayout.cpp | 5 -- .../validation/BindGroupValidationTests.cpp | 51 ++++++++----------- webgpu-cts/expectations.txt | 24 --------- 3 files changed, 22 insertions(+), 58 deletions(-) diff --git a/src/dawn/native/BindGroupLayout.cpp b/src/dawn/native/BindGroupLayout.cpp index e12008d555..d4bd324558 100644 --- a/src/dawn/native/BindGroupLayout.cpp +++ b/src/dawn/native/BindGroupLayout.cpp @@ -113,11 +113,6 @@ MaybeError ValidateBindGroupLayoutEntry(DeviceBase* device, DAWN_INVALID_IF(texture.multisampled && viewDimension != wgpu::TextureViewDimension::e2D, "View dimension (%s) for a multisampled texture bindings was not %s.", viewDimension, wgpu::TextureViewDimension::e2D); - - DAWN_INVALID_IF( - texture.multisampled && texture.sampleType == wgpu::TextureSampleType::Float, - "Sample type for multisampled texture bindings must not be %s.", - wgpu::TextureSampleType::Float); } if (entry.storageTexture.access != wgpu::StorageTextureAccess::Undefined) { diff --git a/src/dawn/tests/unittests/validation/BindGroupValidationTests.cpp b/src/dawn/tests/unittests/validation/BindGroupValidationTests.cpp index 22f38bbb54..112c6691c9 100644 --- a/src/dawn/tests/unittests/validation/BindGroupValidationTests.cpp +++ b/src/dawn/tests/unittests/validation/BindGroupValidationTests.cpp @@ -781,7 +781,7 @@ TEST_F(BindGroupValidationTest, BufferOffsetAlignment) { // Tests constraints on the texture for MultisampledTexture bindings TEST_F(BindGroupValidationTest, MultisampledTexture) { wgpu::BindGroupLayout layout = utils::MakeBindGroupLayout( - device, {{0, wgpu::ShaderStage::Fragment, wgpu::TextureSampleType::UnfilterableFloat, + device, {{0, wgpu::ShaderStage::Fragment, wgpu::TextureSampleType::Float, wgpu::TextureViewDimension::e2D, true}}); wgpu::BindGroupEntry binding; @@ -1420,70 +1420,63 @@ TEST_F(BindGroupLayoutValidationTest, DynamicBufferNumberLimit) { // Test that multisampled textures must be 2D sampled textures TEST_F(BindGroupLayoutValidationTest, MultisampledTextureViewDimension) { // Multisampled 2D texture works. - utils::MakeBindGroupLayout( - device, { - {0, wgpu::ShaderStage::Compute, wgpu::TextureSampleType::UnfilterableFloat, - wgpu::TextureViewDimension::e2D, true}, - }); + utils::MakeBindGroupLayout(device, + { + {0, wgpu::ShaderStage::Compute, wgpu::TextureSampleType::Float, + wgpu::TextureViewDimension::e2D, true}, + }); // Multisampled 2D (defaulted) texture works. - utils::MakeBindGroupLayout( - device, { - {0, wgpu::ShaderStage::Compute, wgpu::TextureSampleType::UnfilterableFloat, - wgpu::TextureViewDimension::Undefined, true}, - }); + utils::MakeBindGroupLayout(device, + { + {0, wgpu::ShaderStage::Compute, wgpu::TextureSampleType::Float, + wgpu::TextureViewDimension::Undefined, true}, + }); // Multisampled 2D array texture is invalid. ASSERT_DEVICE_ERROR(utils::MakeBindGroupLayout( device, { - {0, wgpu::ShaderStage::Compute, wgpu::TextureSampleType::UnfilterableFloat, + {0, wgpu::ShaderStage::Compute, wgpu::TextureSampleType::Float, wgpu::TextureViewDimension::e2DArray, true}, })); // Multisampled cube texture is invalid. ASSERT_DEVICE_ERROR(utils::MakeBindGroupLayout( device, { - {0, wgpu::ShaderStage::Compute, wgpu::TextureSampleType::UnfilterableFloat, + {0, wgpu::ShaderStage::Compute, wgpu::TextureSampleType::Float, wgpu::TextureViewDimension::Cube, true}, })); // Multisampled cube array texture is invalid. ASSERT_DEVICE_ERROR(utils::MakeBindGroupLayout( device, { - {0, wgpu::ShaderStage::Compute, wgpu::TextureSampleType::UnfilterableFloat, + {0, wgpu::ShaderStage::Compute, wgpu::TextureSampleType::Float, wgpu::TextureViewDimension::CubeArray, true}, })); // Multisampled 3D texture is invalid. ASSERT_DEVICE_ERROR(utils::MakeBindGroupLayout( device, { - {0, wgpu::ShaderStage::Compute, wgpu::TextureSampleType::UnfilterableFloat, + {0, wgpu::ShaderStage::Compute, wgpu::TextureSampleType::Float, wgpu::TextureViewDimension::e3D, true}, })); // Multisampled 1D texture is invalid. ASSERT_DEVICE_ERROR(utils::MakeBindGroupLayout( device, { - {0, wgpu::ShaderStage::Compute, wgpu::TextureSampleType::UnfilterableFloat, + {0, wgpu::ShaderStage::Compute, wgpu::TextureSampleType::Float, wgpu::TextureViewDimension::e1D, true}, })); } // Test that multisampled texture bindings are valid TEST_F(BindGroupLayoutValidationTest, MultisampledTextureSampleType) { - // Multisampled float sample type invalid. - ASSERT_DEVICE_ERROR(utils::MakeBindGroupLayout( - device, { - {0, wgpu::ShaderStage::Compute, wgpu::TextureSampleType::Float, - wgpu::TextureViewDimension::e2D, true}, - })); - - // Multisampled unfilterable float sample type works. - utils::MakeBindGroupLayout( - device, { - {0, wgpu::ShaderStage::Compute, wgpu::TextureSampleType::UnfilterableFloat, - wgpu::TextureViewDimension::e2D, true}, - }); + // Multisampled float sample type works. + utils::MakeBindGroupLayout(device, + { + {0, wgpu::ShaderStage::Compute, wgpu::TextureSampleType::Float, + wgpu::TextureViewDimension::e2D, true}, + }); // Multisampled uint sample type works. utils::MakeBindGroupLayout(device, diff --git a/webgpu-cts/expectations.txt b/webgpu-cts/expectations.txt index bba7c8d015..3fcee4744b 100644 --- a/webgpu-cts/expectations.txt +++ b/webgpu-cts/expectations.txt @@ -623,30 +623,6 @@ crbug.com/dawn/0000 [ mac ] worker_webgpu:api,operation,render_pass,storeOp:rend ################################################################################ crbug.com/dawn/0000 [ win ] webgpu:shader,execution,expression,binary,f32_logical:* [ Slow ] -################################################################################ -# test bug. need validation update -# github.com/gpuweb/cts/issues/1848 -################################################################################ -webgpu:api,validation,createBindGroup:binding_must_contain_resource_defined_in_layout: [ Failure ] -webgpu:api,validation,createBindGroup:texture,resource_state: [ Failure ] -webgpu:api,validation,createBindGroup:texture_binding_must_have_correct_usage: [ Failure ] -webgpu:api,validation,createBindGroupLayout:max_resources_per_stage,in_bind_group_layout:maxedEntry={"texture":{"multisampled":false}} [ Failure ] -webgpu:api,validation,createBindGroupLayout:max_resources_per_stage,in_bind_group_layout:maxedEntry={"texture":{"multisampled":true}} [ Failure ] -webgpu:api,validation,createBindGroupLayout:max_resources_per_stage,in_pipeline_layout:maxedEntry={"texture":{"multisampled":false}} [ Failure ] -webgpu:api,validation,createBindGroupLayout:max_resources_per_stage,in_pipeline_layout:maxedEntry={"texture":{"multisampled":true}} [ Failure ] -webgpu:api,validation,createBindGroupLayout:multisampled_validation: [ Failure ] -webgpu:api,validation,createBindGroupLayout:visibility:visibility=0 [ Failure ] -webgpu:api,validation,createBindGroupLayout:visibility:visibility=1 [ Failure ] -webgpu:api,validation,createBindGroupLayout:visibility:visibility=2 [ Failure ] -webgpu:api,validation,createBindGroupLayout:visibility:visibility=3 [ Failure ] -webgpu:api,validation,createBindGroupLayout:visibility:visibility=4 [ Failure ] -webgpu:api,validation,createBindGroupLayout:visibility:visibility=5 [ Failure ] -webgpu:api,validation,createBindGroupLayout:visibility:visibility=6 [ Failure ] -webgpu:api,validation,createBindGroupLayout:visibility:visibility=7 [ Failure ] -webgpu:api,validation,resource_usages,texture,in_pass_encoder:bindings_in_bundle:type0="multisampled-texture";type1="multisampled-texture" [ Failure ] -webgpu:api,validation,resource_usages,texture,in_pass_encoder:bindings_in_bundle:type0="multisampled-texture";type1="render-target" [ Failure ] -webgpu:api,validation,resource_usages,texture,in_pass_encoder:bindings_in_bundle:type0="render-target";type1="multisampled-texture" [ Failure ] - # New failures. Please triage: crbug.com/dawn/0000 [ intel-gen-9 win10 ] webgpu:api,operation,command_buffer,image_copy:mip_levels:initMethod="WriteTexture";checkMethod="PartialCopyT2B";format="rgba32uint";dimension="2d" [ Failure ] crbug.com/dawn/0000 webgpu:api,operation,device,lost:not_lost_on_gc: [ Failure ]