Use new binding type reflection provided by spvc

This adds parity for reflection features in the spvc-only code path up
to 421684f. Additionally changes will be needed to bring support to
parity up to HEAD.

BUG=dawn:337

Change-Id: I2143587c54018da766934fa60d80aedd1ccd151b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/17165
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
This commit is contained in:
Ryan Harrison 2020-03-18 16:33:58 +00:00 committed by Commit Bot service account
parent 83e138ca96
commit 1f9b5960d8
1 changed files with 11 additions and 8 deletions

View File

@ -113,16 +113,12 @@ namespace dawn_native {
return wgpu::BindingType::Sampler; return wgpu::BindingType::Sampler;
case shaderc_spvc_binding_type_sampled_texture: case shaderc_spvc_binding_type_sampled_texture:
return wgpu::BindingType::SampledTexture; return wgpu::BindingType::SampledTexture;
case shaderc_spvc_binding_type_readonly_storage_texture:
// TODO(jiawei.shao@intel.com): add convertion to read-only and write-only storage return wgpu::BindingType::ReadonlyStorageTexture;
// textures when they are supported as shaderc_spvc binding types. case shaderc_spvc_binding_type_writeonly_storage_texture:
return wgpu::BindingType::WriteonlyStorageTexture;
case shaderc_spvc_binding_type_storage_texture: case shaderc_spvc_binding_type_storage_texture:
return wgpu::BindingType::StorageTexture; 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(); UNREACHABLE();
} }
@ -357,6 +353,13 @@ namespace dawn_native {
"Unable to get binding info for storage buffers from shader")); "Unable to get binding info for storage buffers from shader"));
DAWN_TRY(ExtractResourcesBinding(resource_bindings)); 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<shaderc_spvc_resource_location_info> input_stage_locations; std::vector<shaderc_spvc_resource_location_info> input_stage_locations;
DAWN_TRY(CheckSpvcSuccess(mSpvcContext.GetInputStageLocationInfo(&input_stage_locations), DAWN_TRY(CheckSpvcSuccess(mSpvcContext.GetInputStageLocationInfo(&input_stage_locations),
"Unable to get input stage location information from shader")); "Unable to get input stage location information from shader"));