diff --git a/src/dawn_native/BindGroupLayout.cpp b/src/dawn_native/BindGroupLayout.cpp index 2df2483b1c..9c5c8dca1f 100644 --- a/src/dawn_native/BindGroupLayout.cpp +++ b/src/dawn_native/BindGroupLayout.cpp @@ -179,6 +179,8 @@ namespace dawn_native { return DAWN_VALIDATION_ERROR("3D texture bindings may not be multisampled"); case wgpu::TextureViewDimension::e1D: + return DAWN_VALIDATION_ERROR("1D texture bindings may not be multisampled"); + case wgpu::TextureViewDimension::Undefined: default: UNREACHABLE(); diff --git a/src/tests/unittests/validation/BindGroupValidationTests.cpp b/src/tests/unittests/validation/BindGroupValidationTests.cpp index d603636cdf..69604daf61 100644 --- a/src/tests/unittests/validation/BindGroupValidationTests.cpp +++ b/src/tests/unittests/validation/BindGroupValidationTests.cpp @@ -872,6 +872,13 @@ TEST_F(BindGroupLayoutValidationTest, MultisampledTextures) { {0, wgpu::ShaderStage::Compute, wgpu::BindingType::SampledTexture, false, 0, true, wgpu::TextureViewDimension::e3D}, })); + + // Multisampled 1D texture is invalid. + ASSERT_DEVICE_ERROR(utils::MakeBindGroupLayout( + device, { + {0, wgpu::ShaderStage::Compute, wgpu::BindingType::SampledTexture, false, 0, + true, wgpu::TextureViewDimension::e1D}, + })); } // Test that it is an error to pass multisampled=true for non-texture bindings