diff --git a/src/dawn_native/ShaderModule.cpp b/src/dawn_native/ShaderModule.cpp index 1908264e4a..9e0165c204 100644 --- a/src/dawn_native/ShaderModule.cpp +++ b/src/dawn_native/ShaderModule.cpp @@ -113,16 +113,12 @@ namespace dawn_native { return wgpu::BindingType::Sampler; case shaderc_spvc_binding_type_sampled_texture: return wgpu::BindingType::SampledTexture; - - // TODO(jiawei.shao@intel.com): add convertion to read-only and write-only storage - // textures when they are supported as shaderc_spvc binding types. + case shaderc_spvc_binding_type_readonly_storage_texture: + return wgpu::BindingType::ReadonlyStorageTexture; + case shaderc_spvc_binding_type_writeonly_storage_texture: + return wgpu::BindingType::WriteonlyStorageTexture; case shaderc_spvc_binding_type_storage_texture: return wgpu::BindingType::StorageTexture; - default: - // TODO(rharrison): Remove this case once I am done changing the - // values in shaderc_spvc_binding_type - UNREACHABLE(); - return wgpu::BindingType::StorageTexture; } UNREACHABLE(); } @@ -357,6 +353,13 @@ namespace dawn_native { "Unable to get binding info for storage buffers from shader")); DAWN_TRY(ExtractResourcesBinding(resource_bindings)); + DAWN_TRY(CheckSpvcSuccess( + mSpvcContext.GetBindingInfo(shaderc_spvc_shader_resource_storage_images, + shaderc_spvc_binding_type_storage_texture, + &resource_bindings), + "Unable to get binding info for storage textures from shader")); + DAWN_TRY(ExtractResourcesBinding(resource_bindings)); + std::vector input_stage_locations; DAWN_TRY(CheckSpvcSuccess(mSpvcContext.GetInputStageLocationInfo(&input_stage_locations), "Unable to get input stage location information from shader"));