spirv: Add block decorations with a transform

Any struct which is used as the store type of a buffer variable needs
to have a block decoration. If that struct is nested inside an array
or another struct, we wrap it inside another struct first.

This removes the SPIR-V backend's reliance on the [[block]] attribute,
which will soon be deprecated and removed.

Bug: tint:1324
Change-Id: Ib6ad54f24a3e4a090da9faeed699f266abcb66ba
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/72082
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
This commit is contained in:
James Price
2021-12-09 15:45:03 +00:00
parent ac8975f291
commit 3a4443a681
12 changed files with 739 additions and 81 deletions

View File

@@ -302,6 +302,7 @@ tint_unittests_source_set("tint_unittests_sem_src") {
tint_unittests_source_set("tint_unittests_transform_src") {
sources = [
"../src/transform/add_empty_entry_point_test.cc",
"../src/transform/add_spirv_block_decoration_test.cc",
"../src/transform/array_length_from_uniform_test.cc",
"../src/transform/binding_remapper_test.cc",
"../src/transform/calculate_array_length_test.cc",