ast: Remove Struct constructors that don't take a Source

And swap the `decorations` and `members` parameters, as decorations come last for other constructors.

Parsers need fixing up.

Bug: tint:396
Bug: tint:390
Change-Id: Ie9b814c1de24b6c987f0fbb9e6f92da7c352caa2
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/35163
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
This commit is contained in:
Ben Clayton
2020-12-12 12:52:44 +00:00
committed by Commit Bot service account
parent 4543d1a232
commit bcf37549c8
33 changed files with 390 additions and 286 deletions

View File

@@ -225,7 +225,7 @@ ast::Variable* FirstIndexOffset::AddUniformBuffer(ast::Module* mod) {
auto* struct_type = mod->create<ast::type::Struct>(
kStructName,
mod->create<ast::Struct>(std::move(decos), std::move(members)));
mod->create<ast::Struct>(Source{}, std::move(members), std::move(decos)));
auto* idx_var = mod->create<ast::Variable>(
Source{}, // source

View File

@@ -265,7 +265,7 @@ void VertexPulling::State::AddVertexStorageBuffers() {
auto* struct_type = mod->create<ast::type::Struct>(
kStructName,
mod->create<ast::Struct>(std::move(decos), std::move(members)));
mod->create<ast::Struct>(Source{}, std::move(members), std::move(decos)));
for (uint32_t i = 0; i < cfg.vertex_state.size(); ++i) {
// The decorated variable with struct type