Update structs to allow multiple decorations

This CL updates to match the spec change allowing multiple struct
decorations.

Bug: tint:240
Change-Id: Id859c6a331c67c46597fc3c70de06d6cc0f486ec
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/29260
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Reviewed-by: David Neto <dneto@google.com>
This commit is contained in:
dan sinclair
2020-10-08 18:33:25 +00:00
committed by Commit Bot service account
parent 007dc42cbb
commit 1a63c49b4e
25 changed files with 246 additions and 138 deletions

View File

@@ -226,9 +226,12 @@ void VertexPullingTransform::AddVertexStorageBuffers() {
members.push_back(std::make_unique<ast::StructMember>(
kStructBufferName, internal_array_type, std::move(member_dec)));
auto* struct_type = ctx_->type_mgr().Get(
std::make_unique<ast::type::StructType>(std::make_unique<ast::Struct>(
ast::StructDecoration::kBlock, std::move(members))));
ast::StructDecorationList decos;
decos.push_back(ast::StructDecoration::kBlock);
auto* struct_type =
ctx_->type_mgr().Get(std::make_unique<ast::type::StructType>(
std::make_unique<ast::Struct>(std::move(decos), std::move(members))));
for (uint32_t i = 0; i < vertex_state_->vertex_buffers.size(); ++i) {
// The decorated variable with struct type