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>
This commit is contained in:
parent
046389926f
commit
d5db214564
2
DEPS
2
DEPS
|
@ -69,7 +69,7 @@ deps = {
|
|||
'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',
|
||||
},
|
||||
|
||||
|
|
|
@ -412,8 +412,7 @@ namespace dawn_native {
|
|||
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 @@ namespace dawn_native {
|
|||
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);
|
||||
|
|
|
@ -846,3 +846,20 @@ TEST_F(StorageTextureValidationTests, StorageTextureViewDimensionInBindGroup) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 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));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue