mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-10 22:17:51 +00:00
ProgramBuilder: Swap parameter order for Var and Const
Move the storage parameter after type. Const() has no use for storage classes, so this parameter will be removed in the next change. This reordering keeps Var() and Const() parameter types identical for the first two non-optional fields Change-Id: I66669d19fa2175c4f10f615941e69efcab4c23e1 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/41540 Commit-Queue: Ben Clayton <bclayton@google.com> Reviewed-by: dan sinclair <dsinclair@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
4b9e7f92b9
commit
37571bc32d
@@ -84,7 +84,7 @@ void Hlsl::PromoteArrayInitializerToConstVar(CloneContext& ctx) const {
|
||||
auto* dst_init = ctx.Clone(src_init);
|
||||
// Construct the constant that holds the array
|
||||
auto* dst_var = ctx.dst->Const(
|
||||
dst_symbol, ast::StorageClass::kFunction, dst_array_ty, dst_init);
|
||||
dst_symbol, dst_array_ty, ast::StorageClass::kFunction, dst_init);
|
||||
// Construct the variable declaration statement
|
||||
auto* dst_var_decl =
|
||||
ctx.dst->create<ast::VariableDeclStatement>(dst_var);
|
||||
|
||||
@@ -68,9 +68,9 @@ void Spirv::HandleSampleMaskBuiltins(CloneContext& ctx) const {
|
||||
// Use `array<u32, 1>` for the new variable.
|
||||
auto* type = ctx.dst->ty.array(ctx.dst->ty.u32(), 1u);
|
||||
// Create the new variable.
|
||||
auto* var_arr =
|
||||
ctx.dst->Var(var->source(), var_name, var->declared_storage_class(),
|
||||
type, nullptr, ctx.Clone(var->decorations()));
|
||||
auto* var_arr = ctx.dst->Var(var->source(), var_name, type,
|
||||
var->declared_storage_class(), nullptr,
|
||||
ctx.Clone(var->decorations()));
|
||||
// Replace the variable with the arrayed version.
|
||||
ctx.Replace(var, var_arr);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user