Validate 1D texture bindings cannot be multisampled

Bug: chromium:1104737
Change-Id: I61d631f7fce2c7d68823f265f06f75069af765a6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/25101
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
This commit is contained in:
Austin Eng 2020-07-16 20:43:26 +00:00 committed by Commit Bot service account
parent c15c6eb9d8
commit 34f5133104
2 changed files with 9 additions and 0 deletions

View File

@ -179,6 +179,8 @@ namespace dawn_native {
return DAWN_VALIDATION_ERROR("3D texture bindings may not be multisampled"); return DAWN_VALIDATION_ERROR("3D texture bindings may not be multisampled");
case wgpu::TextureViewDimension::e1D: case wgpu::TextureViewDimension::e1D:
return DAWN_VALIDATION_ERROR("1D texture bindings may not be multisampled");
case wgpu::TextureViewDimension::Undefined: case wgpu::TextureViewDimension::Undefined:
default: default:
UNREACHABLE(); UNREACHABLE();

View File

@ -872,6 +872,13 @@ TEST_F(BindGroupLayoutValidationTest, MultisampledTextures) {
{0, wgpu::ShaderStage::Compute, wgpu::BindingType::SampledTexture, false, 0, {0, wgpu::ShaderStage::Compute, wgpu::BindingType::SampledTexture, false, 0,
true, wgpu::TextureViewDimension::e3D}, 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 // Test that it is an error to pass multisampled=true for non-texture bindings