Collect if a storage texture is declared as multisampled in shader
This patch records if a storage texture is declared as multisampled or
not in shaders after a fix in shaderc.
BUG=dawn:267
TEST=dawn_unittests
Change-Id: I3914ccd3bfa4d0b6ab9c7cfb650352b70ba067a5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/17600
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
diff --git a/DEPS b/DEPS
index dca27e2..ea9a36c 100644
--- a/DEPS
+++ b/DEPS
@@ -69,7 +69,7 @@
'condition': 'dawn_standalone',
},
'third_party/shaderc': {
- 'url': '{chromium_git}/external/github.com/google/shaderc@eb7bd643ef43ffb9ba091e39a389d0a2a923b1aa',
+ 'url': '{chromium_git}/external/github.com/google/shaderc@3d915b2802667f44a359463f1f420ac33576001b',
'condition': 'dawn_standalone',
},
diff --git a/src/dawn_native/ShaderModule.cpp b/src/dawn_native/ShaderModule.cpp
index 8732a51..1a7c6b5 100644
--- a/src/dawn_native/ShaderModule.cpp
+++ b/src/dawn_native/ShaderModule.cpp
@@ -412,8 +412,7 @@
return DAWN_VALIDATION_ERROR(
"The storage texture format is not supported");
}
- // TODO(jiawei.shao@intel.com): extract info->multisampled when it is
- // supported for storage images in SPVC.
+ info->multisampled = binding.multisampled;
info->storageTextureFormat = storageTextureFormat;
info->textureDimension =
ToWGPUTextureViewDimension(binding.texture_dimension);
@@ -615,6 +614,7 @@
return DAWN_VALIDATION_ERROR(
"The storage texture format is not supported");
}
+ info->multisampled = imageType.ms;
info->storageTextureFormat = storageTextureFormat;
info->textureDimension =
SpirvDimToTextureViewDimension(imageType.dim, imageType.arrayed);
diff --git a/src/tests/unittests/validation/StorageTextureValidationTests.cpp b/src/tests/unittests/validation/StorageTextureValidationTests.cpp
index 3fe0a0c..46cc280 100644
--- a/src/tests/unittests/validation/StorageTextureValidationTests.cpp
+++ b/src/tests/unittests/validation/StorageTextureValidationTests.cpp
@@ -846,3 +846,20 @@
}
}
}
+
+// Verify multisampled storage textures cannot be supported now.
+TEST_F(StorageTextureValidationTests, MultisampledStorageTexture) {
+ for (wgpu::BindingType bindingType : kSupportedStorageTextureBindingTypes) {
+ std::string computeShader =
+ CreateComputeShaderWithStorageTexture(bindingType, "rgba8", "", "image2DMS");
+ wgpu::ShaderModule csModule = utils::CreateShaderModule(
+ device, utils::SingleShaderStage::Compute, computeShader.c_str());
+
+ wgpu::ComputePipelineDescriptor descriptor;
+ descriptor.layout = nullptr;
+ descriptor.computeStage.module = csModule;
+ descriptor.computeStage.entryPoint = "main";
+
+ ASSERT_DEVICE_ERROR(device.CreateComputePipeline(&descriptor));
+ }
+}