tint: Add ast::ParameterList, use it

This is currently identical to ast::VariableList, but once we break
ast::Variable up, this will become a different vector type.

Bug: tint:1580
Change-Id: Ib2db5772996a63cd1989e36f1034dc1fbd3b371a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93601
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
This commit is contained in:
Ben Clayton
2022-06-15 10:14:27 +00:00
committed by Dawn LUCI CQ
parent 7164b97272
commit 2ae29830db
19 changed files with 42 additions and 37 deletions

View File

@@ -98,7 +98,7 @@ void CalculateArrayLength::Run(CloneContext& ctx, const DataMap&, DataMap&) cons
ctx.dst->Disable(ast::DisabledValidation::kIgnoreConstructibleFunctionParameter);
ctx.dst->AST().AddFunction(ctx.dst->create<ast::Function>(
name,
ast::VariableList{
ast::ParameterList{
// Note: The buffer parameter requires the kStorage StorageClass
// in order for HLSL to emit this as a ByteAddressBuffer.
ctx.dst->create<ast::Variable>(ctx.dst->Sym("buffer"),

View File

@@ -100,7 +100,7 @@ struct CanonicalizeEntryPointIO::State {
const sem::Function* func_sem;
/// The new entry point wrapper function's parameters.
ast::VariableList wrapper_ep_parameters;
ast::ParameterList wrapper_ep_parameters;
/// The members of the wrapper function's struct parameter.
ast::StructMemberList wrapper_struct_param_members;
/// The name of the wrapper function's struct parameter.

View File

@@ -169,7 +169,7 @@ struct CombineSamplers::State {
if (pairs.empty()) {
return nullptr;
}
ast::VariableList params;
ast::ParameterList params;
for (auto pair : func->TextureSamplerPairs()) {
const sem::Variable* texture_var = pair.first;
const sem::Variable* sampler_var = pair.second;

View File

@@ -437,7 +437,7 @@ struct DecomposeMemoryAccess::State {
auto* disable_validation =
b.Disable(ast::DisabledValidation::kIgnoreConstructibleFunctionParameter);
ast::VariableList params = {
ast::ParameterList params = {
// Note: The buffer parameter requires the StorageClass in
// order for HLSL to emit this as a ByteAddressBuffer or cbuffer
// array.
@@ -528,7 +528,7 @@ struct DecomposeMemoryAccess::State {
auto* el_ast_ty = CreateASTTypeFor(ctx, el_ty);
auto* disable_validation =
b.Disable(ast::DisabledValidation::kIgnoreConstructibleFunctionParameter);
ast::VariableList params{
ast::ParameterList params{
// Note: The buffer parameter requires the StorageClass in
// order for HLSL to emit this as a ByteAddressBuffer.
@@ -621,7 +621,7 @@ struct DecomposeMemoryAccess::State {
// The first parameter to all WGSL atomics is the expression to the
// atomic. This is replaced with two parameters: the buffer and offset.
ast::VariableList params = {
ast::ParameterList params = {
// Note: The buffer parameter requires the kStorage StorageClass in
// order for HLSL to emit this as a ByteAddressBuffer.
b.create<ast::Variable>(b.Sym("buffer"), ast::StorageClass::kStorage,

View File

@@ -132,7 +132,7 @@ void RemovePhonies::Run(CloneContext& ctx, const DataMap&, DataMap&) const {
}
auto sink = utils::GetOrCreate(sinks, sig, [&] {
auto name = ctx.dst->Symbols().New("phony_sink");
ast::VariableList params;
ast::ParameterList params;
for (auto* ty : sig.types) {
auto* ast_ty = CreateASTTypeFor(ctx, ty);
params.push_back(

View File

@@ -228,7 +228,7 @@ struct State {
Symbol pulling_position_name;
Symbol struct_buffer_name;
std::unordered_map<uint32_t, Symbol> vertex_buffer_names;
ast::VariableList new_function_parameters;
ast::ParameterList new_function_parameters;
/// Generate the vertex buffer binding name
/// @param index index to append to buffer name