[inspector] Refactor to handle access control wrapped uniform-buffers

Updates the extraction code to assume that the StructType will be
wrapped by an AccessControlType. Tests are changed to match this
behaviour, and some minor naming clean up occured.

BUG=tint:257

Change-Id: I888ac2fae228531e956437afb937082a142d5736
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/31780
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
This commit is contained in:
Ryan Harrison
2020-11-04 16:08:00 +00:00
committed by Commit Bot service account
parent 443039a58f
commit 77f7bb5b00
2 changed files with 74 additions and 50 deletions

View File

@@ -152,11 +152,16 @@ std::vector<ResourceBinding> Inspector::GetUniformBufferResourceBindings(
ast::Variable* var = nullptr;
ast::Function::BindingInfo binding_info;
std::tie(var, binding_info) = ruv;
if (!var->type()->IsStruct()) {
if (!var->type()->IsAccessControl()) {
continue;
}
auto* unwrapped_type = var->type()->UnwrapIfNeeded();
if (!unwrapped_type->IsStruct()) {
continue;
}
if (!var->type()->AsStruct()->IsBlockDecorated()) {
if (!unwrapped_type->AsStruct()->IsBlockDecorated()) {
continue;
}
@@ -220,7 +225,7 @@ std::vector<ResourceBinding> Inspector::GetStorageBufferResourceBindingsImpl(
continue;
}
if (!ac_type->type()->IsStruct()) {
if (!var->type()->UnwrapIfNeeded()->IsStruct()) {
continue;
}