Add semantic::Struct::SizeNoPadding

This is the size of the structure without the trailing alignment
padding. This is what the Dawn needs from the Inspector.

Fixed: tint:653
Change-Id: Iaa01ba949e114973e4a33e084fc10ef9e111016c
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/45120
Reviewed-by: David Neto <dneto@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
This commit is contained in:
Ben Clayton
2021-03-17 21:54:13 +00:00
committed by Commit Bot service account
parent 96829ed314
commit ad97343214
7 changed files with 170 additions and 5 deletions

View File

@@ -392,6 +392,7 @@ std::vector<ResourceBinding> Inspector::GetUniformBufferResourceBindings(
entry.bind_group = binding_info.group->value();
entry.binding = binding_info.binding->value();
entry.size = sem->Size();
entry.size_no_padding = sem->SizeNoPadding();
result.push_back(entry);
}
@@ -567,6 +568,7 @@ std::vector<ResourceBinding> Inspector::GetStorageBufferResourceBindingsImpl(
entry.bind_group = binding_info.group->value();
entry.binding = binding_info.binding->value();
entry.size = sem->Size();
entry.size_no_padding = sem->SizeNoPadding();
result.push_back(entry);
}