diff --git a/src/tint/transform/decompose_memory_access.cc b/src/tint/transform/decompose_memory_access.cc index b3c2292149..28ecebdddd 100644 --- a/src/tint/transform/decompose_memory_access.cc +++ b/src/tint/transform/decompose_memory_access.cc @@ -108,33 +108,29 @@ struct OffsetBinOp : Offset { /// LoadStoreKey is the unordered map key to a load or store intrinsic. struct LoadStoreKey { - builtin::AddressSpace const address_space; // buffer address space - builtin::Access const access; // buffer access - type::Type const* buf_ty = nullptr; // buffer type - type::Type const* el_ty = nullptr; // element type + type::Type const* el_ty = nullptr; // element type + Symbol const buffer; // buffer name bool operator==(const LoadStoreKey& rhs) const { - return address_space == rhs.address_space && access == rhs.access && buf_ty == rhs.buf_ty && - el_ty == rhs.el_ty; + return el_ty == rhs.el_ty && buffer == rhs.buffer; } struct Hasher { inline std::size_t operator()(const LoadStoreKey& u) const { - return utils::Hash(u.address_space, u.access, u.buf_ty, u.el_ty); + return utils::Hash(u.el_ty, u.buffer); } }; }; /// AtomicKey is the unordered map key to an atomic intrinsic. struct AtomicKey { - builtin::Access const access; // buffer access - type::Type const* buf_ty = nullptr; // buffer type - type::Type const* el_ty = nullptr; // element type - sem::BuiltinType const op; // atomic op + type::Type const* el_ty = nullptr; // element type + sem::BuiltinType const op; // atomic op + Symbol const buffer; // buffer name bool operator==(const AtomicKey& rhs) const { - return access == rhs.access && buf_ty == rhs.buf_ty && el_ty == rhs.el_ty && op == rhs.op; + return el_ty == rhs.el_ty && op == rhs.op && buffer == rhs.buffer; } struct Hasher { inline std::size_t operator()(const AtomicKey& u) const { - return utils::Hash(u.access, u.buf_ty, u.el_ty, u.op); + return utils::Hash(u.el_ty, u.op, u.buffer); } }; }; @@ -219,39 +215,41 @@ bool IntrinsicDataTypeFor(const type::Type* ty, DecomposeMemoryAccess::Intrinsic return false; } -/// @returns a DecomposeMemoryAccess::Intrinsic attribute that can be applied -/// to a stub function to load the type `ty`. +/// @returns a DecomposeMemoryAccess::Intrinsic attribute that can be applied to a stub function to +/// load the type @p ty from the uniform or storage buffer with name @p buffer. DecomposeMemoryAccess::Intrinsic* IntrinsicLoadFor(ProgramBuilder* builder, + const type::Type* ty, builtin::AddressSpace address_space, - const type::Type* ty) { + const Symbol& buffer) { DecomposeMemoryAccess::Intrinsic::DataType type; if (!IntrinsicDataTypeFor(ty, type)) { return nullptr; } return builder->ASTNodes().Create( - builder->ID(), builder->AllocateNodeID(), DecomposeMemoryAccess::Intrinsic::Op::kLoad, - address_space, type); + builder->ID(), builder->AllocateNodeID(), DecomposeMemoryAccess::Intrinsic::Op::kLoad, type, + address_space, buffer); } -/// @returns a DecomposeMemoryAccess::Intrinsic attribute that can be applied -/// to a stub function to store the type `ty`. +/// @returns a DecomposeMemoryAccess::Intrinsic attribute that can be applied to a stub function to +/// store the type @p ty to the storage buffer with name @p buffer. DecomposeMemoryAccess::Intrinsic* IntrinsicStoreFor(ProgramBuilder* builder, - builtin::AddressSpace address_space, - const type::Type* ty) { + const type::Type* ty, + const Symbol& buffer) { DecomposeMemoryAccess::Intrinsic::DataType type; if (!IntrinsicDataTypeFor(ty, type)) { return nullptr; } return builder->ASTNodes().Create( builder->ID(), builder->AllocateNodeID(), DecomposeMemoryAccess::Intrinsic::Op::kStore, - address_space, type); + type, builtin::AddressSpace::kStorage, buffer); } -/// @returns a DecomposeMemoryAccess::Intrinsic attribute that can be applied -/// to a stub function for the atomic op and the type `ty`. +/// @returns a DecomposeMemoryAccess::Intrinsic attribute that can be applied to a stub function for +/// the atomic op and the type @p ty. DecomposeMemoryAccess::Intrinsic* IntrinsicAtomicFor(ProgramBuilder* builder, sem::BuiltinType ity, - const type::Type* ty) { + const type::Type* ty, + const Symbol& buffer) { auto op = DecomposeMemoryAccess::Intrinsic::Op::kAtomicLoad; switch (ity) { case sem::BuiltinType::kAtomicLoad: @@ -299,15 +297,16 @@ DecomposeMemoryAccess::Intrinsic* IntrinsicAtomicFor(ProgramBuilder* builder, return nullptr; } return builder->ASTNodes().Create( - builder->ID(), builder->AllocateNodeID(), op, builtin::AddressSpace::kStorage, type); + builder->ID(), builder->AllocateNodeID(), op, type, builtin::AddressSpace::kStorage, + buffer); } /// BufferAccess describes a single storage or uniform buffer access struct BufferAccess { - sem::ValueExpression const* var = nullptr; // Storage buffer variable - Offset const* offset = nullptr; // The byte offset on var - type::Type const* type = nullptr; // The type of the access - operator bool() const { return var; } // Returns true if valid + sem::GlobalVariable const* var = nullptr; // Storage or uniform buffer variable + Offset const* offset = nullptr; // The byte offset on var + type::Type const* type = nullptr; // The type of the access + operator bool() const { return var; } // Returns true if valid }; /// Store describes a single storage or uniform buffer write @@ -452,238 +451,194 @@ struct DecomposeMemoryAccess::State { return access; } - /// LoadFunc() returns a symbol to an intrinsic function that loads an element of type `el_ty` - /// from a storage or uniform buffer of type `buf_ty`. + /// LoadFunc() returns a symbol to an intrinsic function that loads an element of type @p el_ty + /// from a storage or uniform buffer with name @p buffer. /// The emitted function has the signature: - /// `fn load(buf : ptr, offset : u32) -> el_ty` - /// @param buf_ty the storage or uniform buffer type + /// `fn load(offset : u32) -> el_ty` /// @param el_ty the storage or uniform buffer element type - /// @param var_user the variable user + /// @param address_space either kUniform or kStorage + /// @param buffer the symbol of the storage or uniform buffer variable, owned by the target + /// ProgramBuilder. /// @return the name of the function that performs the load - Symbol LoadFunc(const type::Type* buf_ty, - const type::Type* el_ty, - const sem::VariableUser* var_user) { - auto address_space = var_user->Variable()->AddressSpace(); - auto access = var_user->Variable()->Access(); - if (address_space != builtin::AddressSpace::kStorage) { - access = builtin::Access::kUndefined; - } - return utils::GetOrCreate( - load_funcs, LoadStoreKey{address_space, access, buf_ty, el_ty}, [&] { - utils::Vector params{ - b.Param("buffer", - b.ty.pointer(CreateASTTypeFor(ctx, buf_ty), address_space, access), - utils::Vector{b.Disable(ast::DisabledValidation::kFunctionParameter)}), - b.Param("offset", b.ty.u32()), - }; + Symbol LoadFunc(const type::Type* el_ty, + builtin::AddressSpace address_space, + const Symbol& buffer) { + return utils::GetOrCreate(load_funcs, LoadStoreKey{el_ty, buffer}, [&] { + utils::Vector params{b.Param("offset", b.ty.u32())}; - auto name = b.Sym(); + auto name = b.Symbols().New(ctx.dst->Symbols().NameFor(buffer) + "_load"); - if (auto* intrinsic = IntrinsicLoadFor(ctx.dst, address_space, el_ty)) { - auto el_ast_ty = CreateASTTypeFor(ctx, el_ty); - b.Func(name, params, el_ast_ty, nullptr, - utils::Vector{ - intrinsic, - b.Disable(ast::DisabledValidation::kFunctionHasNoBody), - }); - } else if (auto* arr_ty = el_ty->As()) { - // fn load_func(buffer : buf_ty, offset : u32) -> array { - // var arr : array; - // for (var i = 0u; i < array_count; i = i + 1) { - // arr[i] = el_load_func(buffer, offset + i * array_stride) - // } - // return arr; - // } - auto load = LoadFunc(buf_ty, arr_ty->ElemType()->UnwrapRef(), var_user); - auto* arr = b.Var(b.Symbols().New("arr"), CreateASTTypeFor(ctx, arr_ty)); - auto* i = b.Var(b.Symbols().New("i"), b.Expr(0_u)); - auto* for_init = b.Decl(i); - auto arr_cnt = arr_ty->ConstantCount(); - if (TINT_UNLIKELY(!arr_cnt)) { - // Non-constant counts should not be possible: - // * Override-expression counts can only be applied to workgroup arrays, and - // this method only handles storage and uniform. - // * Runtime-sized arrays are not loadable. - TINT_ICE(Transform, b.Diagnostics()) - << "unexpected non-constant array count"; - arr_cnt = 1; + if (auto* intrinsic = IntrinsicLoadFor(ctx.dst, el_ty, address_space, buffer)) { + auto el_ast_ty = CreateASTTypeFor(ctx, el_ty); + b.Func(name, params, el_ast_ty, nullptr, + utils::Vector{ + intrinsic, + b.Disable(ast::DisabledValidation::kFunctionHasNoBody), + }); + } else if (auto* arr_ty = el_ty->As()) { + // fn load_func(buffer : buf_ty, offset : u32) -> array { + // var arr : array; + // for (var i = 0u; i < array_count; i = i + 1) { + // arr[i] = el_load_func(buffer, offset + i * array_stride) + // } + // return arr; + // } + auto load = LoadFunc(arr_ty->ElemType()->UnwrapRef(), address_space, buffer); + auto* arr = b.Var(b.Symbols().New("arr"), CreateASTTypeFor(ctx, arr_ty)); + auto* i = b.Var(b.Symbols().New("i"), b.Expr(0_u)); + auto* for_init = b.Decl(i); + auto arr_cnt = arr_ty->ConstantCount(); + if (TINT_UNLIKELY(!arr_cnt)) { + // Non-constant counts should not be possible: + // * Override-expression counts can only be applied to workgroup arrays, and + // this method only handles storage and uniform. + // * Runtime-sized arrays are not loadable. + TINT_ICE(Transform, b.Diagnostics()) << "unexpected non-constant array count"; + arr_cnt = 1; + } + auto* for_cond = b.create( + ast::BinaryOp::kLessThan, b.Expr(i), b.Expr(u32(arr_cnt.value()))); + auto* for_cont = b.Assign(i, b.Add(i, 1_u)); + auto* arr_el = b.IndexAccessor(arr, i); + auto* el_offset = b.Add(b.Expr("offset"), b.Mul(i, u32(arr_ty->Stride()))); + auto* el_val = b.Call(load, el_offset); + auto* for_loop = + b.For(for_init, for_cond, for_cont, b.Block(b.Assign(arr_el, el_val))); + + b.Func(name, params, CreateASTTypeFor(ctx, arr_ty), + utils::Vector{ + b.Decl(arr), + for_loop, + b.Return(arr), + }); + } else { + utils::Vector values; + if (auto* mat_ty = el_ty->As()) { + auto* vec_ty = mat_ty->ColumnType(); + Symbol load = LoadFunc(vec_ty, address_space, buffer); + for (uint32_t i = 0; i < mat_ty->columns(); i++) { + auto* offset = b.Add("offset", u32(i * mat_ty->ColumnStride())); + values.Push(b.Call(load, offset)); } - auto* for_cond = b.create( - ast::BinaryOp::kLessThan, b.Expr(i), b.Expr(u32(arr_cnt.value()))); - auto* for_cont = b.Assign(i, b.Add(i, 1_u)); - auto* arr_el = b.IndexAccessor(arr, i); - auto* el_offset = b.Add(b.Expr("offset"), b.Mul(i, u32(arr_ty->Stride()))); - auto* el_val = b.Call(load, "buffer", el_offset); - auto* for_loop = - b.For(for_init, for_cond, for_cont, b.Block(b.Assign(arr_el, el_val))); + } else if (auto* str = el_ty->As()) { + for (auto* member : str->Members()) { + auto* offset = b.Add("offset", u32(member->Offset())); + Symbol load = LoadFunc(member->Type()->UnwrapRef(), address_space, buffer); + values.Push(b.Call(load, offset)); + } + } + b.Func(name, params, CreateASTTypeFor(ctx, el_ty), + utils::Vector{ + b.Return(b.Call(CreateASTTypeFor(ctx, el_ty), values)), + }); + } + return name; + }); + } - b.Func(name, params, CreateASTTypeFor(ctx, arr_ty), - utils::Vector{ - b.Decl(arr), - for_loop, - b.Return(arr), - }); - } else { - utils::Vector values; - if (auto* mat_ty = el_ty->As()) { + /// StoreFunc() returns a symbol to an intrinsic function that stores an element of type @p + /// el_ty to the storage buffer @p buffer. The function has the signature: + /// `fn store(offset : u32, value : el_ty)` + /// @param el_ty the storage buffer element type + /// @param buffer the symbol of the storage buffer variable, owned by the target ProgramBuilder. + /// @return the name of the function that performs the store + Symbol StoreFunc(const type::Type* el_ty, const Symbol& buffer) { + return utils::GetOrCreate(store_funcs, LoadStoreKey{el_ty, buffer}, [&] { + utils::Vector params{ + b.Param("offset", b.ty.u32()), + b.Param("value", CreateASTTypeFor(ctx, el_ty)), + }; + + auto name = b.Symbols().New(ctx.dst->Symbols().NameFor(buffer) + "_store"); + + if (auto* intrinsic = IntrinsicStoreFor(ctx.dst, el_ty, buffer)) { + b.Func(name, params, b.ty.void_(), nullptr, + utils::Vector{ + intrinsic, + b.Disable(ast::DisabledValidation::kFunctionHasNoBody), + }); + } else { + auto body = Switch>( + el_ty, // + [&](const type::Array* arr_ty) { + // fn store_func(buffer : buf_ty, offset : u32, value : el_ty) { + // var array = value; // No dynamic indexing on constant arrays + // for (var i = 0u; i < array_count; i = i + 1) { + // arr[i] = el_store_func(buffer, offset + i * array_stride, + // value[i]) + // } + // return arr; + // } + auto* array = b.Var(b.Symbols().New("array"), b.Expr("value")); + auto store = StoreFunc(arr_ty->ElemType()->UnwrapRef(), buffer); + auto* i = b.Var(b.Symbols().New("i"), b.Expr(0_u)); + auto* for_init = b.Decl(i); + auto arr_cnt = arr_ty->ConstantCount(); + if (TINT_UNLIKELY(!arr_cnt)) { + // Non-constant counts should not be possible: + // * Override-expression counts can only be applied to workgroup + // arrays, and this method only handles storage and uniform. + // * Runtime-sized arrays are not storable. + TINT_ICE(Transform, b.Diagnostics()) + << "unexpected non-constant array count"; + arr_cnt = 1; + } + auto* for_cond = b.create( + ast::BinaryOp::kLessThan, b.Expr(i), b.Expr(u32(arr_cnt.value()))); + auto* for_cont = b.Assign(i, b.Add(i, 1_u)); + auto* arr_el = b.IndexAccessor(array, i); + auto* el_offset = b.Add(b.Expr("offset"), b.Mul(i, u32(arr_ty->Stride()))); + auto* store_stmt = b.CallStmt(b.Call(store, el_offset, arr_el)); + auto* for_loop = b.For(for_init, for_cond, for_cont, b.Block(store_stmt)); + + return utils::Vector{b.Decl(array), for_loop}; + }, + [&](const type::Matrix* mat_ty) { auto* vec_ty = mat_ty->ColumnType(); - Symbol load = LoadFunc(buf_ty, vec_ty, var_user); + Symbol store = StoreFunc(vec_ty, buffer); + utils::Vector stmts; for (uint32_t i = 0; i < mat_ty->columns(); i++) { auto* offset = b.Add("offset", u32(i * mat_ty->ColumnStride())); - values.Push(b.Call(load, "buffer", offset)); + auto* element = b.IndexAccessor("value", u32(i)); + auto* call = b.Call(store, offset, element); + stmts.Push(b.CallStmt(call)); } - } else if (auto* str = el_ty->As()) { + return stmts; + }, + [&](const sem::Struct* str) { + utils::Vector stmts; for (auto* member : str->Members()) { auto* offset = b.Add("offset", u32(member->Offset())); - Symbol load = LoadFunc(buf_ty, member->Type()->UnwrapRef(), var_user); - values.Push(b.Call(load, "buffer", offset)); + auto* element = b.MemberAccessor("value", ctx.Clone(member->Name())); + Symbol store = StoreFunc(member->Type()->UnwrapRef(), buffer); + auto* call = b.Call(store, offset, element); + stmts.Push(b.CallStmt(call)); } - } - b.Func(name, params, CreateASTTypeFor(ctx, el_ty), - utils::Vector{ - b.Return(b.Call(CreateASTTypeFor(ctx, el_ty), values)), - }); - } - return name; - }); + return stmts; + }); + + b.Func(name, params, b.ty.void_(), body); + } + + return name; + }); } - /// StoreFunc() returns a symbol to an intrinsic function that stores an - /// element of type `el_ty` to a storage buffer of type `buf_ty`. - /// The function has the signature: - /// `fn store(buf : ptr, offset : u32, value : el_ty)` - /// @param buf_ty the storage buffer type - /// @param el_ty the storage buffer element type - /// @param var_user the variable user - /// @return the name of the function that performs the store - Symbol StoreFunc(const type::Type* buf_ty, - const type::Type* el_ty, - const sem::VariableUser* var_user) { - auto address_space = var_user->Variable()->AddressSpace(); - auto access = var_user->Variable()->Access(); - if (address_space != builtin::AddressSpace::kStorage) { - access = builtin::Access::kUndefined; - } - return utils::GetOrCreate( - store_funcs, LoadStoreKey{address_space, access, buf_ty, el_ty}, [&] { - utils::Vector params{ - b.Param("buffer", - b.ty.pointer(CreateASTTypeFor(ctx, buf_ty), address_space, access), - utils::Vector{b.Disable(ast::DisabledValidation::kFunctionParameter)}), - b.Param("offset", b.ty.u32()), - b.Param("value", CreateASTTypeFor(ctx, el_ty)), - }; - - auto name = b.Sym(); - - if (auto* intrinsic = IntrinsicStoreFor(ctx.dst, address_space, el_ty)) { - b.Func(name, params, b.ty.void_(), nullptr, - utils::Vector{ - intrinsic, - b.Disable(ast::DisabledValidation::kFunctionHasNoBody), - }); - } else { - auto body = Switch>( - el_ty, // - [&](const type::Array* arr_ty) { - // fn store_func(buffer : buf_ty, offset : u32, value : el_ty) { - // var array = value; // No dynamic indexing on constant arrays - // for (var i = 0u; i < array_count; i = i + 1) { - // arr[i] = el_store_func(buffer, offset + i * array_stride, - // value[i]) - // } - // return arr; - // } - auto* array = b.Var(b.Symbols().New("array"), b.Expr("value")); - auto store = - StoreFunc(buf_ty, arr_ty->ElemType()->UnwrapRef(), var_user); - auto* i = b.Var(b.Symbols().New("i"), b.Expr(0_u)); - auto* for_init = b.Decl(i); - auto arr_cnt = arr_ty->ConstantCount(); - if (TINT_UNLIKELY(!arr_cnt)) { - // Non-constant counts should not be possible: - // * Override-expression counts can only be applied to workgroup - // arrays, and this method only handles storage and uniform. - // * Runtime-sized arrays are not storable. - TINT_ICE(Transform, b.Diagnostics()) - << "unexpected non-constant array count"; - arr_cnt = 1; - } - auto* for_cond = b.create( - ast::BinaryOp::kLessThan, b.Expr(i), b.Expr(u32(arr_cnt.value()))); - auto* for_cont = b.Assign(i, b.Add(i, 1_u)); - auto* arr_el = b.IndexAccessor(array, i); - auto* el_offset = - b.Add(b.Expr("offset"), b.Mul(i, u32(arr_ty->Stride()))); - auto* store_stmt = - b.CallStmt(b.Call(store, "buffer", el_offset, arr_el)); - auto* for_loop = - b.For(for_init, for_cond, for_cont, b.Block(store_stmt)); - - return utils::Vector{b.Decl(array), for_loop}; - }, - [&](const type::Matrix* mat_ty) { - auto* vec_ty = mat_ty->ColumnType(); - Symbol store = StoreFunc(buf_ty, vec_ty, var_user); - utils::Vector stmts; - for (uint32_t i = 0; i < mat_ty->columns(); i++) { - auto* offset = b.Add("offset", u32(i * mat_ty->ColumnStride())); - auto* element = b.IndexAccessor("value", u32(i)); - auto* call = b.Call(store, "buffer", offset, element); - stmts.Push(b.CallStmt(call)); - } - return stmts; - }, - [&](const sem::Struct* str) { - utils::Vector stmts; - for (auto* member : str->Members()) { - auto* offset = b.Add("offset", u32(member->Offset())); - auto* element = - b.MemberAccessor("value", ctx.Clone(member->Name())); - Symbol store = - StoreFunc(buf_ty, member->Type()->UnwrapRef(), var_user); - auto* call = b.Call(store, "buffer", offset, element); - stmts.Push(b.CallStmt(call)); - } - return stmts; - }); - - b.Func(name, params, b.ty.void_(), body); - } - - return name; - }); - } - - /// AtomicFunc() returns a symbol to an intrinsic function that performs an - /// atomic operation from a storage buffer of type `buf_ty`. The function has - /// the signature: - // `fn atomic_op(buf : ptr, offset : u32, ...) -> T` - /// @param buf_ty the storage buffer type + /// AtomicFunc() returns a symbol to an intrinsic function that performs an atomic operation on + /// the storage buffer @p buffer. The function has the signature: + // `fn atomic_op(offset : u32, ...) -> T` /// @param el_ty the storage buffer element type /// @param intrinsic the atomic intrinsic - /// @param var_user the variable user + /// @param buffer the symbol of the storage buffer variable, owned by the target ProgramBuilder. /// @return the name of the function that performs the load - Symbol AtomicFunc(const type::Type* buf_ty, - const type::Type* el_ty, + Symbol AtomicFunc(const type::Type* el_ty, const sem::Builtin* intrinsic, - const sem::VariableUser* var_user) { + const Symbol& buffer) { auto op = intrinsic->Type(); - auto address_space = var_user->Variable()->AddressSpace(); - auto access = var_user->Variable()->Access(); - if (address_space != builtin::AddressSpace::kStorage) { - access = builtin::Access::kUndefined; - } - return utils::GetOrCreate(atomic_funcs, AtomicKey{access, buf_ty, el_ty, op}, [&] { + return utils::GetOrCreate(atomic_funcs, AtomicKey{el_ty, op, buffer}, [&] { // The first parameter to all WGSL atomics is the expression to the // atomic. This is replaced with two parameters: the buffer and offset. - utils::Vector params{ - b.Param("buffer", - b.ty.pointer(CreateASTTypeFor(ctx, buf_ty), builtin::AddressSpace::kStorage, - access), - utils::Vector{b.Disable(ast::DisabledValidation::kFunctionParameter)}), - b.Param("offset", b.ty.u32()), - }; + utils::Vector params{b.Param("offset", b.ty.u32())}; // Other parameters are copied as-is: for (size_t i = 1; i < intrinsic->Parameters().Length(); i++) { @@ -692,7 +647,7 @@ struct DecomposeMemoryAccess::State { params.Push(b.Param("param_" + std::to_string(i), ty)); } - auto* atomic = IntrinsicAtomicFor(ctx.dst, op, el_ty); + auto* atomic = IntrinsicAtomicFor(ctx.dst, op, el_ty, buffer); if (TINT_UNLIKELY(!atomic)) { TINT_ICE(Transform, b.Diagnostics()) << "IntrinsicAtomicFor() returned nullptr for op " << op << " and type " @@ -720,7 +675,7 @@ struct DecomposeMemoryAccess::State { ret_ty = CreateASTTypeFor(ctx, intrinsic->ReturnType()); } - auto name = b.Symbols().New(std::string{"tint_"} + intrinsic->str()); + auto name = b.Symbols().New(ctx.dst->Symbols().NameFor(buffer) + intrinsic->str()); b.Func(name, std::move(params), ret_ty, nullptr, utils::Vector{ atomic, @@ -734,9 +689,10 @@ struct DecomposeMemoryAccess::State { DecomposeMemoryAccess::Intrinsic::Intrinsic(ProgramID pid, ast::NodeID nid, Op o, - builtin::AddressSpace sc, - DataType ty) - : Base(pid, nid), op(o), address_space(sc), type(ty) {} + DataType ty, + builtin::AddressSpace as, + const Symbol& buf) + : Base(pid, nid), op(o), type(ty), address_space(as), buffer(buf) {} DecomposeMemoryAccess::Intrinsic::~Intrinsic() = default; std::string DecomposeMemoryAccess::Intrinsic::InternalName() const { std::stringstream ss; @@ -837,8 +793,9 @@ std::string DecomposeMemoryAccess::Intrinsic::InternalName() const { const DecomposeMemoryAccess::Intrinsic* DecomposeMemoryAccess::Intrinsic::Clone( CloneContext* ctx) const { + auto buf = ctx->Clone(buffer); return ctx->dst->ASTNodes().Create( - ctx->dst->ID(), ctx->dst->AllocateNodeID(), op, address_space, type); + ctx->dst->ID(), ctx->dst->AllocateNodeID(), op, type, address_space, buf); } bool DecomposeMemoryAccess::Intrinsic::IsAtomic() const { @@ -872,15 +829,17 @@ Transform::ApplyResult DecomposeMemoryAccess::Apply(const Program* src, if (auto* ident = node->As()) { // X if (auto* sem_ident = sem.GetVal(ident)) { - if (auto* var = sem_ident->UnwrapLoad()->As()) { - if (var->Variable()->AddressSpace() == builtin::AddressSpace::kStorage || - var->Variable()->AddressSpace() == builtin::AddressSpace::kUniform) { - // Variable to a storage or uniform buffer - state.AddAccess(ident, { - var, - state.ToOffset(0u), - var->Type()->UnwrapRef(), - }); + if (auto* user = sem_ident->UnwrapLoad()->As()) { + if (auto* global = user->Variable()->As()) { + if (global->AddressSpace() == builtin::AddressSpace::kStorage || + global->AddressSpace() == builtin::AddressSpace::kUniform) { + // Variable to a storage or uniform buffer + state.AddAccess(ident, { + global, + state.ToOffset(0u), + global->Type()->UnwrapRef(), + }); + } } } } @@ -983,15 +942,12 @@ Transform::ApplyResult DecomposeMemoryAccess::Apply(const Program* src, if (auto access = state.TakeAccess(call_expr->args[0])) { // atomic___(X) ctx.Replace(call_expr, [=, &ctx, &state] { - auto* buf = access.var->Declaration(); auto* offset = access.offset->Build(ctx); - auto* buf_ty = access.var->Type()->UnwrapRef(); auto* el_ty = access.type->UnwrapRef()->As()->Type(); - Symbol func = state.AtomicFunc(buf_ty, el_ty, builtin, - access.var->As()); + auto buffer = ctx.Clone(access.var->Declaration()->name->symbol); + Symbol func = state.AtomicFunc(el_ty, builtin, buffer); - utils::Vector args{ - ctx.dst->AddressOf(ctx.Clone(buf)), offset}; + utils::Vector args{offset}; for (size_t i = 1; i < call_expr->args.Length(); i++) { auto* arg = call_expr->args[i]; args.Push(ctx.Clone(arg)); @@ -1014,26 +970,23 @@ Transform::ApplyResult DecomposeMemoryAccess::Apply(const Program* src, } BufferAccess access = access_it->second; ctx.Replace(expr, [=, &ctx, &state] { - auto* buf = ctx.dst->AddressOf(ctx.CloneWithoutTransform(access.var->Declaration())); auto* offset = access.offset->Build(ctx); - auto* buf_ty = access.var->Type()->UnwrapRef(); auto* el_ty = access.type->UnwrapRef(); - Symbol func = state.LoadFunc(buf_ty, el_ty, access.var->As()); - return ctx.dst->Call(func, buf, offset); + auto buffer = ctx.Clone(access.var->Declaration()->name->symbol); + Symbol func = state.LoadFunc(el_ty, access.var->AddressSpace(), buffer); + return ctx.dst->Call(func, offset); }); } // And replace all storage and uniform buffer assignments with stores for (auto store : state.stores) { ctx.Replace(store.assignment, [=, &ctx, &state] { - auto* buf = - ctx.dst->AddressOf(ctx.CloneWithoutTransform((store.target.var->Declaration()))); auto* offset = store.target.offset->Build(ctx); - auto* buf_ty = store.target.var->Type()->UnwrapRef(); auto* el_ty = store.target.type->UnwrapRef(); auto* value = store.assignment->rhs; - Symbol func = state.StoreFunc(buf_ty, el_ty, store.target.var->As()); - auto* call = ctx.dst->Call(func, buf, offset, ctx.Clone(value)); + auto buffer = ctx.Clone(store.target.var->Declaration()->name->symbol); + Symbol func = state.StoreFunc(el_ty, buffer); + auto* call = ctx.dst->Call(func, offset, ctx.Clone(value)); return ctx.dst->CallStmt(call); }); } diff --git a/src/tint/transform/decompose_memory_access.h b/src/tint/transform/decompose_memory_access.h index b251ed8397..e34cd63554 100644 --- a/src/tint/transform/decompose_memory_access.h +++ b/src/tint/transform/decompose_memory_access.h @@ -27,13 +27,12 @@ class CloneContext; namespace tint::transform { -/// DecomposeMemoryAccess is a transform used to replace storage and uniform -/// buffer accesses with a combination of load, store or atomic functions on -/// primitive types. +/// DecomposeMemoryAccess is a transform used to replace storage and uniform buffer accesses with a +/// combination of load, store or atomic functions on primitive types. class DecomposeMemoryAccess final : public Castable { public: - /// Intrinsic is an InternalAttribute that's used to decorate a stub function - /// so that the HLSL transforms this into calls to + /// Intrinsic is an InternalAttribute that's used to decorate a stub function so that the HLSL + /// transforms this into calls to /// `[RW]ByteAddressBuffer.Load[N]()` or `[RW]ByteAddressBuffer.Store[N]()`, /// with a possible cast. class Intrinsic final : public Castable { @@ -79,9 +78,15 @@ class DecomposeMemoryAccess final : public Castable sb : SB; @internal(intrinsic_load_storage_f32) @internal(disable_validation__function_has_no_body) -fn tint_symbol(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> f32 +fn sb_load(offset : u32) -> f32 @internal(intrinsic_load_storage_i32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_1(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> i32 +fn sb_load_1(offset : u32) -> i32 @internal(intrinsic_load_storage_u32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_2(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> u32 +fn sb_load_2(offset : u32) -> u32 @internal(intrinsic_load_storage_f16) @internal(disable_validation__function_has_no_body) -fn tint_symbol_3(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> f16 +fn sb_load_3(offset : u32) -> f16 @internal(intrinsic_load_storage_vec2_f32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_4(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec2 +fn sb_load_4(offset : u32) -> vec2 @internal(intrinsic_load_storage_vec2_i32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_5(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec2 +fn sb_load_5(offset : u32) -> vec2 @internal(intrinsic_load_storage_vec2_u32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_6(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec2 +fn sb_load_6(offset : u32) -> vec2 @internal(intrinsic_load_storage_vec2_f16) @internal(disable_validation__function_has_no_body) -fn tint_symbol_7(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec2 +fn sb_load_7(offset : u32) -> vec2 @internal(intrinsic_load_storage_vec3_f32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_8(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec3 +fn sb_load_8(offset : u32) -> vec3 @internal(intrinsic_load_storage_vec3_i32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_9(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec3 +fn sb_load_9(offset : u32) -> vec3 @internal(intrinsic_load_storage_vec3_u32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_10(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec3 +fn sb_load_10(offset : u32) -> vec3 @internal(intrinsic_load_storage_vec3_f16) @internal(disable_validation__function_has_no_body) -fn tint_symbol_11(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec3 +fn sb_load_11(offset : u32) -> vec3 @internal(intrinsic_load_storage_vec4_f32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_12(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec4 +fn sb_load_12(offset : u32) -> vec4 @internal(intrinsic_load_storage_vec4_i32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_13(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec4 +fn sb_load_13(offset : u32) -> vec4 @internal(intrinsic_load_storage_vec4_u32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_14(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec4 +fn sb_load_14(offset : u32) -> vec4 @internal(intrinsic_load_storage_vec4_f16) @internal(disable_validation__function_has_no_body) -fn tint_symbol_15(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec4 +fn sb_load_15(offset : u32) -> vec4 -fn tint_symbol_16(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat2x2 { - return mat2x2(tint_symbol_4(buffer, (offset + 0u)), tint_symbol_4(buffer, (offset + 8u))); +fn sb_load_16(offset : u32) -> mat2x2 { + return mat2x2(sb_load_4((offset + 0u)), sb_load_4((offset + 8u))); } -fn tint_symbol_17(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat2x3 { - return mat2x3(tint_symbol_8(buffer, (offset + 0u)), tint_symbol_8(buffer, (offset + 16u))); +fn sb_load_17(offset : u32) -> mat2x3 { + return mat2x3(sb_load_8((offset + 0u)), sb_load_8((offset + 16u))); } -fn tint_symbol_18(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat2x4 { - return mat2x4(tint_symbol_12(buffer, (offset + 0u)), tint_symbol_12(buffer, (offset + 16u))); +fn sb_load_18(offset : u32) -> mat2x4 { + return mat2x4(sb_load_12((offset + 0u)), sb_load_12((offset + 16u))); } -fn tint_symbol_19(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat3x2 { - return mat3x2(tint_symbol_4(buffer, (offset + 0u)), tint_symbol_4(buffer, (offset + 8u)), tint_symbol_4(buffer, (offset + 16u))); +fn sb_load_19(offset : u32) -> mat3x2 { + return mat3x2(sb_load_4((offset + 0u)), sb_load_4((offset + 8u)), sb_load_4((offset + 16u))); } -fn tint_symbol_20(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat3x3 { - return mat3x3(tint_symbol_8(buffer, (offset + 0u)), tint_symbol_8(buffer, (offset + 16u)), tint_symbol_8(buffer, (offset + 32u))); +fn sb_load_20(offset : u32) -> mat3x3 { + return mat3x3(sb_load_8((offset + 0u)), sb_load_8((offset + 16u)), sb_load_8((offset + 32u))); } -fn tint_symbol_21(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat3x4 { - return mat3x4(tint_symbol_12(buffer, (offset + 0u)), tint_symbol_12(buffer, (offset + 16u)), tint_symbol_12(buffer, (offset + 32u))); +fn sb_load_21(offset : u32) -> mat3x4 { + return mat3x4(sb_load_12((offset + 0u)), sb_load_12((offset + 16u)), sb_load_12((offset + 32u))); } -fn tint_symbol_22(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat4x2 { - return mat4x2(tint_symbol_4(buffer, (offset + 0u)), tint_symbol_4(buffer, (offset + 8u)), tint_symbol_4(buffer, (offset + 16u)), tint_symbol_4(buffer, (offset + 24u))); +fn sb_load_22(offset : u32) -> mat4x2 { + return mat4x2(sb_load_4((offset + 0u)), sb_load_4((offset + 8u)), sb_load_4((offset + 16u)), sb_load_4((offset + 24u))); } -fn tint_symbol_23(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat4x3 { - return mat4x3(tint_symbol_8(buffer, (offset + 0u)), tint_symbol_8(buffer, (offset + 16u)), tint_symbol_8(buffer, (offset + 32u)), tint_symbol_8(buffer, (offset + 48u))); +fn sb_load_23(offset : u32) -> mat4x3 { + return mat4x3(sb_load_8((offset + 0u)), sb_load_8((offset + 16u)), sb_load_8((offset + 32u)), sb_load_8((offset + 48u))); } -fn tint_symbol_24(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat4x4 { - return mat4x4(tint_symbol_12(buffer, (offset + 0u)), tint_symbol_12(buffer, (offset + 16u)), tint_symbol_12(buffer, (offset + 32u)), tint_symbol_12(buffer, (offset + 48u))); +fn sb_load_24(offset : u32) -> mat4x4 { + return mat4x4(sb_load_12((offset + 0u)), sb_load_12((offset + 16u)), sb_load_12((offset + 32u)), sb_load_12((offset + 48u))); } -fn tint_symbol_25(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat2x2 { - return mat2x2(tint_symbol_7(buffer, (offset + 0u)), tint_symbol_7(buffer, (offset + 4u))); +fn sb_load_25(offset : u32) -> mat2x2 { + return mat2x2(sb_load_7((offset + 0u)), sb_load_7((offset + 4u))); } -fn tint_symbol_26(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat2x3 { - return mat2x3(tint_symbol_11(buffer, (offset + 0u)), tint_symbol_11(buffer, (offset + 8u))); +fn sb_load_26(offset : u32) -> mat2x3 { + return mat2x3(sb_load_11((offset + 0u)), sb_load_11((offset + 8u))); } -fn tint_symbol_27(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat2x4 { - return mat2x4(tint_symbol_15(buffer, (offset + 0u)), tint_symbol_15(buffer, (offset + 8u))); +fn sb_load_27(offset : u32) -> mat2x4 { + return mat2x4(sb_load_15((offset + 0u)), sb_load_15((offset + 8u))); } -fn tint_symbol_28(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat3x2 { - return mat3x2(tint_symbol_7(buffer, (offset + 0u)), tint_symbol_7(buffer, (offset + 4u)), tint_symbol_7(buffer, (offset + 8u))); +fn sb_load_28(offset : u32) -> mat3x2 { + return mat3x2(sb_load_7((offset + 0u)), sb_load_7((offset + 4u)), sb_load_7((offset + 8u))); } -fn tint_symbol_29(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat3x3 { - return mat3x3(tint_symbol_11(buffer, (offset + 0u)), tint_symbol_11(buffer, (offset + 8u)), tint_symbol_11(buffer, (offset + 16u))); +fn sb_load_29(offset : u32) -> mat3x3 { + return mat3x3(sb_load_11((offset + 0u)), sb_load_11((offset + 8u)), sb_load_11((offset + 16u))); } -fn tint_symbol_30(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat3x4 { - return mat3x4(tint_symbol_15(buffer, (offset + 0u)), tint_symbol_15(buffer, (offset + 8u)), tint_symbol_15(buffer, (offset + 16u))); +fn sb_load_30(offset : u32) -> mat3x4 { + return mat3x4(sb_load_15((offset + 0u)), sb_load_15((offset + 8u)), sb_load_15((offset + 16u))); } -fn tint_symbol_31(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat4x2 { - return mat4x2(tint_symbol_7(buffer, (offset + 0u)), tint_symbol_7(buffer, (offset + 4u)), tint_symbol_7(buffer, (offset + 8u)), tint_symbol_7(buffer, (offset + 12u))); +fn sb_load_31(offset : u32) -> mat4x2 { + return mat4x2(sb_load_7((offset + 0u)), sb_load_7((offset + 4u)), sb_load_7((offset + 8u)), sb_load_7((offset + 12u))); } -fn tint_symbol_32(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat4x3 { - return mat4x3(tint_symbol_11(buffer, (offset + 0u)), tint_symbol_11(buffer, (offset + 8u)), tint_symbol_11(buffer, (offset + 16u)), tint_symbol_11(buffer, (offset + 24u))); +fn sb_load_32(offset : u32) -> mat4x3 { + return mat4x3(sb_load_11((offset + 0u)), sb_load_11((offset + 8u)), sb_load_11((offset + 16u)), sb_load_11((offset + 24u))); } -fn tint_symbol_33(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat4x4 { - return mat4x4(tint_symbol_15(buffer, (offset + 0u)), tint_symbol_15(buffer, (offset + 8u)), tint_symbol_15(buffer, (offset + 16u)), tint_symbol_15(buffer, (offset + 24u))); +fn sb_load_33(offset : u32) -> mat4x4 { + return mat4x4(sb_load_15((offset + 0u)), sb_load_15((offset + 8u)), sb_load_15((offset + 16u)), sb_load_15((offset + 24u))); } -fn tint_symbol_34(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> array, 2u> { +fn sb_load_34(offset : u32) -> array, 2u> { var arr : array, 2u>; for(var i = 0u; (i < 2u); i = (i + 1u)) { - arr[i] = tint_symbol_8(buffer, (offset + (i * 16u))); + arr[i] = sb_load_8((offset + (i * 16u))); } return arr; } -fn tint_symbol_35(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> array, 2u> { +fn sb_load_35(offset : u32) -> array, 2u> { var arr_1 : array, 2u>; for(var i_1 = 0u; (i_1 < 2u); i_1 = (i_1 + 1u)) { - arr_1[i_1] = tint_symbol_11(buffer, (offset + (i_1 * 8u))); + arr_1[i_1] = sb_load_11((offset + (i_1 * 8u))); } return arr_1; } @compute @workgroup_size(1) fn main() { - var scalar_f32 : f32 = tint_symbol(&(sb), 0u); - var scalar_i32 : i32 = tint_symbol_1(&(sb), 4u); - var scalar_u32 : u32 = tint_symbol_2(&(sb), 8u); - var scalar_f16 : f16 = tint_symbol_3(&(sb), 12u); - var vec2_f32 : vec2 = tint_symbol_4(&(sb), 16u); - var vec2_i32 : vec2 = tint_symbol_5(&(sb), 24u); - var vec2_u32 : vec2 = tint_symbol_6(&(sb), 32u); - var vec2_f16 : vec2 = tint_symbol_7(&(sb), 40u); - var vec3_f32 : vec3 = tint_symbol_8(&(sb), 48u); - var vec3_i32 : vec3 = tint_symbol_9(&(sb), 64u); - var vec3_u32 : vec3 = tint_symbol_10(&(sb), 80u); - var vec3_f16 : vec3 = tint_symbol_11(&(sb), 96u); - var vec4_f32 : vec4 = tint_symbol_12(&(sb), 112u); - var vec4_i32 : vec4 = tint_symbol_13(&(sb), 128u); - var vec4_u32 : vec4 = tint_symbol_14(&(sb), 144u); - var vec4_f16 : vec4 = tint_symbol_15(&(sb), 160u); - var mat2x2_f32 : mat2x2 = tint_symbol_16(&(sb), 168u); - var mat2x3_f32 : mat2x3 = tint_symbol_17(&(sb), 192u); - var mat2x4_f32 : mat2x4 = tint_symbol_18(&(sb), 224u); - var mat3x2_f32 : mat3x2 = tint_symbol_19(&(sb), 256u); - var mat3x3_f32 : mat3x3 = tint_symbol_20(&(sb), 288u); - var mat3x4_f32 : mat3x4 = tint_symbol_21(&(sb), 336u); - var mat4x2_f32 : mat4x2 = tint_symbol_22(&(sb), 384u); - var mat4x3_f32 : mat4x3 = tint_symbol_23(&(sb), 416u); - var mat4x4_f32 : mat4x4 = tint_symbol_24(&(sb), 480u); - var mat2x2_f16 : mat2x2 = tint_symbol_25(&(sb), 544u); - var mat2x3_f16 : mat2x3 = tint_symbol_26(&(sb), 552u); - var mat2x4_f16 : mat2x4 = tint_symbol_27(&(sb), 568u); - var mat3x2_f16 : mat3x2 = tint_symbol_28(&(sb), 584u); - var mat3x3_f16 : mat3x3 = tint_symbol_29(&(sb), 600u); - var mat3x4_f16 : mat3x4 = tint_symbol_30(&(sb), 624u); - var mat4x2_f16 : mat4x2 = tint_symbol_31(&(sb), 648u); - var mat4x3_f16 : mat4x3 = tint_symbol_32(&(sb), 664u); - var mat4x4_f16 : mat4x4 = tint_symbol_33(&(sb), 696u); - var arr2_vec3_f32 : array, 2> = tint_symbol_34(&(sb), 736u); - var arr2_vec3_f16 : array, 2> = tint_symbol_35(&(sb), 768u); + var scalar_f32 : f32 = sb_load(0u); + var scalar_i32 : i32 = sb_load_1(4u); + var scalar_u32 : u32 = sb_load_2(8u); + var scalar_f16 : f16 = sb_load_3(12u); + var vec2_f32 : vec2 = sb_load_4(16u); + var vec2_i32 : vec2 = sb_load_5(24u); + var vec2_u32 : vec2 = sb_load_6(32u); + var vec2_f16 : vec2 = sb_load_7(40u); + var vec3_f32 : vec3 = sb_load_8(48u); + var vec3_i32 : vec3 = sb_load_9(64u); + var vec3_u32 : vec3 = sb_load_10(80u); + var vec3_f16 : vec3 = sb_load_11(96u); + var vec4_f32 : vec4 = sb_load_12(112u); + var vec4_i32 : vec4 = sb_load_13(128u); + var vec4_u32 : vec4 = sb_load_14(144u); + var vec4_f16 : vec4 = sb_load_15(160u); + var mat2x2_f32 : mat2x2 = sb_load_16(168u); + var mat2x3_f32 : mat2x3 = sb_load_17(192u); + var mat2x4_f32 : mat2x4 = sb_load_18(224u); + var mat3x2_f32 : mat3x2 = sb_load_19(256u); + var mat3x3_f32 : mat3x3 = sb_load_20(288u); + var mat3x4_f32 : mat3x4 = sb_load_21(336u); + var mat4x2_f32 : mat4x2 = sb_load_22(384u); + var mat4x3_f32 : mat4x3 = sb_load_23(416u); + var mat4x4_f32 : mat4x4 = sb_load_24(480u); + var mat2x2_f16 : mat2x2 = sb_load_25(544u); + var mat2x3_f16 : mat2x3 = sb_load_26(552u); + var mat2x4_f16 : mat2x4 = sb_load_27(568u); + var mat3x2_f16 : mat3x2 = sb_load_28(584u); + var mat3x3_f16 : mat3x3 = sb_load_29(600u); + var mat3x4_f16 : mat3x4 = sb_load_30(624u); + var mat4x2_f16 : mat4x2 = sb_load_31(648u); + var mat4x3_f16 : mat4x3 = sb_load_32(664u); + var mat4x4_f16 : mat4x4 = sb_load_33(696u); + var arr2_vec3_f32 : array, 2> = sb_load_34(736u); + var arr2_vec3_f16 : array, 2> = sb_load_35(768u); } )"; @@ -451,179 +451,179 @@ struct SB { enable f16; @internal(intrinsic_load_storage_f32) @internal(disable_validation__function_has_no_body) -fn tint_symbol(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> f32 +fn sb_load(offset : u32) -> f32 @internal(intrinsic_load_storage_i32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_1(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> i32 +fn sb_load_1(offset : u32) -> i32 @internal(intrinsic_load_storage_u32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_2(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> u32 +fn sb_load_2(offset : u32) -> u32 @internal(intrinsic_load_storage_f16) @internal(disable_validation__function_has_no_body) -fn tint_symbol_3(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> f16 +fn sb_load_3(offset : u32) -> f16 @internal(intrinsic_load_storage_vec2_f32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_4(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec2 +fn sb_load_4(offset : u32) -> vec2 @internal(intrinsic_load_storage_vec2_i32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_5(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec2 +fn sb_load_5(offset : u32) -> vec2 @internal(intrinsic_load_storage_vec2_u32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_6(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec2 +fn sb_load_6(offset : u32) -> vec2 @internal(intrinsic_load_storage_vec2_f16) @internal(disable_validation__function_has_no_body) -fn tint_symbol_7(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec2 +fn sb_load_7(offset : u32) -> vec2 @internal(intrinsic_load_storage_vec3_f32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_8(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec3 +fn sb_load_8(offset : u32) -> vec3 @internal(intrinsic_load_storage_vec3_i32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_9(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec3 +fn sb_load_9(offset : u32) -> vec3 @internal(intrinsic_load_storage_vec3_u32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_10(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec3 +fn sb_load_10(offset : u32) -> vec3 @internal(intrinsic_load_storage_vec3_f16) @internal(disable_validation__function_has_no_body) -fn tint_symbol_11(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec3 +fn sb_load_11(offset : u32) -> vec3 @internal(intrinsic_load_storage_vec4_f32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_12(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec4 +fn sb_load_12(offset : u32) -> vec4 @internal(intrinsic_load_storage_vec4_i32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_13(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec4 +fn sb_load_13(offset : u32) -> vec4 @internal(intrinsic_load_storage_vec4_u32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_14(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec4 +fn sb_load_14(offset : u32) -> vec4 @internal(intrinsic_load_storage_vec4_f16) @internal(disable_validation__function_has_no_body) -fn tint_symbol_15(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec4 +fn sb_load_15(offset : u32) -> vec4 -fn tint_symbol_16(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat2x2 { - return mat2x2(tint_symbol_4(buffer, (offset + 0u)), tint_symbol_4(buffer, (offset + 8u))); +fn sb_load_16(offset : u32) -> mat2x2 { + return mat2x2(sb_load_4((offset + 0u)), sb_load_4((offset + 8u))); } -fn tint_symbol_17(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat2x3 { - return mat2x3(tint_symbol_8(buffer, (offset + 0u)), tint_symbol_8(buffer, (offset + 16u))); +fn sb_load_17(offset : u32) -> mat2x3 { + return mat2x3(sb_load_8((offset + 0u)), sb_load_8((offset + 16u))); } -fn tint_symbol_18(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat2x4 { - return mat2x4(tint_symbol_12(buffer, (offset + 0u)), tint_symbol_12(buffer, (offset + 16u))); +fn sb_load_18(offset : u32) -> mat2x4 { + return mat2x4(sb_load_12((offset + 0u)), sb_load_12((offset + 16u))); } -fn tint_symbol_19(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat3x2 { - return mat3x2(tint_symbol_4(buffer, (offset + 0u)), tint_symbol_4(buffer, (offset + 8u)), tint_symbol_4(buffer, (offset + 16u))); +fn sb_load_19(offset : u32) -> mat3x2 { + return mat3x2(sb_load_4((offset + 0u)), sb_load_4((offset + 8u)), sb_load_4((offset + 16u))); } -fn tint_symbol_20(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat3x3 { - return mat3x3(tint_symbol_8(buffer, (offset + 0u)), tint_symbol_8(buffer, (offset + 16u)), tint_symbol_8(buffer, (offset + 32u))); +fn sb_load_20(offset : u32) -> mat3x3 { + return mat3x3(sb_load_8((offset + 0u)), sb_load_8((offset + 16u)), sb_load_8((offset + 32u))); } -fn tint_symbol_21(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat3x4 { - return mat3x4(tint_symbol_12(buffer, (offset + 0u)), tint_symbol_12(buffer, (offset + 16u)), tint_symbol_12(buffer, (offset + 32u))); +fn sb_load_21(offset : u32) -> mat3x4 { + return mat3x4(sb_load_12((offset + 0u)), sb_load_12((offset + 16u)), sb_load_12((offset + 32u))); } -fn tint_symbol_22(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat4x2 { - return mat4x2(tint_symbol_4(buffer, (offset + 0u)), tint_symbol_4(buffer, (offset + 8u)), tint_symbol_4(buffer, (offset + 16u)), tint_symbol_4(buffer, (offset + 24u))); +fn sb_load_22(offset : u32) -> mat4x2 { + return mat4x2(sb_load_4((offset + 0u)), sb_load_4((offset + 8u)), sb_load_4((offset + 16u)), sb_load_4((offset + 24u))); } -fn tint_symbol_23(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat4x3 { - return mat4x3(tint_symbol_8(buffer, (offset + 0u)), tint_symbol_8(buffer, (offset + 16u)), tint_symbol_8(buffer, (offset + 32u)), tint_symbol_8(buffer, (offset + 48u))); +fn sb_load_23(offset : u32) -> mat4x3 { + return mat4x3(sb_load_8((offset + 0u)), sb_load_8((offset + 16u)), sb_load_8((offset + 32u)), sb_load_8((offset + 48u))); } -fn tint_symbol_24(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat4x4 { - return mat4x4(tint_symbol_12(buffer, (offset + 0u)), tint_symbol_12(buffer, (offset + 16u)), tint_symbol_12(buffer, (offset + 32u)), tint_symbol_12(buffer, (offset + 48u))); +fn sb_load_24(offset : u32) -> mat4x4 { + return mat4x4(sb_load_12((offset + 0u)), sb_load_12((offset + 16u)), sb_load_12((offset + 32u)), sb_load_12((offset + 48u))); } -fn tint_symbol_25(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat2x2 { - return mat2x2(tint_symbol_7(buffer, (offset + 0u)), tint_symbol_7(buffer, (offset + 4u))); +fn sb_load_25(offset : u32) -> mat2x2 { + return mat2x2(sb_load_7((offset + 0u)), sb_load_7((offset + 4u))); } -fn tint_symbol_26(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat2x3 { - return mat2x3(tint_symbol_11(buffer, (offset + 0u)), tint_symbol_11(buffer, (offset + 8u))); +fn sb_load_26(offset : u32) -> mat2x3 { + return mat2x3(sb_load_11((offset + 0u)), sb_load_11((offset + 8u))); } -fn tint_symbol_27(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat2x4 { - return mat2x4(tint_symbol_15(buffer, (offset + 0u)), tint_symbol_15(buffer, (offset + 8u))); +fn sb_load_27(offset : u32) -> mat2x4 { + return mat2x4(sb_load_15((offset + 0u)), sb_load_15((offset + 8u))); } -fn tint_symbol_28(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat3x2 { - return mat3x2(tint_symbol_7(buffer, (offset + 0u)), tint_symbol_7(buffer, (offset + 4u)), tint_symbol_7(buffer, (offset + 8u))); +fn sb_load_28(offset : u32) -> mat3x2 { + return mat3x2(sb_load_7((offset + 0u)), sb_load_7((offset + 4u)), sb_load_7((offset + 8u))); } -fn tint_symbol_29(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat3x3 { - return mat3x3(tint_symbol_11(buffer, (offset + 0u)), tint_symbol_11(buffer, (offset + 8u)), tint_symbol_11(buffer, (offset + 16u))); +fn sb_load_29(offset : u32) -> mat3x3 { + return mat3x3(sb_load_11((offset + 0u)), sb_load_11((offset + 8u)), sb_load_11((offset + 16u))); } -fn tint_symbol_30(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat3x4 { - return mat3x4(tint_symbol_15(buffer, (offset + 0u)), tint_symbol_15(buffer, (offset + 8u)), tint_symbol_15(buffer, (offset + 16u))); +fn sb_load_30(offset : u32) -> mat3x4 { + return mat3x4(sb_load_15((offset + 0u)), sb_load_15((offset + 8u)), sb_load_15((offset + 16u))); } -fn tint_symbol_31(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat4x2 { - return mat4x2(tint_symbol_7(buffer, (offset + 0u)), tint_symbol_7(buffer, (offset + 4u)), tint_symbol_7(buffer, (offset + 8u)), tint_symbol_7(buffer, (offset + 12u))); +fn sb_load_31(offset : u32) -> mat4x2 { + return mat4x2(sb_load_7((offset + 0u)), sb_load_7((offset + 4u)), sb_load_7((offset + 8u)), sb_load_7((offset + 12u))); } -fn tint_symbol_32(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat4x3 { - return mat4x3(tint_symbol_11(buffer, (offset + 0u)), tint_symbol_11(buffer, (offset + 8u)), tint_symbol_11(buffer, (offset + 16u)), tint_symbol_11(buffer, (offset + 24u))); +fn sb_load_32(offset : u32) -> mat4x3 { + return mat4x3(sb_load_11((offset + 0u)), sb_load_11((offset + 8u)), sb_load_11((offset + 16u)), sb_load_11((offset + 24u))); } -fn tint_symbol_33(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat4x4 { - return mat4x4(tint_symbol_15(buffer, (offset + 0u)), tint_symbol_15(buffer, (offset + 8u)), tint_symbol_15(buffer, (offset + 16u)), tint_symbol_15(buffer, (offset + 24u))); +fn sb_load_33(offset : u32) -> mat4x4 { + return mat4x4(sb_load_15((offset + 0u)), sb_load_15((offset + 8u)), sb_load_15((offset + 16u)), sb_load_15((offset + 24u))); } -fn tint_symbol_34(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> array, 2u> { +fn sb_load_34(offset : u32) -> array, 2u> { var arr : array, 2u>; for(var i = 0u; (i < 2u); i = (i + 1u)) { - arr[i] = tint_symbol_8(buffer, (offset + (i * 16u))); + arr[i] = sb_load_8((offset + (i * 16u))); } return arr; } -fn tint_symbol_35(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> array, 2u> { +fn sb_load_35(offset : u32) -> array, 2u> { var arr_1 : array, 2u>; for(var i_1 = 0u; (i_1 < 2u); i_1 = (i_1 + 1u)) { - arr_1[i_1] = tint_symbol_11(buffer, (offset + (i_1 * 8u))); + arr_1[i_1] = sb_load_11((offset + (i_1 * 8u))); } return arr_1; } @compute @workgroup_size(1) fn main() { - var scalar_f32 : f32 = tint_symbol(&(sb), 0u); - var scalar_i32 : i32 = tint_symbol_1(&(sb), 4u); - var scalar_u32 : u32 = tint_symbol_2(&(sb), 8u); - var scalar_f16 : f16 = tint_symbol_3(&(sb), 12u); - var vec2_f32 : vec2 = tint_symbol_4(&(sb), 16u); - var vec2_i32 : vec2 = tint_symbol_5(&(sb), 24u); - var vec2_u32 : vec2 = tint_symbol_6(&(sb), 32u); - var vec2_f16 : vec2 = tint_symbol_7(&(sb), 40u); - var vec3_f32 : vec3 = tint_symbol_8(&(sb), 48u); - var vec3_i32 : vec3 = tint_symbol_9(&(sb), 64u); - var vec3_u32 : vec3 = tint_symbol_10(&(sb), 80u); - var vec3_f16 : vec3 = tint_symbol_11(&(sb), 96u); - var vec4_f32 : vec4 = tint_symbol_12(&(sb), 112u); - var vec4_i32 : vec4 = tint_symbol_13(&(sb), 128u); - var vec4_u32 : vec4 = tint_symbol_14(&(sb), 144u); - var vec4_f16 : vec4 = tint_symbol_15(&(sb), 160u); - var mat2x2_f32 : mat2x2 = tint_symbol_16(&(sb), 168u); - var mat2x3_f32 : mat2x3 = tint_symbol_17(&(sb), 192u); - var mat2x4_f32 : mat2x4 = tint_symbol_18(&(sb), 224u); - var mat3x2_f32 : mat3x2 = tint_symbol_19(&(sb), 256u); - var mat3x3_f32 : mat3x3 = tint_symbol_20(&(sb), 288u); - var mat3x4_f32 : mat3x4 = tint_symbol_21(&(sb), 336u); - var mat4x2_f32 : mat4x2 = tint_symbol_22(&(sb), 384u); - var mat4x3_f32 : mat4x3 = tint_symbol_23(&(sb), 416u); - var mat4x4_f32 : mat4x4 = tint_symbol_24(&(sb), 480u); - var mat2x2_f16 : mat2x2 = tint_symbol_25(&(sb), 544u); - var mat2x3_f16 : mat2x3 = tint_symbol_26(&(sb), 552u); - var mat2x4_f16 : mat2x4 = tint_symbol_27(&(sb), 568u); - var mat3x2_f16 : mat3x2 = tint_symbol_28(&(sb), 584u); - var mat3x3_f16 : mat3x3 = tint_symbol_29(&(sb), 600u); - var mat3x4_f16 : mat3x4 = tint_symbol_30(&(sb), 624u); - var mat4x2_f16 : mat4x2 = tint_symbol_31(&(sb), 648u); - var mat4x3_f16 : mat4x3 = tint_symbol_32(&(sb), 664u); - var mat4x4_f16 : mat4x4 = tint_symbol_33(&(sb), 696u); - var arr2_vec3_f32 : array, 2> = tint_symbol_34(&(sb), 736u); - var arr2_vec3_f16 : array, 2> = tint_symbol_35(&(sb), 768u); + var scalar_f32 : f32 = sb_load(0u); + var scalar_i32 : i32 = sb_load_1(4u); + var scalar_u32 : u32 = sb_load_2(8u); + var scalar_f16 : f16 = sb_load_3(12u); + var vec2_f32 : vec2 = sb_load_4(16u); + var vec2_i32 : vec2 = sb_load_5(24u); + var vec2_u32 : vec2 = sb_load_6(32u); + var vec2_f16 : vec2 = sb_load_7(40u); + var vec3_f32 : vec3 = sb_load_8(48u); + var vec3_i32 : vec3 = sb_load_9(64u); + var vec3_u32 : vec3 = sb_load_10(80u); + var vec3_f16 : vec3 = sb_load_11(96u); + var vec4_f32 : vec4 = sb_load_12(112u); + var vec4_i32 : vec4 = sb_load_13(128u); + var vec4_u32 : vec4 = sb_load_14(144u); + var vec4_f16 : vec4 = sb_load_15(160u); + var mat2x2_f32 : mat2x2 = sb_load_16(168u); + var mat2x3_f32 : mat2x3 = sb_load_17(192u); + var mat2x4_f32 : mat2x4 = sb_load_18(224u); + var mat3x2_f32 : mat3x2 = sb_load_19(256u); + var mat3x3_f32 : mat3x3 = sb_load_20(288u); + var mat3x4_f32 : mat3x4 = sb_load_21(336u); + var mat4x2_f32 : mat4x2 = sb_load_22(384u); + var mat4x3_f32 : mat4x3 = sb_load_23(416u); + var mat4x4_f32 : mat4x4 = sb_load_24(480u); + var mat2x2_f16 : mat2x2 = sb_load_25(544u); + var mat2x3_f16 : mat2x3 = sb_load_26(552u); + var mat2x4_f16 : mat2x4 = sb_load_27(568u); + var mat3x2_f16 : mat3x2 = sb_load_28(584u); + var mat3x3_f16 : mat3x3 = sb_load_29(600u); + var mat3x4_f16 : mat3x4 = sb_load_30(624u); + var mat4x2_f16 : mat4x2 = sb_load_31(648u); + var mat4x3_f16 : mat4x3 = sb_load_32(664u); + var mat4x4_f16 : mat4x4 = sb_load_33(696u); + var arr2_vec3_f32 : array, 2> = sb_load_34(736u); + var arr2_vec3_f16 : array, 2> = sb_load_35(768u); } @group(0) @binding(0) var sb : SB; @@ -804,179 +804,179 @@ struct UB { @group(0) @binding(0) var ub : UB; @internal(intrinsic_load_uniform_f32) @internal(disable_validation__function_has_no_body) -fn tint_symbol(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> f32 +fn ub_load(offset : u32) -> f32 @internal(intrinsic_load_uniform_i32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_1(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> i32 +fn ub_load_1(offset : u32) -> i32 @internal(intrinsic_load_uniform_u32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_2(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> u32 +fn ub_load_2(offset : u32) -> u32 @internal(intrinsic_load_uniform_f16) @internal(disable_validation__function_has_no_body) -fn tint_symbol_3(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> f16 +fn ub_load_3(offset : u32) -> f16 @internal(intrinsic_load_uniform_vec2_f32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_4(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec2 +fn ub_load_4(offset : u32) -> vec2 @internal(intrinsic_load_uniform_vec2_i32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_5(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec2 +fn ub_load_5(offset : u32) -> vec2 @internal(intrinsic_load_uniform_vec2_u32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_6(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec2 +fn ub_load_6(offset : u32) -> vec2 @internal(intrinsic_load_uniform_vec2_f16) @internal(disable_validation__function_has_no_body) -fn tint_symbol_7(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec2 +fn ub_load_7(offset : u32) -> vec2 @internal(intrinsic_load_uniform_vec3_f32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_8(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec3 +fn ub_load_8(offset : u32) -> vec3 @internal(intrinsic_load_uniform_vec3_i32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_9(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec3 +fn ub_load_9(offset : u32) -> vec3 @internal(intrinsic_load_uniform_vec3_u32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_10(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec3 +fn ub_load_10(offset : u32) -> vec3 @internal(intrinsic_load_uniform_vec3_f16) @internal(disable_validation__function_has_no_body) -fn tint_symbol_11(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec3 +fn ub_load_11(offset : u32) -> vec3 @internal(intrinsic_load_uniform_vec4_f32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_12(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec4 +fn ub_load_12(offset : u32) -> vec4 @internal(intrinsic_load_uniform_vec4_i32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_13(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec4 +fn ub_load_13(offset : u32) -> vec4 @internal(intrinsic_load_uniform_vec4_u32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_14(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec4 +fn ub_load_14(offset : u32) -> vec4 @internal(intrinsic_load_uniform_vec4_f16) @internal(disable_validation__function_has_no_body) -fn tint_symbol_15(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec4 +fn ub_load_15(offset : u32) -> vec4 -fn tint_symbol_16(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat2x2 { - return mat2x2(tint_symbol_4(buffer, (offset + 0u)), tint_symbol_4(buffer, (offset + 8u))); +fn ub_load_16(offset : u32) -> mat2x2 { + return mat2x2(ub_load_4((offset + 0u)), ub_load_4((offset + 8u))); } -fn tint_symbol_17(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat2x3 { - return mat2x3(tint_symbol_8(buffer, (offset + 0u)), tint_symbol_8(buffer, (offset + 16u))); +fn ub_load_17(offset : u32) -> mat2x3 { + return mat2x3(ub_load_8((offset + 0u)), ub_load_8((offset + 16u))); } -fn tint_symbol_18(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat2x4 { - return mat2x4(tint_symbol_12(buffer, (offset + 0u)), tint_symbol_12(buffer, (offset + 16u))); +fn ub_load_18(offset : u32) -> mat2x4 { + return mat2x4(ub_load_12((offset + 0u)), ub_load_12((offset + 16u))); } -fn tint_symbol_19(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat3x2 { - return mat3x2(tint_symbol_4(buffer, (offset + 0u)), tint_symbol_4(buffer, (offset + 8u)), tint_symbol_4(buffer, (offset + 16u))); +fn ub_load_19(offset : u32) -> mat3x2 { + return mat3x2(ub_load_4((offset + 0u)), ub_load_4((offset + 8u)), ub_load_4((offset + 16u))); } -fn tint_symbol_20(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat3x3 { - return mat3x3(tint_symbol_8(buffer, (offset + 0u)), tint_symbol_8(buffer, (offset + 16u)), tint_symbol_8(buffer, (offset + 32u))); +fn ub_load_20(offset : u32) -> mat3x3 { + return mat3x3(ub_load_8((offset + 0u)), ub_load_8((offset + 16u)), ub_load_8((offset + 32u))); } -fn tint_symbol_21(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat3x4 { - return mat3x4(tint_symbol_12(buffer, (offset + 0u)), tint_symbol_12(buffer, (offset + 16u)), tint_symbol_12(buffer, (offset + 32u))); +fn ub_load_21(offset : u32) -> mat3x4 { + return mat3x4(ub_load_12((offset + 0u)), ub_load_12((offset + 16u)), ub_load_12((offset + 32u))); } -fn tint_symbol_22(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat4x2 { - return mat4x2(tint_symbol_4(buffer, (offset + 0u)), tint_symbol_4(buffer, (offset + 8u)), tint_symbol_4(buffer, (offset + 16u)), tint_symbol_4(buffer, (offset + 24u))); +fn ub_load_22(offset : u32) -> mat4x2 { + return mat4x2(ub_load_4((offset + 0u)), ub_load_4((offset + 8u)), ub_load_4((offset + 16u)), ub_load_4((offset + 24u))); } -fn tint_symbol_23(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat4x3 { - return mat4x3(tint_symbol_8(buffer, (offset + 0u)), tint_symbol_8(buffer, (offset + 16u)), tint_symbol_8(buffer, (offset + 32u)), tint_symbol_8(buffer, (offset + 48u))); +fn ub_load_23(offset : u32) -> mat4x3 { + return mat4x3(ub_load_8((offset + 0u)), ub_load_8((offset + 16u)), ub_load_8((offset + 32u)), ub_load_8((offset + 48u))); } -fn tint_symbol_24(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat4x4 { - return mat4x4(tint_symbol_12(buffer, (offset + 0u)), tint_symbol_12(buffer, (offset + 16u)), tint_symbol_12(buffer, (offset + 32u)), tint_symbol_12(buffer, (offset + 48u))); +fn ub_load_24(offset : u32) -> mat4x4 { + return mat4x4(ub_load_12((offset + 0u)), ub_load_12((offset + 16u)), ub_load_12((offset + 32u)), ub_load_12((offset + 48u))); } -fn tint_symbol_25(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat2x2 { - return mat2x2(tint_symbol_7(buffer, (offset + 0u)), tint_symbol_7(buffer, (offset + 4u))); +fn ub_load_25(offset : u32) -> mat2x2 { + return mat2x2(ub_load_7((offset + 0u)), ub_load_7((offset + 4u))); } -fn tint_symbol_26(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat2x3 { - return mat2x3(tint_symbol_11(buffer, (offset + 0u)), tint_symbol_11(buffer, (offset + 8u))); +fn ub_load_26(offset : u32) -> mat2x3 { + return mat2x3(ub_load_11((offset + 0u)), ub_load_11((offset + 8u))); } -fn tint_symbol_27(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat2x4 { - return mat2x4(tint_symbol_15(buffer, (offset + 0u)), tint_symbol_15(buffer, (offset + 8u))); +fn ub_load_27(offset : u32) -> mat2x4 { + return mat2x4(ub_load_15((offset + 0u)), ub_load_15((offset + 8u))); } -fn tint_symbol_28(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat3x2 { - return mat3x2(tint_symbol_7(buffer, (offset + 0u)), tint_symbol_7(buffer, (offset + 4u)), tint_symbol_7(buffer, (offset + 8u))); +fn ub_load_28(offset : u32) -> mat3x2 { + return mat3x2(ub_load_7((offset + 0u)), ub_load_7((offset + 4u)), ub_load_7((offset + 8u))); } -fn tint_symbol_29(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat3x3 { - return mat3x3(tint_symbol_11(buffer, (offset + 0u)), tint_symbol_11(buffer, (offset + 8u)), tint_symbol_11(buffer, (offset + 16u))); +fn ub_load_29(offset : u32) -> mat3x3 { + return mat3x3(ub_load_11((offset + 0u)), ub_load_11((offset + 8u)), ub_load_11((offset + 16u))); } -fn tint_symbol_30(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat3x4 { - return mat3x4(tint_symbol_15(buffer, (offset + 0u)), tint_symbol_15(buffer, (offset + 8u)), tint_symbol_15(buffer, (offset + 16u))); +fn ub_load_30(offset : u32) -> mat3x4 { + return mat3x4(ub_load_15((offset + 0u)), ub_load_15((offset + 8u)), ub_load_15((offset + 16u))); } -fn tint_symbol_31(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat4x2 { - return mat4x2(tint_symbol_7(buffer, (offset + 0u)), tint_symbol_7(buffer, (offset + 4u)), tint_symbol_7(buffer, (offset + 8u)), tint_symbol_7(buffer, (offset + 12u))); +fn ub_load_31(offset : u32) -> mat4x2 { + return mat4x2(ub_load_7((offset + 0u)), ub_load_7((offset + 4u)), ub_load_7((offset + 8u)), ub_load_7((offset + 12u))); } -fn tint_symbol_32(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat4x3 { - return mat4x3(tint_symbol_11(buffer, (offset + 0u)), tint_symbol_11(buffer, (offset + 8u)), tint_symbol_11(buffer, (offset + 16u)), tint_symbol_11(buffer, (offset + 24u))); +fn ub_load_32(offset : u32) -> mat4x3 { + return mat4x3(ub_load_11((offset + 0u)), ub_load_11((offset + 8u)), ub_load_11((offset + 16u)), ub_load_11((offset + 24u))); } -fn tint_symbol_33(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat4x4 { - return mat4x4(tint_symbol_15(buffer, (offset + 0u)), tint_symbol_15(buffer, (offset + 8u)), tint_symbol_15(buffer, (offset + 16u)), tint_symbol_15(buffer, (offset + 24u))); +fn ub_load_33(offset : u32) -> mat4x4 { + return mat4x4(ub_load_15((offset + 0u)), ub_load_15((offset + 8u)), ub_load_15((offset + 16u)), ub_load_15((offset + 24u))); } -fn tint_symbol_34(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> array, 2u> { +fn ub_load_34(offset : u32) -> array, 2u> { var arr : array, 2u>; for(var i = 0u; (i < 2u); i = (i + 1u)) { - arr[i] = tint_symbol_8(buffer, (offset + (i * 16u))); + arr[i] = ub_load_8((offset + (i * 16u))); } return arr; } -fn tint_symbol_35(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> array, 2u> { +fn ub_load_35(offset : u32) -> array, 2u> { var arr_1 : array, 2u>; for(var i_1 = 0u; (i_1 < 2u); i_1 = (i_1 + 1u)) { - arr_1[i_1] = tint_symbol_31(buffer, (offset + (i_1 * 16u))); + arr_1[i_1] = ub_load_31((offset + (i_1 * 16u))); } return arr_1; } @compute @workgroup_size(1) fn main() { - var scalar_f32 : f32 = tint_symbol(&(ub), 0u); - var scalar_i32 : i32 = tint_symbol_1(&(ub), 4u); - var scalar_u32 : u32 = tint_symbol_2(&(ub), 8u); - var scalar_f16 : f16 = tint_symbol_3(&(ub), 12u); - var vec2_f32 : vec2 = tint_symbol_4(&(ub), 16u); - var vec2_i32 : vec2 = tint_symbol_5(&(ub), 24u); - var vec2_u32 : vec2 = tint_symbol_6(&(ub), 32u); - var vec2_f16 : vec2 = tint_symbol_7(&(ub), 40u); - var vec3_f32 : vec3 = tint_symbol_8(&(ub), 48u); - var vec3_i32 : vec3 = tint_symbol_9(&(ub), 64u); - var vec3_u32 : vec3 = tint_symbol_10(&(ub), 80u); - var vec3_f16 : vec3 = tint_symbol_11(&(ub), 96u); - var vec4_f32 : vec4 = tint_symbol_12(&(ub), 112u); - var vec4_i32 : vec4 = tint_symbol_13(&(ub), 128u); - var vec4_u32 : vec4 = tint_symbol_14(&(ub), 144u); - var vec4_f16 : vec4 = tint_symbol_15(&(ub), 160u); - var mat2x2_f32 : mat2x2 = tint_symbol_16(&(ub), 168u); - var mat2x3_f32 : mat2x3 = tint_symbol_17(&(ub), 192u); - var mat2x4_f32 : mat2x4 = tint_symbol_18(&(ub), 224u); - var mat3x2_f32 : mat3x2 = tint_symbol_19(&(ub), 256u); - var mat3x3_f32 : mat3x3 = tint_symbol_20(&(ub), 288u); - var mat3x4_f32 : mat3x4 = tint_symbol_21(&(ub), 336u); - var mat4x2_f32 : mat4x2 = tint_symbol_22(&(ub), 384u); - var mat4x3_f32 : mat4x3 = tint_symbol_23(&(ub), 416u); - var mat4x4_f32 : mat4x4 = tint_symbol_24(&(ub), 480u); - var mat2x2_f16 : mat2x2 = tint_symbol_25(&(ub), 544u); - var mat2x3_f16 : mat2x3 = tint_symbol_26(&(ub), 552u); - var mat2x4_f16 : mat2x4 = tint_symbol_27(&(ub), 568u); - var mat3x2_f16 : mat3x2 = tint_symbol_28(&(ub), 584u); - var mat3x3_f16 : mat3x3 = tint_symbol_29(&(ub), 600u); - var mat3x4_f16 : mat3x4 = tint_symbol_30(&(ub), 624u); - var mat4x2_f16 : mat4x2 = tint_symbol_31(&(ub), 648u); - var mat4x3_f16 : mat4x3 = tint_symbol_32(&(ub), 664u); - var mat4x4_f16 : mat4x4 = tint_symbol_33(&(ub), 696u); - var arr2_vec3_f32 : array, 2> = tint_symbol_34(&(ub), 736u); - var arr2_mat4x2_f16 : array, 2> = tint_symbol_35(&(ub), 768u); + var scalar_f32 : f32 = ub_load(0u); + var scalar_i32 : i32 = ub_load_1(4u); + var scalar_u32 : u32 = ub_load_2(8u); + var scalar_f16 : f16 = ub_load_3(12u); + var vec2_f32 : vec2 = ub_load_4(16u); + var vec2_i32 : vec2 = ub_load_5(24u); + var vec2_u32 : vec2 = ub_load_6(32u); + var vec2_f16 : vec2 = ub_load_7(40u); + var vec3_f32 : vec3 = ub_load_8(48u); + var vec3_i32 : vec3 = ub_load_9(64u); + var vec3_u32 : vec3 = ub_load_10(80u); + var vec3_f16 : vec3 = ub_load_11(96u); + var vec4_f32 : vec4 = ub_load_12(112u); + var vec4_i32 : vec4 = ub_load_13(128u); + var vec4_u32 : vec4 = ub_load_14(144u); + var vec4_f16 : vec4 = ub_load_15(160u); + var mat2x2_f32 : mat2x2 = ub_load_16(168u); + var mat2x3_f32 : mat2x3 = ub_load_17(192u); + var mat2x4_f32 : mat2x4 = ub_load_18(224u); + var mat3x2_f32 : mat3x2 = ub_load_19(256u); + var mat3x3_f32 : mat3x3 = ub_load_20(288u); + var mat3x4_f32 : mat3x4 = ub_load_21(336u); + var mat4x2_f32 : mat4x2 = ub_load_22(384u); + var mat4x3_f32 : mat4x3 = ub_load_23(416u); + var mat4x4_f32 : mat4x4 = ub_load_24(480u); + var mat2x2_f16 : mat2x2 = ub_load_25(544u); + var mat2x3_f16 : mat2x3 = ub_load_26(552u); + var mat2x4_f16 : mat2x4 = ub_load_27(568u); + var mat3x2_f16 : mat3x2 = ub_load_28(584u); + var mat3x3_f16 : mat3x3 = ub_load_29(600u); + var mat3x4_f16 : mat3x4 = ub_load_30(624u); + var mat4x2_f16 : mat4x2 = ub_load_31(648u); + var mat4x3_f16 : mat4x3 = ub_load_32(664u); + var mat4x4_f16 : mat4x4 = ub_load_33(696u); + var arr2_vec3_f32 : array, 2> = ub_load_34(736u); + var arr2_mat4x2_f16 : array, 2> = ub_load_35(768u); } )"; @@ -1075,179 +1075,179 @@ struct UB { enable f16; @internal(intrinsic_load_uniform_f32) @internal(disable_validation__function_has_no_body) -fn tint_symbol(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> f32 +fn ub_load(offset : u32) -> f32 @internal(intrinsic_load_uniform_i32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_1(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> i32 +fn ub_load_1(offset : u32) -> i32 @internal(intrinsic_load_uniform_u32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_2(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> u32 +fn ub_load_2(offset : u32) -> u32 @internal(intrinsic_load_uniform_f16) @internal(disable_validation__function_has_no_body) -fn tint_symbol_3(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> f16 +fn ub_load_3(offset : u32) -> f16 @internal(intrinsic_load_uniform_vec2_f32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_4(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec2 +fn ub_load_4(offset : u32) -> vec2 @internal(intrinsic_load_uniform_vec2_i32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_5(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec2 +fn ub_load_5(offset : u32) -> vec2 @internal(intrinsic_load_uniform_vec2_u32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_6(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec2 +fn ub_load_6(offset : u32) -> vec2 @internal(intrinsic_load_uniform_vec2_f16) @internal(disable_validation__function_has_no_body) -fn tint_symbol_7(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec2 +fn ub_load_7(offset : u32) -> vec2 @internal(intrinsic_load_uniform_vec3_f32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_8(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec3 +fn ub_load_8(offset : u32) -> vec3 @internal(intrinsic_load_uniform_vec3_i32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_9(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec3 +fn ub_load_9(offset : u32) -> vec3 @internal(intrinsic_load_uniform_vec3_u32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_10(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec3 +fn ub_load_10(offset : u32) -> vec3 @internal(intrinsic_load_uniform_vec3_f16) @internal(disable_validation__function_has_no_body) -fn tint_symbol_11(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec3 +fn ub_load_11(offset : u32) -> vec3 @internal(intrinsic_load_uniform_vec4_f32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_12(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec4 +fn ub_load_12(offset : u32) -> vec4 @internal(intrinsic_load_uniform_vec4_i32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_13(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec4 +fn ub_load_13(offset : u32) -> vec4 @internal(intrinsic_load_uniform_vec4_u32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_14(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec4 +fn ub_load_14(offset : u32) -> vec4 @internal(intrinsic_load_uniform_vec4_f16) @internal(disable_validation__function_has_no_body) -fn tint_symbol_15(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec4 +fn ub_load_15(offset : u32) -> vec4 -fn tint_symbol_16(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat2x2 { - return mat2x2(tint_symbol_4(buffer, (offset + 0u)), tint_symbol_4(buffer, (offset + 8u))); +fn ub_load_16(offset : u32) -> mat2x2 { + return mat2x2(ub_load_4((offset + 0u)), ub_load_4((offset + 8u))); } -fn tint_symbol_17(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat2x3 { - return mat2x3(tint_symbol_8(buffer, (offset + 0u)), tint_symbol_8(buffer, (offset + 16u))); +fn ub_load_17(offset : u32) -> mat2x3 { + return mat2x3(ub_load_8((offset + 0u)), ub_load_8((offset + 16u))); } -fn tint_symbol_18(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat2x4 { - return mat2x4(tint_symbol_12(buffer, (offset + 0u)), tint_symbol_12(buffer, (offset + 16u))); +fn ub_load_18(offset : u32) -> mat2x4 { + return mat2x4(ub_load_12((offset + 0u)), ub_load_12((offset + 16u))); } -fn tint_symbol_19(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat3x2 { - return mat3x2(tint_symbol_4(buffer, (offset + 0u)), tint_symbol_4(buffer, (offset + 8u)), tint_symbol_4(buffer, (offset + 16u))); +fn ub_load_19(offset : u32) -> mat3x2 { + return mat3x2(ub_load_4((offset + 0u)), ub_load_4((offset + 8u)), ub_load_4((offset + 16u))); } -fn tint_symbol_20(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat3x3 { - return mat3x3(tint_symbol_8(buffer, (offset + 0u)), tint_symbol_8(buffer, (offset + 16u)), tint_symbol_8(buffer, (offset + 32u))); +fn ub_load_20(offset : u32) -> mat3x3 { + return mat3x3(ub_load_8((offset + 0u)), ub_load_8((offset + 16u)), ub_load_8((offset + 32u))); } -fn tint_symbol_21(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat3x4 { - return mat3x4(tint_symbol_12(buffer, (offset + 0u)), tint_symbol_12(buffer, (offset + 16u)), tint_symbol_12(buffer, (offset + 32u))); +fn ub_load_21(offset : u32) -> mat3x4 { + return mat3x4(ub_load_12((offset + 0u)), ub_load_12((offset + 16u)), ub_load_12((offset + 32u))); } -fn tint_symbol_22(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat4x2 { - return mat4x2(tint_symbol_4(buffer, (offset + 0u)), tint_symbol_4(buffer, (offset + 8u)), tint_symbol_4(buffer, (offset + 16u)), tint_symbol_4(buffer, (offset + 24u))); +fn ub_load_22(offset : u32) -> mat4x2 { + return mat4x2(ub_load_4((offset + 0u)), ub_load_4((offset + 8u)), ub_load_4((offset + 16u)), ub_load_4((offset + 24u))); } -fn tint_symbol_23(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat4x3 { - return mat4x3(tint_symbol_8(buffer, (offset + 0u)), tint_symbol_8(buffer, (offset + 16u)), tint_symbol_8(buffer, (offset + 32u)), tint_symbol_8(buffer, (offset + 48u))); +fn ub_load_23(offset : u32) -> mat4x3 { + return mat4x3(ub_load_8((offset + 0u)), ub_load_8((offset + 16u)), ub_load_8((offset + 32u)), ub_load_8((offset + 48u))); } -fn tint_symbol_24(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat4x4 { - return mat4x4(tint_symbol_12(buffer, (offset + 0u)), tint_symbol_12(buffer, (offset + 16u)), tint_symbol_12(buffer, (offset + 32u)), tint_symbol_12(buffer, (offset + 48u))); +fn ub_load_24(offset : u32) -> mat4x4 { + return mat4x4(ub_load_12((offset + 0u)), ub_load_12((offset + 16u)), ub_load_12((offset + 32u)), ub_load_12((offset + 48u))); } -fn tint_symbol_25(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat2x2 { - return mat2x2(tint_symbol_7(buffer, (offset + 0u)), tint_symbol_7(buffer, (offset + 4u))); +fn ub_load_25(offset : u32) -> mat2x2 { + return mat2x2(ub_load_7((offset + 0u)), ub_load_7((offset + 4u))); } -fn tint_symbol_26(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat2x3 { - return mat2x3(tint_symbol_11(buffer, (offset + 0u)), tint_symbol_11(buffer, (offset + 8u))); +fn ub_load_26(offset : u32) -> mat2x3 { + return mat2x3(ub_load_11((offset + 0u)), ub_load_11((offset + 8u))); } -fn tint_symbol_27(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat2x4 { - return mat2x4(tint_symbol_15(buffer, (offset + 0u)), tint_symbol_15(buffer, (offset + 8u))); +fn ub_load_27(offset : u32) -> mat2x4 { + return mat2x4(ub_load_15((offset + 0u)), ub_load_15((offset + 8u))); } -fn tint_symbol_28(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat3x2 { - return mat3x2(tint_symbol_7(buffer, (offset + 0u)), tint_symbol_7(buffer, (offset + 4u)), tint_symbol_7(buffer, (offset + 8u))); +fn ub_load_28(offset : u32) -> mat3x2 { + return mat3x2(ub_load_7((offset + 0u)), ub_load_7((offset + 4u)), ub_load_7((offset + 8u))); } -fn tint_symbol_29(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat3x3 { - return mat3x3(tint_symbol_11(buffer, (offset + 0u)), tint_symbol_11(buffer, (offset + 8u)), tint_symbol_11(buffer, (offset + 16u))); +fn ub_load_29(offset : u32) -> mat3x3 { + return mat3x3(ub_load_11((offset + 0u)), ub_load_11((offset + 8u)), ub_load_11((offset + 16u))); } -fn tint_symbol_30(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat3x4 { - return mat3x4(tint_symbol_15(buffer, (offset + 0u)), tint_symbol_15(buffer, (offset + 8u)), tint_symbol_15(buffer, (offset + 16u))); +fn ub_load_30(offset : u32) -> mat3x4 { + return mat3x4(ub_load_15((offset + 0u)), ub_load_15((offset + 8u)), ub_load_15((offset + 16u))); } -fn tint_symbol_31(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat4x2 { - return mat4x2(tint_symbol_7(buffer, (offset + 0u)), tint_symbol_7(buffer, (offset + 4u)), tint_symbol_7(buffer, (offset + 8u)), tint_symbol_7(buffer, (offset + 12u))); +fn ub_load_31(offset : u32) -> mat4x2 { + return mat4x2(ub_load_7((offset + 0u)), ub_load_7((offset + 4u)), ub_load_7((offset + 8u)), ub_load_7((offset + 12u))); } -fn tint_symbol_32(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat4x3 { - return mat4x3(tint_symbol_11(buffer, (offset + 0u)), tint_symbol_11(buffer, (offset + 8u)), tint_symbol_11(buffer, (offset + 16u)), tint_symbol_11(buffer, (offset + 24u))); +fn ub_load_32(offset : u32) -> mat4x3 { + return mat4x3(ub_load_11((offset + 0u)), ub_load_11((offset + 8u)), ub_load_11((offset + 16u)), ub_load_11((offset + 24u))); } -fn tint_symbol_33(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat4x4 { - return mat4x4(tint_symbol_15(buffer, (offset + 0u)), tint_symbol_15(buffer, (offset + 8u)), tint_symbol_15(buffer, (offset + 16u)), tint_symbol_15(buffer, (offset + 24u))); +fn ub_load_33(offset : u32) -> mat4x4 { + return mat4x4(ub_load_15((offset + 0u)), ub_load_15((offset + 8u)), ub_load_15((offset + 16u)), ub_load_15((offset + 24u))); } -fn tint_symbol_34(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> array, 2u> { +fn ub_load_34(offset : u32) -> array, 2u> { var arr : array, 2u>; for(var i = 0u; (i < 2u); i = (i + 1u)) { - arr[i] = tint_symbol_8(buffer, (offset + (i * 16u))); + arr[i] = ub_load_8((offset + (i * 16u))); } return arr; } -fn tint_symbol_35(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> array, 2u> { +fn ub_load_35(offset : u32) -> array, 2u> { var arr_1 : array, 2u>; for(var i_1 = 0u; (i_1 < 2u); i_1 = (i_1 + 1u)) { - arr_1[i_1] = tint_symbol_31(buffer, (offset + (i_1 * 16u))); + arr_1[i_1] = ub_load_31((offset + (i_1 * 16u))); } return arr_1; } @compute @workgroup_size(1) fn main() { - var scalar_f32 : f32 = tint_symbol(&(ub), 0u); - var scalar_i32 : i32 = tint_symbol_1(&(ub), 4u); - var scalar_u32 : u32 = tint_symbol_2(&(ub), 8u); - var scalar_f16 : f16 = tint_symbol_3(&(ub), 12u); - var vec2_f32 : vec2 = tint_symbol_4(&(ub), 16u); - var vec2_i32 : vec2 = tint_symbol_5(&(ub), 24u); - var vec2_u32 : vec2 = tint_symbol_6(&(ub), 32u); - var vec2_f16 : vec2 = tint_symbol_7(&(ub), 40u); - var vec3_f32 : vec3 = tint_symbol_8(&(ub), 48u); - var vec3_i32 : vec3 = tint_symbol_9(&(ub), 64u); - var vec3_u32 : vec3 = tint_symbol_10(&(ub), 80u); - var vec3_f16 : vec3 = tint_symbol_11(&(ub), 96u); - var vec4_f32 : vec4 = tint_symbol_12(&(ub), 112u); - var vec4_i32 : vec4 = tint_symbol_13(&(ub), 128u); - var vec4_u32 : vec4 = tint_symbol_14(&(ub), 144u); - var vec4_f16 : vec4 = tint_symbol_15(&(ub), 160u); - var mat2x2_f32 : mat2x2 = tint_symbol_16(&(ub), 168u); - var mat2x3_f32 : mat2x3 = tint_symbol_17(&(ub), 192u); - var mat2x4_f32 : mat2x4 = tint_symbol_18(&(ub), 224u); - var mat3x2_f32 : mat3x2 = tint_symbol_19(&(ub), 256u); - var mat3x3_f32 : mat3x3 = tint_symbol_20(&(ub), 288u); - var mat3x4_f32 : mat3x4 = tint_symbol_21(&(ub), 336u); - var mat4x2_f32 : mat4x2 = tint_symbol_22(&(ub), 384u); - var mat4x3_f32 : mat4x3 = tint_symbol_23(&(ub), 416u); - var mat4x4_f32 : mat4x4 = tint_symbol_24(&(ub), 480u); - var mat2x2_f16 : mat2x2 = tint_symbol_25(&(ub), 544u); - var mat2x3_f16 : mat2x3 = tint_symbol_26(&(ub), 552u); - var mat2x4_f16 : mat2x4 = tint_symbol_27(&(ub), 568u); - var mat3x2_f16 : mat3x2 = tint_symbol_28(&(ub), 584u); - var mat3x3_f16 : mat3x3 = tint_symbol_29(&(ub), 600u); - var mat3x4_f16 : mat3x4 = tint_symbol_30(&(ub), 624u); - var mat4x2_f16 : mat4x2 = tint_symbol_31(&(ub), 648u); - var mat4x3_f16 : mat4x3 = tint_symbol_32(&(ub), 664u); - var mat4x4_f16 : mat4x4 = tint_symbol_33(&(ub), 696u); - var arr2_vec3_f32 : array, 2> = tint_symbol_34(&(ub), 736u); - var arr2_mat4x2_f16 : array, 2> = tint_symbol_35(&(ub), 768u); + var scalar_f32 : f32 = ub_load(0u); + var scalar_i32 : i32 = ub_load_1(4u); + var scalar_u32 : u32 = ub_load_2(8u); + var scalar_f16 : f16 = ub_load_3(12u); + var vec2_f32 : vec2 = ub_load_4(16u); + var vec2_i32 : vec2 = ub_load_5(24u); + var vec2_u32 : vec2 = ub_load_6(32u); + var vec2_f16 : vec2 = ub_load_7(40u); + var vec3_f32 : vec3 = ub_load_8(48u); + var vec3_i32 : vec3 = ub_load_9(64u); + var vec3_u32 : vec3 = ub_load_10(80u); + var vec3_f16 : vec3 = ub_load_11(96u); + var vec4_f32 : vec4 = ub_load_12(112u); + var vec4_i32 : vec4 = ub_load_13(128u); + var vec4_u32 : vec4 = ub_load_14(144u); + var vec4_f16 : vec4 = ub_load_15(160u); + var mat2x2_f32 : mat2x2 = ub_load_16(168u); + var mat2x3_f32 : mat2x3 = ub_load_17(192u); + var mat2x4_f32 : mat2x4 = ub_load_18(224u); + var mat3x2_f32 : mat3x2 = ub_load_19(256u); + var mat3x3_f32 : mat3x3 = ub_load_20(288u); + var mat3x4_f32 : mat3x4 = ub_load_21(336u); + var mat4x2_f32 : mat4x2 = ub_load_22(384u); + var mat4x3_f32 : mat4x3 = ub_load_23(416u); + var mat4x4_f32 : mat4x4 = ub_load_24(480u); + var mat2x2_f16 : mat2x2 = ub_load_25(544u); + var mat2x3_f16 : mat2x3 = ub_load_26(552u); + var mat2x4_f16 : mat2x4 = ub_load_27(568u); + var mat3x2_f16 : mat3x2 = ub_load_28(584u); + var mat3x3_f16 : mat3x3 = ub_load_29(600u); + var mat3x4_f16 : mat3x4 = ub_load_30(624u); + var mat4x2_f16 : mat4x2 = ub_load_31(648u); + var mat4x3_f16 : mat4x3 = ub_load_32(664u); + var mat4x4_f16 : mat4x4 = ub_load_33(696u); + var arr2_vec3_f32 : array, 2> = ub_load_34(736u); + var arr2_mat4x2_f16 : array, 2> = ub_load_35(768u); } @group(0) @binding(0) var ub : UB; @@ -1428,213 +1428,213 @@ struct SB { @group(0) @binding(0) var sb : SB; @internal(intrinsic_store_storage_f32) @internal(disable_validation__function_has_no_body) -fn tint_symbol(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : f32) +fn sb_store(offset : u32, value : f32) @internal(intrinsic_store_storage_i32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_1(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : i32) +fn sb_store_1(offset : u32, value : i32) @internal(intrinsic_store_storage_u32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_2(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : u32) +fn sb_store_2(offset : u32, value : u32) @internal(intrinsic_store_storage_f16) @internal(disable_validation__function_has_no_body) -fn tint_symbol_3(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : f16) +fn sb_store_3(offset : u32, value : f16) @internal(intrinsic_store_storage_vec2_f32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_4(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : vec2) +fn sb_store_4(offset : u32, value : vec2) @internal(intrinsic_store_storage_vec2_i32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_5(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : vec2) +fn sb_store_5(offset : u32, value : vec2) @internal(intrinsic_store_storage_vec2_u32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_6(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : vec2) +fn sb_store_6(offset : u32, value : vec2) @internal(intrinsic_store_storage_vec2_f16) @internal(disable_validation__function_has_no_body) -fn tint_symbol_7(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : vec2) +fn sb_store_7(offset : u32, value : vec2) @internal(intrinsic_store_storage_vec3_f32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_8(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : vec3) +fn sb_store_8(offset : u32, value : vec3) @internal(intrinsic_store_storage_vec3_i32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_9(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : vec3) +fn sb_store_9(offset : u32, value : vec3) @internal(intrinsic_store_storage_vec3_u32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_10(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : vec3) +fn sb_store_10(offset : u32, value : vec3) @internal(intrinsic_store_storage_vec3_f16) @internal(disable_validation__function_has_no_body) -fn tint_symbol_11(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : vec3) +fn sb_store_11(offset : u32, value : vec3) @internal(intrinsic_store_storage_vec4_f32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_12(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : vec4) +fn sb_store_12(offset : u32, value : vec4) @internal(intrinsic_store_storage_vec4_i32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_13(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : vec4) +fn sb_store_13(offset : u32, value : vec4) @internal(intrinsic_store_storage_vec4_u32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_14(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : vec4) +fn sb_store_14(offset : u32, value : vec4) @internal(intrinsic_store_storage_vec4_f16) @internal(disable_validation__function_has_no_body) -fn tint_symbol_15(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : vec4) +fn sb_store_15(offset : u32, value : vec4) -fn tint_symbol_16(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat2x2) { - tint_symbol_4(buffer, (offset + 0u), value[0u]); - tint_symbol_4(buffer, (offset + 8u), value[1u]); +fn sb_store_16(offset : u32, value : mat2x2) { + sb_store_4((offset + 0u), value[0u]); + sb_store_4((offset + 8u), value[1u]); } -fn tint_symbol_17(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat2x3) { - tint_symbol_8(buffer, (offset + 0u), value[0u]); - tint_symbol_8(buffer, (offset + 16u), value[1u]); +fn sb_store_17(offset : u32, value : mat2x3) { + sb_store_8((offset + 0u), value[0u]); + sb_store_8((offset + 16u), value[1u]); } -fn tint_symbol_18(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat2x4) { - tint_symbol_12(buffer, (offset + 0u), value[0u]); - tint_symbol_12(buffer, (offset + 16u), value[1u]); +fn sb_store_18(offset : u32, value : mat2x4) { + sb_store_12((offset + 0u), value[0u]); + sb_store_12((offset + 16u), value[1u]); } -fn tint_symbol_19(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat3x2) { - tint_symbol_4(buffer, (offset + 0u), value[0u]); - tint_symbol_4(buffer, (offset + 8u), value[1u]); - tint_symbol_4(buffer, (offset + 16u), value[2u]); +fn sb_store_19(offset : u32, value : mat3x2) { + sb_store_4((offset + 0u), value[0u]); + sb_store_4((offset + 8u), value[1u]); + sb_store_4((offset + 16u), value[2u]); } -fn tint_symbol_20(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat3x3) { - tint_symbol_8(buffer, (offset + 0u), value[0u]); - tint_symbol_8(buffer, (offset + 16u), value[1u]); - tint_symbol_8(buffer, (offset + 32u), value[2u]); +fn sb_store_20(offset : u32, value : mat3x3) { + sb_store_8((offset + 0u), value[0u]); + sb_store_8((offset + 16u), value[1u]); + sb_store_8((offset + 32u), value[2u]); } -fn tint_symbol_21(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat3x4) { - tint_symbol_12(buffer, (offset + 0u), value[0u]); - tint_symbol_12(buffer, (offset + 16u), value[1u]); - tint_symbol_12(buffer, (offset + 32u), value[2u]); +fn sb_store_21(offset : u32, value : mat3x4) { + sb_store_12((offset + 0u), value[0u]); + sb_store_12((offset + 16u), value[1u]); + sb_store_12((offset + 32u), value[2u]); } -fn tint_symbol_22(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat4x2) { - tint_symbol_4(buffer, (offset + 0u), value[0u]); - tint_symbol_4(buffer, (offset + 8u), value[1u]); - tint_symbol_4(buffer, (offset + 16u), value[2u]); - tint_symbol_4(buffer, (offset + 24u), value[3u]); +fn sb_store_22(offset : u32, value : mat4x2) { + sb_store_4((offset + 0u), value[0u]); + sb_store_4((offset + 8u), value[1u]); + sb_store_4((offset + 16u), value[2u]); + sb_store_4((offset + 24u), value[3u]); } -fn tint_symbol_23(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat4x3) { - tint_symbol_8(buffer, (offset + 0u), value[0u]); - tint_symbol_8(buffer, (offset + 16u), value[1u]); - tint_symbol_8(buffer, (offset + 32u), value[2u]); - tint_symbol_8(buffer, (offset + 48u), value[3u]); +fn sb_store_23(offset : u32, value : mat4x3) { + sb_store_8((offset + 0u), value[0u]); + sb_store_8((offset + 16u), value[1u]); + sb_store_8((offset + 32u), value[2u]); + sb_store_8((offset + 48u), value[3u]); } -fn tint_symbol_24(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat4x4) { - tint_symbol_12(buffer, (offset + 0u), value[0u]); - tint_symbol_12(buffer, (offset + 16u), value[1u]); - tint_symbol_12(buffer, (offset + 32u), value[2u]); - tint_symbol_12(buffer, (offset + 48u), value[3u]); +fn sb_store_24(offset : u32, value : mat4x4) { + sb_store_12((offset + 0u), value[0u]); + sb_store_12((offset + 16u), value[1u]); + sb_store_12((offset + 32u), value[2u]); + sb_store_12((offset + 48u), value[3u]); } -fn tint_symbol_25(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat2x2) { - tint_symbol_7(buffer, (offset + 0u), value[0u]); - tint_symbol_7(buffer, (offset + 4u), value[1u]); +fn sb_store_25(offset : u32, value : mat2x2) { + sb_store_7((offset + 0u), value[0u]); + sb_store_7((offset + 4u), value[1u]); } -fn tint_symbol_26(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat2x3) { - tint_symbol_11(buffer, (offset + 0u), value[0u]); - tint_symbol_11(buffer, (offset + 8u), value[1u]); +fn sb_store_26(offset : u32, value : mat2x3) { + sb_store_11((offset + 0u), value[0u]); + sb_store_11((offset + 8u), value[1u]); } -fn tint_symbol_27(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat2x4) { - tint_symbol_15(buffer, (offset + 0u), value[0u]); - tint_symbol_15(buffer, (offset + 8u), value[1u]); +fn sb_store_27(offset : u32, value : mat2x4) { + sb_store_15((offset + 0u), value[0u]); + sb_store_15((offset + 8u), value[1u]); } -fn tint_symbol_28(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat3x2) { - tint_symbol_7(buffer, (offset + 0u), value[0u]); - tint_symbol_7(buffer, (offset + 4u), value[1u]); - tint_symbol_7(buffer, (offset + 8u), value[2u]); +fn sb_store_28(offset : u32, value : mat3x2) { + sb_store_7((offset + 0u), value[0u]); + sb_store_7((offset + 4u), value[1u]); + sb_store_7((offset + 8u), value[2u]); } -fn tint_symbol_29(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat3x3) { - tint_symbol_11(buffer, (offset + 0u), value[0u]); - tint_symbol_11(buffer, (offset + 8u), value[1u]); - tint_symbol_11(buffer, (offset + 16u), value[2u]); +fn sb_store_29(offset : u32, value : mat3x3) { + sb_store_11((offset + 0u), value[0u]); + sb_store_11((offset + 8u), value[1u]); + sb_store_11((offset + 16u), value[2u]); } -fn tint_symbol_30(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat3x4) { - tint_symbol_15(buffer, (offset + 0u), value[0u]); - tint_symbol_15(buffer, (offset + 8u), value[1u]); - tint_symbol_15(buffer, (offset + 16u), value[2u]); +fn sb_store_30(offset : u32, value : mat3x4) { + sb_store_15((offset + 0u), value[0u]); + sb_store_15((offset + 8u), value[1u]); + sb_store_15((offset + 16u), value[2u]); } -fn tint_symbol_31(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat4x2) { - tint_symbol_7(buffer, (offset + 0u), value[0u]); - tint_symbol_7(buffer, (offset + 4u), value[1u]); - tint_symbol_7(buffer, (offset + 8u), value[2u]); - tint_symbol_7(buffer, (offset + 12u), value[3u]); +fn sb_store_31(offset : u32, value : mat4x2) { + sb_store_7((offset + 0u), value[0u]); + sb_store_7((offset + 4u), value[1u]); + sb_store_7((offset + 8u), value[2u]); + sb_store_7((offset + 12u), value[3u]); } -fn tint_symbol_32(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat4x3) { - tint_symbol_11(buffer, (offset + 0u), value[0u]); - tint_symbol_11(buffer, (offset + 8u), value[1u]); - tint_symbol_11(buffer, (offset + 16u), value[2u]); - tint_symbol_11(buffer, (offset + 24u), value[3u]); +fn sb_store_32(offset : u32, value : mat4x3) { + sb_store_11((offset + 0u), value[0u]); + sb_store_11((offset + 8u), value[1u]); + sb_store_11((offset + 16u), value[2u]); + sb_store_11((offset + 24u), value[3u]); } -fn tint_symbol_33(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat4x4) { - tint_symbol_15(buffer, (offset + 0u), value[0u]); - tint_symbol_15(buffer, (offset + 8u), value[1u]); - tint_symbol_15(buffer, (offset + 16u), value[2u]); - tint_symbol_15(buffer, (offset + 24u), value[3u]); +fn sb_store_33(offset : u32, value : mat4x4) { + sb_store_15((offset + 0u), value[0u]); + sb_store_15((offset + 8u), value[1u]); + sb_store_15((offset + 16u), value[2u]); + sb_store_15((offset + 24u), value[3u]); } -fn tint_symbol_34(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : array, 2u>) { +fn sb_store_34(offset : u32, value : array, 2u>) { var array_1 = value; for(var i = 0u; (i < 2u); i = (i + 1u)) { - tint_symbol_8(buffer, (offset + (i * 16u)), array_1[i]); + sb_store_8((offset + (i * 16u)), array_1[i]); } } -fn tint_symbol_35(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : array, 2u>) { +fn sb_store_35(offset : u32, value : array, 2u>) { var array_2 = value; for(var i_1 = 0u; (i_1 < 2u); i_1 = (i_1 + 1u)) { - tint_symbol_31(buffer, (offset + (i_1 * 16u)), array_2[i_1]); + sb_store_31((offset + (i_1 * 16u)), array_2[i_1]); } } @compute @workgroup_size(1) fn main() { - tint_symbol(&(sb), 0u, f32()); - tint_symbol_1(&(sb), 4u, i32()); - tint_symbol_2(&(sb), 8u, u32()); - tint_symbol_3(&(sb), 12u, f16()); - tint_symbol_4(&(sb), 16u, vec2()); - tint_symbol_5(&(sb), 24u, vec2()); - tint_symbol_6(&(sb), 32u, vec2()); - tint_symbol_7(&(sb), 40u, vec2()); - tint_symbol_8(&(sb), 48u, vec3()); - tint_symbol_9(&(sb), 64u, vec3()); - tint_symbol_10(&(sb), 80u, vec3()); - tint_symbol_11(&(sb), 96u, vec3()); - tint_symbol_12(&(sb), 112u, vec4()); - tint_symbol_13(&(sb), 128u, vec4()); - tint_symbol_14(&(sb), 144u, vec4()); - tint_symbol_15(&(sb), 160u, vec4()); - tint_symbol_16(&(sb), 168u, mat2x2()); - tint_symbol_17(&(sb), 192u, mat2x3()); - tint_symbol_18(&(sb), 224u, mat2x4()); - tint_symbol_19(&(sb), 256u, mat3x2()); - tint_symbol_20(&(sb), 288u, mat3x3()); - tint_symbol_21(&(sb), 336u, mat3x4()); - tint_symbol_22(&(sb), 384u, mat4x2()); - tint_symbol_23(&(sb), 416u, mat4x3()); - tint_symbol_24(&(sb), 480u, mat4x4()); - tint_symbol_25(&(sb), 544u, mat2x2()); - tint_symbol_26(&(sb), 552u, mat2x3()); - tint_symbol_27(&(sb), 568u, mat2x4()); - tint_symbol_28(&(sb), 584u, mat3x2()); - tint_symbol_29(&(sb), 600u, mat3x3()); - tint_symbol_30(&(sb), 624u, mat3x4()); - tint_symbol_31(&(sb), 648u, mat4x2()); - tint_symbol_32(&(sb), 664u, mat4x3()); - tint_symbol_33(&(sb), 696u, mat4x4()); - tint_symbol_34(&(sb), 736u, array, 2>()); - tint_symbol_35(&(sb), 768u, array, 2>()); + sb_store(0u, f32()); + sb_store_1(4u, i32()); + sb_store_2(8u, u32()); + sb_store_3(12u, f16()); + sb_store_4(16u, vec2()); + sb_store_5(24u, vec2()); + sb_store_6(32u, vec2()); + sb_store_7(40u, vec2()); + sb_store_8(48u, vec3()); + sb_store_9(64u, vec3()); + sb_store_10(80u, vec3()); + sb_store_11(96u, vec3()); + sb_store_12(112u, vec4()); + sb_store_13(128u, vec4()); + sb_store_14(144u, vec4()); + sb_store_15(160u, vec4()); + sb_store_16(168u, mat2x2()); + sb_store_17(192u, mat2x3()); + sb_store_18(224u, mat2x4()); + sb_store_19(256u, mat3x2()); + sb_store_20(288u, mat3x3()); + sb_store_21(336u, mat3x4()); + sb_store_22(384u, mat4x2()); + sb_store_23(416u, mat4x3()); + sb_store_24(480u, mat4x4()); + sb_store_25(544u, mat2x2()); + sb_store_26(552u, mat2x3()); + sb_store_27(568u, mat2x4()); + sb_store_28(584u, mat3x2()); + sb_store_29(600u, mat3x3()); + sb_store_30(624u, mat3x4()); + sb_store_31(648u, mat4x2()); + sb_store_32(664u, mat4x3()); + sb_store_33(696u, mat4x4()); + sb_store_34(736u, array, 2>()); + sb_store_35(768u, array, 2>()); } )"; @@ -1733,213 +1733,213 @@ struct SB { enable f16; @internal(intrinsic_store_storage_f32) @internal(disable_validation__function_has_no_body) -fn tint_symbol(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : f32) +fn sb_store(offset : u32, value : f32) @internal(intrinsic_store_storage_i32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_1(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : i32) +fn sb_store_1(offset : u32, value : i32) @internal(intrinsic_store_storage_u32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_2(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : u32) +fn sb_store_2(offset : u32, value : u32) @internal(intrinsic_store_storage_f16) @internal(disable_validation__function_has_no_body) -fn tint_symbol_3(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : f16) +fn sb_store_3(offset : u32, value : f16) @internal(intrinsic_store_storage_vec2_f32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_4(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : vec2) +fn sb_store_4(offset : u32, value : vec2) @internal(intrinsic_store_storage_vec2_i32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_5(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : vec2) +fn sb_store_5(offset : u32, value : vec2) @internal(intrinsic_store_storage_vec2_u32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_6(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : vec2) +fn sb_store_6(offset : u32, value : vec2) @internal(intrinsic_store_storage_vec2_f16) @internal(disable_validation__function_has_no_body) -fn tint_symbol_7(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : vec2) +fn sb_store_7(offset : u32, value : vec2) @internal(intrinsic_store_storage_vec3_f32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_8(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : vec3) +fn sb_store_8(offset : u32, value : vec3) @internal(intrinsic_store_storage_vec3_i32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_9(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : vec3) +fn sb_store_9(offset : u32, value : vec3) @internal(intrinsic_store_storage_vec3_u32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_10(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : vec3) +fn sb_store_10(offset : u32, value : vec3) @internal(intrinsic_store_storage_vec3_f16) @internal(disable_validation__function_has_no_body) -fn tint_symbol_11(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : vec3) +fn sb_store_11(offset : u32, value : vec3) @internal(intrinsic_store_storage_vec4_f32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_12(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : vec4) +fn sb_store_12(offset : u32, value : vec4) @internal(intrinsic_store_storage_vec4_i32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_13(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : vec4) +fn sb_store_13(offset : u32, value : vec4) @internal(intrinsic_store_storage_vec4_u32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_14(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : vec4) +fn sb_store_14(offset : u32, value : vec4) @internal(intrinsic_store_storage_vec4_f16) @internal(disable_validation__function_has_no_body) -fn tint_symbol_15(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : vec4) +fn sb_store_15(offset : u32, value : vec4) -fn tint_symbol_16(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat2x2) { - tint_symbol_4(buffer, (offset + 0u), value[0u]); - tint_symbol_4(buffer, (offset + 8u), value[1u]); +fn sb_store_16(offset : u32, value : mat2x2) { + sb_store_4((offset + 0u), value[0u]); + sb_store_4((offset + 8u), value[1u]); } -fn tint_symbol_17(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat2x3) { - tint_symbol_8(buffer, (offset + 0u), value[0u]); - tint_symbol_8(buffer, (offset + 16u), value[1u]); +fn sb_store_17(offset : u32, value : mat2x3) { + sb_store_8((offset + 0u), value[0u]); + sb_store_8((offset + 16u), value[1u]); } -fn tint_symbol_18(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat2x4) { - tint_symbol_12(buffer, (offset + 0u), value[0u]); - tint_symbol_12(buffer, (offset + 16u), value[1u]); +fn sb_store_18(offset : u32, value : mat2x4) { + sb_store_12((offset + 0u), value[0u]); + sb_store_12((offset + 16u), value[1u]); } -fn tint_symbol_19(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat3x2) { - tint_symbol_4(buffer, (offset + 0u), value[0u]); - tint_symbol_4(buffer, (offset + 8u), value[1u]); - tint_symbol_4(buffer, (offset + 16u), value[2u]); +fn sb_store_19(offset : u32, value : mat3x2) { + sb_store_4((offset + 0u), value[0u]); + sb_store_4((offset + 8u), value[1u]); + sb_store_4((offset + 16u), value[2u]); } -fn tint_symbol_20(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat3x3) { - tint_symbol_8(buffer, (offset + 0u), value[0u]); - tint_symbol_8(buffer, (offset + 16u), value[1u]); - tint_symbol_8(buffer, (offset + 32u), value[2u]); +fn sb_store_20(offset : u32, value : mat3x3) { + sb_store_8((offset + 0u), value[0u]); + sb_store_8((offset + 16u), value[1u]); + sb_store_8((offset + 32u), value[2u]); } -fn tint_symbol_21(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat3x4) { - tint_symbol_12(buffer, (offset + 0u), value[0u]); - tint_symbol_12(buffer, (offset + 16u), value[1u]); - tint_symbol_12(buffer, (offset + 32u), value[2u]); +fn sb_store_21(offset : u32, value : mat3x4) { + sb_store_12((offset + 0u), value[0u]); + sb_store_12((offset + 16u), value[1u]); + sb_store_12((offset + 32u), value[2u]); } -fn tint_symbol_22(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat4x2) { - tint_symbol_4(buffer, (offset + 0u), value[0u]); - tint_symbol_4(buffer, (offset + 8u), value[1u]); - tint_symbol_4(buffer, (offset + 16u), value[2u]); - tint_symbol_4(buffer, (offset + 24u), value[3u]); +fn sb_store_22(offset : u32, value : mat4x2) { + sb_store_4((offset + 0u), value[0u]); + sb_store_4((offset + 8u), value[1u]); + sb_store_4((offset + 16u), value[2u]); + sb_store_4((offset + 24u), value[3u]); } -fn tint_symbol_23(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat4x3) { - tint_symbol_8(buffer, (offset + 0u), value[0u]); - tint_symbol_8(buffer, (offset + 16u), value[1u]); - tint_symbol_8(buffer, (offset + 32u), value[2u]); - tint_symbol_8(buffer, (offset + 48u), value[3u]); +fn sb_store_23(offset : u32, value : mat4x3) { + sb_store_8((offset + 0u), value[0u]); + sb_store_8((offset + 16u), value[1u]); + sb_store_8((offset + 32u), value[2u]); + sb_store_8((offset + 48u), value[3u]); } -fn tint_symbol_24(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat4x4) { - tint_symbol_12(buffer, (offset + 0u), value[0u]); - tint_symbol_12(buffer, (offset + 16u), value[1u]); - tint_symbol_12(buffer, (offset + 32u), value[2u]); - tint_symbol_12(buffer, (offset + 48u), value[3u]); +fn sb_store_24(offset : u32, value : mat4x4) { + sb_store_12((offset + 0u), value[0u]); + sb_store_12((offset + 16u), value[1u]); + sb_store_12((offset + 32u), value[2u]); + sb_store_12((offset + 48u), value[3u]); } -fn tint_symbol_25(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat2x2) { - tint_symbol_7(buffer, (offset + 0u), value[0u]); - tint_symbol_7(buffer, (offset + 4u), value[1u]); +fn sb_store_25(offset : u32, value : mat2x2) { + sb_store_7((offset + 0u), value[0u]); + sb_store_7((offset + 4u), value[1u]); } -fn tint_symbol_26(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat2x3) { - tint_symbol_11(buffer, (offset + 0u), value[0u]); - tint_symbol_11(buffer, (offset + 8u), value[1u]); +fn sb_store_26(offset : u32, value : mat2x3) { + sb_store_11((offset + 0u), value[0u]); + sb_store_11((offset + 8u), value[1u]); } -fn tint_symbol_27(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat2x4) { - tint_symbol_15(buffer, (offset + 0u), value[0u]); - tint_symbol_15(buffer, (offset + 8u), value[1u]); +fn sb_store_27(offset : u32, value : mat2x4) { + sb_store_15((offset + 0u), value[0u]); + sb_store_15((offset + 8u), value[1u]); } -fn tint_symbol_28(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat3x2) { - tint_symbol_7(buffer, (offset + 0u), value[0u]); - tint_symbol_7(buffer, (offset + 4u), value[1u]); - tint_symbol_7(buffer, (offset + 8u), value[2u]); +fn sb_store_28(offset : u32, value : mat3x2) { + sb_store_7((offset + 0u), value[0u]); + sb_store_7((offset + 4u), value[1u]); + sb_store_7((offset + 8u), value[2u]); } -fn tint_symbol_29(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat3x3) { - tint_symbol_11(buffer, (offset + 0u), value[0u]); - tint_symbol_11(buffer, (offset + 8u), value[1u]); - tint_symbol_11(buffer, (offset + 16u), value[2u]); +fn sb_store_29(offset : u32, value : mat3x3) { + sb_store_11((offset + 0u), value[0u]); + sb_store_11((offset + 8u), value[1u]); + sb_store_11((offset + 16u), value[2u]); } -fn tint_symbol_30(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat3x4) { - tint_symbol_15(buffer, (offset + 0u), value[0u]); - tint_symbol_15(buffer, (offset + 8u), value[1u]); - tint_symbol_15(buffer, (offset + 16u), value[2u]); +fn sb_store_30(offset : u32, value : mat3x4) { + sb_store_15((offset + 0u), value[0u]); + sb_store_15((offset + 8u), value[1u]); + sb_store_15((offset + 16u), value[2u]); } -fn tint_symbol_31(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat4x2) { - tint_symbol_7(buffer, (offset + 0u), value[0u]); - tint_symbol_7(buffer, (offset + 4u), value[1u]); - tint_symbol_7(buffer, (offset + 8u), value[2u]); - tint_symbol_7(buffer, (offset + 12u), value[3u]); +fn sb_store_31(offset : u32, value : mat4x2) { + sb_store_7((offset + 0u), value[0u]); + sb_store_7((offset + 4u), value[1u]); + sb_store_7((offset + 8u), value[2u]); + sb_store_7((offset + 12u), value[3u]); } -fn tint_symbol_32(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat4x3) { - tint_symbol_11(buffer, (offset + 0u), value[0u]); - tint_symbol_11(buffer, (offset + 8u), value[1u]); - tint_symbol_11(buffer, (offset + 16u), value[2u]); - tint_symbol_11(buffer, (offset + 24u), value[3u]); +fn sb_store_32(offset : u32, value : mat4x3) { + sb_store_11((offset + 0u), value[0u]); + sb_store_11((offset + 8u), value[1u]); + sb_store_11((offset + 16u), value[2u]); + sb_store_11((offset + 24u), value[3u]); } -fn tint_symbol_33(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat4x4) { - tint_symbol_15(buffer, (offset + 0u), value[0u]); - tint_symbol_15(buffer, (offset + 8u), value[1u]); - tint_symbol_15(buffer, (offset + 16u), value[2u]); - tint_symbol_15(buffer, (offset + 24u), value[3u]); +fn sb_store_33(offset : u32, value : mat4x4) { + sb_store_15((offset + 0u), value[0u]); + sb_store_15((offset + 8u), value[1u]); + sb_store_15((offset + 16u), value[2u]); + sb_store_15((offset + 24u), value[3u]); } -fn tint_symbol_34(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : array, 2u>) { +fn sb_store_34(offset : u32, value : array, 2u>) { var array_1 = value; for(var i = 0u; (i < 2u); i = (i + 1u)) { - tint_symbol_8(buffer, (offset + (i * 16u)), array_1[i]); + sb_store_8((offset + (i * 16u)), array_1[i]); } } -fn tint_symbol_35(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : array, 2u>) { +fn sb_store_35(offset : u32, value : array, 2u>) { var array_2 = value; for(var i_1 = 0u; (i_1 < 2u); i_1 = (i_1 + 1u)) { - tint_symbol_31(buffer, (offset + (i_1 * 16u)), array_2[i_1]); + sb_store_31((offset + (i_1 * 16u)), array_2[i_1]); } } @compute @workgroup_size(1) fn main() { - tint_symbol(&(sb), 0u, f32()); - tint_symbol_1(&(sb), 4u, i32()); - tint_symbol_2(&(sb), 8u, u32()); - tint_symbol_3(&(sb), 12u, f16()); - tint_symbol_4(&(sb), 16u, vec2()); - tint_symbol_5(&(sb), 24u, vec2()); - tint_symbol_6(&(sb), 32u, vec2()); - tint_symbol_7(&(sb), 40u, vec2()); - tint_symbol_8(&(sb), 48u, vec3()); - tint_symbol_9(&(sb), 64u, vec3()); - tint_symbol_10(&(sb), 80u, vec3()); - tint_symbol_11(&(sb), 96u, vec3()); - tint_symbol_12(&(sb), 112u, vec4()); - tint_symbol_13(&(sb), 128u, vec4()); - tint_symbol_14(&(sb), 144u, vec4()); - tint_symbol_15(&(sb), 160u, vec4()); - tint_symbol_16(&(sb), 168u, mat2x2()); - tint_symbol_17(&(sb), 192u, mat2x3()); - tint_symbol_18(&(sb), 224u, mat2x4()); - tint_symbol_19(&(sb), 256u, mat3x2()); - tint_symbol_20(&(sb), 288u, mat3x3()); - tint_symbol_21(&(sb), 336u, mat3x4()); - tint_symbol_22(&(sb), 384u, mat4x2()); - tint_symbol_23(&(sb), 416u, mat4x3()); - tint_symbol_24(&(sb), 480u, mat4x4()); - tint_symbol_25(&(sb), 544u, mat2x2()); - tint_symbol_26(&(sb), 552u, mat2x3()); - tint_symbol_27(&(sb), 568u, mat2x4()); - tint_symbol_28(&(sb), 584u, mat3x2()); - tint_symbol_29(&(sb), 600u, mat3x3()); - tint_symbol_30(&(sb), 624u, mat3x4()); - tint_symbol_31(&(sb), 648u, mat4x2()); - tint_symbol_32(&(sb), 664u, mat4x3()); - tint_symbol_33(&(sb), 696u, mat4x4()); - tint_symbol_34(&(sb), 736u, array, 2>()); - tint_symbol_35(&(sb), 768u, array, 2>()); + sb_store(0u, f32()); + sb_store_1(4u, i32()); + sb_store_2(8u, u32()); + sb_store_3(12u, f16()); + sb_store_4(16u, vec2()); + sb_store_5(24u, vec2()); + sb_store_6(32u, vec2()); + sb_store_7(40u, vec2()); + sb_store_8(48u, vec3()); + sb_store_9(64u, vec3()); + sb_store_10(80u, vec3()); + sb_store_11(96u, vec3()); + sb_store_12(112u, vec4()); + sb_store_13(128u, vec4()); + sb_store_14(144u, vec4()); + sb_store_15(160u, vec4()); + sb_store_16(168u, mat2x2()); + sb_store_17(192u, mat2x3()); + sb_store_18(224u, mat2x4()); + sb_store_19(256u, mat3x2()); + sb_store_20(288u, mat3x3()); + sb_store_21(336u, mat3x4()); + sb_store_22(384u, mat4x2()); + sb_store_23(416u, mat4x3()); + sb_store_24(480u, mat4x4()); + sb_store_25(544u, mat2x2()); + sb_store_26(552u, mat2x3()); + sb_store_27(568u, mat2x4()); + sb_store_28(584u, mat3x2()); + sb_store_29(600u, mat3x3()); + sb_store_30(624u, mat3x4()); + sb_store_31(648u, mat4x2()); + sb_store_32(664u, mat4x3()); + sb_store_33(696u, mat4x4()); + sb_store_34(736u, array, 2>()); + sb_store_35(768u, array, 2>()); } @group(0) @binding(0) var sb : SB; @@ -2085,148 +2085,148 @@ struct SB { @group(0) @binding(0) var sb : SB; @internal(intrinsic_load_storage_f32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_1(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> f32 +fn sb_load_1(offset : u32) -> f32 @internal(intrinsic_load_storage_i32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_2(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> i32 +fn sb_load_2(offset : u32) -> i32 @internal(intrinsic_load_storage_u32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_3(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> u32 +fn sb_load_3(offset : u32) -> u32 @internal(intrinsic_load_storage_f16) @internal(disable_validation__function_has_no_body) -fn tint_symbol_4(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> f16 +fn sb_load_4(offset : u32) -> f16 @internal(intrinsic_load_storage_vec2_f32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_5(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec2 +fn sb_load_5(offset : u32) -> vec2 @internal(intrinsic_load_storage_vec2_i32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_6(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec2 +fn sb_load_6(offset : u32) -> vec2 @internal(intrinsic_load_storage_vec2_u32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_7(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec2 +fn sb_load_7(offset : u32) -> vec2 @internal(intrinsic_load_storage_vec2_f16) @internal(disable_validation__function_has_no_body) -fn tint_symbol_8(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec2 +fn sb_load_8(offset : u32) -> vec2 @internal(intrinsic_load_storage_vec3_f32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_9(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec3 +fn sb_load_9(offset : u32) -> vec3 @internal(intrinsic_load_storage_vec3_i32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_10(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec3 +fn sb_load_10(offset : u32) -> vec3 @internal(intrinsic_load_storage_vec3_u32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_11(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec3 +fn sb_load_11(offset : u32) -> vec3 @internal(intrinsic_load_storage_vec3_f16) @internal(disable_validation__function_has_no_body) -fn tint_symbol_12(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec3 +fn sb_load_12(offset : u32) -> vec3 @internal(intrinsic_load_storage_vec4_f32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_13(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec4 +fn sb_load_13(offset : u32) -> vec4 @internal(intrinsic_load_storage_vec4_i32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_14(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec4 +fn sb_load_14(offset : u32) -> vec4 @internal(intrinsic_load_storage_vec4_u32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_15(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec4 +fn sb_load_15(offset : u32) -> vec4 @internal(intrinsic_load_storage_vec4_f16) @internal(disable_validation__function_has_no_body) -fn tint_symbol_16(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec4 +fn sb_load_16(offset : u32) -> vec4 -fn tint_symbol_17(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat2x2 { - return mat2x2(tint_symbol_5(buffer, (offset + 0u)), tint_symbol_5(buffer, (offset + 8u))); +fn sb_load_17(offset : u32) -> mat2x2 { + return mat2x2(sb_load_5((offset + 0u)), sb_load_5((offset + 8u))); } -fn tint_symbol_18(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat2x3 { - return mat2x3(tint_symbol_9(buffer, (offset + 0u)), tint_symbol_9(buffer, (offset + 16u))); +fn sb_load_18(offset : u32) -> mat2x3 { + return mat2x3(sb_load_9((offset + 0u)), sb_load_9((offset + 16u))); } -fn tint_symbol_19(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat2x4 { - return mat2x4(tint_symbol_13(buffer, (offset + 0u)), tint_symbol_13(buffer, (offset + 16u))); +fn sb_load_19(offset : u32) -> mat2x4 { + return mat2x4(sb_load_13((offset + 0u)), sb_load_13((offset + 16u))); } -fn tint_symbol_20(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat3x2 { - return mat3x2(tint_symbol_5(buffer, (offset + 0u)), tint_symbol_5(buffer, (offset + 8u)), tint_symbol_5(buffer, (offset + 16u))); +fn sb_load_20(offset : u32) -> mat3x2 { + return mat3x2(sb_load_5((offset + 0u)), sb_load_5((offset + 8u)), sb_load_5((offset + 16u))); } -fn tint_symbol_21(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat3x3 { - return mat3x3(tint_symbol_9(buffer, (offset + 0u)), tint_symbol_9(buffer, (offset + 16u)), tint_symbol_9(buffer, (offset + 32u))); +fn sb_load_21(offset : u32) -> mat3x3 { + return mat3x3(sb_load_9((offset + 0u)), sb_load_9((offset + 16u)), sb_load_9((offset + 32u))); } -fn tint_symbol_22(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat3x4 { - return mat3x4(tint_symbol_13(buffer, (offset + 0u)), tint_symbol_13(buffer, (offset + 16u)), tint_symbol_13(buffer, (offset + 32u))); +fn sb_load_22(offset : u32) -> mat3x4 { + return mat3x4(sb_load_13((offset + 0u)), sb_load_13((offset + 16u)), sb_load_13((offset + 32u))); } -fn tint_symbol_23(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat4x2 { - return mat4x2(tint_symbol_5(buffer, (offset + 0u)), tint_symbol_5(buffer, (offset + 8u)), tint_symbol_5(buffer, (offset + 16u)), tint_symbol_5(buffer, (offset + 24u))); +fn sb_load_23(offset : u32) -> mat4x2 { + return mat4x2(sb_load_5((offset + 0u)), sb_load_5((offset + 8u)), sb_load_5((offset + 16u)), sb_load_5((offset + 24u))); } -fn tint_symbol_24(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat4x3 { - return mat4x3(tint_symbol_9(buffer, (offset + 0u)), tint_symbol_9(buffer, (offset + 16u)), tint_symbol_9(buffer, (offset + 32u)), tint_symbol_9(buffer, (offset + 48u))); +fn sb_load_24(offset : u32) -> mat4x3 { + return mat4x3(sb_load_9((offset + 0u)), sb_load_9((offset + 16u)), sb_load_9((offset + 32u)), sb_load_9((offset + 48u))); } -fn tint_symbol_25(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat4x4 { - return mat4x4(tint_symbol_13(buffer, (offset + 0u)), tint_symbol_13(buffer, (offset + 16u)), tint_symbol_13(buffer, (offset + 32u)), tint_symbol_13(buffer, (offset + 48u))); +fn sb_load_25(offset : u32) -> mat4x4 { + return mat4x4(sb_load_13((offset + 0u)), sb_load_13((offset + 16u)), sb_load_13((offset + 32u)), sb_load_13((offset + 48u))); } -fn tint_symbol_26(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat2x2 { - return mat2x2(tint_symbol_8(buffer, (offset + 0u)), tint_symbol_8(buffer, (offset + 4u))); +fn sb_load_26(offset : u32) -> mat2x2 { + return mat2x2(sb_load_8((offset + 0u)), sb_load_8((offset + 4u))); } -fn tint_symbol_27(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat2x3 { - return mat2x3(tint_symbol_12(buffer, (offset + 0u)), tint_symbol_12(buffer, (offset + 8u))); +fn sb_load_27(offset : u32) -> mat2x3 { + return mat2x3(sb_load_12((offset + 0u)), sb_load_12((offset + 8u))); } -fn tint_symbol_28(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat2x4 { - return mat2x4(tint_symbol_16(buffer, (offset + 0u)), tint_symbol_16(buffer, (offset + 8u))); +fn sb_load_28(offset : u32) -> mat2x4 { + return mat2x4(sb_load_16((offset + 0u)), sb_load_16((offset + 8u))); } -fn tint_symbol_29(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat3x2 { - return mat3x2(tint_symbol_8(buffer, (offset + 0u)), tint_symbol_8(buffer, (offset + 4u)), tint_symbol_8(buffer, (offset + 8u))); +fn sb_load_29(offset : u32) -> mat3x2 { + return mat3x2(sb_load_8((offset + 0u)), sb_load_8((offset + 4u)), sb_load_8((offset + 8u))); } -fn tint_symbol_30(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat3x3 { - return mat3x3(tint_symbol_12(buffer, (offset + 0u)), tint_symbol_12(buffer, (offset + 8u)), tint_symbol_12(buffer, (offset + 16u))); +fn sb_load_30(offset : u32) -> mat3x3 { + return mat3x3(sb_load_12((offset + 0u)), sb_load_12((offset + 8u)), sb_load_12((offset + 16u))); } -fn tint_symbol_31(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat3x4 { - return mat3x4(tint_symbol_16(buffer, (offset + 0u)), tint_symbol_16(buffer, (offset + 8u)), tint_symbol_16(buffer, (offset + 16u))); +fn sb_load_31(offset : u32) -> mat3x4 { + return mat3x4(sb_load_16((offset + 0u)), sb_load_16((offset + 8u)), sb_load_16((offset + 16u))); } -fn tint_symbol_32(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat4x2 { - return mat4x2(tint_symbol_8(buffer, (offset + 0u)), tint_symbol_8(buffer, (offset + 4u)), tint_symbol_8(buffer, (offset + 8u)), tint_symbol_8(buffer, (offset + 12u))); +fn sb_load_32(offset : u32) -> mat4x2 { + return mat4x2(sb_load_8((offset + 0u)), sb_load_8((offset + 4u)), sb_load_8((offset + 8u)), sb_load_8((offset + 12u))); } -fn tint_symbol_33(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat4x3 { - return mat4x3(tint_symbol_12(buffer, (offset + 0u)), tint_symbol_12(buffer, (offset + 8u)), tint_symbol_12(buffer, (offset + 16u)), tint_symbol_12(buffer, (offset + 24u))); +fn sb_load_33(offset : u32) -> mat4x3 { + return mat4x3(sb_load_12((offset + 0u)), sb_load_12((offset + 8u)), sb_load_12((offset + 16u)), sb_load_12((offset + 24u))); } -fn tint_symbol_34(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat4x4 { - return mat4x4(tint_symbol_16(buffer, (offset + 0u)), tint_symbol_16(buffer, (offset + 8u)), tint_symbol_16(buffer, (offset + 16u)), tint_symbol_16(buffer, (offset + 24u))); +fn sb_load_34(offset : u32) -> mat4x4 { + return mat4x4(sb_load_16((offset + 0u)), sb_load_16((offset + 8u)), sb_load_16((offset + 16u)), sb_load_16((offset + 24u))); } -fn tint_symbol_35(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> array, 2u> { +fn sb_load_35(offset : u32) -> array, 2u> { var arr : array, 2u>; for(var i = 0u; (i < 2u); i = (i + 1u)) { - arr[i] = tint_symbol_9(buffer, (offset + (i * 16u))); + arr[i] = sb_load_9((offset + (i * 16u))); } return arr; } -fn tint_symbol_36(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> array, 2u> { +fn sb_load_36(offset : u32) -> array, 2u> { var arr_1 : array, 2u>; for(var i_1 = 0u; (i_1 < 2u); i_1 = (i_1 + 1u)) { - arr_1[i_1] = tint_symbol_32(buffer, (offset + (i_1 * 16u))); + arr_1[i_1] = sb_load_32((offset + (i_1 * 16u))); } return arr_1; } -fn tint_symbol(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> SB { - return SB(tint_symbol_1(buffer, (offset + 0u)), tint_symbol_2(buffer, (offset + 4u)), tint_symbol_3(buffer, (offset + 8u)), tint_symbol_4(buffer, (offset + 12u)), tint_symbol_5(buffer, (offset + 16u)), tint_symbol_6(buffer, (offset + 24u)), tint_symbol_7(buffer, (offset + 32u)), tint_symbol_8(buffer, (offset + 40u)), tint_symbol_9(buffer, (offset + 48u)), tint_symbol_10(buffer, (offset + 64u)), tint_symbol_11(buffer, (offset + 80u)), tint_symbol_12(buffer, (offset + 96u)), tint_symbol_13(buffer, (offset + 112u)), tint_symbol_14(buffer, (offset + 128u)), tint_symbol_15(buffer, (offset + 144u)), tint_symbol_16(buffer, (offset + 160u)), tint_symbol_17(buffer, (offset + 168u)), tint_symbol_18(buffer, (offset + 192u)), tint_symbol_19(buffer, (offset + 224u)), tint_symbol_20(buffer, (offset + 256u)), tint_symbol_21(buffer, (offset + 288u)), tint_symbol_22(buffer, (offset + 336u)), tint_symbol_23(buffer, (offset + 384u)), tint_symbol_24(buffer, (offset + 416u)), tint_symbol_25(buffer, (offset + 480u)), tint_symbol_26(buffer, (offset + 544u)), tint_symbol_27(buffer, (offset + 552u)), tint_symbol_28(buffer, (offset + 568u)), tint_symbol_29(buffer, (offset + 584u)), tint_symbol_30(buffer, (offset + 600u)), tint_symbol_31(buffer, (offset + 624u)), tint_symbol_32(buffer, (offset + 648u)), tint_symbol_33(buffer, (offset + 664u)), tint_symbol_34(buffer, (offset + 696u)), tint_symbol_35(buffer, (offset + 736u)), tint_symbol_36(buffer, (offset + 768u))); +fn sb_load(offset : u32) -> SB { + return SB(sb_load_1((offset + 0u)), sb_load_2((offset + 4u)), sb_load_3((offset + 8u)), sb_load_4((offset + 12u)), sb_load_5((offset + 16u)), sb_load_6((offset + 24u)), sb_load_7((offset + 32u)), sb_load_8((offset + 40u)), sb_load_9((offset + 48u)), sb_load_10((offset + 64u)), sb_load_11((offset + 80u)), sb_load_12((offset + 96u)), sb_load_13((offset + 112u)), sb_load_14((offset + 128u)), sb_load_15((offset + 144u)), sb_load_16((offset + 160u)), sb_load_17((offset + 168u)), sb_load_18((offset + 192u)), sb_load_19((offset + 224u)), sb_load_20((offset + 256u)), sb_load_21((offset + 288u)), sb_load_22((offset + 336u)), sb_load_23((offset + 384u)), sb_load_24((offset + 416u)), sb_load_25((offset + 480u)), sb_load_26((offset + 544u)), sb_load_27((offset + 552u)), sb_load_28((offset + 568u)), sb_load_29((offset + 584u)), sb_load_30((offset + 600u)), sb_load_31((offset + 624u)), sb_load_32((offset + 648u)), sb_load_33((offset + 664u)), sb_load_34((offset + 696u)), sb_load_35((offset + 736u)), sb_load_36((offset + 768u))); } @compute @workgroup_size(1) fn main() { - var x : SB = tint_symbol(&(sb), 0u); + var x : SB = sb_load(0u); } )"; @@ -2290,148 +2290,148 @@ struct SB { enable f16; @internal(intrinsic_load_storage_f32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_1(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> f32 +fn sb_load_1(offset : u32) -> f32 @internal(intrinsic_load_storage_i32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_2(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> i32 +fn sb_load_2(offset : u32) -> i32 @internal(intrinsic_load_storage_u32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_3(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> u32 +fn sb_load_3(offset : u32) -> u32 @internal(intrinsic_load_storage_f16) @internal(disable_validation__function_has_no_body) -fn tint_symbol_4(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> f16 +fn sb_load_4(offset : u32) -> f16 @internal(intrinsic_load_storage_vec2_f32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_5(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec2 +fn sb_load_5(offset : u32) -> vec2 @internal(intrinsic_load_storage_vec2_i32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_6(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec2 +fn sb_load_6(offset : u32) -> vec2 @internal(intrinsic_load_storage_vec2_u32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_7(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec2 +fn sb_load_7(offset : u32) -> vec2 @internal(intrinsic_load_storage_vec2_f16) @internal(disable_validation__function_has_no_body) -fn tint_symbol_8(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec2 +fn sb_load_8(offset : u32) -> vec2 @internal(intrinsic_load_storage_vec3_f32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_9(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec3 +fn sb_load_9(offset : u32) -> vec3 @internal(intrinsic_load_storage_vec3_i32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_10(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec3 +fn sb_load_10(offset : u32) -> vec3 @internal(intrinsic_load_storage_vec3_u32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_11(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec3 +fn sb_load_11(offset : u32) -> vec3 @internal(intrinsic_load_storage_vec3_f16) @internal(disable_validation__function_has_no_body) -fn tint_symbol_12(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec3 +fn sb_load_12(offset : u32) -> vec3 @internal(intrinsic_load_storage_vec4_f32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_13(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec4 +fn sb_load_13(offset : u32) -> vec4 @internal(intrinsic_load_storage_vec4_i32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_14(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec4 +fn sb_load_14(offset : u32) -> vec4 @internal(intrinsic_load_storage_vec4_u32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_15(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec4 +fn sb_load_15(offset : u32) -> vec4 @internal(intrinsic_load_storage_vec4_f16) @internal(disable_validation__function_has_no_body) -fn tint_symbol_16(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> vec4 +fn sb_load_16(offset : u32) -> vec4 -fn tint_symbol_17(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat2x2 { - return mat2x2(tint_symbol_5(buffer, (offset + 0u)), tint_symbol_5(buffer, (offset + 8u))); +fn sb_load_17(offset : u32) -> mat2x2 { + return mat2x2(sb_load_5((offset + 0u)), sb_load_5((offset + 8u))); } -fn tint_symbol_18(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat2x3 { - return mat2x3(tint_symbol_9(buffer, (offset + 0u)), tint_symbol_9(buffer, (offset + 16u))); +fn sb_load_18(offset : u32) -> mat2x3 { + return mat2x3(sb_load_9((offset + 0u)), sb_load_9((offset + 16u))); } -fn tint_symbol_19(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat2x4 { - return mat2x4(tint_symbol_13(buffer, (offset + 0u)), tint_symbol_13(buffer, (offset + 16u))); +fn sb_load_19(offset : u32) -> mat2x4 { + return mat2x4(sb_load_13((offset + 0u)), sb_load_13((offset + 16u))); } -fn tint_symbol_20(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat3x2 { - return mat3x2(tint_symbol_5(buffer, (offset + 0u)), tint_symbol_5(buffer, (offset + 8u)), tint_symbol_5(buffer, (offset + 16u))); +fn sb_load_20(offset : u32) -> mat3x2 { + return mat3x2(sb_load_5((offset + 0u)), sb_load_5((offset + 8u)), sb_load_5((offset + 16u))); } -fn tint_symbol_21(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat3x3 { - return mat3x3(tint_symbol_9(buffer, (offset + 0u)), tint_symbol_9(buffer, (offset + 16u)), tint_symbol_9(buffer, (offset + 32u))); +fn sb_load_21(offset : u32) -> mat3x3 { + return mat3x3(sb_load_9((offset + 0u)), sb_load_9((offset + 16u)), sb_load_9((offset + 32u))); } -fn tint_symbol_22(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat3x4 { - return mat3x4(tint_symbol_13(buffer, (offset + 0u)), tint_symbol_13(buffer, (offset + 16u)), tint_symbol_13(buffer, (offset + 32u))); +fn sb_load_22(offset : u32) -> mat3x4 { + return mat3x4(sb_load_13((offset + 0u)), sb_load_13((offset + 16u)), sb_load_13((offset + 32u))); } -fn tint_symbol_23(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat4x2 { - return mat4x2(tint_symbol_5(buffer, (offset + 0u)), tint_symbol_5(buffer, (offset + 8u)), tint_symbol_5(buffer, (offset + 16u)), tint_symbol_5(buffer, (offset + 24u))); +fn sb_load_23(offset : u32) -> mat4x2 { + return mat4x2(sb_load_5((offset + 0u)), sb_load_5((offset + 8u)), sb_load_5((offset + 16u)), sb_load_5((offset + 24u))); } -fn tint_symbol_24(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat4x3 { - return mat4x3(tint_symbol_9(buffer, (offset + 0u)), tint_symbol_9(buffer, (offset + 16u)), tint_symbol_9(buffer, (offset + 32u)), tint_symbol_9(buffer, (offset + 48u))); +fn sb_load_24(offset : u32) -> mat4x3 { + return mat4x3(sb_load_9((offset + 0u)), sb_load_9((offset + 16u)), sb_load_9((offset + 32u)), sb_load_9((offset + 48u))); } -fn tint_symbol_25(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat4x4 { - return mat4x4(tint_symbol_13(buffer, (offset + 0u)), tint_symbol_13(buffer, (offset + 16u)), tint_symbol_13(buffer, (offset + 32u)), tint_symbol_13(buffer, (offset + 48u))); +fn sb_load_25(offset : u32) -> mat4x4 { + return mat4x4(sb_load_13((offset + 0u)), sb_load_13((offset + 16u)), sb_load_13((offset + 32u)), sb_load_13((offset + 48u))); } -fn tint_symbol_26(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat2x2 { - return mat2x2(tint_symbol_8(buffer, (offset + 0u)), tint_symbol_8(buffer, (offset + 4u))); +fn sb_load_26(offset : u32) -> mat2x2 { + return mat2x2(sb_load_8((offset + 0u)), sb_load_8((offset + 4u))); } -fn tint_symbol_27(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat2x3 { - return mat2x3(tint_symbol_12(buffer, (offset + 0u)), tint_symbol_12(buffer, (offset + 8u))); +fn sb_load_27(offset : u32) -> mat2x3 { + return mat2x3(sb_load_12((offset + 0u)), sb_load_12((offset + 8u))); } -fn tint_symbol_28(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat2x4 { - return mat2x4(tint_symbol_16(buffer, (offset + 0u)), tint_symbol_16(buffer, (offset + 8u))); +fn sb_load_28(offset : u32) -> mat2x4 { + return mat2x4(sb_load_16((offset + 0u)), sb_load_16((offset + 8u))); } -fn tint_symbol_29(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat3x2 { - return mat3x2(tint_symbol_8(buffer, (offset + 0u)), tint_symbol_8(buffer, (offset + 4u)), tint_symbol_8(buffer, (offset + 8u))); +fn sb_load_29(offset : u32) -> mat3x2 { + return mat3x2(sb_load_8((offset + 0u)), sb_load_8((offset + 4u)), sb_load_8((offset + 8u))); } -fn tint_symbol_30(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat3x3 { - return mat3x3(tint_symbol_12(buffer, (offset + 0u)), tint_symbol_12(buffer, (offset + 8u)), tint_symbol_12(buffer, (offset + 16u))); +fn sb_load_30(offset : u32) -> mat3x3 { + return mat3x3(sb_load_12((offset + 0u)), sb_load_12((offset + 8u)), sb_load_12((offset + 16u))); } -fn tint_symbol_31(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat3x4 { - return mat3x4(tint_symbol_16(buffer, (offset + 0u)), tint_symbol_16(buffer, (offset + 8u)), tint_symbol_16(buffer, (offset + 16u))); +fn sb_load_31(offset : u32) -> mat3x4 { + return mat3x4(sb_load_16((offset + 0u)), sb_load_16((offset + 8u)), sb_load_16((offset + 16u))); } -fn tint_symbol_32(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat4x2 { - return mat4x2(tint_symbol_8(buffer, (offset + 0u)), tint_symbol_8(buffer, (offset + 4u)), tint_symbol_8(buffer, (offset + 8u)), tint_symbol_8(buffer, (offset + 12u))); +fn sb_load_32(offset : u32) -> mat4x2 { + return mat4x2(sb_load_8((offset + 0u)), sb_load_8((offset + 4u)), sb_load_8((offset + 8u)), sb_load_8((offset + 12u))); } -fn tint_symbol_33(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat4x3 { - return mat4x3(tint_symbol_12(buffer, (offset + 0u)), tint_symbol_12(buffer, (offset + 8u)), tint_symbol_12(buffer, (offset + 16u)), tint_symbol_12(buffer, (offset + 24u))); +fn sb_load_33(offset : u32) -> mat4x3 { + return mat4x3(sb_load_12((offset + 0u)), sb_load_12((offset + 8u)), sb_load_12((offset + 16u)), sb_load_12((offset + 24u))); } -fn tint_symbol_34(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> mat4x4 { - return mat4x4(tint_symbol_16(buffer, (offset + 0u)), tint_symbol_16(buffer, (offset + 8u)), tint_symbol_16(buffer, (offset + 16u)), tint_symbol_16(buffer, (offset + 24u))); +fn sb_load_34(offset : u32) -> mat4x4 { + return mat4x4(sb_load_16((offset + 0u)), sb_load_16((offset + 8u)), sb_load_16((offset + 16u)), sb_load_16((offset + 24u))); } -fn tint_symbol_35(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> array, 2u> { +fn sb_load_35(offset : u32) -> array, 2u> { var arr : array, 2u>; for(var i = 0u; (i < 2u); i = (i + 1u)) { - arr[i] = tint_symbol_9(buffer, (offset + (i * 16u))); + arr[i] = sb_load_9((offset + (i * 16u))); } return arr; } -fn tint_symbol_36(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> array, 2u> { +fn sb_load_36(offset : u32) -> array, 2u> { var arr_1 : array, 2u>; for(var i_1 = 0u; (i_1 < 2u); i_1 = (i_1 + 1u)) { - arr_1[i_1] = tint_symbol_32(buffer, (offset + (i_1 * 16u))); + arr_1[i_1] = sb_load_32((offset + (i_1 * 16u))); } return arr_1; } -fn tint_symbol(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> SB { - return SB(tint_symbol_1(buffer, (offset + 0u)), tint_symbol_2(buffer, (offset + 4u)), tint_symbol_3(buffer, (offset + 8u)), tint_symbol_4(buffer, (offset + 12u)), tint_symbol_5(buffer, (offset + 16u)), tint_symbol_6(buffer, (offset + 24u)), tint_symbol_7(buffer, (offset + 32u)), tint_symbol_8(buffer, (offset + 40u)), tint_symbol_9(buffer, (offset + 48u)), tint_symbol_10(buffer, (offset + 64u)), tint_symbol_11(buffer, (offset + 80u)), tint_symbol_12(buffer, (offset + 96u)), tint_symbol_13(buffer, (offset + 112u)), tint_symbol_14(buffer, (offset + 128u)), tint_symbol_15(buffer, (offset + 144u)), tint_symbol_16(buffer, (offset + 160u)), tint_symbol_17(buffer, (offset + 168u)), tint_symbol_18(buffer, (offset + 192u)), tint_symbol_19(buffer, (offset + 224u)), tint_symbol_20(buffer, (offset + 256u)), tint_symbol_21(buffer, (offset + 288u)), tint_symbol_22(buffer, (offset + 336u)), tint_symbol_23(buffer, (offset + 384u)), tint_symbol_24(buffer, (offset + 416u)), tint_symbol_25(buffer, (offset + 480u)), tint_symbol_26(buffer, (offset + 544u)), tint_symbol_27(buffer, (offset + 552u)), tint_symbol_28(buffer, (offset + 568u)), tint_symbol_29(buffer, (offset + 584u)), tint_symbol_30(buffer, (offset + 600u)), tint_symbol_31(buffer, (offset + 624u)), tint_symbol_32(buffer, (offset + 648u)), tint_symbol_33(buffer, (offset + 664u)), tint_symbol_34(buffer, (offset + 696u)), tint_symbol_35(buffer, (offset + 736u)), tint_symbol_36(buffer, (offset + 768u))); +fn sb_load(offset : u32) -> SB { + return SB(sb_load_1((offset + 0u)), sb_load_2((offset + 4u)), sb_load_3((offset + 8u)), sb_load_4((offset + 12u)), sb_load_5((offset + 16u)), sb_load_6((offset + 24u)), sb_load_7((offset + 32u)), sb_load_8((offset + 40u)), sb_load_9((offset + 48u)), sb_load_10((offset + 64u)), sb_load_11((offset + 80u)), sb_load_12((offset + 96u)), sb_load_13((offset + 112u)), sb_load_14((offset + 128u)), sb_load_15((offset + 144u)), sb_load_16((offset + 160u)), sb_load_17((offset + 168u)), sb_load_18((offset + 192u)), sb_load_19((offset + 224u)), sb_load_20((offset + 256u)), sb_load_21((offset + 288u)), sb_load_22((offset + 336u)), sb_load_23((offset + 384u)), sb_load_24((offset + 416u)), sb_load_25((offset + 480u)), sb_load_26((offset + 544u)), sb_load_27((offset + 552u)), sb_load_28((offset + 568u)), sb_load_29((offset + 584u)), sb_load_30((offset + 600u)), sb_load_31((offset + 624u)), sb_load_32((offset + 648u)), sb_load_33((offset + 664u)), sb_load_34((offset + 696u)), sb_load_35((offset + 736u)), sb_load_36((offset + 768u))); } @compute @workgroup_size(1) fn main() { - var x : SB = tint_symbol(&(sb), 0u); + var x : SB = sb_load(0u); } @group(0) @binding(0) var sb : SB; @@ -2577,217 +2577,217 @@ struct SB { @group(0) @binding(0) var sb : SB; @internal(intrinsic_store_storage_f32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_1(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : f32) +fn sb_store_1(offset : u32, value : f32) @internal(intrinsic_store_storage_i32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_2(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : i32) +fn sb_store_2(offset : u32, value : i32) @internal(intrinsic_store_storage_u32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_3(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : u32) +fn sb_store_3(offset : u32, value : u32) @internal(intrinsic_store_storage_f16) @internal(disable_validation__function_has_no_body) -fn tint_symbol_4(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : f16) +fn sb_store_4(offset : u32, value : f16) @internal(intrinsic_store_storage_vec2_f32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_5(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : vec2) +fn sb_store_5(offset : u32, value : vec2) @internal(intrinsic_store_storage_vec2_i32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_6(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : vec2) +fn sb_store_6(offset : u32, value : vec2) @internal(intrinsic_store_storage_vec2_u32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_7(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : vec2) +fn sb_store_7(offset : u32, value : vec2) @internal(intrinsic_store_storage_vec2_f16) @internal(disable_validation__function_has_no_body) -fn tint_symbol_8(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : vec2) +fn sb_store_8(offset : u32, value : vec2) @internal(intrinsic_store_storage_vec3_f32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_9(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : vec3) +fn sb_store_9(offset : u32, value : vec3) @internal(intrinsic_store_storage_vec3_i32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_10(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : vec3) +fn sb_store_10(offset : u32, value : vec3) @internal(intrinsic_store_storage_vec3_u32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_11(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : vec3) +fn sb_store_11(offset : u32, value : vec3) @internal(intrinsic_store_storage_vec3_f16) @internal(disable_validation__function_has_no_body) -fn tint_symbol_12(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : vec3) +fn sb_store_12(offset : u32, value : vec3) @internal(intrinsic_store_storage_vec4_f32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_13(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : vec4) +fn sb_store_13(offset : u32, value : vec4) @internal(intrinsic_store_storage_vec4_i32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_14(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : vec4) +fn sb_store_14(offset : u32, value : vec4) @internal(intrinsic_store_storage_vec4_u32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_15(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : vec4) +fn sb_store_15(offset : u32, value : vec4) @internal(intrinsic_store_storage_vec4_f16) @internal(disable_validation__function_has_no_body) -fn tint_symbol_16(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : vec4) +fn sb_store_16(offset : u32, value : vec4) -fn tint_symbol_17(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat2x2) { - tint_symbol_5(buffer, (offset + 0u), value[0u]); - tint_symbol_5(buffer, (offset + 8u), value[1u]); +fn sb_store_17(offset : u32, value : mat2x2) { + sb_store_5((offset + 0u), value[0u]); + sb_store_5((offset + 8u), value[1u]); } -fn tint_symbol_18(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat2x3) { - tint_symbol_9(buffer, (offset + 0u), value[0u]); - tint_symbol_9(buffer, (offset + 16u), value[1u]); +fn sb_store_18(offset : u32, value : mat2x3) { + sb_store_9((offset + 0u), value[0u]); + sb_store_9((offset + 16u), value[1u]); } -fn tint_symbol_19(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat2x4) { - tint_symbol_13(buffer, (offset + 0u), value[0u]); - tint_symbol_13(buffer, (offset + 16u), value[1u]); +fn sb_store_19(offset : u32, value : mat2x4) { + sb_store_13((offset + 0u), value[0u]); + sb_store_13((offset + 16u), value[1u]); } -fn tint_symbol_20(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat3x2) { - tint_symbol_5(buffer, (offset + 0u), value[0u]); - tint_symbol_5(buffer, (offset + 8u), value[1u]); - tint_symbol_5(buffer, (offset + 16u), value[2u]); +fn sb_store_20(offset : u32, value : mat3x2) { + sb_store_5((offset + 0u), value[0u]); + sb_store_5((offset + 8u), value[1u]); + sb_store_5((offset + 16u), value[2u]); } -fn tint_symbol_21(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat3x3) { - tint_symbol_9(buffer, (offset + 0u), value[0u]); - tint_symbol_9(buffer, (offset + 16u), value[1u]); - tint_symbol_9(buffer, (offset + 32u), value[2u]); +fn sb_store_21(offset : u32, value : mat3x3) { + sb_store_9((offset + 0u), value[0u]); + sb_store_9((offset + 16u), value[1u]); + sb_store_9((offset + 32u), value[2u]); } -fn tint_symbol_22(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat3x4) { - tint_symbol_13(buffer, (offset + 0u), value[0u]); - tint_symbol_13(buffer, (offset + 16u), value[1u]); - tint_symbol_13(buffer, (offset + 32u), value[2u]); +fn sb_store_22(offset : u32, value : mat3x4) { + sb_store_13((offset + 0u), value[0u]); + sb_store_13((offset + 16u), value[1u]); + sb_store_13((offset + 32u), value[2u]); } -fn tint_symbol_23(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat4x2) { - tint_symbol_5(buffer, (offset + 0u), value[0u]); - tint_symbol_5(buffer, (offset + 8u), value[1u]); - tint_symbol_5(buffer, (offset + 16u), value[2u]); - tint_symbol_5(buffer, (offset + 24u), value[3u]); +fn sb_store_23(offset : u32, value : mat4x2) { + sb_store_5((offset + 0u), value[0u]); + sb_store_5((offset + 8u), value[1u]); + sb_store_5((offset + 16u), value[2u]); + sb_store_5((offset + 24u), value[3u]); } -fn tint_symbol_24(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat4x3) { - tint_symbol_9(buffer, (offset + 0u), value[0u]); - tint_symbol_9(buffer, (offset + 16u), value[1u]); - tint_symbol_9(buffer, (offset + 32u), value[2u]); - tint_symbol_9(buffer, (offset + 48u), value[3u]); +fn sb_store_24(offset : u32, value : mat4x3) { + sb_store_9((offset + 0u), value[0u]); + sb_store_9((offset + 16u), value[1u]); + sb_store_9((offset + 32u), value[2u]); + sb_store_9((offset + 48u), value[3u]); } -fn tint_symbol_25(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat4x4) { - tint_symbol_13(buffer, (offset + 0u), value[0u]); - tint_symbol_13(buffer, (offset + 16u), value[1u]); - tint_symbol_13(buffer, (offset + 32u), value[2u]); - tint_symbol_13(buffer, (offset + 48u), value[3u]); +fn sb_store_25(offset : u32, value : mat4x4) { + sb_store_13((offset + 0u), value[0u]); + sb_store_13((offset + 16u), value[1u]); + sb_store_13((offset + 32u), value[2u]); + sb_store_13((offset + 48u), value[3u]); } -fn tint_symbol_26(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat2x2) { - tint_symbol_8(buffer, (offset + 0u), value[0u]); - tint_symbol_8(buffer, (offset + 4u), value[1u]); +fn sb_store_26(offset : u32, value : mat2x2) { + sb_store_8((offset + 0u), value[0u]); + sb_store_8((offset + 4u), value[1u]); } -fn tint_symbol_27(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat2x3) { - tint_symbol_12(buffer, (offset + 0u), value[0u]); - tint_symbol_12(buffer, (offset + 8u), value[1u]); +fn sb_store_27(offset : u32, value : mat2x3) { + sb_store_12((offset + 0u), value[0u]); + sb_store_12((offset + 8u), value[1u]); } -fn tint_symbol_28(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat2x4) { - tint_symbol_16(buffer, (offset + 0u), value[0u]); - tint_symbol_16(buffer, (offset + 8u), value[1u]); +fn sb_store_28(offset : u32, value : mat2x4) { + sb_store_16((offset + 0u), value[0u]); + sb_store_16((offset + 8u), value[1u]); } -fn tint_symbol_29(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat3x2) { - tint_symbol_8(buffer, (offset + 0u), value[0u]); - tint_symbol_8(buffer, (offset + 4u), value[1u]); - tint_symbol_8(buffer, (offset + 8u), value[2u]); +fn sb_store_29(offset : u32, value : mat3x2) { + sb_store_8((offset + 0u), value[0u]); + sb_store_8((offset + 4u), value[1u]); + sb_store_8((offset + 8u), value[2u]); } -fn tint_symbol_30(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat3x3) { - tint_symbol_12(buffer, (offset + 0u), value[0u]); - tint_symbol_12(buffer, (offset + 8u), value[1u]); - tint_symbol_12(buffer, (offset + 16u), value[2u]); +fn sb_store_30(offset : u32, value : mat3x3) { + sb_store_12((offset + 0u), value[0u]); + sb_store_12((offset + 8u), value[1u]); + sb_store_12((offset + 16u), value[2u]); } -fn tint_symbol_31(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat3x4) { - tint_symbol_16(buffer, (offset + 0u), value[0u]); - tint_symbol_16(buffer, (offset + 8u), value[1u]); - tint_symbol_16(buffer, (offset + 16u), value[2u]); +fn sb_store_31(offset : u32, value : mat3x4) { + sb_store_16((offset + 0u), value[0u]); + sb_store_16((offset + 8u), value[1u]); + sb_store_16((offset + 16u), value[2u]); } -fn tint_symbol_32(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat4x2) { - tint_symbol_8(buffer, (offset + 0u), value[0u]); - tint_symbol_8(buffer, (offset + 4u), value[1u]); - tint_symbol_8(buffer, (offset + 8u), value[2u]); - tint_symbol_8(buffer, (offset + 12u), value[3u]); +fn sb_store_32(offset : u32, value : mat4x2) { + sb_store_8((offset + 0u), value[0u]); + sb_store_8((offset + 4u), value[1u]); + sb_store_8((offset + 8u), value[2u]); + sb_store_8((offset + 12u), value[3u]); } -fn tint_symbol_33(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat4x3) { - tint_symbol_12(buffer, (offset + 0u), value[0u]); - tint_symbol_12(buffer, (offset + 8u), value[1u]); - tint_symbol_12(buffer, (offset + 16u), value[2u]); - tint_symbol_12(buffer, (offset + 24u), value[3u]); +fn sb_store_33(offset : u32, value : mat4x3) { + sb_store_12((offset + 0u), value[0u]); + sb_store_12((offset + 8u), value[1u]); + sb_store_12((offset + 16u), value[2u]); + sb_store_12((offset + 24u), value[3u]); } -fn tint_symbol_34(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat4x4) { - tint_symbol_16(buffer, (offset + 0u), value[0u]); - tint_symbol_16(buffer, (offset + 8u), value[1u]); - tint_symbol_16(buffer, (offset + 16u), value[2u]); - tint_symbol_16(buffer, (offset + 24u), value[3u]); +fn sb_store_34(offset : u32, value : mat4x4) { + sb_store_16((offset + 0u), value[0u]); + sb_store_16((offset + 8u), value[1u]); + sb_store_16((offset + 16u), value[2u]); + sb_store_16((offset + 24u), value[3u]); } -fn tint_symbol_35(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : array, 2u>) { +fn sb_store_35(offset : u32, value : array, 2u>) { var array_1 = value; for(var i = 0u; (i < 2u); i = (i + 1u)) { - tint_symbol_9(buffer, (offset + (i * 16u)), array_1[i]); + sb_store_9((offset + (i * 16u)), array_1[i]); } } -fn tint_symbol_36(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : array, 2u>) { +fn sb_store_36(offset : u32, value : array, 2u>) { var array_2 = value; for(var i_1 = 0u; (i_1 < 2u); i_1 = (i_1 + 1u)) { - tint_symbol_32(buffer, (offset + (i_1 * 16u)), array_2[i_1]); + sb_store_32((offset + (i_1 * 16u)), array_2[i_1]); } } -fn tint_symbol(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : SB) { - tint_symbol_1(buffer, (offset + 0u), value.scalar_f32); - tint_symbol_2(buffer, (offset + 4u), value.scalar_i32); - tint_symbol_3(buffer, (offset + 8u), value.scalar_u32); - tint_symbol_4(buffer, (offset + 12u), value.scalar_f16); - tint_symbol_5(buffer, (offset + 16u), value.vec2_f32); - tint_symbol_6(buffer, (offset + 24u), value.vec2_i32); - tint_symbol_7(buffer, (offset + 32u), value.vec2_u32); - tint_symbol_8(buffer, (offset + 40u), value.vec2_f16); - tint_symbol_9(buffer, (offset + 48u), value.vec3_f32); - tint_symbol_10(buffer, (offset + 64u), value.vec3_i32); - tint_symbol_11(buffer, (offset + 80u), value.vec3_u32); - tint_symbol_12(buffer, (offset + 96u), value.vec3_f16); - tint_symbol_13(buffer, (offset + 112u), value.vec4_f32); - tint_symbol_14(buffer, (offset + 128u), value.vec4_i32); - tint_symbol_15(buffer, (offset + 144u), value.vec4_u32); - tint_symbol_16(buffer, (offset + 160u), value.vec4_f16); - tint_symbol_17(buffer, (offset + 168u), value.mat2x2_f32); - tint_symbol_18(buffer, (offset + 192u), value.mat2x3_f32); - tint_symbol_19(buffer, (offset + 224u), value.mat2x4_f32); - tint_symbol_20(buffer, (offset + 256u), value.mat3x2_f32); - tint_symbol_21(buffer, (offset + 288u), value.mat3x3_f32); - tint_symbol_22(buffer, (offset + 336u), value.mat3x4_f32); - tint_symbol_23(buffer, (offset + 384u), value.mat4x2_f32); - tint_symbol_24(buffer, (offset + 416u), value.mat4x3_f32); - tint_symbol_25(buffer, (offset + 480u), value.mat4x4_f32); - tint_symbol_26(buffer, (offset + 544u), value.mat2x2_f16); - tint_symbol_27(buffer, (offset + 552u), value.mat2x3_f16); - tint_symbol_28(buffer, (offset + 568u), value.mat2x4_f16); - tint_symbol_29(buffer, (offset + 584u), value.mat3x2_f16); - tint_symbol_30(buffer, (offset + 600u), value.mat3x3_f16); - tint_symbol_31(buffer, (offset + 624u), value.mat3x4_f16); - tint_symbol_32(buffer, (offset + 648u), value.mat4x2_f16); - tint_symbol_33(buffer, (offset + 664u), value.mat4x3_f16); - tint_symbol_34(buffer, (offset + 696u), value.mat4x4_f16); - tint_symbol_35(buffer, (offset + 736u), value.arr2_vec3_f32); - tint_symbol_36(buffer, (offset + 768u), value.arr2_mat4x2_f16); +fn sb_store(offset : u32, value : SB) { + sb_store_1((offset + 0u), value.scalar_f32); + sb_store_2((offset + 4u), value.scalar_i32); + sb_store_3((offset + 8u), value.scalar_u32); + sb_store_4((offset + 12u), value.scalar_f16); + sb_store_5((offset + 16u), value.vec2_f32); + sb_store_6((offset + 24u), value.vec2_i32); + sb_store_7((offset + 32u), value.vec2_u32); + sb_store_8((offset + 40u), value.vec2_f16); + sb_store_9((offset + 48u), value.vec3_f32); + sb_store_10((offset + 64u), value.vec3_i32); + sb_store_11((offset + 80u), value.vec3_u32); + sb_store_12((offset + 96u), value.vec3_f16); + sb_store_13((offset + 112u), value.vec4_f32); + sb_store_14((offset + 128u), value.vec4_i32); + sb_store_15((offset + 144u), value.vec4_u32); + sb_store_16((offset + 160u), value.vec4_f16); + sb_store_17((offset + 168u), value.mat2x2_f32); + sb_store_18((offset + 192u), value.mat2x3_f32); + sb_store_19((offset + 224u), value.mat2x4_f32); + sb_store_20((offset + 256u), value.mat3x2_f32); + sb_store_21((offset + 288u), value.mat3x3_f32); + sb_store_22((offset + 336u), value.mat3x4_f32); + sb_store_23((offset + 384u), value.mat4x2_f32); + sb_store_24((offset + 416u), value.mat4x3_f32); + sb_store_25((offset + 480u), value.mat4x4_f32); + sb_store_26((offset + 544u), value.mat2x2_f16); + sb_store_27((offset + 552u), value.mat2x3_f16); + sb_store_28((offset + 568u), value.mat2x4_f16); + sb_store_29((offset + 584u), value.mat3x2_f16); + sb_store_30((offset + 600u), value.mat3x3_f16); + sb_store_31((offset + 624u), value.mat3x4_f16); + sb_store_32((offset + 648u), value.mat4x2_f16); + sb_store_33((offset + 664u), value.mat4x3_f16); + sb_store_34((offset + 696u), value.mat4x4_f16); + sb_store_35((offset + 736u), value.arr2_vec3_f32); + sb_store_36((offset + 768u), value.arr2_mat4x2_f16); } @compute @workgroup_size(1) fn main() { - tint_symbol(&(sb), 0u, SB()); + sb_store(0u, SB()); } )"; @@ -2851,217 +2851,217 @@ struct SB { enable f16; @internal(intrinsic_store_storage_f32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_1(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : f32) +fn sb_store_1(offset : u32, value : f32) @internal(intrinsic_store_storage_i32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_2(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : i32) +fn sb_store_2(offset : u32, value : i32) @internal(intrinsic_store_storage_u32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_3(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : u32) +fn sb_store_3(offset : u32, value : u32) @internal(intrinsic_store_storage_f16) @internal(disable_validation__function_has_no_body) -fn tint_symbol_4(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : f16) +fn sb_store_4(offset : u32, value : f16) @internal(intrinsic_store_storage_vec2_f32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_5(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : vec2) +fn sb_store_5(offset : u32, value : vec2) @internal(intrinsic_store_storage_vec2_i32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_6(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : vec2) +fn sb_store_6(offset : u32, value : vec2) @internal(intrinsic_store_storage_vec2_u32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_7(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : vec2) +fn sb_store_7(offset : u32, value : vec2) @internal(intrinsic_store_storage_vec2_f16) @internal(disable_validation__function_has_no_body) -fn tint_symbol_8(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : vec2) +fn sb_store_8(offset : u32, value : vec2) @internal(intrinsic_store_storage_vec3_f32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_9(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : vec3) +fn sb_store_9(offset : u32, value : vec3) @internal(intrinsic_store_storage_vec3_i32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_10(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : vec3) +fn sb_store_10(offset : u32, value : vec3) @internal(intrinsic_store_storage_vec3_u32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_11(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : vec3) +fn sb_store_11(offset : u32, value : vec3) @internal(intrinsic_store_storage_vec3_f16) @internal(disable_validation__function_has_no_body) -fn tint_symbol_12(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : vec3) +fn sb_store_12(offset : u32, value : vec3) @internal(intrinsic_store_storage_vec4_f32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_13(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : vec4) +fn sb_store_13(offset : u32, value : vec4) @internal(intrinsic_store_storage_vec4_i32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_14(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : vec4) +fn sb_store_14(offset : u32, value : vec4) @internal(intrinsic_store_storage_vec4_u32) @internal(disable_validation__function_has_no_body) -fn tint_symbol_15(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : vec4) +fn sb_store_15(offset : u32, value : vec4) @internal(intrinsic_store_storage_vec4_f16) @internal(disable_validation__function_has_no_body) -fn tint_symbol_16(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : vec4) +fn sb_store_16(offset : u32, value : vec4) -fn tint_symbol_17(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat2x2) { - tint_symbol_5(buffer, (offset + 0u), value[0u]); - tint_symbol_5(buffer, (offset + 8u), value[1u]); +fn sb_store_17(offset : u32, value : mat2x2) { + sb_store_5((offset + 0u), value[0u]); + sb_store_5((offset + 8u), value[1u]); } -fn tint_symbol_18(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat2x3) { - tint_symbol_9(buffer, (offset + 0u), value[0u]); - tint_symbol_9(buffer, (offset + 16u), value[1u]); +fn sb_store_18(offset : u32, value : mat2x3) { + sb_store_9((offset + 0u), value[0u]); + sb_store_9((offset + 16u), value[1u]); } -fn tint_symbol_19(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat2x4) { - tint_symbol_13(buffer, (offset + 0u), value[0u]); - tint_symbol_13(buffer, (offset + 16u), value[1u]); +fn sb_store_19(offset : u32, value : mat2x4) { + sb_store_13((offset + 0u), value[0u]); + sb_store_13((offset + 16u), value[1u]); } -fn tint_symbol_20(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat3x2) { - tint_symbol_5(buffer, (offset + 0u), value[0u]); - tint_symbol_5(buffer, (offset + 8u), value[1u]); - tint_symbol_5(buffer, (offset + 16u), value[2u]); +fn sb_store_20(offset : u32, value : mat3x2) { + sb_store_5((offset + 0u), value[0u]); + sb_store_5((offset + 8u), value[1u]); + sb_store_5((offset + 16u), value[2u]); } -fn tint_symbol_21(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat3x3) { - tint_symbol_9(buffer, (offset + 0u), value[0u]); - tint_symbol_9(buffer, (offset + 16u), value[1u]); - tint_symbol_9(buffer, (offset + 32u), value[2u]); +fn sb_store_21(offset : u32, value : mat3x3) { + sb_store_9((offset + 0u), value[0u]); + sb_store_9((offset + 16u), value[1u]); + sb_store_9((offset + 32u), value[2u]); } -fn tint_symbol_22(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat3x4) { - tint_symbol_13(buffer, (offset + 0u), value[0u]); - tint_symbol_13(buffer, (offset + 16u), value[1u]); - tint_symbol_13(buffer, (offset + 32u), value[2u]); +fn sb_store_22(offset : u32, value : mat3x4) { + sb_store_13((offset + 0u), value[0u]); + sb_store_13((offset + 16u), value[1u]); + sb_store_13((offset + 32u), value[2u]); } -fn tint_symbol_23(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat4x2) { - tint_symbol_5(buffer, (offset + 0u), value[0u]); - tint_symbol_5(buffer, (offset + 8u), value[1u]); - tint_symbol_5(buffer, (offset + 16u), value[2u]); - tint_symbol_5(buffer, (offset + 24u), value[3u]); +fn sb_store_23(offset : u32, value : mat4x2) { + sb_store_5((offset + 0u), value[0u]); + sb_store_5((offset + 8u), value[1u]); + sb_store_5((offset + 16u), value[2u]); + sb_store_5((offset + 24u), value[3u]); } -fn tint_symbol_24(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat4x3) { - tint_symbol_9(buffer, (offset + 0u), value[0u]); - tint_symbol_9(buffer, (offset + 16u), value[1u]); - tint_symbol_9(buffer, (offset + 32u), value[2u]); - tint_symbol_9(buffer, (offset + 48u), value[3u]); +fn sb_store_24(offset : u32, value : mat4x3) { + sb_store_9((offset + 0u), value[0u]); + sb_store_9((offset + 16u), value[1u]); + sb_store_9((offset + 32u), value[2u]); + sb_store_9((offset + 48u), value[3u]); } -fn tint_symbol_25(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat4x4) { - tint_symbol_13(buffer, (offset + 0u), value[0u]); - tint_symbol_13(buffer, (offset + 16u), value[1u]); - tint_symbol_13(buffer, (offset + 32u), value[2u]); - tint_symbol_13(buffer, (offset + 48u), value[3u]); +fn sb_store_25(offset : u32, value : mat4x4) { + sb_store_13((offset + 0u), value[0u]); + sb_store_13((offset + 16u), value[1u]); + sb_store_13((offset + 32u), value[2u]); + sb_store_13((offset + 48u), value[3u]); } -fn tint_symbol_26(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat2x2) { - tint_symbol_8(buffer, (offset + 0u), value[0u]); - tint_symbol_8(buffer, (offset + 4u), value[1u]); +fn sb_store_26(offset : u32, value : mat2x2) { + sb_store_8((offset + 0u), value[0u]); + sb_store_8((offset + 4u), value[1u]); } -fn tint_symbol_27(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat2x3) { - tint_symbol_12(buffer, (offset + 0u), value[0u]); - tint_symbol_12(buffer, (offset + 8u), value[1u]); +fn sb_store_27(offset : u32, value : mat2x3) { + sb_store_12((offset + 0u), value[0u]); + sb_store_12((offset + 8u), value[1u]); } -fn tint_symbol_28(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat2x4) { - tint_symbol_16(buffer, (offset + 0u), value[0u]); - tint_symbol_16(buffer, (offset + 8u), value[1u]); +fn sb_store_28(offset : u32, value : mat2x4) { + sb_store_16((offset + 0u), value[0u]); + sb_store_16((offset + 8u), value[1u]); } -fn tint_symbol_29(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat3x2) { - tint_symbol_8(buffer, (offset + 0u), value[0u]); - tint_symbol_8(buffer, (offset + 4u), value[1u]); - tint_symbol_8(buffer, (offset + 8u), value[2u]); +fn sb_store_29(offset : u32, value : mat3x2) { + sb_store_8((offset + 0u), value[0u]); + sb_store_8((offset + 4u), value[1u]); + sb_store_8((offset + 8u), value[2u]); } -fn tint_symbol_30(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat3x3) { - tint_symbol_12(buffer, (offset + 0u), value[0u]); - tint_symbol_12(buffer, (offset + 8u), value[1u]); - tint_symbol_12(buffer, (offset + 16u), value[2u]); +fn sb_store_30(offset : u32, value : mat3x3) { + sb_store_12((offset + 0u), value[0u]); + sb_store_12((offset + 8u), value[1u]); + sb_store_12((offset + 16u), value[2u]); } -fn tint_symbol_31(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat3x4) { - tint_symbol_16(buffer, (offset + 0u), value[0u]); - tint_symbol_16(buffer, (offset + 8u), value[1u]); - tint_symbol_16(buffer, (offset + 16u), value[2u]); +fn sb_store_31(offset : u32, value : mat3x4) { + sb_store_16((offset + 0u), value[0u]); + sb_store_16((offset + 8u), value[1u]); + sb_store_16((offset + 16u), value[2u]); } -fn tint_symbol_32(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat4x2) { - tint_symbol_8(buffer, (offset + 0u), value[0u]); - tint_symbol_8(buffer, (offset + 4u), value[1u]); - tint_symbol_8(buffer, (offset + 8u), value[2u]); - tint_symbol_8(buffer, (offset + 12u), value[3u]); +fn sb_store_32(offset : u32, value : mat4x2) { + sb_store_8((offset + 0u), value[0u]); + sb_store_8((offset + 4u), value[1u]); + sb_store_8((offset + 8u), value[2u]); + sb_store_8((offset + 12u), value[3u]); } -fn tint_symbol_33(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat4x3) { - tint_symbol_12(buffer, (offset + 0u), value[0u]); - tint_symbol_12(buffer, (offset + 8u), value[1u]); - tint_symbol_12(buffer, (offset + 16u), value[2u]); - tint_symbol_12(buffer, (offset + 24u), value[3u]); +fn sb_store_33(offset : u32, value : mat4x3) { + sb_store_12((offset + 0u), value[0u]); + sb_store_12((offset + 8u), value[1u]); + sb_store_12((offset + 16u), value[2u]); + sb_store_12((offset + 24u), value[3u]); } -fn tint_symbol_34(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : mat4x4) { - tint_symbol_16(buffer, (offset + 0u), value[0u]); - tint_symbol_16(buffer, (offset + 8u), value[1u]); - tint_symbol_16(buffer, (offset + 16u), value[2u]); - tint_symbol_16(buffer, (offset + 24u), value[3u]); +fn sb_store_34(offset : u32, value : mat4x4) { + sb_store_16((offset + 0u), value[0u]); + sb_store_16((offset + 8u), value[1u]); + sb_store_16((offset + 16u), value[2u]); + sb_store_16((offset + 24u), value[3u]); } -fn tint_symbol_35(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : array, 2u>) { +fn sb_store_35(offset : u32, value : array, 2u>) { var array_1 = value; for(var i = 0u; (i < 2u); i = (i + 1u)) { - tint_symbol_9(buffer, (offset + (i * 16u)), array_1[i]); + sb_store_9((offset + (i * 16u)), array_1[i]); } } -fn tint_symbol_36(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : array, 2u>) { +fn sb_store_36(offset : u32, value : array, 2u>) { var array_2 = value; for(var i_1 = 0u; (i_1 < 2u); i_1 = (i_1 + 1u)) { - tint_symbol_32(buffer, (offset + (i_1 * 16u)), array_2[i_1]); + sb_store_32((offset + (i_1 * 16u)), array_2[i_1]); } } -fn tint_symbol(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, value : SB) { - tint_symbol_1(buffer, (offset + 0u), value.scalar_f32); - tint_symbol_2(buffer, (offset + 4u), value.scalar_i32); - tint_symbol_3(buffer, (offset + 8u), value.scalar_u32); - tint_symbol_4(buffer, (offset + 12u), value.scalar_f16); - tint_symbol_5(buffer, (offset + 16u), value.vec2_f32); - tint_symbol_6(buffer, (offset + 24u), value.vec2_i32); - tint_symbol_7(buffer, (offset + 32u), value.vec2_u32); - tint_symbol_8(buffer, (offset + 40u), value.vec2_f16); - tint_symbol_9(buffer, (offset + 48u), value.vec3_f32); - tint_symbol_10(buffer, (offset + 64u), value.vec3_i32); - tint_symbol_11(buffer, (offset + 80u), value.vec3_u32); - tint_symbol_12(buffer, (offset + 96u), value.vec3_f16); - tint_symbol_13(buffer, (offset + 112u), value.vec4_f32); - tint_symbol_14(buffer, (offset + 128u), value.vec4_i32); - tint_symbol_15(buffer, (offset + 144u), value.vec4_u32); - tint_symbol_16(buffer, (offset + 160u), value.vec4_f16); - tint_symbol_17(buffer, (offset + 168u), value.mat2x2_f32); - tint_symbol_18(buffer, (offset + 192u), value.mat2x3_f32); - tint_symbol_19(buffer, (offset + 224u), value.mat2x4_f32); - tint_symbol_20(buffer, (offset + 256u), value.mat3x2_f32); - tint_symbol_21(buffer, (offset + 288u), value.mat3x3_f32); - tint_symbol_22(buffer, (offset + 336u), value.mat3x4_f32); - tint_symbol_23(buffer, (offset + 384u), value.mat4x2_f32); - tint_symbol_24(buffer, (offset + 416u), value.mat4x3_f32); - tint_symbol_25(buffer, (offset + 480u), value.mat4x4_f32); - tint_symbol_26(buffer, (offset + 544u), value.mat2x2_f16); - tint_symbol_27(buffer, (offset + 552u), value.mat2x3_f16); - tint_symbol_28(buffer, (offset + 568u), value.mat2x4_f16); - tint_symbol_29(buffer, (offset + 584u), value.mat3x2_f16); - tint_symbol_30(buffer, (offset + 600u), value.mat3x3_f16); - tint_symbol_31(buffer, (offset + 624u), value.mat3x4_f16); - tint_symbol_32(buffer, (offset + 648u), value.mat4x2_f16); - tint_symbol_33(buffer, (offset + 664u), value.mat4x3_f16); - tint_symbol_34(buffer, (offset + 696u), value.mat4x4_f16); - tint_symbol_35(buffer, (offset + 736u), value.arr2_vec3_f32); - tint_symbol_36(buffer, (offset + 768u), value.arr2_mat4x2_f16); +fn sb_store(offset : u32, value : SB) { + sb_store_1((offset + 0u), value.scalar_f32); + sb_store_2((offset + 4u), value.scalar_i32); + sb_store_3((offset + 8u), value.scalar_u32); + sb_store_4((offset + 12u), value.scalar_f16); + sb_store_5((offset + 16u), value.vec2_f32); + sb_store_6((offset + 24u), value.vec2_i32); + sb_store_7((offset + 32u), value.vec2_u32); + sb_store_8((offset + 40u), value.vec2_f16); + sb_store_9((offset + 48u), value.vec3_f32); + sb_store_10((offset + 64u), value.vec3_i32); + sb_store_11((offset + 80u), value.vec3_u32); + sb_store_12((offset + 96u), value.vec3_f16); + sb_store_13((offset + 112u), value.vec4_f32); + sb_store_14((offset + 128u), value.vec4_i32); + sb_store_15((offset + 144u), value.vec4_u32); + sb_store_16((offset + 160u), value.vec4_f16); + sb_store_17((offset + 168u), value.mat2x2_f32); + sb_store_18((offset + 192u), value.mat2x3_f32); + sb_store_19((offset + 224u), value.mat2x4_f32); + sb_store_20((offset + 256u), value.mat3x2_f32); + sb_store_21((offset + 288u), value.mat3x3_f32); + sb_store_22((offset + 336u), value.mat3x4_f32); + sb_store_23((offset + 384u), value.mat4x2_f32); + sb_store_24((offset + 416u), value.mat4x3_f32); + sb_store_25((offset + 480u), value.mat4x4_f32); + sb_store_26((offset + 544u), value.mat2x2_f16); + sb_store_27((offset + 552u), value.mat2x3_f16); + sb_store_28((offset + 568u), value.mat2x4_f16); + sb_store_29((offset + 584u), value.mat3x2_f16); + sb_store_30((offset + 600u), value.mat3x3_f16); + sb_store_31((offset + 624u), value.mat3x4_f16); + sb_store_32((offset + 648u), value.mat4x2_f16); + sb_store_33((offset + 664u), value.mat4x3_f16); + sb_store_34((offset + 696u), value.mat4x4_f16); + sb_store_35((offset + 736u), value.arr2_vec3_f32); + sb_store_36((offset + 768u), value.arr2_mat4x2_f16); } @compute @workgroup_size(1) fn main() { - tint_symbol(&(sb), 0u, SB()); + sb_store(0u, SB()); } @group(0) @binding(0) var sb : SB; @@ -3172,11 +3172,11 @@ struct SB { @group(0) @binding(0) var sb : SB; @internal(intrinsic_load_storage_f32) @internal(disable_validation__function_has_no_body) -fn tint_symbol(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> f32 +fn sb_load(offset : u32) -> f32 @compute @workgroup_size(1) fn main() { - var x : f32 = tint_symbol(&(sb), 712u); + var x : f32 = sb_load(712u); } )"; @@ -3222,11 +3222,11 @@ struct S1 { auto* expect = R"( @internal(intrinsic_load_storage_f32) @internal(disable_validation__function_has_no_body) -fn tint_symbol(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> f32 +fn sb_load(offset : u32) -> f32 @compute @workgroup_size(1) fn main() { - var x : f32 = tint_symbol(&(sb), 712u); + var x : f32 = sb_load(712u); } @group(0) @binding(0) var sb : SB; @@ -3308,14 +3308,14 @@ struct SB { @group(0) @binding(0) var sb : SB; @internal(intrinsic_load_storage_f32) @internal(disable_validation__function_has_no_body) -fn tint_symbol(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> f32 +fn sb_load(offset : u32) -> f32 @compute @workgroup_size(1) fn main() { var i : i32 = 4; var j : u32 = 1u; var k : i32 = 2; - var x : f32 = tint_symbol(&(sb), (((((128u + (128u * u32(i))) + 16u) + (32u * j)) + 16u) + (4u * u32(k)))); + var x : f32 = sb_load((((((128u + (128u * u32(i))) + 16u) + (32u * j)) + 16u) + (4u * u32(k)))); } )"; @@ -3357,14 +3357,14 @@ struct S1 { auto* expect = R"( @internal(intrinsic_load_storage_f32) @internal(disable_validation__function_has_no_body) -fn tint_symbol(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> f32 +fn sb_load(offset : u32) -> f32 @compute @workgroup_size(1) fn main() { var i : i32 = 4; var j : u32 = 1u; var k : i32 = 2; - var x : f32 = tint_symbol(&(sb), (((((128u + (128u * u32(i))) + 16u) + (32u * j)) + 16u) + (4u * u32(k)))); + var x : f32 = sb_load((((((128u + (128u * u32(i))) + 16u) + (32u * j)) + 16u) + (4u * u32(k)))); } @group(0) @binding(0) var sb : SB; @@ -3462,14 +3462,14 @@ struct SB { @group(0) @binding(0) var sb : SB; @internal(intrinsic_load_storage_f32) @internal(disable_validation__function_has_no_body) -fn tint_symbol(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> f32 +fn sb_load(offset : u32) -> f32 @compute @workgroup_size(1) fn main() { var i : i32 = 4; var j : u32 = 1u; var k : i32 = 2; - var x : f32 = tint_symbol(&(sb), (((((128u + (128u * u32(i))) + 16u) + (32u * j)) + 16u) + (4u * u32(k)))); + var x : f32 = sb_load((((((128u + (128u * u32(i))) + 16u) + (32u * j)) + 16u) + (4u * u32(k)))); } )"; @@ -3519,14 +3519,14 @@ struct S1 { auto* expect = R"( @internal(intrinsic_load_storage_f32) @internal(disable_validation__function_has_no_body) -fn tint_symbol(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> f32 +fn sb_load(offset : u32) -> f32 @compute @workgroup_size(1) fn main() { var i : i32 = 4; var j : u32 = 1u; var k : i32 = 2; - var x : f32 = tint_symbol(&(sb), (((((128u + (128u * u32(i))) + 16u) + (32u * j)) + 16u) + (4u * u32(k)))); + var x : f32 = sb_load((((((128u + (128u * u32(i))) + 16u) + (32u * j)) + 16u) + (4u * u32(k)))); } @group(0) @binding(0) var sb : SB; @@ -3611,34 +3611,34 @@ struct SB { @group(0) @binding(0) var sb : SB; @internal(intrinsic_atomic_store_storage_i32) @internal(disable_validation__function_has_no_body) -fn tint_atomicStore(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, param_1 : i32) +fn sbatomicStore(offset : u32, param_1 : i32) @internal(intrinsic_atomic_load_storage_i32) @internal(disable_validation__function_has_no_body) -fn tint_atomicLoad(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> i32 +fn sbatomicLoad(offset : u32) -> i32 @internal(intrinsic_atomic_add_storage_i32) @internal(disable_validation__function_has_no_body) -fn tint_atomicAdd(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, param_1 : i32) -> i32 +fn sbatomicAdd(offset : u32, param_1 : i32) -> i32 @internal(intrinsic_atomic_sub_storage_i32) @internal(disable_validation__function_has_no_body) -fn tint_atomicSub(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, param_1 : i32) -> i32 +fn sbatomicSub(offset : u32, param_1 : i32) -> i32 @internal(intrinsic_atomic_max_storage_i32) @internal(disable_validation__function_has_no_body) -fn tint_atomicMax(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, param_1 : i32) -> i32 +fn sbatomicMax(offset : u32, param_1 : i32) -> i32 @internal(intrinsic_atomic_min_storage_i32) @internal(disable_validation__function_has_no_body) -fn tint_atomicMin(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, param_1 : i32) -> i32 +fn sbatomicMin(offset : u32, param_1 : i32) -> i32 @internal(intrinsic_atomic_and_storage_i32) @internal(disable_validation__function_has_no_body) -fn tint_atomicAnd(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, param_1 : i32) -> i32 +fn sbatomicAnd(offset : u32, param_1 : i32) -> i32 @internal(intrinsic_atomic_or_storage_i32) @internal(disable_validation__function_has_no_body) -fn tint_atomicOr(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, param_1 : i32) -> i32 +fn sbatomicOr(offset : u32, param_1 : i32) -> i32 @internal(intrinsic_atomic_xor_storage_i32) @internal(disable_validation__function_has_no_body) -fn tint_atomicXor(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, param_1 : i32) -> i32 +fn sbatomicXor(offset : u32, param_1 : i32) -> i32 @internal(intrinsic_atomic_exchange_storage_i32) @internal(disable_validation__function_has_no_body) -fn tint_atomicExchange(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, param_1 : i32) -> i32 +fn sbatomicExchange(offset : u32, param_1 : i32) -> i32 struct atomic_compare_exchange_weak_ret_type { old_value : i32, @@ -3646,37 +3646,37 @@ struct atomic_compare_exchange_weak_ret_type { } @internal(intrinsic_atomic_compare_exchange_weak_storage_i32) @internal(disable_validation__function_has_no_body) -fn tint_atomicCompareExchangeWeak(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, param_1 : i32, param_2 : i32) -> atomic_compare_exchange_weak_ret_type +fn sbatomicCompareExchangeWeak(offset : u32, param_1 : i32, param_2 : i32) -> atomic_compare_exchange_weak_ret_type @internal(intrinsic_atomic_store_storage_u32) @internal(disable_validation__function_has_no_body) -fn tint_atomicStore_1(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, param_1 : u32) +fn sbatomicStore_1(offset : u32, param_1 : u32) @internal(intrinsic_atomic_load_storage_u32) @internal(disable_validation__function_has_no_body) -fn tint_atomicLoad_1(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> u32 +fn sbatomicLoad_1(offset : u32) -> u32 @internal(intrinsic_atomic_add_storage_u32) @internal(disable_validation__function_has_no_body) -fn tint_atomicAdd_1(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, param_1 : u32) -> u32 +fn sbatomicAdd_1(offset : u32, param_1 : u32) -> u32 @internal(intrinsic_atomic_sub_storage_u32) @internal(disable_validation__function_has_no_body) -fn tint_atomicSub_1(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, param_1 : u32) -> u32 +fn sbatomicSub_1(offset : u32, param_1 : u32) -> u32 @internal(intrinsic_atomic_max_storage_u32) @internal(disable_validation__function_has_no_body) -fn tint_atomicMax_1(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, param_1 : u32) -> u32 +fn sbatomicMax_1(offset : u32, param_1 : u32) -> u32 @internal(intrinsic_atomic_min_storage_u32) @internal(disable_validation__function_has_no_body) -fn tint_atomicMin_1(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, param_1 : u32) -> u32 +fn sbatomicMin_1(offset : u32, param_1 : u32) -> u32 @internal(intrinsic_atomic_and_storage_u32) @internal(disable_validation__function_has_no_body) -fn tint_atomicAnd_1(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, param_1 : u32) -> u32 +fn sbatomicAnd_1(offset : u32, param_1 : u32) -> u32 @internal(intrinsic_atomic_or_storage_u32) @internal(disable_validation__function_has_no_body) -fn tint_atomicOr_1(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, param_1 : u32) -> u32 +fn sbatomicOr_1(offset : u32, param_1 : u32) -> u32 @internal(intrinsic_atomic_xor_storage_u32) @internal(disable_validation__function_has_no_body) -fn tint_atomicXor_1(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, param_1 : u32) -> u32 +fn sbatomicXor_1(offset : u32, param_1 : u32) -> u32 @internal(intrinsic_atomic_exchange_storage_u32) @internal(disable_validation__function_has_no_body) -fn tint_atomicExchange_1(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, param_1 : u32) -> u32 +fn sbatomicExchange_1(offset : u32, param_1 : u32) -> u32 struct atomic_compare_exchange_weak_ret_type_1 { old_value : u32, @@ -3684,32 +3684,32 @@ struct atomic_compare_exchange_weak_ret_type_1 { } @internal(intrinsic_atomic_compare_exchange_weak_storage_u32) @internal(disable_validation__function_has_no_body) -fn tint_atomicCompareExchangeWeak_1(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, param_1 : u32, param_2 : u32) -> atomic_compare_exchange_weak_ret_type_1 +fn sbatomicCompareExchangeWeak_1(offset : u32, param_1 : u32, param_2 : u32) -> atomic_compare_exchange_weak_ret_type_1 @compute @workgroup_size(1) fn main() { - tint_atomicStore(&(sb), 16u, 123); - tint_atomicLoad(&(sb), 16u); - tint_atomicAdd(&(sb), 16u, 123); - tint_atomicSub(&(sb), 16u, 123); - tint_atomicMax(&(sb), 16u, 123); - tint_atomicMin(&(sb), 16u, 123); - tint_atomicAnd(&(sb), 16u, 123); - tint_atomicOr(&(sb), 16u, 123); - tint_atomicXor(&(sb), 16u, 123); - tint_atomicExchange(&(sb), 16u, 123); - tint_atomicCompareExchangeWeak(&(sb), 16u, 123, 345); - tint_atomicStore_1(&(sb), 20u, 123u); - tint_atomicLoad_1(&(sb), 20u); - tint_atomicAdd_1(&(sb), 20u, 123u); - tint_atomicSub_1(&(sb), 20u, 123u); - tint_atomicMax_1(&(sb), 20u, 123u); - tint_atomicMin_1(&(sb), 20u, 123u); - tint_atomicAnd_1(&(sb), 20u, 123u); - tint_atomicOr_1(&(sb), 20u, 123u); - tint_atomicXor_1(&(sb), 20u, 123u); - tint_atomicExchange_1(&(sb), 20u, 123u); - tint_atomicCompareExchangeWeak_1(&(sb), 20u, 123u, 345u); + sbatomicStore(16u, 123); + sbatomicLoad(16u); + sbatomicAdd(16u, 123); + sbatomicSub(16u, 123); + sbatomicMax(16u, 123); + sbatomicMin(16u, 123); + sbatomicAnd(16u, 123); + sbatomicOr(16u, 123); + sbatomicXor(16u, 123); + sbatomicExchange(16u, 123); + sbatomicCompareExchangeWeak(16u, 123, 345); + sbatomicStore_1(20u, 123u); + sbatomicLoad_1(20u); + sbatomicAdd_1(20u, 123u); + sbatomicSub_1(20u, 123u); + sbatomicMax_1(20u, 123u); + sbatomicMin_1(20u, 123u); + sbatomicAnd_1(20u, 123u); + sbatomicOr_1(20u, 123u); + sbatomicXor_1(20u, 123u); + sbatomicExchange_1(20u, 123u); + sbatomicCompareExchangeWeak_1(20u, 123u, 345u); } )"; @@ -3758,34 +3758,34 @@ struct SB { auto* expect = R"( @internal(intrinsic_atomic_store_storage_i32) @internal(disable_validation__function_has_no_body) -fn tint_atomicStore(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, param_1 : i32) +fn sbatomicStore(offset : u32, param_1 : i32) @internal(intrinsic_atomic_load_storage_i32) @internal(disable_validation__function_has_no_body) -fn tint_atomicLoad(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> i32 +fn sbatomicLoad(offset : u32) -> i32 @internal(intrinsic_atomic_add_storage_i32) @internal(disable_validation__function_has_no_body) -fn tint_atomicAdd(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, param_1 : i32) -> i32 +fn sbatomicAdd(offset : u32, param_1 : i32) -> i32 @internal(intrinsic_atomic_sub_storage_i32) @internal(disable_validation__function_has_no_body) -fn tint_atomicSub(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, param_1 : i32) -> i32 +fn sbatomicSub(offset : u32, param_1 : i32) -> i32 @internal(intrinsic_atomic_max_storage_i32) @internal(disable_validation__function_has_no_body) -fn tint_atomicMax(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, param_1 : i32) -> i32 +fn sbatomicMax(offset : u32, param_1 : i32) -> i32 @internal(intrinsic_atomic_min_storage_i32) @internal(disable_validation__function_has_no_body) -fn tint_atomicMin(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, param_1 : i32) -> i32 +fn sbatomicMin(offset : u32, param_1 : i32) -> i32 @internal(intrinsic_atomic_and_storage_i32) @internal(disable_validation__function_has_no_body) -fn tint_atomicAnd(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, param_1 : i32) -> i32 +fn sbatomicAnd(offset : u32, param_1 : i32) -> i32 @internal(intrinsic_atomic_or_storage_i32) @internal(disable_validation__function_has_no_body) -fn tint_atomicOr(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, param_1 : i32) -> i32 +fn sbatomicOr(offset : u32, param_1 : i32) -> i32 @internal(intrinsic_atomic_xor_storage_i32) @internal(disable_validation__function_has_no_body) -fn tint_atomicXor(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, param_1 : i32) -> i32 +fn sbatomicXor(offset : u32, param_1 : i32) -> i32 @internal(intrinsic_atomic_exchange_storage_i32) @internal(disable_validation__function_has_no_body) -fn tint_atomicExchange(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, param_1 : i32) -> i32 +fn sbatomicExchange(offset : u32, param_1 : i32) -> i32 struct atomic_compare_exchange_weak_ret_type { old_value : i32, @@ -3793,37 +3793,37 @@ struct atomic_compare_exchange_weak_ret_type { } @internal(intrinsic_atomic_compare_exchange_weak_storage_i32) @internal(disable_validation__function_has_no_body) -fn tint_atomicCompareExchangeWeak(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, param_1 : i32, param_2 : i32) -> atomic_compare_exchange_weak_ret_type +fn sbatomicCompareExchangeWeak(offset : u32, param_1 : i32, param_2 : i32) -> atomic_compare_exchange_weak_ret_type @internal(intrinsic_atomic_store_storage_u32) @internal(disable_validation__function_has_no_body) -fn tint_atomicStore_1(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, param_1 : u32) +fn sbatomicStore_1(offset : u32, param_1 : u32) @internal(intrinsic_atomic_load_storage_u32) @internal(disable_validation__function_has_no_body) -fn tint_atomicLoad_1(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32) -> u32 +fn sbatomicLoad_1(offset : u32) -> u32 @internal(intrinsic_atomic_add_storage_u32) @internal(disable_validation__function_has_no_body) -fn tint_atomicAdd_1(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, param_1 : u32) -> u32 +fn sbatomicAdd_1(offset : u32, param_1 : u32) -> u32 @internal(intrinsic_atomic_sub_storage_u32) @internal(disable_validation__function_has_no_body) -fn tint_atomicSub_1(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, param_1 : u32) -> u32 +fn sbatomicSub_1(offset : u32, param_1 : u32) -> u32 @internal(intrinsic_atomic_max_storage_u32) @internal(disable_validation__function_has_no_body) -fn tint_atomicMax_1(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, param_1 : u32) -> u32 +fn sbatomicMax_1(offset : u32, param_1 : u32) -> u32 @internal(intrinsic_atomic_min_storage_u32) @internal(disable_validation__function_has_no_body) -fn tint_atomicMin_1(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, param_1 : u32) -> u32 +fn sbatomicMin_1(offset : u32, param_1 : u32) -> u32 @internal(intrinsic_atomic_and_storage_u32) @internal(disable_validation__function_has_no_body) -fn tint_atomicAnd_1(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, param_1 : u32) -> u32 +fn sbatomicAnd_1(offset : u32, param_1 : u32) -> u32 @internal(intrinsic_atomic_or_storage_u32) @internal(disable_validation__function_has_no_body) -fn tint_atomicOr_1(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, param_1 : u32) -> u32 +fn sbatomicOr_1(offset : u32, param_1 : u32) -> u32 @internal(intrinsic_atomic_xor_storage_u32) @internal(disable_validation__function_has_no_body) -fn tint_atomicXor_1(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, param_1 : u32) -> u32 +fn sbatomicXor_1(offset : u32, param_1 : u32) -> u32 @internal(intrinsic_atomic_exchange_storage_u32) @internal(disable_validation__function_has_no_body) -fn tint_atomicExchange_1(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, param_1 : u32) -> u32 +fn sbatomicExchange_1(offset : u32, param_1 : u32) -> u32 struct atomic_compare_exchange_weak_ret_type_1 { old_value : u32, @@ -3831,32 +3831,32 @@ struct atomic_compare_exchange_weak_ret_type_1 { } @internal(intrinsic_atomic_compare_exchange_weak_storage_u32) @internal(disable_validation__function_has_no_body) -fn tint_atomicCompareExchangeWeak_1(@internal(disable_validation__function_parameter) buffer : ptr, offset : u32, param_1 : u32, param_2 : u32) -> atomic_compare_exchange_weak_ret_type_1 +fn sbatomicCompareExchangeWeak_1(offset : u32, param_1 : u32, param_2 : u32) -> atomic_compare_exchange_weak_ret_type_1 @compute @workgroup_size(1) fn main() { - tint_atomicStore(&(sb), 16u, 123); - tint_atomicLoad(&(sb), 16u); - tint_atomicAdd(&(sb), 16u, 123); - tint_atomicSub(&(sb), 16u, 123); - tint_atomicMax(&(sb), 16u, 123); - tint_atomicMin(&(sb), 16u, 123); - tint_atomicAnd(&(sb), 16u, 123); - tint_atomicOr(&(sb), 16u, 123); - tint_atomicXor(&(sb), 16u, 123); - tint_atomicExchange(&(sb), 16u, 123); - tint_atomicCompareExchangeWeak(&(sb), 16u, 123, 345); - tint_atomicStore_1(&(sb), 20u, 123u); - tint_atomicLoad_1(&(sb), 20u); - tint_atomicAdd_1(&(sb), 20u, 123u); - tint_atomicSub_1(&(sb), 20u, 123u); - tint_atomicMax_1(&(sb), 20u, 123u); - tint_atomicMin_1(&(sb), 20u, 123u); - tint_atomicAnd_1(&(sb), 20u, 123u); - tint_atomicOr_1(&(sb), 20u, 123u); - tint_atomicXor_1(&(sb), 20u, 123u); - tint_atomicExchange_1(&(sb), 20u, 123u); - tint_atomicCompareExchangeWeak_1(&(sb), 20u, 123u, 345u); + sbatomicStore(16u, 123); + sbatomicLoad(16u); + sbatomicAdd(16u, 123); + sbatomicSub(16u, 123); + sbatomicMax(16u, 123); + sbatomicMin(16u, 123); + sbatomicAnd(16u, 123); + sbatomicOr(16u, 123); + sbatomicXor(16u, 123); + sbatomicExchange(16u, 123); + sbatomicCompareExchangeWeak(16u, 123, 345); + sbatomicStore_1(20u, 123u); + sbatomicLoad_1(20u); + sbatomicAdd_1(20u, 123u); + sbatomicSub_1(20u, 123u); + sbatomicMax_1(20u, 123u); + sbatomicMin_1(20u, 123u); + sbatomicAnd_1(20u, 123u); + sbatomicOr_1(20u, 123u); + sbatomicXor_1(20u, 123u); + sbatomicExchange_1(20u, 123u); + sbatomicCompareExchangeWeak_1(20u, 123u, 345u); } @group(0) @binding(0) var sb : SB; diff --git a/src/tint/writer/hlsl/generator_impl.cc b/src/tint/writer/hlsl/generator_impl.cc index cce8c06597..787962b3fa 100644 --- a/src/tint/writer/hlsl/generator_impl.cc +++ b/src/tint/writer/hlsl/generator_impl.cc @@ -1112,8 +1112,8 @@ bool GeneratorImpl::EmitUniformBufferAccess( std::ostream& out, const ast::CallExpression* expr, const transform::DecomposeMemoryAccess::Intrinsic* intrinsic) { - const auto& args = expr->args; - auto* offset_arg = builder_.Sem().GetVal(args[1]); + auto const buffer = program_->Symbols().NameFor(intrinsic->buffer); + auto* const offset = expr->args[0]; // offset in bytes uint32_t scalar_offset_bytes = 0; @@ -1129,7 +1129,7 @@ bool GeneratorImpl::EmitUniformBufferAccess( // If true, use scalar_offset_index, otherwise use scalar_offset_index_expr bool scalar_offset_constant = false; - if (auto* val = offset_arg->ConstantValue()) { + if (auto* val = builder_.Sem().GetVal(offset)->ConstantValue()) { TINT_ASSERT(Writer, val->Type()->Is()); scalar_offset_bytes = static_cast(val->ValueAs()); scalar_offset_index = scalar_offset_bytes / 4; // bytes -> scalar index @@ -1151,7 +1151,7 @@ bool GeneratorImpl::EmitUniformBufferAccess( { auto pre = line(); pre << "const uint " << scalar_offset_bytes_expr << " = ("; - if (!EmitExpression(pre, args[1])) { // offset + if (!EmitExpression(pre, offset)) { return false; } pre << ");"; @@ -1162,7 +1162,7 @@ bool GeneratorImpl::EmitUniformBufferAccess( scalar_offset_index_unified_expr = UniqueIdentifier("scalar_offset"); auto pre = line(); pre << "const uint " << scalar_offset_index_unified_expr << " = ("; - if (!EmitExpression(pre, args[1])) { // offset + if (!EmitExpression(pre, offset)) { return false; } pre << ") / 4;"; @@ -1182,9 +1182,7 @@ bool GeneratorImpl::EmitUniformBufferAccess( return result; }; auto load_u32_to = [&](std::ostream& target) { - if (!EmitExpression(target, args[0])) { // buffer - return false; - } + target << buffer; if (scalar_offset_constant) { target << "[" << (scalar_offset_index / 4) << "]." << swizzle[scalar_offset_index & 3]; @@ -1198,20 +1196,14 @@ bool GeneratorImpl::EmitUniformBufferAccess( // Has a minimum alignment of 8 bytes, so is either .xy or .zw auto load_vec2_u32_to = [&](std::ostream& target) { if (scalar_offset_constant) { - if (!EmitExpression(target, args[0])) { // buffer - return false; - } - target << "[" << (scalar_offset_index / 4) << "]"; - target << ((scalar_offset_index & 2) == 0 ? ".xy" : ".zw"); + target << buffer << "[" << (scalar_offset_index / 4) << "]" + << ((scalar_offset_index & 2) == 0 ? ".xy" : ".zw"); } else { std::string ubo_load = UniqueIdentifier("ubo_load"); { auto pre = line(); - pre << "uint4 " << ubo_load << " = "; - if (!EmitExpression(pre, args[0])) { // buffer - return false; - } - pre << "[" << scalar_offset_index_unified_expr << " / 4];"; + pre << "uint4 " << ubo_load << " = " << buffer << "[" + << scalar_offset_index_unified_expr << " / 4];"; } target << "((" << scalar_offset_index_unified_expr << " & 2) ? " << ubo_load << ".zw : " << ubo_load << ".xy)"; @@ -1221,9 +1213,7 @@ bool GeneratorImpl::EmitUniformBufferAccess( auto load_vec2_u32 = [&] { return load_vec2_u32_to(out); }; // vec4 has a minimum alignment of 16 bytes, easiest case auto load_vec4_u32 = [&] { - if (!EmitExpression(out, args[0])) { // buffer - return false; - } + out << buffer; if (scalar_offset_constant) { out << "[" << (scalar_offset_index / 4) << "]"; } else { @@ -1242,10 +1232,7 @@ bool GeneratorImpl::EmitUniformBufferAccess( auto load_scalar_f16 = [&] { // offset bytes = 4k, ((buffer[index].x) & 0xFFFF) // offset bytes = 4k+2, ((buffer[index].x >> 16) & 0xFFFF) - out << "float16_t(f16tof32((("; - if (!EmitExpression(out, args[0])) { // buffer - return false; - } + out << "float16_t(f16tof32(((" << buffer; if (scalar_offset_constant) { out << "[" << (scalar_offset_index / 4) << "]." << swizzle[scalar_offset_index & 3]; @@ -1413,7 +1400,9 @@ bool GeneratorImpl::EmitStorageBufferAccess( std::ostream& out, const ast::CallExpression* expr, const transform::DecomposeMemoryAccess::Intrinsic* intrinsic) { - const auto& args = expr->args; + auto const buffer = program_->Symbols().NameFor(intrinsic->buffer); + auto* const offset = expr->args[0]; + auto* const value = expr->args[1]; using Op = transform::DecomposeMemoryAccess::Intrinsic::Op; using DataType = transform::DecomposeMemoryAccess::Intrinsic::DataType; @@ -1423,15 +1412,12 @@ bool GeneratorImpl::EmitStorageBufferAccess( if (cast) { out << cast << "("; } - if (!EmitExpression(out, args[0])) { // buffer - return false; - } - out << ".Load"; + out << buffer << ".Load"; if (n > 1) { out << n; } ScopedParen sp(out); - if (!EmitExpression(out, args[1])) { // offset + if (!EmitExpression(out, offset)) { return false; } if (cast) { @@ -1443,12 +1429,9 @@ bool GeneratorImpl::EmitStorageBufferAccess( // Used by loading f16 types, e.g. for f16 type, set type parameter to "float16_t" // to emit `buffer.Load(offset)`. auto templated_load = [&](const char* type) { - if (!EmitExpression(out, args[0])) { // buffer - return false; - } - out << ".Load<" << type << ">"; // templated load + out << buffer << ".Load<" << type << ">"; // templated load ScopedParen sp(out); - if (!EmitExpression(out, args[1])) { // offset + if (!EmitExpression(out, offset)) { return false; } return true; @@ -1495,20 +1478,17 @@ bool GeneratorImpl::EmitStorageBufferAccess( case Op::kStore: { auto store = [&](int n) { - if (!EmitExpression(out, args[0])) { // buffer - return false; - } - out << ".Store"; + out << buffer << ".Store"; if (n > 1) { out << n; } ScopedParen sp1(out); - if (!EmitExpression(out, args[1])) { // offset + if (!EmitExpression(out, offset)) { return false; } out << ", asuint"; ScopedParen sp2(out); - if (!EmitExpression(out, args[2])) { // value + if (!EmitExpression(out, value)) { return false; } return true; @@ -1517,16 +1497,13 @@ bool GeneratorImpl::EmitStorageBufferAccess( // Used by storing f16 types, e.g. for f16 type, set type parameter to "float16_t" // to emit `buffer.Store(offset)`. auto templated_store = [&](const char* type) { - if (!EmitExpression(out, args[0])) { // buffer - return false; - } - out << ".Store<" << type << ">"; // templated store + out << buffer << ".Store<" << type << ">"; // templated store ScopedParen sp1(out); - if (!EmitExpression(out, args[1])) { // offset + if (!EmitExpression(out, offset)) { return false; } out << ", "; - if (!EmitExpression(out, args[2])) { // value + if (!EmitExpression(out, value)) { return false; } return true; @@ -1571,7 +1548,7 @@ bool GeneratorImpl::EmitStorageBufferAccess( return false; } default: - // Break out to error case below/ + // Break out to error case below // Note that atomic intrinsics are generated as functions. break; } @@ -1588,10 +1565,11 @@ bool GeneratorImpl::EmitStorageAtomicIntrinsic( const sem::Function* sem_func = builder_.Sem().Get(func); auto* result_ty = sem_func->ReturnType(); - const auto& params = sem_func->Parameters(); const auto name = builder_.Symbols().NameFor(func->name->symbol); auto& buf = *current_buffer_; + auto const buffer = program_->Symbols().NameFor(intrinsic->buffer); + auto rmw = [&](const char* hlsl) -> bool { { auto fn = line(&buf); @@ -1599,7 +1577,7 @@ bool GeneratorImpl::EmitStorageAtomicIntrinsic( builtin::Access::kUndefined, name)) { return false; } - fn << "(RWByteAddressBuffer buffer, uint offset, "; + fn << "(uint offset, "; if (!EmitTypeAndName(fn, result_ty, builtin::AddressSpace::kUndefined, builtin::Access::kUndefined, "value")) { return false; @@ -1624,7 +1602,7 @@ bool GeneratorImpl::EmitStorageAtomicIntrinsic( } { auto l = line(&buf); - l << "buffer." << hlsl << "(offset, "; + l << buffer << "." << hlsl << "(offset, "; if (intrinsic->op == Op::kAtomicSub) { l << "-"; } @@ -1669,7 +1647,7 @@ bool GeneratorImpl::EmitStorageAtomicIntrinsic( builtin::Access::kUndefined, name)) { return false; } - fn << "(RWByteAddressBuffer buffer, uint offset) {"; + fn << "(uint offset) {"; } buf.IncrementIndent(); @@ -1688,17 +1666,17 @@ bool GeneratorImpl::EmitStorageAtomicIntrinsic( l << " = 0;"; } - line(&buf) << "buffer.InterlockedOr(offset, 0, value);"; + line(&buf) << buffer << ".InterlockedOr(offset, 0, value);"; line(&buf) << "return value;"; return true; } case Op::kAtomicStore: { + auto* const value_ty = sem_func->Parameters()[1]->Type()->UnwrapRef(); // HLSL does not have an InterlockedStore, so we emulate it with // InterlockedExchange and discard the returned value - auto* value_ty = params[2]->Type()->UnwrapRef(); { auto fn = line(&buf); - fn << "void " << name << "(RWByteAddressBuffer buffer, uint offset, "; + fn << "void " << name << "(uint offset, "; if (!EmitTypeAndName(fn, value_ty, builtin::AddressSpace::kUndefined, builtin::Access::kUndefined, "value")) { return false; @@ -1721,20 +1699,20 @@ bool GeneratorImpl::EmitStorageAtomicIntrinsic( } l << ";"; } - line(&buf) << "buffer.InterlockedExchange(offset, value, ignored);"; + line(&buf) << buffer << ".InterlockedExchange(offset, value, ignored);"; return true; } case Op::kAtomicCompareExchangeWeak: { + auto* const value_ty = sem_func->Parameters()[1]->Type()->UnwrapRef(); // NOTE: We don't need to emit the return type struct here as DecomposeMemoryAccess // already added it to the AST, and it should have already been emitted by now. - auto* value_ty = params[2]->Type()->UnwrapRef(); { auto fn = line(&buf); if (!EmitTypeAndName(fn, result_ty, builtin::AddressSpace::kUndefined, builtin::Access::kUndefined, name)) { return false; } - fn << "(RWByteAddressBuffer buffer, uint offset, "; + fn << "(uint offset, "; if (!EmitTypeAndName(fn, value_ty, builtin::AddressSpace::kUndefined, builtin::Access::kUndefined, "compare")) { return false; @@ -1767,8 +1745,8 @@ bool GeneratorImpl::EmitStorageAtomicIntrinsic( l << ";"; } - line(&buf) << "buffer.InterlockedCompareExchange(offset, compare, value, " - "result.old_value);"; + line(&buf) << buffer + << ".InterlockedCompareExchange(offset, compare, value, result.old_value);"; line(&buf) << "result.exchanged = result.old_value == compare;"; line(&buf) << "return result;"; diff --git a/src/tint/writer/hlsl/generator_impl_member_accessor_test.cc b/src/tint/writer/hlsl/generator_impl_member_accessor_test.cc index 0a2112b334..ca08714585 100644 --- a/src/tint/writer/hlsl/generator_impl_member_accessor_test.cc +++ b/src/tint/writer/hlsl/generator_impl_member_accessor_test.cc @@ -202,86 +202,86 @@ INSTANTIATE_TEST_SUITE_P( TypeCase{ty_vec4, "asint(data.Load4(16u))"}, TypeCase{ty_vec4, "data.Load >(8u)"}, TypeCase{ty_mat2x2, - "return float2x2(asfloat(buffer.Load2((offset + 0u))), " - "asfloat(buffer.Load2((offset + 8u))));"}, + "return float2x2(asfloat(data.Load2((offset + 0u))), " + "asfloat(data.Load2((offset + 8u))));"}, TypeCase{ty_mat2x3, - "return float2x3(asfloat(buffer.Load3((offset + 0u))), " - "asfloat(buffer.Load3((offset + 16u))));"}, + "return float2x3(asfloat(data.Load3((offset + 0u))), " + "asfloat(data.Load3((offset + 16u))));"}, TypeCase{ty_mat2x4, - "return float2x4(asfloat(buffer.Load4((offset + 0u))), " - "asfloat(buffer.Load4((offset + 16u))));"}, + "return float2x4(asfloat(data.Load4((offset + 0u))), " + "asfloat(data.Load4((offset + 16u))));"}, TypeCase{ty_mat3x2, - "return float3x2(asfloat(buffer.Load2((offset + 0u))), " - "asfloat(buffer.Load2((offset + 8u))), " - "asfloat(buffer.Load2((offset + 16u))));"}, + "return float3x2(asfloat(data.Load2((offset + 0u))), " + "asfloat(data.Load2((offset + 8u))), " + "asfloat(data.Load2((offset + 16u))));"}, TypeCase{ty_mat3x3, - "return float3x3(asfloat(buffer.Load3((offset + 0u))), " - "asfloat(buffer.Load3((offset + 16u))), " - "asfloat(buffer.Load3((offset + 32u))));"}, + "return float3x3(asfloat(data.Load3((offset + 0u))), " + "asfloat(data.Load3((offset + 16u))), " + "asfloat(data.Load3((offset + 32u))));"}, TypeCase{ty_mat3x4, - "return float3x4(asfloat(buffer.Load4((offset + 0u))), " - "asfloat(buffer.Load4((offset + 16u))), " - "asfloat(buffer.Load4((offset + 32u))));"}, + "return float3x4(asfloat(data.Load4((offset + 0u))), " + "asfloat(data.Load4((offset + 16u))), " + "asfloat(data.Load4((offset + 32u))));"}, TypeCase{ty_mat4x2, - "return float4x2(asfloat(buffer.Load2((offset + 0u))), " - "asfloat(buffer.Load2((offset + 8u))), " - "asfloat(buffer.Load2((offset + 16u))), " - "asfloat(buffer.Load2((offset + 24u))));"}, + "return float4x2(asfloat(data.Load2((offset + 0u))), " + "asfloat(data.Load2((offset + 8u))), " + "asfloat(data.Load2((offset + 16u))), " + "asfloat(data.Load2((offset + 24u))));"}, TypeCase{ty_mat4x3, - "return float4x3(asfloat(buffer.Load3((offset + 0u))), " - "asfloat(buffer.Load3((offset + 16u))), " - "asfloat(buffer.Load3((offset + 32u))), " - "asfloat(buffer.Load3((offset + 48u))));"}, + "return float4x3(asfloat(data.Load3((offset + 0u))), " + "asfloat(data.Load3((offset + 16u))), " + "asfloat(data.Load3((offset + 32u))), " + "asfloat(data.Load3((offset + 48u))));"}, TypeCase{ty_mat4x4, - "return float4x4(asfloat(buffer.Load4((offset + 0u))), " - "asfloat(buffer.Load4((offset + 16u))), " - "asfloat(buffer.Load4((offset + 32u))), " - "asfloat(buffer.Load4((offset + 48u))));"}, + "return float4x4(asfloat(data.Load4((offset + 0u))), " + "asfloat(data.Load4((offset + 16u))), " + "asfloat(data.Load4((offset + 32u))), " + "asfloat(data.Load4((offset + 48u))));"}, TypeCase{ty_mat2x2, "return matrix(" - "buffer.Load >((offset + 0u)), " - "buffer.Load >((offset + 4u)));"}, + "data.Load >((offset + 0u)), " + "data.Load >((offset + 4u)));"}, TypeCase{ty_mat2x3, "return matrix(" - "buffer.Load >((offset + 0u)), " - "buffer.Load >((offset + 8u)));"}, + "data.Load >((offset + 0u)), " + "data.Load >((offset + 8u)));"}, TypeCase{ty_mat2x4, "return matrix(" - "buffer.Load >((offset + 0u)), " - "buffer.Load >((offset + 8u)));"}, + "data.Load >((offset + 0u)), " + "data.Load >((offset + 8u)));"}, TypeCase{ty_mat3x2, "return matrix(" - "buffer.Load >((offset + 0u)), " - "buffer.Load >((offset + 4u)), " - "buffer.Load >((offset + 8u)));"}, + "data.Load >((offset + 0u)), " + "data.Load >((offset + 4u)), " + "data.Load >((offset + 8u)));"}, TypeCase{ty_mat3x3, "return matrix(" - "buffer.Load >((offset + 0u)), " - "buffer.Load >((offset + 8u)), " - "buffer.Load >((offset + 16u)));"}, + "data.Load >((offset + 0u)), " + "data.Load >((offset + 8u)), " + "data.Load >((offset + 16u)));"}, TypeCase{ty_mat3x4, "return matrix(" - "buffer.Load >((offset + 0u)), " - "buffer.Load >((offset + 8u)), " - "buffer.Load >((offset + 16u)));"}, + "data.Load >((offset + 0u)), " + "data.Load >((offset + 8u)), " + "data.Load >((offset + 16u)));"}, TypeCase{ty_mat4x2, "return matrix(" - "buffer.Load >((offset + 0u)), " - "buffer.Load >((offset + 4u)), " - "buffer.Load >((offset + 8u)), " - "buffer.Load >((offset + 12u)));"}, + "data.Load >((offset + 0u)), " + "data.Load >((offset + 4u)), " + "data.Load >((offset + 8u)), " + "data.Load >((offset + 12u)));"}, TypeCase{ty_mat4x3, "return matrix(" - "buffer.Load >((offset + 0u)), " - "buffer.Load >((offset + 8u)), " - "buffer.Load >((offset + 16u)), " - "buffer.Load >((offset + 24u)));"}, + "data.Load >((offset + 0u)), " + "data.Load >((offset + 8u)), " + "data.Load >((offset + 16u)), " + "data.Load >((offset + 24u)));"}, TypeCase{ty_mat4x4, "return matrix(" - "buffer.Load >((offset + 0u)), " - "buffer.Load >((offset + 8u)), " - "buffer.Load >((offset + 16u)), " - "buffer.Load >((offset + 24u)));"})); + "data.Load >((offset + 0u)), " + "data.Load >((offset + 8u)), " + "data.Load >((offset + 16u)), " + "data.Load >((offset + 24u)));"})); using HlslGeneratorImplTest_MemberAccessor_StorageBufferLoad_DynamicOffset = HlslGeneratorImplTest_MemberAccessorWithParam; @@ -346,86 +346,86 @@ INSTANTIATE_TEST_SUITE_P( TypeCase{ty_vec4, "asint(data.Load4(((48u * uint(i)) + 16u)))"}, TypeCase{ty_vec4, "data.Load >(((32u * uint(i)) + 8u))"}, TypeCase{ty_mat2x2, - "return float2x2(asfloat(buffer.Load2((offset + 0u))), " - "asfloat(buffer.Load2((offset + 8u))));"}, + "return float2x2(asfloat(data.Load2((offset + 0u))), " + "asfloat(data.Load2((offset + 8u))));"}, TypeCase{ty_mat2x3, - "return float2x3(asfloat(buffer.Load3((offset + 0u))), " - "asfloat(buffer.Load3((offset + 16u))));"}, + "return float2x3(asfloat(data.Load3((offset + 0u))), " + "asfloat(data.Load3((offset + 16u))));"}, TypeCase{ty_mat2x4, - "return float2x4(asfloat(buffer.Load4((offset + 0u))), " - "asfloat(buffer.Load4((offset + 16u))));"}, + "return float2x4(asfloat(data.Load4((offset + 0u))), " + "asfloat(data.Load4((offset + 16u))));"}, TypeCase{ty_mat3x2, - "return float3x2(asfloat(buffer.Load2((offset + 0u))), " - "asfloat(buffer.Load2((offset + 8u))), " - "asfloat(buffer.Load2((offset + 16u))));"}, + "return float3x2(asfloat(data.Load2((offset + 0u))), " + "asfloat(data.Load2((offset + 8u))), " + "asfloat(data.Load2((offset + 16u))));"}, TypeCase{ty_mat3x3, - "return float3x3(asfloat(buffer.Load3((offset + 0u))), " - "asfloat(buffer.Load3((offset + 16u))), " - "asfloat(buffer.Load3((offset + 32u))));"}, + "return float3x3(asfloat(data.Load3((offset + 0u))), " + "asfloat(data.Load3((offset + 16u))), " + "asfloat(data.Load3((offset + 32u))));"}, TypeCase{ty_mat3x4, - "return float3x4(asfloat(buffer.Load4((offset + 0u))), " - "asfloat(buffer.Load4((offset + 16u))), " - "asfloat(buffer.Load4((offset + 32u))));"}, + "return float3x4(asfloat(data.Load4((offset + 0u))), " + "asfloat(data.Load4((offset + 16u))), " + "asfloat(data.Load4((offset + 32u))));"}, TypeCase{ty_mat4x2, - "return float4x2(asfloat(buffer.Load2((offset + 0u))), " - "asfloat(buffer.Load2((offset + 8u))), " - "asfloat(buffer.Load2((offset + 16u))), " - "asfloat(buffer.Load2((offset + 24u))));"}, + "return float4x2(asfloat(data.Load2((offset + 0u))), " + "asfloat(data.Load2((offset + 8u))), " + "asfloat(data.Load2((offset + 16u))), " + "asfloat(data.Load2((offset + 24u))));"}, TypeCase{ty_mat4x3, - "return float4x3(asfloat(buffer.Load3((offset + 0u))), " - "asfloat(buffer.Load3((offset + 16u))), " - "asfloat(buffer.Load3((offset + 32u))), " - "asfloat(buffer.Load3((offset + 48u))));"}, + "return float4x3(asfloat(data.Load3((offset + 0u))), " + "asfloat(data.Load3((offset + 16u))), " + "asfloat(data.Load3((offset + 32u))), " + "asfloat(data.Load3((offset + 48u))));"}, TypeCase{ty_mat4x4, - "return float4x4(asfloat(buffer.Load4((offset + 0u))), " - "asfloat(buffer.Load4((offset + 16u))), " - "asfloat(buffer.Load4((offset + 32u))), " - "asfloat(buffer.Load4((offset + 48u))));"}, + "return float4x4(asfloat(data.Load4((offset + 0u))), " + "asfloat(data.Load4((offset + 16u))), " + "asfloat(data.Load4((offset + 32u))), " + "asfloat(data.Load4((offset + 48u))));"}, TypeCase{ty_mat2x2, "return matrix(" - "buffer.Load >((offset + 0u)), " - "buffer.Load >((offset + 4u)));"}, + "data.Load >((offset + 0u)), " + "data.Load >((offset + 4u)));"}, TypeCase{ty_mat2x3, "return matrix(" - "buffer.Load >((offset + 0u)), " - "buffer.Load >((offset + 8u)));"}, + "data.Load >((offset + 0u)), " + "data.Load >((offset + 8u)));"}, TypeCase{ty_mat2x4, "return matrix(" - "buffer.Load >((offset + 0u)), " - "buffer.Load >((offset + 8u)));"}, + "data.Load >((offset + 0u)), " + "data.Load >((offset + 8u)));"}, TypeCase{ty_mat3x2, "return matrix(" - "buffer.Load >((offset + 0u)), " - "buffer.Load >((offset + 4u)), " - "buffer.Load >((offset + 8u)));"}, + "data.Load >((offset + 0u)), " + "data.Load >((offset + 4u)), " + "data.Load >((offset + 8u)));"}, TypeCase{ty_mat3x3, "return matrix(" - "buffer.Load >((offset + 0u)), " - "buffer.Load >((offset + 8u)), " - "buffer.Load >((offset + 16u)));"}, + "data.Load >((offset + 0u)), " + "data.Load >((offset + 8u)), " + "data.Load >((offset + 16u)));"}, TypeCase{ty_mat3x4, "return matrix(" - "buffer.Load >((offset + 0u)), " - "buffer.Load >((offset + 8u)), " - "buffer.Load >((offset + 16u)));"}, + "data.Load >((offset + 0u)), " + "data.Load >((offset + 8u)), " + "data.Load >((offset + 16u)));"}, TypeCase{ty_mat4x2, "return matrix(" - "buffer.Load >((offset + 0u)), " - "buffer.Load >((offset + 4u)), " - "buffer.Load >((offset + 8u)), " - "buffer.Load >((offset + 12u)));"}, + "data.Load >((offset + 0u)), " + "data.Load >((offset + 4u)), " + "data.Load >((offset + 8u)), " + "data.Load >((offset + 12u)));"}, TypeCase{ty_mat4x3, "return matrix(" - "buffer.Load >((offset + 0u)), " - "buffer.Load >((offset + 8u)), " - "buffer.Load >((offset + 16u)), " - "buffer.Load >((offset + 24u)));"}, + "data.Load >((offset + 0u)), " + "data.Load >((offset + 8u)), " + "data.Load >((offset + 16u)), " + "data.Load >((offset + 24u)));"}, TypeCase{ty_mat4x4, "return matrix(" - "buffer.Load >((offset + 0u)), " - "buffer.Load >((offset + 8u)), " - "buffer.Load >((offset + 16u)), " - "buffer.Load >((offset + 24u)));"})); + "data.Load >((offset + 0u)), " + "data.Load >((offset + 8u)), " + "data.Load >((offset + 16u)), " + "data.Load >((offset + 24u)));"})); using HlslGeneratorImplTest_MemberAccessor_UniformBufferLoad_ConstantOffset = HlslGeneratorImplTest_MemberAccessorWithParam; @@ -483,207 +483,207 @@ INSTANTIATE_TEST_SUITE_P( vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); vector x = vector(ubo_load_xz[0], ubo_load_yw[0], ubo_load_xz[1], ubo_load_yw[1]);)"}, - TypeCase{ty_mat2x2, R"(float2x2 tint_symbol(uint4 buffer[2], uint offset) { + TypeCase{ty_mat2x2, R"(float2x2 data_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = data[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = data[scalar_offset_1 / 4]; return float2x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy))); })"}, - TypeCase{ty_mat2x3, R"(float2x3 tint_symbol(uint4 buffer[3], uint offset) { + TypeCase{ty_mat2x3, R"(float2x3 data_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz)); + return float2x3(asfloat(data[scalar_offset / 4].xyz), asfloat(data[scalar_offset_1 / 4].xyz)); })"}, - TypeCase{ty_mat2x4, R"(float2x4 tint_symbol(uint4 buffer[3], uint offset) { + TypeCase{ty_mat2x4, R"(float2x4 data_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4])); + return float2x4(asfloat(data[scalar_offset / 4]), asfloat(data[scalar_offset_1 / 4])); })"}, - TypeCase{ty_mat3x2, R"(float3x2 tint_symbol(uint4 buffer[2], uint offset) { + TypeCase{ty_mat3x2, R"(float3x2 data_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = data[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = data[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = data[scalar_offset_2 / 4]; return float3x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy))); })"}, - TypeCase{ty_mat3x3, R"(float3x3 tint_symbol(uint4 buffer[4], uint offset) { + TypeCase{ty_mat3x3, R"(float3x3 data_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz)); + return float3x3(asfloat(data[scalar_offset / 4].xyz), asfloat(data[scalar_offset_1 / 4].xyz), asfloat(data[scalar_offset_2 / 4].xyz)); })"}, - TypeCase{ty_mat3x4, R"(float3x4 tint_symbol(uint4 buffer[4], uint offset) { + TypeCase{ty_mat3x4, R"(float3x4 data_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); + return float3x4(asfloat(data[scalar_offset / 4]), asfloat(data[scalar_offset_1 / 4]), asfloat(data[scalar_offset_2 / 4])); })"}, - TypeCase{ty_mat4x2, R"(float4x2 tint_symbol(uint4 buffer[3], uint offset) { + TypeCase{ty_mat4x2, R"(float4x2 data_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = data[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = data[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = data[scalar_offset_2 / 4]; const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_3 = data[scalar_offset_3 / 4]; return float4x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy)), asfloat(((scalar_offset_3 & 2) ? ubo_load_3.zw : ubo_load_3.xy))); })"}, - TypeCase{ty_mat4x3, R"(float4x3 tint_symbol(uint4 buffer[5], uint offset) { + TypeCase{ty_mat4x3, R"(float4x3 data_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz)); + return float4x3(asfloat(data[scalar_offset / 4].xyz), asfloat(data[scalar_offset_1 / 4].xyz), asfloat(data[scalar_offset_2 / 4].xyz), asfloat(data[scalar_offset_3 / 4].xyz)); })"}, - TypeCase{ty_mat4x4, R"(float4x4 tint_symbol(uint4 buffer[5], uint offset) { + TypeCase{ty_mat4x4, R"(float4x4 data_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]), asfloat(buffer[scalar_offset_3 / 4])); + return float4x4(asfloat(data[scalar_offset / 4]), asfloat(data[scalar_offset_1 / 4]), asfloat(data[scalar_offset_2 / 4]), asfloat(data[scalar_offset_3 / 4])); })"}, TypeCase{ty_mat2x2, - R"(matrix tint_symbol(uint4 buffer[1], uint offset) { + R"(matrix data_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint ubo_load = buffer[scalar_offset / 4][scalar_offset % 4]; + uint ubo_load = data[scalar_offset / 4][scalar_offset % 4]; const uint scalar_offset_1 = ((offset + 4u)) / 4; - uint ubo_load_1 = buffer[scalar_offset_1 / 4][scalar_offset_1 % 4]; + uint ubo_load_1 = data[scalar_offset_1 / 4][scalar_offset_1 % 4]; return matrix(vector(float16_t(f16tof32(ubo_load & 0xFFFF)), float16_t(f16tof32(ubo_load >> 16))), vector(float16_t(f16tof32(ubo_load_1 & 0xFFFF)), float16_t(f16tof32(ubo_load_1 >> 16)))); })"}, TypeCase{ty_mat2x3, - R"(matrix tint_symbol(uint4 buffer[2], uint offset) { + R"(matrix data_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = data[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = data[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); return matrix(vector(ubo_load_xz[0], ubo_load_y, ubo_load_xz[1]), vector(ubo_load_2_xz[0], ubo_load_2_y, ubo_load_2_xz[1])); })"}, TypeCase{ty_mat2x4, - R"(matrix tint_symbol(uint4 buffer[2], uint offset) { + R"(matrix data_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = data[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = data[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); vector ubo_load_2_yw = vector(f16tof32(ubo_load_2 >> 16)); return matrix(vector(ubo_load_xz[0], ubo_load_yw[0], ubo_load_xz[1], ubo_load_yw[1]), vector(ubo_load_2_xz[0], ubo_load_2_yw[0], ubo_load_2_xz[1], ubo_load_2_yw[1])); })"}, TypeCase{ty_mat3x2, - R"(matrix tint_symbol(uint4 buffer[1], uint offset) { + R"(matrix data_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint ubo_load = buffer[scalar_offset / 4][scalar_offset % 4]; + uint ubo_load = data[scalar_offset / 4][scalar_offset % 4]; const uint scalar_offset_1 = ((offset + 4u)) / 4; - uint ubo_load_1 = buffer[scalar_offset_1 / 4][scalar_offset_1 % 4]; + uint ubo_load_1 = data[scalar_offset_1 / 4][scalar_offset_1 % 4]; const uint scalar_offset_2 = ((offset + 8u)) / 4; - uint ubo_load_2 = buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]; + uint ubo_load_2 = data[scalar_offset_2 / 4][scalar_offset_2 % 4]; return matrix(vector(float16_t(f16tof32(ubo_load & 0xFFFF)), float16_t(f16tof32(ubo_load >> 16))), vector(float16_t(f16tof32(ubo_load_1 & 0xFFFF)), float16_t(f16tof32(ubo_load_1 >> 16))), vector(float16_t(f16tof32(ubo_load_2 & 0xFFFF)), float16_t(f16tof32(ubo_load_2 >> 16)))); })"}, TypeCase{ty_mat3x3, - R"(matrix tint_symbol(uint4 buffer[2], uint offset) { + R"(matrix data_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = data[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = data[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = data[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); float16_t ubo_load_4_y = f16tof32(ubo_load_4[0] >> 16); return matrix(vector(ubo_load_xz[0], ubo_load_y, ubo_load_xz[1]), vector(ubo_load_2_xz[0], ubo_load_2_y, ubo_load_2_xz[1]), vector(ubo_load_4_xz[0], ubo_load_4_y, ubo_load_4_xz[1])); })"}, TypeCase{ty_mat3x4, - R"(matrix tint_symbol(uint4 buffer[2], uint offset) { + R"(matrix data_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = data[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = data[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); vector ubo_load_2_yw = vector(f16tof32(ubo_load_2 >> 16)); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = data[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); vector ubo_load_4_yw = vector(f16tof32(ubo_load_4 >> 16)); return matrix(vector(ubo_load_xz[0], ubo_load_yw[0], ubo_load_xz[1], ubo_load_yw[1]), vector(ubo_load_2_xz[0], ubo_load_2_yw[0], ubo_load_2_xz[1], ubo_load_2_yw[1]), vector(ubo_load_4_xz[0], ubo_load_4_yw[0], ubo_load_4_xz[1], ubo_load_4_yw[1]));)"}, TypeCase{ty_mat4x2, - R"(matrix tint_symbol(uint4 buffer[2], uint offset) { + R"(matrix data_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint ubo_load = buffer[scalar_offset / 4][scalar_offset % 4]; + uint ubo_load = data[scalar_offset / 4][scalar_offset % 4]; const uint scalar_offset_1 = ((offset + 4u)) / 4; - uint ubo_load_1 = buffer[scalar_offset_1 / 4][scalar_offset_1 % 4]; + uint ubo_load_1 = data[scalar_offset_1 / 4][scalar_offset_1 % 4]; const uint scalar_offset_2 = ((offset + 8u)) / 4; - uint ubo_load_2 = buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]; + uint ubo_load_2 = data[scalar_offset_2 / 4][scalar_offset_2 % 4]; const uint scalar_offset_3 = ((offset + 12u)) / 4; - uint ubo_load_3 = buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]; + uint ubo_load_3 = data[scalar_offset_3 / 4][scalar_offset_3 % 4]; return matrix(vector(float16_t(f16tof32(ubo_load & 0xFFFF)), float16_t(f16tof32(ubo_load >> 16))), vector(float16_t(f16tof32(ubo_load_1 & 0xFFFF)), float16_t(f16tof32(ubo_load_1 >> 16))), vector(float16_t(f16tof32(ubo_load_2 & 0xFFFF)), float16_t(f16tof32(ubo_load_2 >> 16))), vector(float16_t(f16tof32(ubo_load_3 & 0xFFFF)), float16_t(f16tof32(ubo_load_3 >> 16)))); })"}, TypeCase{ty_mat4x3, - R"(matrix tint_symbol(uint4 buffer[3], uint offset) { + R"(matrix data_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = data[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = data[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = data[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); float16_t ubo_load_4_y = f16tof32(ubo_load_4[0] >> 16); const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_7 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_7 = data[scalar_offset_3 / 4]; uint2 ubo_load_6 = ((scalar_offset_3 & 2) ? ubo_load_7.zw : ubo_load_7.xy); vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); float16_t ubo_load_6_y = f16tof32(ubo_load_6[0] >> 16); return matrix(vector(ubo_load_xz[0], ubo_load_y, ubo_load_xz[1]), vector(ubo_load_2_xz[0], ubo_load_2_y, ubo_load_2_xz[1]), vector(ubo_load_4_xz[0], ubo_load_4_y, ubo_load_4_xz[1]), vector(ubo_load_6_xz[0], ubo_load_6_y, ubo_load_6_xz[1])); })"}, TypeCase{ty_mat4x4, - R"(matrix tint_symbol(uint4 buffer[3], uint offset) { + R"(matrix data_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = data[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = data[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); vector ubo_load_2_yw = vector(f16tof32(ubo_load_2 >> 16)); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = data[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); vector ubo_load_4_yw = vector(f16tof32(ubo_load_4 >> 16)); const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_7 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_7 = data[scalar_offset_3 / 4]; uint2 ubo_load_6 = ((scalar_offset_3 & 2) ? ubo_load_7.zw : ubo_load_7.xy); vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); vector ubo_load_6_yw = vector(f16tof32(ubo_load_6 >> 16)); @@ -769,208 +769,208 @@ INSTANTIATE_TEST_SUITE_P( vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); vector x = vector(ubo_load_xz[0], ubo_load_yw[0], ubo_load_xz[1], ubo_load_yw[1]);)"}, - TypeCase{ty_mat2x2, R"(float2x2 tint_symbol(uint4 buffer[12], uint offset) { + TypeCase{ty_mat2x2, R"(float2x2 data_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = data[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = data[scalar_offset_1 / 4]; return float2x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy))); })"}, - TypeCase{ty_mat2x3, R"(float2x3 tint_symbol(uint4 buffer[16], uint offset) { + TypeCase{ty_mat2x3, R"(float2x3 data_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz)); + return float2x3(asfloat(data[scalar_offset / 4].xyz), asfloat(data[scalar_offset_1 / 4].xyz)); })"}, - TypeCase{ty_mat2x4, R"(float2x4 tint_symbol(uint4 buffer[16], uint offset) { + TypeCase{ty_mat2x4, R"(float2x4 data_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4])); + return float2x4(asfloat(data[scalar_offset / 4]), asfloat(data[scalar_offset_1 / 4])); })"}, - TypeCase{ty_mat3x2, R"(float3x2 tint_symbol(uint4 buffer[12], uint offset) { + TypeCase{ty_mat3x2, R"(float3x2 data_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = data[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = data[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = data[scalar_offset_2 / 4]; return float3x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy))); })"}, - TypeCase{ty_mat3x3, R"(float3x3 tint_symbol(uint4 buffer[20], uint offset) { + TypeCase{ty_mat3x3, R"(float3x3 data_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz)); + return float3x3(asfloat(data[scalar_offset / 4].xyz), asfloat(data[scalar_offset_1 / 4].xyz), asfloat(data[scalar_offset_2 / 4].xyz)); })"}, - TypeCase{ty_mat3x4, R"(float3x4 tint_symbol(uint4 buffer[20], uint offset) { + TypeCase{ty_mat3x4, R"(float3x4 data_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); + return float3x4(asfloat(data[scalar_offset / 4]), asfloat(data[scalar_offset_1 / 4]), asfloat(data[scalar_offset_2 / 4])); })"}, - TypeCase{ty_mat4x2, R"(float4x2 tint_symbol(uint4 buffer[16], uint offset) { + TypeCase{ty_mat4x2, R"(float4x2 data_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = data[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = data[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = data[scalar_offset_2 / 4]; const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_3 = data[scalar_offset_3 / 4]; return float4x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy)), asfloat(((scalar_offset_3 & 2) ? ubo_load_3.zw : ubo_load_3.xy))); })"}, - TypeCase{ty_mat4x3, R"(float4x3 tint_symbol(uint4 buffer[24], uint offset) { + TypeCase{ty_mat4x3, R"(float4x3 data_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz)); + return float4x3(asfloat(data[scalar_offset / 4].xyz), asfloat(data[scalar_offset_1 / 4].xyz), asfloat(data[scalar_offset_2 / 4].xyz), asfloat(data[scalar_offset_3 / 4].xyz)); })"}, - TypeCase{ty_mat4x4, R"(float4x4 tint_symbol(uint4 buffer[24], uint offset) { + TypeCase{ty_mat4x4, R"(float4x4 data_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]), asfloat(buffer[scalar_offset_3 / 4])); + return float4x4(asfloat(data[scalar_offset / 4]), asfloat(data[scalar_offset_1 / 4]), asfloat(data[scalar_offset_2 / 4]), asfloat(data[scalar_offset_3 / 4])); })"}, TypeCase{ty_mat2x2, - R"(matrix tint_symbol(uint4 buffer[8], uint offset) { + R"(matrix data_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint ubo_load = buffer[scalar_offset / 4][scalar_offset % 4]; + uint ubo_load = data[scalar_offset / 4][scalar_offset % 4]; const uint scalar_offset_1 = ((offset + 4u)) / 4; - uint ubo_load_1 = buffer[scalar_offset_1 / 4][scalar_offset_1 % 4]; + uint ubo_load_1 = data[scalar_offset_1 / 4][scalar_offset_1 % 4]; return matrix(vector(float16_t(f16tof32(ubo_load & 0xFFFF)), float16_t(f16tof32(ubo_load >> 16))), vector(float16_t(f16tof32(ubo_load_1 & 0xFFFF)), float16_t(f16tof32(ubo_load_1 >> 16)))); })"}, TypeCase{ty_mat2x3, - R"(matrix tint_symbol(uint4 buffer[12], uint offset) { + R"(matrix data_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = data[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = data[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); return matrix(vector(ubo_load_xz[0], ubo_load_y, ubo_load_xz[1]), vector(ubo_load_2_xz[0], ubo_load_2_y, ubo_load_2_xz[1])); })"}, TypeCase{ty_mat2x4, - R"(matrix tint_symbol(uint4 buffer[12], uint offset) { + R"(matrix data_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = data[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = data[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); vector ubo_load_2_yw = vector(f16tof32(ubo_load_2 >> 16)); return matrix(vector(ubo_load_xz[0], ubo_load_yw[0], ubo_load_xz[1], ubo_load_yw[1]), vector(ubo_load_2_xz[0], ubo_load_2_yw[0], ubo_load_2_xz[1], ubo_load_2_yw[1])); })"}, TypeCase{ty_mat3x2, - R"(matrix tint_symbol(uint4 buffer[8], uint offset) { + R"(matrix data_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint ubo_load = buffer[scalar_offset / 4][scalar_offset % 4]; + uint ubo_load = data[scalar_offset / 4][scalar_offset % 4]; const uint scalar_offset_1 = ((offset + 4u)) / 4; - uint ubo_load_1 = buffer[scalar_offset_1 / 4][scalar_offset_1 % 4]; + uint ubo_load_1 = data[scalar_offset_1 / 4][scalar_offset_1 % 4]; const uint scalar_offset_2 = ((offset + 8u)) / 4; - uint ubo_load_2 = buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]; + uint ubo_load_2 = data[scalar_offset_2 / 4][scalar_offset_2 % 4]; return matrix(vector(float16_t(f16tof32(ubo_load & 0xFFFF)), float16_t(f16tof32(ubo_load >> 16))), vector(float16_t(f16tof32(ubo_load_1 & 0xFFFF)), float16_t(f16tof32(ubo_load_1 >> 16))), vector(float16_t(f16tof32(ubo_load_2 & 0xFFFF)), float16_t(f16tof32(ubo_load_2 >> 16)))); })"}, TypeCase{ty_mat3x3, - R"(matrix tint_symbol(uint4 buffer[12], uint offset) { + R"(matrix data_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = data[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = data[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = data[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); float16_t ubo_load_4_y = f16tof32(ubo_load_4[0] >> 16); return matrix(vector(ubo_load_xz[0], ubo_load_y, ubo_load_xz[1]), vector(ubo_load_2_xz[0], ubo_load_2_y, ubo_load_2_xz[1]), vector(ubo_load_4_xz[0], ubo_load_4_y, ubo_load_4_xz[1])); })"}, TypeCase{ty_mat3x4, - R"(matrix tint_symbol(uint4 buffer[12], uint offset) { + R"(matrix data_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = data[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = data[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); vector ubo_load_2_yw = vector(f16tof32(ubo_load_2 >> 16)); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = data[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); vector ubo_load_4_yw = vector(f16tof32(ubo_load_4 >> 16)); return matrix(vector(ubo_load_xz[0], ubo_load_yw[0], ubo_load_xz[1], ubo_load_yw[1]), vector(ubo_load_2_xz[0], ubo_load_2_yw[0], ubo_load_2_xz[1], ubo_load_2_yw[1]), vector(ubo_load_4_xz[0], ubo_load_4_yw[0], ubo_load_4_xz[1], ubo_load_4_yw[1])); })"}, TypeCase{ty_mat4x2, - R"(matrix tint_symbol(uint4 buffer[12], uint offset) { + R"(matrix data_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint ubo_load = buffer[scalar_offset / 4][scalar_offset % 4]; + uint ubo_load = data[scalar_offset / 4][scalar_offset % 4]; const uint scalar_offset_1 = ((offset + 4u)) / 4; - uint ubo_load_1 = buffer[scalar_offset_1 / 4][scalar_offset_1 % 4]; + uint ubo_load_1 = data[scalar_offset_1 / 4][scalar_offset_1 % 4]; const uint scalar_offset_2 = ((offset + 8u)) / 4; - uint ubo_load_2 = buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]; + uint ubo_load_2 = data[scalar_offset_2 / 4][scalar_offset_2 % 4]; const uint scalar_offset_3 = ((offset + 12u)) / 4; - uint ubo_load_3 = buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]; + uint ubo_load_3 = data[scalar_offset_3 / 4][scalar_offset_3 % 4]; return matrix(vector(float16_t(f16tof32(ubo_load & 0xFFFF)), float16_t(f16tof32(ubo_load >> 16))), vector(float16_t(f16tof32(ubo_load_1 & 0xFFFF)), float16_t(f16tof32(ubo_load_1 >> 16))), vector(float16_t(f16tof32(ubo_load_2 & 0xFFFF)), float16_t(f16tof32(ubo_load_2 >> 16))), vector(float16_t(f16tof32(ubo_load_3 & 0xFFFF)), float16_t(f16tof32(ubo_load_3 >> 16)))); })"}, TypeCase{ty_mat4x3, - R"(matrix tint_symbol(uint4 buffer[16], uint offset) { + R"(matrix data_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = data[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = data[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = data[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); float16_t ubo_load_4_y = f16tof32(ubo_load_4[0] >> 16); const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_7 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_7 = data[scalar_offset_3 / 4]; uint2 ubo_load_6 = ((scalar_offset_3 & 2) ? ubo_load_7.zw : ubo_load_7.xy); vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); float16_t ubo_load_6_y = f16tof32(ubo_load_6[0] >> 16); return matrix(vector(ubo_load_xz[0], ubo_load_y, ubo_load_xz[1]), vector(ubo_load_2_xz[0], ubo_load_2_y, ubo_load_2_xz[1]), vector(ubo_load_4_xz[0], ubo_load_4_y, ubo_load_4_xz[1]), vector(ubo_load_6_xz[0], ubo_load_6_y, ubo_load_6_xz[1])); })"}, TypeCase{ty_mat4x4, - R"(matrix tint_symbol(uint4 buffer[16], uint offset) { + R"(matrix data_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = data[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = data[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); vector ubo_load_2_yw = vector(f16tof32(ubo_load_2 >> 16)); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = data[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); vector ubo_load_4_yw = vector(f16tof32(ubo_load_4 >> 16)); const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_7 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_7 = data[scalar_offset_3 / 4]; uint2 ubo_load_6 = ((scalar_offset_3 & 2) ? ubo_load_7.zw : ubo_load_7.xy); vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); vector ubo_load_6_yw = vector(f16tof32(ubo_load_6 >> 16)); @@ -1026,95 +1026,97 @@ INSTANTIATE_TEST_SUITE_P( TypeCase{ty_vec4, "data.Store4(16u, asuint(value))"}, TypeCase{ty_vec4, "data.Store4(16u, asuint(value))"}, TypeCase{ty_vec4, "data.Store >(8u, value)"}, - TypeCase{ty_mat2x2, R"({ - buffer.Store2((offset + 0u), asuint(value[0u])); - buffer.Store2((offset + 8u), asuint(value[1u])); + TypeCase{ty_mat2x2, R"( + +void data_store(uint offset, float2x2 value) { + data.Store2((offset + 0u), asuint(value[0u])); + data.Store2((offset + 8u), asuint(value[1u])); })"}, TypeCase{ty_mat2x3, R"({ - buffer.Store3((offset + 0u), asuint(value[0u])); - buffer.Store3((offset + 16u), asuint(value[1u])); + data.Store3((offset + 0u), asuint(value[0u])); + data.Store3((offset + 16u), asuint(value[1u])); })"}, TypeCase{ty_mat2x4, R"({ - buffer.Store4((offset + 0u), asuint(value[0u])); - buffer.Store4((offset + 16u), asuint(value[1u])); + data.Store4((offset + 0u), asuint(value[0u])); + data.Store4((offset + 16u), asuint(value[1u])); })"}, TypeCase{ty_mat3x2, R"({ - buffer.Store2((offset + 0u), asuint(value[0u])); - buffer.Store2((offset + 8u), asuint(value[1u])); - buffer.Store2((offset + 16u), asuint(value[2u])); + data.Store2((offset + 0u), asuint(value[0u])); + data.Store2((offset + 8u), asuint(value[1u])); + data.Store2((offset + 16u), asuint(value[2u])); })"}, TypeCase{ty_mat3x3, R"({ - buffer.Store3((offset + 0u), asuint(value[0u])); - buffer.Store3((offset + 16u), asuint(value[1u])); - buffer.Store3((offset + 32u), asuint(value[2u])); + data.Store3((offset + 0u), asuint(value[0u])); + data.Store3((offset + 16u), asuint(value[1u])); + data.Store3((offset + 32u), asuint(value[2u])); })"}, TypeCase{ty_mat3x4, R"({ - buffer.Store4((offset + 0u), asuint(value[0u])); - buffer.Store4((offset + 16u), asuint(value[1u])); - buffer.Store4((offset + 32u), asuint(value[2u])); + data.Store4((offset + 0u), asuint(value[0u])); + data.Store4((offset + 16u), asuint(value[1u])); + data.Store4((offset + 32u), asuint(value[2u])); })"}, TypeCase{ty_mat4x2, R"({ - buffer.Store2((offset + 0u), asuint(value[0u])); - buffer.Store2((offset + 8u), asuint(value[1u])); - buffer.Store2((offset + 16u), asuint(value[2u])); - buffer.Store2((offset + 24u), asuint(value[3u])); + data.Store2((offset + 0u), asuint(value[0u])); + data.Store2((offset + 8u), asuint(value[1u])); + data.Store2((offset + 16u), asuint(value[2u])); + data.Store2((offset + 24u), asuint(value[3u])); })"}, TypeCase{ty_mat4x3, R"({ - buffer.Store3((offset + 0u), asuint(value[0u])); - buffer.Store3((offset + 16u), asuint(value[1u])); - buffer.Store3((offset + 32u), asuint(value[2u])); - buffer.Store3((offset + 48u), asuint(value[3u])); + data.Store3((offset + 0u), asuint(value[0u])); + data.Store3((offset + 16u), asuint(value[1u])); + data.Store3((offset + 32u), asuint(value[2u])); + data.Store3((offset + 48u), asuint(value[3u])); })"}, TypeCase{ty_mat4x4, R"({ - buffer.Store4((offset + 0u), asuint(value[0u])); - buffer.Store4((offset + 16u), asuint(value[1u])); - buffer.Store4((offset + 32u), asuint(value[2u])); - buffer.Store4((offset + 48u), asuint(value[3u])); + data.Store4((offset + 0u), asuint(value[0u])); + data.Store4((offset + 16u), asuint(value[1u])); + data.Store4((offset + 32u), asuint(value[2u])); + data.Store4((offset + 48u), asuint(value[3u])); })"}, TypeCase{ty_mat2x2, R"({ - buffer.Store >((offset + 0u), value[0u]); - buffer.Store >((offset + 4u), value[1u]); + data.Store >((offset + 0u), value[0u]); + data.Store >((offset + 4u), value[1u]); })"}, TypeCase{ty_mat2x3, R"({ - buffer.Store >((offset + 0u), value[0u]); - buffer.Store >((offset + 8u), value[1u]); + data.Store >((offset + 0u), value[0u]); + data.Store >((offset + 8u), value[1u]); })"}, TypeCase{ty_mat2x4, R"({ - buffer.Store >((offset + 0u), value[0u]); - buffer.Store >((offset + 8u), value[1u]); + data.Store >((offset + 0u), value[0u]); + data.Store >((offset + 8u), value[1u]); })"}, TypeCase{ty_mat3x2, R"({ - buffer.Store >((offset + 0u), value[0u]); - buffer.Store >((offset + 4u), value[1u]); - buffer.Store >((offset + 8u), value[2u]); + data.Store >((offset + 0u), value[0u]); + data.Store >((offset + 4u), value[1u]); + data.Store >((offset + 8u), value[2u]); })"}, TypeCase{ty_mat3x3, R"({ - buffer.Store >((offset + 0u), value[0u]); - buffer.Store >((offset + 8u), value[1u]); - buffer.Store >((offset + 16u), value[2u]); + data.Store >((offset + 0u), value[0u]); + data.Store >((offset + 8u), value[1u]); + data.Store >((offset + 16u), value[2u]); })"}, TypeCase{ty_mat3x4, R"({ - buffer.Store >((offset + 0u), value[0u]); - buffer.Store >((offset + 8u), value[1u]); - buffer.Store >((offset + 16u), value[2u]); + data.Store >((offset + 0u), value[0u]); + data.Store >((offset + 8u), value[1u]); + data.Store >((offset + 16u), value[2u]); })"}, TypeCase{ty_mat4x2, R"({ - buffer.Store >((offset + 0u), value[0u]); - buffer.Store >((offset + 4u), value[1u]); - buffer.Store >((offset + 8u), value[2u]); - buffer.Store >((offset + 12u), value[3u]); + data.Store >((offset + 0u), value[0u]); + data.Store >((offset + 4u), value[1u]); + data.Store >((offset + 8u), value[2u]); + data.Store >((offset + 12u), value[3u]); })"}, TypeCase{ty_mat4x3, R"({ - buffer.Store >((offset + 0u), value[0u]); - buffer.Store >((offset + 8u), value[1u]); - buffer.Store >((offset + 16u), value[2u]); - buffer.Store >((offset + 24u), value[3u]); + data.Store >((offset + 0u), value[0u]); + data.Store >((offset + 8u), value[1u]); + data.Store >((offset + 16u), value[2u]); + data.Store >((offset + 24u), value[3u]); })"}, TypeCase{ty_mat4x4, R"({ - buffer.Store >((offset + 0u), value[0u]); - buffer.Store >((offset + 8u), value[1u]); - buffer.Store >((offset + 16u), value[2u]); - buffer.Store >((offset + 24u), value[3u]); + data.Store >((offset + 0u), value[0u]); + data.Store >((offset + 8u), value[1u]); + data.Store >((offset + 16u), value[2u]); + data.Store >((offset + 24u), value[3u]); })"})); TEST_F(HlslGeneratorImplTest_MemberAccessor, StorageBuffer_Store_Matrix_Empty) { @@ -1140,13 +1142,13 @@ TEST_F(HlslGeneratorImplTest_MemberAccessor, StorageBuffer_Store_Matrix_Empty) { auto* expected = R"(RWByteAddressBuffer data : register(u0, space1); -void tint_symbol(RWByteAddressBuffer buffer, uint offset, float2x3 value) { - buffer.Store3((offset + 0u), asuint(value[0u])); - buffer.Store3((offset + 16u), asuint(value[1u])); +void data_store(uint offset, float2x3 value) { + data.Store3((offset + 0u), asuint(value[0u])); + data.Store3((offset + 16u), asuint(value[1u])); } void main() { - tint_symbol(data, 16u, float2x3((0.0f).xxx, (0.0f).xxx)); + data_store(16u, float2x3((0.0f).xxx, (0.0f).xxx)); return; } )"; @@ -1388,13 +1390,13 @@ TEST_F(HlslGeneratorImplTest_MemberAccessor, RWByteAddressBuffer data : register(u0, space1); -Inner tint_symbol(RWByteAddressBuffer buffer, uint offset) { - const Inner tint_symbol_2 = {asint(buffer.Load((offset + 0u)))}; - return tint_symbol_2; +Inner data_load(uint offset) { + const Inner tint_symbol = {asint(data.Load((offset + 0u)))}; + return tint_symbol; } void main() { - Inner x = tint_symbol(data, 48u); + Inner x = data_load(48u); return; } )"; @@ -1440,14 +1442,14 @@ cbuffer cbuffer_data : register(b1, space1) { uint4 data[6]; }; -Inner tint_symbol(uint4 buffer[6], uint offset) { +Inner data_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - const Inner tint_symbol_2 = {asint(buffer[scalar_offset / 4][scalar_offset % 4])}; - return tint_symbol_2; + const Inner tint_symbol = {asint(data[scalar_offset / 4][scalar_offset % 4])}; + return tint_symbol; } void main() { - Inner x = tint_symbol(data, 48u); + Inner x = data_load(48u); return; } )"; diff --git a/src/tint/writer/hlsl/generator_impl_sanitizer_test.cc b/src/tint/writer/hlsl/generator_impl_sanitizer_test.cc index b7d1bb9556..e349b5c18d 100644 --- a/src/tint/writer/hlsl/generator_impl_sanitizer_test.cc +++ b/src/tint/writer/hlsl/generator_impl_sanitizer_test.cc @@ -159,10 +159,10 @@ ByteAddressBuffer b : register(t1, space2); ByteAddressBuffer c : register(t2, space2); void a_func() { - uint tint_symbol_4 = 0u; - b.GetDimensions(tint_symbol_4); - const uint tint_symbol_5 = ((tint_symbol_4 - 0u) / 4u); - uint len = (tint_symbol_5 + ((tint_symbol_1[1].w - 0u) / 4u)); + uint tint_symbol_3 = 0u; + b.GetDimensions(tint_symbol_3); + const uint tint_symbol_4 = ((tint_symbol_3 - 0u) / 4u); + uint len = (tint_symbol_4 + ((tint_symbol_1[1].w - 0u) / 4u)); return; } )"; diff --git a/test/tint/array/assign_to_function_var.wgsl.expected.dxc.hlsl b/test/tint/array/assign_to_function_var.wgsl.expected.dxc.hlsl index a697cf197e..d492bbf083 100644 --- a/test/tint/array/assign_to_function_var.wgsl.expected.dxc.hlsl +++ b/test/tint/array/assign_to_function_var.wgsl.expected.dxc.hlsl @@ -16,33 +16,33 @@ RWByteAddressBuffer src_storage : register(u1, space0); typedef int4 ret_arr_ret[4]; ret_arr_ret ret_arr() { - const int4 tint_symbol_6[4] = (int4[4])0; - return tint_symbol_6; + const int4 tint_symbol_2[4] = (int4[4])0; + return tint_symbol_2; } S ret_struct_arr() { - const S tint_symbol_7 = (S)0; - return tint_symbol_7; + const S tint_symbol_3 = (S)0; + return tint_symbol_3; } -typedef int4 tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[4], uint offset) { +typedef int4 src_uniform_load_ret[4]; +src_uniform_load_ret src_uniform_load(uint offset) { int4 arr_1[4] = (int4[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { const uint scalar_offset = ((offset + (i * 16u))) / 4; - arr_1[i] = asint(buffer[scalar_offset / 4]); + arr_1[i] = asint(src_uniform[scalar_offset / 4]); } } return arr_1; } -typedef int4 tint_symbol_4_ret[4]; -tint_symbol_4_ret tint_symbol_4(RWByteAddressBuffer buffer, uint offset) { +typedef int4 src_storage_load_ret[4]; +src_storage_load_ret src_storage_load(uint offset) { int4 arr_2[4] = (int4[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr_2[i_1] = asint(buffer.Load4((offset + (i_1 * 16u)))); + arr_2[i_1] = asint(src_storage.Load4((offset + (i_1 * 16u)))); } } return arr_2; @@ -51,8 +51,8 @@ tint_symbol_4_ret tint_symbol_4(RWByteAddressBuffer buffer, uint offset) { void foo(int4 src_param[4]) { int4 src_function[4] = (int4[4])0; int4 tint_symbol[4] = (int4[4])0; - const int4 tint_symbol_8[4] = {(1).xxxx, (2).xxxx, (3).xxxx, (3).xxxx}; - tint_symbol = tint_symbol_8; + const int4 tint_symbol_4[4] = {(1).xxxx, (2).xxxx, (3).xxxx, (3).xxxx}; + tint_symbol = tint_symbol_4; tint_symbol = src_param; tint_symbol = ret_arr(); const int4 src_let[4] = (int4[4])0; @@ -62,8 +62,8 @@ void foo(int4 src_param[4]) { tint_symbol = src_workgroup; const S tint_symbol_1 = ret_struct_arr(); tint_symbol = tint_symbol_1.arr; - tint_symbol = tint_symbol_2(src_uniform, 0u); - tint_symbol = tint_symbol_4(src_storage, 0u); + tint_symbol = src_uniform_load(0u); + tint_symbol = src_storage_load(0u); int dst_nested[4][3][2] = (int[4][3][2])0; int src_nested[4][3][2] = (int[4][3][2])0; dst_nested = src_nested; diff --git a/test/tint/array/assign_to_function_var.wgsl.expected.fxc.hlsl b/test/tint/array/assign_to_function_var.wgsl.expected.fxc.hlsl index a697cf197e..d492bbf083 100644 --- a/test/tint/array/assign_to_function_var.wgsl.expected.fxc.hlsl +++ b/test/tint/array/assign_to_function_var.wgsl.expected.fxc.hlsl @@ -16,33 +16,33 @@ RWByteAddressBuffer src_storage : register(u1, space0); typedef int4 ret_arr_ret[4]; ret_arr_ret ret_arr() { - const int4 tint_symbol_6[4] = (int4[4])0; - return tint_symbol_6; + const int4 tint_symbol_2[4] = (int4[4])0; + return tint_symbol_2; } S ret_struct_arr() { - const S tint_symbol_7 = (S)0; - return tint_symbol_7; + const S tint_symbol_3 = (S)0; + return tint_symbol_3; } -typedef int4 tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[4], uint offset) { +typedef int4 src_uniform_load_ret[4]; +src_uniform_load_ret src_uniform_load(uint offset) { int4 arr_1[4] = (int4[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { const uint scalar_offset = ((offset + (i * 16u))) / 4; - arr_1[i] = asint(buffer[scalar_offset / 4]); + arr_1[i] = asint(src_uniform[scalar_offset / 4]); } } return arr_1; } -typedef int4 tint_symbol_4_ret[4]; -tint_symbol_4_ret tint_symbol_4(RWByteAddressBuffer buffer, uint offset) { +typedef int4 src_storage_load_ret[4]; +src_storage_load_ret src_storage_load(uint offset) { int4 arr_2[4] = (int4[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr_2[i_1] = asint(buffer.Load4((offset + (i_1 * 16u)))); + arr_2[i_1] = asint(src_storage.Load4((offset + (i_1 * 16u)))); } } return arr_2; @@ -51,8 +51,8 @@ tint_symbol_4_ret tint_symbol_4(RWByteAddressBuffer buffer, uint offset) { void foo(int4 src_param[4]) { int4 src_function[4] = (int4[4])0; int4 tint_symbol[4] = (int4[4])0; - const int4 tint_symbol_8[4] = {(1).xxxx, (2).xxxx, (3).xxxx, (3).xxxx}; - tint_symbol = tint_symbol_8; + const int4 tint_symbol_4[4] = {(1).xxxx, (2).xxxx, (3).xxxx, (3).xxxx}; + tint_symbol = tint_symbol_4; tint_symbol = src_param; tint_symbol = ret_arr(); const int4 src_let[4] = (int4[4])0; @@ -62,8 +62,8 @@ void foo(int4 src_param[4]) { tint_symbol = src_workgroup; const S tint_symbol_1 = ret_struct_arr(); tint_symbol = tint_symbol_1.arr; - tint_symbol = tint_symbol_2(src_uniform, 0u); - tint_symbol = tint_symbol_4(src_storage, 0u); + tint_symbol = src_uniform_load(0u); + tint_symbol = src_storage_load(0u); int dst_nested[4][3][2] = (int[4][3][2])0; int src_nested[4][3][2] = (int[4][3][2])0; dst_nested = src_nested; diff --git a/test/tint/array/assign_to_private_var.wgsl.expected.dxc.hlsl b/test/tint/array/assign_to_private_var.wgsl.expected.dxc.hlsl index d22b14e24a..6cf00a3e52 100644 --- a/test/tint/array/assign_to_private_var.wgsl.expected.dxc.hlsl +++ b/test/tint/array/assign_to_private_var.wgsl.expected.dxc.hlsl @@ -18,33 +18,33 @@ static int dst_nested[4][3][2] = (int[4][3][2])0; typedef int4 ret_arr_ret[4]; ret_arr_ret ret_arr() { - const int4 tint_symbol_6[4] = (int4[4])0; - return tint_symbol_6; + const int4 tint_symbol_2[4] = (int4[4])0; + return tint_symbol_2; } S ret_struct_arr() { - const S tint_symbol_7 = (S)0; - return tint_symbol_7; + const S tint_symbol_3 = (S)0; + return tint_symbol_3; } -typedef int4 tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[4], uint offset) { +typedef int4 src_uniform_load_ret[4]; +src_uniform_load_ret src_uniform_load(uint offset) { int4 arr_1[4] = (int4[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { const uint scalar_offset = ((offset + (i * 16u))) / 4; - arr_1[i] = asint(buffer[scalar_offset / 4]); + arr_1[i] = asint(src_uniform[scalar_offset / 4]); } } return arr_1; } -typedef int4 tint_symbol_4_ret[4]; -tint_symbol_4_ret tint_symbol_4(RWByteAddressBuffer buffer, uint offset) { +typedef int4 src_storage_load_ret[4]; +src_storage_load_ret src_storage_load(uint offset) { int4 arr_2[4] = (int4[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr_2[i_1] = asint(buffer.Load4((offset + (i_1 * 16u)))); + arr_2[i_1] = asint(src_storage.Load4((offset + (i_1 * 16u)))); } } return arr_2; @@ -52,8 +52,8 @@ tint_symbol_4_ret tint_symbol_4(RWByteAddressBuffer buffer, uint offset) { void foo(int4 src_param[4]) { int4 src_function[4] = (int4[4])0; - const int4 tint_symbol_8[4] = {(1).xxxx, (2).xxxx, (3).xxxx, (3).xxxx}; - tint_symbol = tint_symbol_8; + const int4 tint_symbol_4[4] = {(1).xxxx, (2).xxxx, (3).xxxx, (3).xxxx}; + tint_symbol = tint_symbol_4; tint_symbol = src_param; tint_symbol = ret_arr(); const int4 src_let[4] = (int4[4])0; @@ -63,8 +63,8 @@ void foo(int4 src_param[4]) { tint_symbol = src_workgroup; const S tint_symbol_1 = ret_struct_arr(); tint_symbol = tint_symbol_1.arr; - tint_symbol = tint_symbol_2(src_uniform, 0u); - tint_symbol = tint_symbol_4(src_storage, 0u); + tint_symbol = src_uniform_load(0u); + tint_symbol = src_storage_load(0u); int src_nested[4][3][2] = (int[4][3][2])0; dst_nested = src_nested; } diff --git a/test/tint/array/assign_to_private_var.wgsl.expected.fxc.hlsl b/test/tint/array/assign_to_private_var.wgsl.expected.fxc.hlsl index d22b14e24a..6cf00a3e52 100644 --- a/test/tint/array/assign_to_private_var.wgsl.expected.fxc.hlsl +++ b/test/tint/array/assign_to_private_var.wgsl.expected.fxc.hlsl @@ -18,33 +18,33 @@ static int dst_nested[4][3][2] = (int[4][3][2])0; typedef int4 ret_arr_ret[4]; ret_arr_ret ret_arr() { - const int4 tint_symbol_6[4] = (int4[4])0; - return tint_symbol_6; + const int4 tint_symbol_2[4] = (int4[4])0; + return tint_symbol_2; } S ret_struct_arr() { - const S tint_symbol_7 = (S)0; - return tint_symbol_7; + const S tint_symbol_3 = (S)0; + return tint_symbol_3; } -typedef int4 tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[4], uint offset) { +typedef int4 src_uniform_load_ret[4]; +src_uniform_load_ret src_uniform_load(uint offset) { int4 arr_1[4] = (int4[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { const uint scalar_offset = ((offset + (i * 16u))) / 4; - arr_1[i] = asint(buffer[scalar_offset / 4]); + arr_1[i] = asint(src_uniform[scalar_offset / 4]); } } return arr_1; } -typedef int4 tint_symbol_4_ret[4]; -tint_symbol_4_ret tint_symbol_4(RWByteAddressBuffer buffer, uint offset) { +typedef int4 src_storage_load_ret[4]; +src_storage_load_ret src_storage_load(uint offset) { int4 arr_2[4] = (int4[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr_2[i_1] = asint(buffer.Load4((offset + (i_1 * 16u)))); + arr_2[i_1] = asint(src_storage.Load4((offset + (i_1 * 16u)))); } } return arr_2; @@ -52,8 +52,8 @@ tint_symbol_4_ret tint_symbol_4(RWByteAddressBuffer buffer, uint offset) { void foo(int4 src_param[4]) { int4 src_function[4] = (int4[4])0; - const int4 tint_symbol_8[4] = {(1).xxxx, (2).xxxx, (3).xxxx, (3).xxxx}; - tint_symbol = tint_symbol_8; + const int4 tint_symbol_4[4] = {(1).xxxx, (2).xxxx, (3).xxxx, (3).xxxx}; + tint_symbol = tint_symbol_4; tint_symbol = src_param; tint_symbol = ret_arr(); const int4 src_let[4] = (int4[4])0; @@ -63,8 +63,8 @@ void foo(int4 src_param[4]) { tint_symbol = src_workgroup; const S tint_symbol_1 = ret_struct_arr(); tint_symbol = tint_symbol_1.arr; - tint_symbol = tint_symbol_2(src_uniform, 0u); - tint_symbol = tint_symbol_4(src_storage, 0u); + tint_symbol = src_uniform_load(0u); + tint_symbol = src_storage_load(0u); int src_nested[4][3][2] = (int[4][3][2])0; dst_nested = src_nested; } diff --git a/test/tint/array/assign_to_storage_var.wgsl.expected.dxc.hlsl b/test/tint/array/assign_to_storage_var.wgsl.expected.dxc.hlsl index 2ce38dc55b..2603bf4e1f 100644 --- a/test/tint/array/assign_to_storage_var.wgsl.expected.dxc.hlsl +++ b/test/tint/array/assign_to_storage_var.wgsl.expected.dxc.hlsl @@ -18,90 +18,90 @@ RWByteAddressBuffer dst_nested : register(u3, space0); typedef int4 ret_arr_ret[4]; ret_arr_ret ret_arr() { - const int4 tint_symbol_13[4] = (int4[4])0; - return tint_symbol_13; + const int4 tint_symbol_3[4] = (int4[4])0; + return tint_symbol_3; } S ret_struct_arr() { - const S tint_symbol_14 = (S)0; - return tint_symbol_14; + const S tint_symbol_4 = (S)0; + return tint_symbol_4; } -void tint_symbol_3(RWByteAddressBuffer buffer, uint offset, int4 value[4]) { +void tint_symbol_store(uint offset, int4 value[4]) { int4 array_1[4] = value; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - buffer.Store4((offset + (i * 16u)), asuint(array_1[i])); + tint_symbol.Store4((offset + (i * 16u)), asuint(array_1[i])); } } } -typedef int4 tint_symbol_5_ret[4]; -tint_symbol_5_ret tint_symbol_5(uint4 buffer[4], uint offset) { +typedef int4 src_uniform_load_ret[4]; +src_uniform_load_ret src_uniform_load(uint offset) { int4 arr_1[4] = (int4[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { const uint scalar_offset = ((offset + (i_1 * 16u))) / 4; - arr_1[i_1] = asint(buffer[scalar_offset / 4]); + arr_1[i_1] = asint(src_uniform[scalar_offset / 4]); } } return arr_1; } -typedef int4 tint_symbol_7_ret[4]; -tint_symbol_7_ret tint_symbol_7(RWByteAddressBuffer buffer, uint offset) { +typedef int4 src_storage_load_ret[4]; +src_storage_load_ret src_storage_load(uint offset) { int4 arr_2[4] = (int4[4])0; { for(uint i_2 = 0u; (i_2 < 4u); i_2 = (i_2 + 1u)) { - arr_2[i_2] = asint(buffer.Load4((offset + (i_2 * 16u)))); + arr_2[i_2] = asint(src_storage.Load4((offset + (i_2 * 16u)))); } } return arr_2; } -void tint_symbol_11(RWByteAddressBuffer buffer, uint offset, int value[2]) { +void dst_nested_store_2(uint offset, int value[2]) { int array_4[2] = value; { for(uint i_3 = 0u; (i_3 < 2u); i_3 = (i_3 + 1u)) { - buffer.Store((offset + (i_3 * 4u)), asuint(array_4[i_3])); + dst_nested.Store((offset + (i_3 * 4u)), asuint(array_4[i_3])); } } } -void tint_symbol_10(RWByteAddressBuffer buffer, uint offset, int value[3][2]) { +void dst_nested_store_1(uint offset, int value[3][2]) { int array_3[3][2] = value; { for(uint i_4 = 0u; (i_4 < 3u); i_4 = (i_4 + 1u)) { - tint_symbol_11(buffer, (offset + (i_4 * 8u)), array_3[i_4]); + dst_nested_store_2((offset + (i_4 * 8u)), array_3[i_4]); } } } -void tint_symbol_9(RWByteAddressBuffer buffer, uint offset, int value[4][3][2]) { +void dst_nested_store(uint offset, int value[4][3][2]) { int array_2[4][3][2] = value; { for(uint i_5 = 0u; (i_5 < 4u); i_5 = (i_5 + 1u)) { - tint_symbol_10(buffer, (offset + (i_5 * 24u)), array_2[i_5]); + dst_nested_store_1((offset + (i_5 * 24u)), array_2[i_5]); } } } void foo(int4 src_param[4]) { int4 src_function[4] = (int4[4])0; - const int4 tint_symbol_15[4] = {(1).xxxx, (2).xxxx, (3).xxxx, (3).xxxx}; - tint_symbol_3(tint_symbol, 0u, tint_symbol_15); - tint_symbol_3(tint_symbol, 0u, src_param); + const int4 tint_symbol_5[4] = {(1).xxxx, (2).xxxx, (3).xxxx, (3).xxxx}; + tint_symbol_store(0u, tint_symbol_5); + tint_symbol_store(0u, src_param); const int4 tint_symbol_1[4] = ret_arr(); - tint_symbol_3(tint_symbol, 0u, tint_symbol_1); + tint_symbol_store(0u, tint_symbol_1); const int4 src_let[4] = (int4[4])0; - tint_symbol_3(tint_symbol, 0u, src_let); - tint_symbol_3(tint_symbol, 0u, src_function); - tint_symbol_3(tint_symbol, 0u, src_private); - tint_symbol_3(tint_symbol, 0u, src_workgroup); + tint_symbol_store(0u, src_let); + tint_symbol_store(0u, src_function); + tint_symbol_store(0u, src_private); + tint_symbol_store(0u, src_workgroup); const S tint_symbol_2 = ret_struct_arr(); - tint_symbol_3(tint_symbol, 0u, tint_symbol_2.arr); - tint_symbol_3(tint_symbol, 0u, tint_symbol_5(src_uniform, 0u)); - tint_symbol_3(tint_symbol, 0u, tint_symbol_7(src_storage, 0u)); + tint_symbol_store(0u, tint_symbol_2.arr); + tint_symbol_store(0u, src_uniform_load(0u)); + tint_symbol_store(0u, src_storage_load(0u)); int src_nested[4][3][2] = (int[4][3][2])0; - tint_symbol_9(dst_nested, 0u, src_nested); + dst_nested_store(0u, src_nested); } diff --git a/test/tint/array/assign_to_storage_var.wgsl.expected.fxc.hlsl b/test/tint/array/assign_to_storage_var.wgsl.expected.fxc.hlsl index 2ce38dc55b..2603bf4e1f 100644 --- a/test/tint/array/assign_to_storage_var.wgsl.expected.fxc.hlsl +++ b/test/tint/array/assign_to_storage_var.wgsl.expected.fxc.hlsl @@ -18,90 +18,90 @@ RWByteAddressBuffer dst_nested : register(u3, space0); typedef int4 ret_arr_ret[4]; ret_arr_ret ret_arr() { - const int4 tint_symbol_13[4] = (int4[4])0; - return tint_symbol_13; + const int4 tint_symbol_3[4] = (int4[4])0; + return tint_symbol_3; } S ret_struct_arr() { - const S tint_symbol_14 = (S)0; - return tint_symbol_14; + const S tint_symbol_4 = (S)0; + return tint_symbol_4; } -void tint_symbol_3(RWByteAddressBuffer buffer, uint offset, int4 value[4]) { +void tint_symbol_store(uint offset, int4 value[4]) { int4 array_1[4] = value; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - buffer.Store4((offset + (i * 16u)), asuint(array_1[i])); + tint_symbol.Store4((offset + (i * 16u)), asuint(array_1[i])); } } } -typedef int4 tint_symbol_5_ret[4]; -tint_symbol_5_ret tint_symbol_5(uint4 buffer[4], uint offset) { +typedef int4 src_uniform_load_ret[4]; +src_uniform_load_ret src_uniform_load(uint offset) { int4 arr_1[4] = (int4[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { const uint scalar_offset = ((offset + (i_1 * 16u))) / 4; - arr_1[i_1] = asint(buffer[scalar_offset / 4]); + arr_1[i_1] = asint(src_uniform[scalar_offset / 4]); } } return arr_1; } -typedef int4 tint_symbol_7_ret[4]; -tint_symbol_7_ret tint_symbol_7(RWByteAddressBuffer buffer, uint offset) { +typedef int4 src_storage_load_ret[4]; +src_storage_load_ret src_storage_load(uint offset) { int4 arr_2[4] = (int4[4])0; { for(uint i_2 = 0u; (i_2 < 4u); i_2 = (i_2 + 1u)) { - arr_2[i_2] = asint(buffer.Load4((offset + (i_2 * 16u)))); + arr_2[i_2] = asint(src_storage.Load4((offset + (i_2 * 16u)))); } } return arr_2; } -void tint_symbol_11(RWByteAddressBuffer buffer, uint offset, int value[2]) { +void dst_nested_store_2(uint offset, int value[2]) { int array_4[2] = value; { for(uint i_3 = 0u; (i_3 < 2u); i_3 = (i_3 + 1u)) { - buffer.Store((offset + (i_3 * 4u)), asuint(array_4[i_3])); + dst_nested.Store((offset + (i_3 * 4u)), asuint(array_4[i_3])); } } } -void tint_symbol_10(RWByteAddressBuffer buffer, uint offset, int value[3][2]) { +void dst_nested_store_1(uint offset, int value[3][2]) { int array_3[3][2] = value; { for(uint i_4 = 0u; (i_4 < 3u); i_4 = (i_4 + 1u)) { - tint_symbol_11(buffer, (offset + (i_4 * 8u)), array_3[i_4]); + dst_nested_store_2((offset + (i_4 * 8u)), array_3[i_4]); } } } -void tint_symbol_9(RWByteAddressBuffer buffer, uint offset, int value[4][3][2]) { +void dst_nested_store(uint offset, int value[4][3][2]) { int array_2[4][3][2] = value; { for(uint i_5 = 0u; (i_5 < 4u); i_5 = (i_5 + 1u)) { - tint_symbol_10(buffer, (offset + (i_5 * 24u)), array_2[i_5]); + dst_nested_store_1((offset + (i_5 * 24u)), array_2[i_5]); } } } void foo(int4 src_param[4]) { int4 src_function[4] = (int4[4])0; - const int4 tint_symbol_15[4] = {(1).xxxx, (2).xxxx, (3).xxxx, (3).xxxx}; - tint_symbol_3(tint_symbol, 0u, tint_symbol_15); - tint_symbol_3(tint_symbol, 0u, src_param); + const int4 tint_symbol_5[4] = {(1).xxxx, (2).xxxx, (3).xxxx, (3).xxxx}; + tint_symbol_store(0u, tint_symbol_5); + tint_symbol_store(0u, src_param); const int4 tint_symbol_1[4] = ret_arr(); - tint_symbol_3(tint_symbol, 0u, tint_symbol_1); + tint_symbol_store(0u, tint_symbol_1); const int4 src_let[4] = (int4[4])0; - tint_symbol_3(tint_symbol, 0u, src_let); - tint_symbol_3(tint_symbol, 0u, src_function); - tint_symbol_3(tint_symbol, 0u, src_private); - tint_symbol_3(tint_symbol, 0u, src_workgroup); + tint_symbol_store(0u, src_let); + tint_symbol_store(0u, src_function); + tint_symbol_store(0u, src_private); + tint_symbol_store(0u, src_workgroup); const S tint_symbol_2 = ret_struct_arr(); - tint_symbol_3(tint_symbol, 0u, tint_symbol_2.arr); - tint_symbol_3(tint_symbol, 0u, tint_symbol_5(src_uniform, 0u)); - tint_symbol_3(tint_symbol, 0u, tint_symbol_7(src_storage, 0u)); + tint_symbol_store(0u, tint_symbol_2.arr); + tint_symbol_store(0u, src_uniform_load(0u)); + tint_symbol_store(0u, src_storage_load(0u)); int src_nested[4][3][2] = (int[4][3][2])0; - tint_symbol_9(dst_nested, 0u, src_nested); + dst_nested_store(0u, src_nested); } diff --git a/test/tint/array/assign_to_workgroup_var.wgsl.expected.dxc.hlsl b/test/tint/array/assign_to_workgroup_var.wgsl.expected.dxc.hlsl index e8cffb5e26..49474fb76e 100644 --- a/test/tint/array/assign_to_workgroup_var.wgsl.expected.dxc.hlsl +++ b/test/tint/array/assign_to_workgroup_var.wgsl.expected.dxc.hlsl @@ -18,33 +18,33 @@ groupshared int dst_nested[4][3][2]; typedef int4 ret_arr_ret[4]; ret_arr_ret ret_arr() { - const int4 tint_symbol_6[4] = (int4[4])0; - return tint_symbol_6; + const int4 tint_symbol_2[4] = (int4[4])0; + return tint_symbol_2; } S ret_struct_arr() { - const S tint_symbol_7 = (S)0; - return tint_symbol_7; + const S tint_symbol_3 = (S)0; + return tint_symbol_3; } -typedef int4 tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[4], uint offset) { +typedef int4 src_uniform_load_ret[4]; +src_uniform_load_ret src_uniform_load(uint offset) { int4 arr_1[4] = (int4[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { const uint scalar_offset = ((offset + (i * 16u))) / 4; - arr_1[i] = asint(buffer[scalar_offset / 4]); + arr_1[i] = asint(src_uniform[scalar_offset / 4]); } } return arr_1; } -typedef int4 tint_symbol_4_ret[4]; -tint_symbol_4_ret tint_symbol_4(RWByteAddressBuffer buffer, uint offset) { +typedef int4 src_storage_load_ret[4]; +src_storage_load_ret src_storage_load(uint offset) { int4 arr_2[4] = (int4[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr_2[i_1] = asint(buffer.Load4((offset + (i_1 * 16u)))); + arr_2[i_1] = asint(src_storage.Load4((offset + (i_1 * 16u)))); } } return arr_2; @@ -52,8 +52,8 @@ tint_symbol_4_ret tint_symbol_4(RWByteAddressBuffer buffer, uint offset) { void foo(int4 src_param[4]) { int4 src_function[4] = (int4[4])0; - const int4 tint_symbol_8[4] = {(1).xxxx, (2).xxxx, (3).xxxx, (3).xxxx}; - tint_symbol = tint_symbol_8; + const int4 tint_symbol_4[4] = {(1).xxxx, (2).xxxx, (3).xxxx, (3).xxxx}; + tint_symbol = tint_symbol_4; tint_symbol = src_param; tint_symbol = ret_arr(); const int4 src_let[4] = (int4[4])0; @@ -63,8 +63,8 @@ void foo(int4 src_param[4]) { tint_symbol = src_workgroup; const S tint_symbol_1 = ret_struct_arr(); tint_symbol = tint_symbol_1.arr; - tint_symbol = tint_symbol_2(src_uniform, 0u); - tint_symbol = tint_symbol_4(src_storage, 0u); + tint_symbol = src_uniform_load(0u); + tint_symbol = src_storage_load(0u); int src_nested[4][3][2] = (int[4][3][2])0; dst_nested = src_nested; } diff --git a/test/tint/array/assign_to_workgroup_var.wgsl.expected.fxc.hlsl b/test/tint/array/assign_to_workgroup_var.wgsl.expected.fxc.hlsl index e8cffb5e26..49474fb76e 100644 --- a/test/tint/array/assign_to_workgroup_var.wgsl.expected.fxc.hlsl +++ b/test/tint/array/assign_to_workgroup_var.wgsl.expected.fxc.hlsl @@ -18,33 +18,33 @@ groupshared int dst_nested[4][3][2]; typedef int4 ret_arr_ret[4]; ret_arr_ret ret_arr() { - const int4 tint_symbol_6[4] = (int4[4])0; - return tint_symbol_6; + const int4 tint_symbol_2[4] = (int4[4])0; + return tint_symbol_2; } S ret_struct_arr() { - const S tint_symbol_7 = (S)0; - return tint_symbol_7; + const S tint_symbol_3 = (S)0; + return tint_symbol_3; } -typedef int4 tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[4], uint offset) { +typedef int4 src_uniform_load_ret[4]; +src_uniform_load_ret src_uniform_load(uint offset) { int4 arr_1[4] = (int4[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { const uint scalar_offset = ((offset + (i * 16u))) / 4; - arr_1[i] = asint(buffer[scalar_offset / 4]); + arr_1[i] = asint(src_uniform[scalar_offset / 4]); } } return arr_1; } -typedef int4 tint_symbol_4_ret[4]; -tint_symbol_4_ret tint_symbol_4(RWByteAddressBuffer buffer, uint offset) { +typedef int4 src_storage_load_ret[4]; +src_storage_load_ret src_storage_load(uint offset) { int4 arr_2[4] = (int4[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr_2[i_1] = asint(buffer.Load4((offset + (i_1 * 16u)))); + arr_2[i_1] = asint(src_storage.Load4((offset + (i_1 * 16u)))); } } return arr_2; @@ -52,8 +52,8 @@ tint_symbol_4_ret tint_symbol_4(RWByteAddressBuffer buffer, uint offset) { void foo(int4 src_param[4]) { int4 src_function[4] = (int4[4])0; - const int4 tint_symbol_8[4] = {(1).xxxx, (2).xxxx, (3).xxxx, (3).xxxx}; - tint_symbol = tint_symbol_8; + const int4 tint_symbol_4[4] = {(1).xxxx, (2).xxxx, (3).xxxx, (3).xxxx}; + tint_symbol = tint_symbol_4; tint_symbol = src_param; tint_symbol = ret_arr(); const int4 src_let[4] = (int4[4])0; @@ -63,8 +63,8 @@ void foo(int4 src_param[4]) { tint_symbol = src_workgroup; const S tint_symbol_1 = ret_struct_arr(); tint_symbol = tint_symbol_1.arr; - tint_symbol = tint_symbol_2(src_uniform, 0u); - tint_symbol = tint_symbol_4(src_storage, 0u); + tint_symbol = src_uniform_load(0u); + tint_symbol = src_storage_load(0u); int src_nested[4][3][2] = (int[4][3][2])0; dst_nested = src_nested; } diff --git a/test/tint/array/strides.spvasm.expected.dxc.hlsl b/test/tint/array/strides.spvasm.expected.dxc.hlsl index 72a5a23c65..e510dd6c0a 100644 --- a/test/tint/array/strides.spvasm.expected.dxc.hlsl +++ b/test/tint/array/strides.spvasm.expected.dxc.hlsl @@ -7,91 +7,91 @@ struct strided_arr_1 { RWByteAddressBuffer s : register(u0, space0); -strided_arr tint_symbol_4(RWByteAddressBuffer buffer, uint offset) { - const strided_arr tint_symbol_12 = {asfloat(buffer.Load((offset + 0u)))}; - return tint_symbol_12; +strided_arr s_load_4(uint offset) { + const strided_arr tint_symbol = {asfloat(s.Load((offset + 0u)))}; + return tint_symbol; } -typedef strided_arr tint_symbol_3_ret[2]; -tint_symbol_3_ret tint_symbol_3(RWByteAddressBuffer buffer, uint offset) { +typedef strided_arr s_load_3_ret[2]; +s_load_3_ret s_load_3(uint offset) { strided_arr arr[2] = (strided_arr[2])0; { for(uint i = 0u; (i < 2u); i = (i + 1u)) { - arr[i] = tint_symbol_4(buffer, (offset + (i * 8u))); + arr[i] = s_load_4((offset + (i * 8u))); } } return arr; } -typedef strided_arr tint_symbol_2_ret[3][2]; -tint_symbol_2_ret tint_symbol_2(RWByteAddressBuffer buffer, uint offset) { +typedef strided_arr s_load_2_ret[3][2]; +s_load_2_ret s_load_2(uint offset) { strided_arr arr_1[3][2] = (strided_arr[3][2])0; { for(uint i_1 = 0u; (i_1 < 3u); i_1 = (i_1 + 1u)) { - arr_1[i_1] = tint_symbol_3(buffer, (offset + (i_1 * 16u))); + arr_1[i_1] = s_load_3((offset + (i_1 * 16u))); } } return arr_1; } -strided_arr_1 tint_symbol_1(RWByteAddressBuffer buffer, uint offset) { - const strided_arr_1 tint_symbol_13 = {tint_symbol_2(buffer, (offset + 0u))}; - return tint_symbol_13; +strided_arr_1 s_load_1(uint offset) { + const strided_arr_1 tint_symbol_1 = {s_load_2((offset + 0u))}; + return tint_symbol_1; } -typedef strided_arr_1 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(RWByteAddressBuffer buffer, uint offset) { +typedef strided_arr_1 s_load_ret[4]; +s_load_ret s_load(uint offset) { strided_arr_1 arr_2[4] = (strided_arr_1[4])0; { for(uint i_2 = 0u; (i_2 < 4u); i_2 = (i_2 + 1u)) { - arr_2[i_2] = tint_symbol_1(buffer, (offset + (i_2 * 128u))); + arr_2[i_2] = s_load_1((offset + (i_2 * 128u))); } } return arr_2; } -void tint_symbol_10(RWByteAddressBuffer buffer, uint offset, strided_arr value) { - buffer.Store((offset + 0u), asuint(value.el)); +void s_store_4(uint offset, strided_arr value) { + s.Store((offset + 0u), asuint(value.el)); } -void tint_symbol_9(RWByteAddressBuffer buffer, uint offset, strided_arr value[2]) { +void s_store_3(uint offset, strided_arr value[2]) { strided_arr array_3[2] = value; { for(uint i_3 = 0u; (i_3 < 2u); i_3 = (i_3 + 1u)) { - tint_symbol_10(buffer, (offset + (i_3 * 8u)), array_3[i_3]); + s_store_4((offset + (i_3 * 8u)), array_3[i_3]); } } } -void tint_symbol_8(RWByteAddressBuffer buffer, uint offset, strided_arr value[3][2]) { +void s_store_2(uint offset, strided_arr value[3][2]) { strided_arr array_2[3][2] = value; { for(uint i_4 = 0u; (i_4 < 3u); i_4 = (i_4 + 1u)) { - tint_symbol_9(buffer, (offset + (i_4 * 16u)), array_2[i_4]); + s_store_3((offset + (i_4 * 16u)), array_2[i_4]); } } } -void tint_symbol_7(RWByteAddressBuffer buffer, uint offset, strided_arr_1 value) { - tint_symbol_8(buffer, (offset + 0u), value.el); +void s_store_1(uint offset, strided_arr_1 value) { + s_store_2((offset + 0u), value.el); } -void tint_symbol_6(RWByteAddressBuffer buffer, uint offset, strided_arr_1 value[4]) { +void s_store(uint offset, strided_arr_1 value[4]) { strided_arr_1 array_1[4] = value; { for(uint i_5 = 0u; (i_5 < 4u); i_5 = (i_5 + 1u)) { - tint_symbol_7(buffer, (offset + (i_5 * 128u)), array_1[i_5]); + s_store_1((offset + (i_5 * 128u)), array_1[i_5]); } } } void f_1() { - const strided_arr_1 x_19[4] = tint_symbol(s, 0u); - const strided_arr x_24[3][2] = tint_symbol_2(s, 384u); - const strided_arr x_28[2] = tint_symbol_3(s, 416u); + const strided_arr_1 x_19[4] = s_load(0u); + const strided_arr x_24[3][2] = s_load_2(384u); + const strided_arr x_28[2] = s_load_3(416u); const float x_32 = asfloat(s.Load(424u)); - const strided_arr_1 tint_symbol_14[4] = (strided_arr_1[4])0; - tint_symbol_6(s, 0u, tint_symbol_14); + const strided_arr_1 tint_symbol_2[4] = (strided_arr_1[4])0; + s_store(0u, tint_symbol_2); s.Store(424u, asuint(5.0f)); return; } diff --git a/test/tint/array/strides.spvasm.expected.fxc.hlsl b/test/tint/array/strides.spvasm.expected.fxc.hlsl index 72a5a23c65..e510dd6c0a 100644 --- a/test/tint/array/strides.spvasm.expected.fxc.hlsl +++ b/test/tint/array/strides.spvasm.expected.fxc.hlsl @@ -7,91 +7,91 @@ struct strided_arr_1 { RWByteAddressBuffer s : register(u0, space0); -strided_arr tint_symbol_4(RWByteAddressBuffer buffer, uint offset) { - const strided_arr tint_symbol_12 = {asfloat(buffer.Load((offset + 0u)))}; - return tint_symbol_12; +strided_arr s_load_4(uint offset) { + const strided_arr tint_symbol = {asfloat(s.Load((offset + 0u)))}; + return tint_symbol; } -typedef strided_arr tint_symbol_3_ret[2]; -tint_symbol_3_ret tint_symbol_3(RWByteAddressBuffer buffer, uint offset) { +typedef strided_arr s_load_3_ret[2]; +s_load_3_ret s_load_3(uint offset) { strided_arr arr[2] = (strided_arr[2])0; { for(uint i = 0u; (i < 2u); i = (i + 1u)) { - arr[i] = tint_symbol_4(buffer, (offset + (i * 8u))); + arr[i] = s_load_4((offset + (i * 8u))); } } return arr; } -typedef strided_arr tint_symbol_2_ret[3][2]; -tint_symbol_2_ret tint_symbol_2(RWByteAddressBuffer buffer, uint offset) { +typedef strided_arr s_load_2_ret[3][2]; +s_load_2_ret s_load_2(uint offset) { strided_arr arr_1[3][2] = (strided_arr[3][2])0; { for(uint i_1 = 0u; (i_1 < 3u); i_1 = (i_1 + 1u)) { - arr_1[i_1] = tint_symbol_3(buffer, (offset + (i_1 * 16u))); + arr_1[i_1] = s_load_3((offset + (i_1 * 16u))); } } return arr_1; } -strided_arr_1 tint_symbol_1(RWByteAddressBuffer buffer, uint offset) { - const strided_arr_1 tint_symbol_13 = {tint_symbol_2(buffer, (offset + 0u))}; - return tint_symbol_13; +strided_arr_1 s_load_1(uint offset) { + const strided_arr_1 tint_symbol_1 = {s_load_2((offset + 0u))}; + return tint_symbol_1; } -typedef strided_arr_1 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(RWByteAddressBuffer buffer, uint offset) { +typedef strided_arr_1 s_load_ret[4]; +s_load_ret s_load(uint offset) { strided_arr_1 arr_2[4] = (strided_arr_1[4])0; { for(uint i_2 = 0u; (i_2 < 4u); i_2 = (i_2 + 1u)) { - arr_2[i_2] = tint_symbol_1(buffer, (offset + (i_2 * 128u))); + arr_2[i_2] = s_load_1((offset + (i_2 * 128u))); } } return arr_2; } -void tint_symbol_10(RWByteAddressBuffer buffer, uint offset, strided_arr value) { - buffer.Store((offset + 0u), asuint(value.el)); +void s_store_4(uint offset, strided_arr value) { + s.Store((offset + 0u), asuint(value.el)); } -void tint_symbol_9(RWByteAddressBuffer buffer, uint offset, strided_arr value[2]) { +void s_store_3(uint offset, strided_arr value[2]) { strided_arr array_3[2] = value; { for(uint i_3 = 0u; (i_3 < 2u); i_3 = (i_3 + 1u)) { - tint_symbol_10(buffer, (offset + (i_3 * 8u)), array_3[i_3]); + s_store_4((offset + (i_3 * 8u)), array_3[i_3]); } } } -void tint_symbol_8(RWByteAddressBuffer buffer, uint offset, strided_arr value[3][2]) { +void s_store_2(uint offset, strided_arr value[3][2]) { strided_arr array_2[3][2] = value; { for(uint i_4 = 0u; (i_4 < 3u); i_4 = (i_4 + 1u)) { - tint_symbol_9(buffer, (offset + (i_4 * 16u)), array_2[i_4]); + s_store_3((offset + (i_4 * 16u)), array_2[i_4]); } } } -void tint_symbol_7(RWByteAddressBuffer buffer, uint offset, strided_arr_1 value) { - tint_symbol_8(buffer, (offset + 0u), value.el); +void s_store_1(uint offset, strided_arr_1 value) { + s_store_2((offset + 0u), value.el); } -void tint_symbol_6(RWByteAddressBuffer buffer, uint offset, strided_arr_1 value[4]) { +void s_store(uint offset, strided_arr_1 value[4]) { strided_arr_1 array_1[4] = value; { for(uint i_5 = 0u; (i_5 < 4u); i_5 = (i_5 + 1u)) { - tint_symbol_7(buffer, (offset + (i_5 * 128u)), array_1[i_5]); + s_store_1((offset + (i_5 * 128u)), array_1[i_5]); } } } void f_1() { - const strided_arr_1 x_19[4] = tint_symbol(s, 0u); - const strided_arr x_24[3][2] = tint_symbol_2(s, 384u); - const strided_arr x_28[2] = tint_symbol_3(s, 416u); + const strided_arr_1 x_19[4] = s_load(0u); + const strided_arr x_24[3][2] = s_load_2(384u); + const strided_arr x_28[2] = s_load_3(416u); const float x_32 = asfloat(s.Load(424u)); - const strided_arr_1 tint_symbol_14[4] = (strided_arr_1[4])0; - tint_symbol_6(s, 0u, tint_symbol_14); + const strided_arr_1 tint_symbol_2[4] = (strided_arr_1[4])0; + s_store(0u, tint_symbol_2); s.Store(424u, asuint(5.0f)); return; } diff --git a/test/tint/buffer/storage/dynamic_index/read.wgsl.expected.dxc.hlsl b/test/tint/buffer/storage/dynamic_index/read.wgsl.expected.dxc.hlsl index 17abe57cb9..bd6bf6213f 100644 --- a/test/tint/buffer/storage/dynamic_index/read.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/storage/dynamic_index/read.wgsl.expected.dxc.hlsl @@ -4,48 +4,48 @@ struct tint_symbol_1 { uint idx : SV_GroupIndex; }; -float2x2 tint_symbol_14(ByteAddressBuffer buffer, uint offset) { - return float2x2(asfloat(buffer.Load2((offset + 0u))), asfloat(buffer.Load2((offset + 8u)))); +float2x2 sb_load_12(uint offset) { + return float2x2(asfloat(sb.Load2((offset + 0u))), asfloat(sb.Load2((offset + 8u)))); } -float2x3 tint_symbol_15(ByteAddressBuffer buffer, uint offset) { - return float2x3(asfloat(buffer.Load3((offset + 0u))), asfloat(buffer.Load3((offset + 16u)))); +float2x3 sb_load_13(uint offset) { + return float2x3(asfloat(sb.Load3((offset + 0u))), asfloat(sb.Load3((offset + 16u)))); } -float2x4 tint_symbol_16(ByteAddressBuffer buffer, uint offset) { - return float2x4(asfloat(buffer.Load4((offset + 0u))), asfloat(buffer.Load4((offset + 16u)))); +float2x4 sb_load_14(uint offset) { + return float2x4(asfloat(sb.Load4((offset + 0u))), asfloat(sb.Load4((offset + 16u)))); } -float3x2 tint_symbol_17(ByteAddressBuffer buffer, uint offset) { - return float3x2(asfloat(buffer.Load2((offset + 0u))), asfloat(buffer.Load2((offset + 8u))), asfloat(buffer.Load2((offset + 16u)))); +float3x2 sb_load_15(uint offset) { + return float3x2(asfloat(sb.Load2((offset + 0u))), asfloat(sb.Load2((offset + 8u))), asfloat(sb.Load2((offset + 16u)))); } -float3x3 tint_symbol_18(ByteAddressBuffer buffer, uint offset) { - return float3x3(asfloat(buffer.Load3((offset + 0u))), asfloat(buffer.Load3((offset + 16u))), asfloat(buffer.Load3((offset + 32u)))); +float3x3 sb_load_16(uint offset) { + return float3x3(asfloat(sb.Load3((offset + 0u))), asfloat(sb.Load3((offset + 16u))), asfloat(sb.Load3((offset + 32u)))); } -float3x4 tint_symbol_19(ByteAddressBuffer buffer, uint offset) { - return float3x4(asfloat(buffer.Load4((offset + 0u))), asfloat(buffer.Load4((offset + 16u))), asfloat(buffer.Load4((offset + 32u)))); +float3x4 sb_load_17(uint offset) { + return float3x4(asfloat(sb.Load4((offset + 0u))), asfloat(sb.Load4((offset + 16u))), asfloat(sb.Load4((offset + 32u)))); } -float4x2 tint_symbol_20(ByteAddressBuffer buffer, uint offset) { - return float4x2(asfloat(buffer.Load2((offset + 0u))), asfloat(buffer.Load2((offset + 8u))), asfloat(buffer.Load2((offset + 16u))), asfloat(buffer.Load2((offset + 24u)))); +float4x2 sb_load_18(uint offset) { + return float4x2(asfloat(sb.Load2((offset + 0u))), asfloat(sb.Load2((offset + 8u))), asfloat(sb.Load2((offset + 16u))), asfloat(sb.Load2((offset + 24u)))); } -float4x3 tint_symbol_21(ByteAddressBuffer buffer, uint offset) { - return float4x3(asfloat(buffer.Load3((offset + 0u))), asfloat(buffer.Load3((offset + 16u))), asfloat(buffer.Load3((offset + 32u))), asfloat(buffer.Load3((offset + 48u)))); +float4x3 sb_load_19(uint offset) { + return float4x3(asfloat(sb.Load3((offset + 0u))), asfloat(sb.Load3((offset + 16u))), asfloat(sb.Load3((offset + 32u))), asfloat(sb.Load3((offset + 48u)))); } -float4x4 tint_symbol_22(ByteAddressBuffer buffer, uint offset) { - return float4x4(asfloat(buffer.Load4((offset + 0u))), asfloat(buffer.Load4((offset + 16u))), asfloat(buffer.Load4((offset + 32u))), asfloat(buffer.Load4((offset + 48u)))); +float4x4 sb_load_20(uint offset) { + return float4x4(asfloat(sb.Load4((offset + 0u))), asfloat(sb.Load4((offset + 16u))), asfloat(sb.Load4((offset + 32u))), asfloat(sb.Load4((offset + 48u)))); } -typedef float3 tint_symbol_23_ret[2]; -tint_symbol_23_ret tint_symbol_23(ByteAddressBuffer buffer, uint offset) { +typedef float3 sb_load_21_ret[2]; +sb_load_21_ret sb_load_21(uint offset) { float3 arr_1[2] = (float3[2])0; { for(uint i = 0u; (i < 2u); i = (i + 1u)) { - arr_1[i] = asfloat(buffer.Load3((offset + (i * 16u)))); + arr_1[i] = asfloat(sb.Load3((offset + (i * 16u)))); } } return arr_1; @@ -64,16 +64,16 @@ void main_inner(uint idx) { const float4 vec4_f32 = asfloat(sb.Load4(((544u * idx) + 96u))); const int4 vec4_i32 = asint(sb.Load4(((544u * idx) + 112u))); const uint4 vec4_u32 = sb.Load4(((544u * idx) + 128u)); - const float2x2 mat2x2_f32 = tint_symbol_14(sb, ((544u * idx) + 144u)); - const float2x3 mat2x3_f32 = tint_symbol_15(sb, ((544u * idx) + 160u)); - const float2x4 mat2x4_f32 = tint_symbol_16(sb, ((544u * idx) + 192u)); - const float3x2 mat3x2_f32 = tint_symbol_17(sb, ((544u * idx) + 224u)); - const float3x3 mat3x3_f32 = tint_symbol_18(sb, ((544u * idx) + 256u)); - const float3x4 mat3x4_f32 = tint_symbol_19(sb, ((544u * idx) + 304u)); - const float4x2 mat4x2_f32 = tint_symbol_20(sb, ((544u * idx) + 352u)); - const float4x3 mat4x3_f32 = tint_symbol_21(sb, ((544u * idx) + 384u)); - const float4x4 mat4x4_f32 = tint_symbol_22(sb, ((544u * idx) + 448u)); - const float3 arr2_vec3_f32[2] = tint_symbol_23(sb, ((544u * idx) + 512u)); + const float2x2 mat2x2_f32 = sb_load_12(((544u * idx) + 144u)); + const float2x3 mat2x3_f32 = sb_load_13(((544u * idx) + 160u)); + const float2x4 mat2x4_f32 = sb_load_14(((544u * idx) + 192u)); + const float3x2 mat3x2_f32 = sb_load_15(((544u * idx) + 224u)); + const float3x3 mat3x3_f32 = sb_load_16(((544u * idx) + 256u)); + const float3x4 mat3x4_f32 = sb_load_17(((544u * idx) + 304u)); + const float4x2 mat4x2_f32 = sb_load_18(((544u * idx) + 352u)); + const float4x3 mat4x3_f32 = sb_load_19(((544u * idx) + 384u)); + const float4x4 mat4x4_f32 = sb_load_20(((544u * idx) + 448u)); + const float3 arr2_vec3_f32[2] = sb_load_21(((544u * idx) + 512u)); } [numthreads(1, 1, 1)] diff --git a/test/tint/buffer/storage/dynamic_index/read.wgsl.expected.fxc.hlsl b/test/tint/buffer/storage/dynamic_index/read.wgsl.expected.fxc.hlsl index 17abe57cb9..bd6bf6213f 100644 --- a/test/tint/buffer/storage/dynamic_index/read.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/storage/dynamic_index/read.wgsl.expected.fxc.hlsl @@ -4,48 +4,48 @@ struct tint_symbol_1 { uint idx : SV_GroupIndex; }; -float2x2 tint_symbol_14(ByteAddressBuffer buffer, uint offset) { - return float2x2(asfloat(buffer.Load2((offset + 0u))), asfloat(buffer.Load2((offset + 8u)))); +float2x2 sb_load_12(uint offset) { + return float2x2(asfloat(sb.Load2((offset + 0u))), asfloat(sb.Load2((offset + 8u)))); } -float2x3 tint_symbol_15(ByteAddressBuffer buffer, uint offset) { - return float2x3(asfloat(buffer.Load3((offset + 0u))), asfloat(buffer.Load3((offset + 16u)))); +float2x3 sb_load_13(uint offset) { + return float2x3(asfloat(sb.Load3((offset + 0u))), asfloat(sb.Load3((offset + 16u)))); } -float2x4 tint_symbol_16(ByteAddressBuffer buffer, uint offset) { - return float2x4(asfloat(buffer.Load4((offset + 0u))), asfloat(buffer.Load4((offset + 16u)))); +float2x4 sb_load_14(uint offset) { + return float2x4(asfloat(sb.Load4((offset + 0u))), asfloat(sb.Load4((offset + 16u)))); } -float3x2 tint_symbol_17(ByteAddressBuffer buffer, uint offset) { - return float3x2(asfloat(buffer.Load2((offset + 0u))), asfloat(buffer.Load2((offset + 8u))), asfloat(buffer.Load2((offset + 16u)))); +float3x2 sb_load_15(uint offset) { + return float3x2(asfloat(sb.Load2((offset + 0u))), asfloat(sb.Load2((offset + 8u))), asfloat(sb.Load2((offset + 16u)))); } -float3x3 tint_symbol_18(ByteAddressBuffer buffer, uint offset) { - return float3x3(asfloat(buffer.Load3((offset + 0u))), asfloat(buffer.Load3((offset + 16u))), asfloat(buffer.Load3((offset + 32u)))); +float3x3 sb_load_16(uint offset) { + return float3x3(asfloat(sb.Load3((offset + 0u))), asfloat(sb.Load3((offset + 16u))), asfloat(sb.Load3((offset + 32u)))); } -float3x4 tint_symbol_19(ByteAddressBuffer buffer, uint offset) { - return float3x4(asfloat(buffer.Load4((offset + 0u))), asfloat(buffer.Load4((offset + 16u))), asfloat(buffer.Load4((offset + 32u)))); +float3x4 sb_load_17(uint offset) { + return float3x4(asfloat(sb.Load4((offset + 0u))), asfloat(sb.Load4((offset + 16u))), asfloat(sb.Load4((offset + 32u)))); } -float4x2 tint_symbol_20(ByteAddressBuffer buffer, uint offset) { - return float4x2(asfloat(buffer.Load2((offset + 0u))), asfloat(buffer.Load2((offset + 8u))), asfloat(buffer.Load2((offset + 16u))), asfloat(buffer.Load2((offset + 24u)))); +float4x2 sb_load_18(uint offset) { + return float4x2(asfloat(sb.Load2((offset + 0u))), asfloat(sb.Load2((offset + 8u))), asfloat(sb.Load2((offset + 16u))), asfloat(sb.Load2((offset + 24u)))); } -float4x3 tint_symbol_21(ByteAddressBuffer buffer, uint offset) { - return float4x3(asfloat(buffer.Load3((offset + 0u))), asfloat(buffer.Load3((offset + 16u))), asfloat(buffer.Load3((offset + 32u))), asfloat(buffer.Load3((offset + 48u)))); +float4x3 sb_load_19(uint offset) { + return float4x3(asfloat(sb.Load3((offset + 0u))), asfloat(sb.Load3((offset + 16u))), asfloat(sb.Load3((offset + 32u))), asfloat(sb.Load3((offset + 48u)))); } -float4x4 tint_symbol_22(ByteAddressBuffer buffer, uint offset) { - return float4x4(asfloat(buffer.Load4((offset + 0u))), asfloat(buffer.Load4((offset + 16u))), asfloat(buffer.Load4((offset + 32u))), asfloat(buffer.Load4((offset + 48u)))); +float4x4 sb_load_20(uint offset) { + return float4x4(asfloat(sb.Load4((offset + 0u))), asfloat(sb.Load4((offset + 16u))), asfloat(sb.Load4((offset + 32u))), asfloat(sb.Load4((offset + 48u)))); } -typedef float3 tint_symbol_23_ret[2]; -tint_symbol_23_ret tint_symbol_23(ByteAddressBuffer buffer, uint offset) { +typedef float3 sb_load_21_ret[2]; +sb_load_21_ret sb_load_21(uint offset) { float3 arr_1[2] = (float3[2])0; { for(uint i = 0u; (i < 2u); i = (i + 1u)) { - arr_1[i] = asfloat(buffer.Load3((offset + (i * 16u)))); + arr_1[i] = asfloat(sb.Load3((offset + (i * 16u)))); } } return arr_1; @@ -64,16 +64,16 @@ void main_inner(uint idx) { const float4 vec4_f32 = asfloat(sb.Load4(((544u * idx) + 96u))); const int4 vec4_i32 = asint(sb.Load4(((544u * idx) + 112u))); const uint4 vec4_u32 = sb.Load4(((544u * idx) + 128u)); - const float2x2 mat2x2_f32 = tint_symbol_14(sb, ((544u * idx) + 144u)); - const float2x3 mat2x3_f32 = tint_symbol_15(sb, ((544u * idx) + 160u)); - const float2x4 mat2x4_f32 = tint_symbol_16(sb, ((544u * idx) + 192u)); - const float3x2 mat3x2_f32 = tint_symbol_17(sb, ((544u * idx) + 224u)); - const float3x3 mat3x3_f32 = tint_symbol_18(sb, ((544u * idx) + 256u)); - const float3x4 mat3x4_f32 = tint_symbol_19(sb, ((544u * idx) + 304u)); - const float4x2 mat4x2_f32 = tint_symbol_20(sb, ((544u * idx) + 352u)); - const float4x3 mat4x3_f32 = tint_symbol_21(sb, ((544u * idx) + 384u)); - const float4x4 mat4x4_f32 = tint_symbol_22(sb, ((544u * idx) + 448u)); - const float3 arr2_vec3_f32[2] = tint_symbol_23(sb, ((544u * idx) + 512u)); + const float2x2 mat2x2_f32 = sb_load_12(((544u * idx) + 144u)); + const float2x3 mat2x3_f32 = sb_load_13(((544u * idx) + 160u)); + const float2x4 mat2x4_f32 = sb_load_14(((544u * idx) + 192u)); + const float3x2 mat3x2_f32 = sb_load_15(((544u * idx) + 224u)); + const float3x3 mat3x3_f32 = sb_load_16(((544u * idx) + 256u)); + const float3x4 mat3x4_f32 = sb_load_17(((544u * idx) + 304u)); + const float4x2 mat4x2_f32 = sb_load_18(((544u * idx) + 352u)); + const float4x3 mat4x3_f32 = sb_load_19(((544u * idx) + 384u)); + const float4x4 mat4x4_f32 = sb_load_20(((544u * idx) + 448u)); + const float3 arr2_vec3_f32[2] = sb_load_21(((544u * idx) + 512u)); } [numthreads(1, 1, 1)] diff --git a/test/tint/buffer/storage/dynamic_index/read_f16.wgsl.expected.dxc.hlsl b/test/tint/buffer/storage/dynamic_index/read_f16.wgsl.expected.dxc.hlsl index e14b161e52..ee12f42eef 100644 --- a/test/tint/buffer/storage/dynamic_index/read_f16.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/storage/dynamic_index/read_f16.wgsl.expected.dxc.hlsl @@ -4,95 +4,95 @@ struct tint_symbol_1 { uint idx : SV_GroupIndex; }; -float2x2 tint_symbol_18(ByteAddressBuffer buffer, uint offset) { - return float2x2(asfloat(buffer.Load2((offset + 0u))), asfloat(buffer.Load2((offset + 8u)))); +float2x2 sb_load_16(uint offset) { + return float2x2(asfloat(sb.Load2((offset + 0u))), asfloat(sb.Load2((offset + 8u)))); } -float2x3 tint_symbol_19(ByteAddressBuffer buffer, uint offset) { - return float2x3(asfloat(buffer.Load3((offset + 0u))), asfloat(buffer.Load3((offset + 16u)))); +float2x3 sb_load_17(uint offset) { + return float2x3(asfloat(sb.Load3((offset + 0u))), asfloat(sb.Load3((offset + 16u)))); } -float2x4 tint_symbol_20(ByteAddressBuffer buffer, uint offset) { - return float2x4(asfloat(buffer.Load4((offset + 0u))), asfloat(buffer.Load4((offset + 16u)))); +float2x4 sb_load_18(uint offset) { + return float2x4(asfloat(sb.Load4((offset + 0u))), asfloat(sb.Load4((offset + 16u)))); } -float3x2 tint_symbol_21(ByteAddressBuffer buffer, uint offset) { - return float3x2(asfloat(buffer.Load2((offset + 0u))), asfloat(buffer.Load2((offset + 8u))), asfloat(buffer.Load2((offset + 16u)))); +float3x2 sb_load_19(uint offset) { + return float3x2(asfloat(sb.Load2((offset + 0u))), asfloat(sb.Load2((offset + 8u))), asfloat(sb.Load2((offset + 16u)))); } -float3x3 tint_symbol_22(ByteAddressBuffer buffer, uint offset) { - return float3x3(asfloat(buffer.Load3((offset + 0u))), asfloat(buffer.Load3((offset + 16u))), asfloat(buffer.Load3((offset + 32u)))); +float3x3 sb_load_20(uint offset) { + return float3x3(asfloat(sb.Load3((offset + 0u))), asfloat(sb.Load3((offset + 16u))), asfloat(sb.Load3((offset + 32u)))); } -float3x4 tint_symbol_23(ByteAddressBuffer buffer, uint offset) { - return float3x4(asfloat(buffer.Load4((offset + 0u))), asfloat(buffer.Load4((offset + 16u))), asfloat(buffer.Load4((offset + 32u)))); +float3x4 sb_load_21(uint offset) { + return float3x4(asfloat(sb.Load4((offset + 0u))), asfloat(sb.Load4((offset + 16u))), asfloat(sb.Load4((offset + 32u)))); } -float4x2 tint_symbol_24(ByteAddressBuffer buffer, uint offset) { - return float4x2(asfloat(buffer.Load2((offset + 0u))), asfloat(buffer.Load2((offset + 8u))), asfloat(buffer.Load2((offset + 16u))), asfloat(buffer.Load2((offset + 24u)))); +float4x2 sb_load_22(uint offset) { + return float4x2(asfloat(sb.Load2((offset + 0u))), asfloat(sb.Load2((offset + 8u))), asfloat(sb.Load2((offset + 16u))), asfloat(sb.Load2((offset + 24u)))); } -float4x3 tint_symbol_25(ByteAddressBuffer buffer, uint offset) { - return float4x3(asfloat(buffer.Load3((offset + 0u))), asfloat(buffer.Load3((offset + 16u))), asfloat(buffer.Load3((offset + 32u))), asfloat(buffer.Load3((offset + 48u)))); +float4x3 sb_load_23(uint offset) { + return float4x3(asfloat(sb.Load3((offset + 0u))), asfloat(sb.Load3((offset + 16u))), asfloat(sb.Load3((offset + 32u))), asfloat(sb.Load3((offset + 48u)))); } -float4x4 tint_symbol_26(ByteAddressBuffer buffer, uint offset) { - return float4x4(asfloat(buffer.Load4((offset + 0u))), asfloat(buffer.Load4((offset + 16u))), asfloat(buffer.Load4((offset + 32u))), asfloat(buffer.Load4((offset + 48u)))); +float4x4 sb_load_24(uint offset) { + return float4x4(asfloat(sb.Load4((offset + 0u))), asfloat(sb.Load4((offset + 16u))), asfloat(sb.Load4((offset + 32u))), asfloat(sb.Load4((offset + 48u)))); } -matrix tint_symbol_27(ByteAddressBuffer buffer, uint offset) { - return matrix(buffer.Load >((offset + 0u)), buffer.Load >((offset + 4u))); +matrix sb_load_25(uint offset) { + return matrix(sb.Load >((offset + 0u)), sb.Load >((offset + 4u))); } -matrix tint_symbol_28(ByteAddressBuffer buffer, uint offset) { - return matrix(buffer.Load >((offset + 0u)), buffer.Load >((offset + 8u))); +matrix sb_load_26(uint offset) { + return matrix(sb.Load >((offset + 0u)), sb.Load >((offset + 8u))); } -matrix tint_symbol_29(ByteAddressBuffer buffer, uint offset) { - return matrix(buffer.Load >((offset + 0u)), buffer.Load >((offset + 8u))); +matrix sb_load_27(uint offset) { + return matrix(sb.Load >((offset + 0u)), sb.Load >((offset + 8u))); } -matrix tint_symbol_30(ByteAddressBuffer buffer, uint offset) { - return matrix(buffer.Load >((offset + 0u)), buffer.Load >((offset + 4u)), buffer.Load >((offset + 8u))); +matrix sb_load_28(uint offset) { + return matrix(sb.Load >((offset + 0u)), sb.Load >((offset + 4u)), sb.Load >((offset + 8u))); } -matrix tint_symbol_31(ByteAddressBuffer buffer, uint offset) { - return matrix(buffer.Load >((offset + 0u)), buffer.Load >((offset + 8u)), buffer.Load >((offset + 16u))); +matrix sb_load_29(uint offset) { + return matrix(sb.Load >((offset + 0u)), sb.Load >((offset + 8u)), sb.Load >((offset + 16u))); } -matrix tint_symbol_32(ByteAddressBuffer buffer, uint offset) { - return matrix(buffer.Load >((offset + 0u)), buffer.Load >((offset + 8u)), buffer.Load >((offset + 16u))); +matrix sb_load_30(uint offset) { + return matrix(sb.Load >((offset + 0u)), sb.Load >((offset + 8u)), sb.Load >((offset + 16u))); } -matrix tint_symbol_33(ByteAddressBuffer buffer, uint offset) { - return matrix(buffer.Load >((offset + 0u)), buffer.Load >((offset + 4u)), buffer.Load >((offset + 8u)), buffer.Load >((offset + 12u))); +matrix sb_load_31(uint offset) { + return matrix(sb.Load >((offset + 0u)), sb.Load >((offset + 4u)), sb.Load >((offset + 8u)), sb.Load >((offset + 12u))); } -matrix tint_symbol_34(ByteAddressBuffer buffer, uint offset) { - return matrix(buffer.Load >((offset + 0u)), buffer.Load >((offset + 8u)), buffer.Load >((offset + 16u)), buffer.Load >((offset + 24u))); +matrix sb_load_32(uint offset) { + return matrix(sb.Load >((offset + 0u)), sb.Load >((offset + 8u)), sb.Load >((offset + 16u)), sb.Load >((offset + 24u))); } -matrix tint_symbol_35(ByteAddressBuffer buffer, uint offset) { - return matrix(buffer.Load >((offset + 0u)), buffer.Load >((offset + 8u)), buffer.Load >((offset + 16u)), buffer.Load >((offset + 24u))); +matrix sb_load_33(uint offset) { + return matrix(sb.Load >((offset + 0u)), sb.Load >((offset + 8u)), sb.Load >((offset + 16u)), sb.Load >((offset + 24u))); } -typedef float3 tint_symbol_36_ret[2]; -tint_symbol_36_ret tint_symbol_36(ByteAddressBuffer buffer, uint offset) { +typedef float3 sb_load_34_ret[2]; +sb_load_34_ret sb_load_34(uint offset) { float3 arr_1[2] = (float3[2])0; { for(uint i = 0u; (i < 2u); i = (i + 1u)) { - arr_1[i] = asfloat(buffer.Load3((offset + (i * 16u)))); + arr_1[i] = asfloat(sb.Load3((offset + (i * 16u)))); } } return arr_1; } -typedef matrix tint_symbol_37_ret[2]; -tint_symbol_37_ret tint_symbol_37(ByteAddressBuffer buffer, uint offset) { +typedef matrix sb_load_35_ret[2]; +sb_load_35_ret sb_load_35(uint offset) { matrix arr_2[2] = (matrix[2])0; { for(uint i_1 = 0u; (i_1 < 2u); i_1 = (i_1 + 1u)) { - arr_2[i_1] = tint_symbol_33(buffer, (offset + (i_1 * 16u))); + arr_2[i_1] = sb_load_31((offset + (i_1 * 16u))); } } return arr_2; @@ -115,26 +115,26 @@ void main_inner(uint idx) { const int4 vec4_i32 = asint(sb.Load4(((800u * idx) + 128u))); const uint4 vec4_u32 = sb.Load4(((800u * idx) + 144u)); const vector vec4_f16 = sb.Load >(((800u * idx) + 160u)); - const float2x2 mat2x2_f32 = tint_symbol_18(sb, ((800u * idx) + 168u)); - const float2x3 mat2x3_f32 = tint_symbol_19(sb, ((800u * idx) + 192u)); - const float2x4 mat2x4_f32 = tint_symbol_20(sb, ((800u * idx) + 224u)); - const float3x2 mat3x2_f32 = tint_symbol_21(sb, ((800u * idx) + 256u)); - const float3x3 mat3x3_f32 = tint_symbol_22(sb, ((800u * idx) + 288u)); - const float3x4 mat3x4_f32 = tint_symbol_23(sb, ((800u * idx) + 336u)); - const float4x2 mat4x2_f32 = tint_symbol_24(sb, ((800u * idx) + 384u)); - const float4x3 mat4x3_f32 = tint_symbol_25(sb, ((800u * idx) + 416u)); - const float4x4 mat4x4_f32 = tint_symbol_26(sb, ((800u * idx) + 480u)); - const matrix mat2x2_f16 = tint_symbol_27(sb, ((800u * idx) + 544u)); - const matrix mat2x3_f16 = tint_symbol_28(sb, ((800u * idx) + 552u)); - const matrix mat2x4_f16 = tint_symbol_29(sb, ((800u * idx) + 568u)); - const matrix mat3x2_f16 = tint_symbol_30(sb, ((800u * idx) + 584u)); - const matrix mat3x3_f16 = tint_symbol_31(sb, ((800u * idx) + 600u)); - const matrix mat3x4_f16 = tint_symbol_32(sb, ((800u * idx) + 624u)); - const matrix mat4x2_f16 = tint_symbol_33(sb, ((800u * idx) + 648u)); - const matrix mat4x3_f16 = tint_symbol_34(sb, ((800u * idx) + 664u)); - const matrix mat4x4_f16 = tint_symbol_35(sb, ((800u * idx) + 696u)); - const float3 arr2_vec3_f32[2] = tint_symbol_36(sb, ((800u * idx) + 736u)); - const matrix arr2_mat4x2_f16[2] = tint_symbol_37(sb, ((800u * idx) + 768u)); + const float2x2 mat2x2_f32 = sb_load_16(((800u * idx) + 168u)); + const float2x3 mat2x3_f32 = sb_load_17(((800u * idx) + 192u)); + const float2x4 mat2x4_f32 = sb_load_18(((800u * idx) + 224u)); + const float3x2 mat3x2_f32 = sb_load_19(((800u * idx) + 256u)); + const float3x3 mat3x3_f32 = sb_load_20(((800u * idx) + 288u)); + const float3x4 mat3x4_f32 = sb_load_21(((800u * idx) + 336u)); + const float4x2 mat4x2_f32 = sb_load_22(((800u * idx) + 384u)); + const float4x3 mat4x3_f32 = sb_load_23(((800u * idx) + 416u)); + const float4x4 mat4x4_f32 = sb_load_24(((800u * idx) + 480u)); + const matrix mat2x2_f16 = sb_load_25(((800u * idx) + 544u)); + const matrix mat2x3_f16 = sb_load_26(((800u * idx) + 552u)); + const matrix mat2x4_f16 = sb_load_27(((800u * idx) + 568u)); + const matrix mat3x2_f16 = sb_load_28(((800u * idx) + 584u)); + const matrix mat3x3_f16 = sb_load_29(((800u * idx) + 600u)); + const matrix mat3x4_f16 = sb_load_30(((800u * idx) + 624u)); + const matrix mat4x2_f16 = sb_load_31(((800u * idx) + 648u)); + const matrix mat4x3_f16 = sb_load_32(((800u * idx) + 664u)); + const matrix mat4x4_f16 = sb_load_33(((800u * idx) + 696u)); + const float3 arr2_vec3_f32[2] = sb_load_34(((800u * idx) + 736u)); + const matrix arr2_mat4x2_f16[2] = sb_load_35(((800u * idx) + 768u)); } [numthreads(1, 1, 1)] diff --git a/test/tint/buffer/storage/dynamic_index/write.wgsl.expected.dxc.hlsl b/test/tint/buffer/storage/dynamic_index/write.wgsl.expected.dxc.hlsl index 508e26972c..b3788964f1 100644 --- a/test/tint/buffer/storage/dynamic_index/write.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/storage/dynamic_index/write.wgsl.expected.dxc.hlsl @@ -4,65 +4,65 @@ struct tint_symbol_1 { uint idx : SV_GroupIndex; }; -void tint_symbol_14(RWByteAddressBuffer buffer, uint offset, float2x2 value) { - buffer.Store2((offset + 0u), asuint(value[0u])); - buffer.Store2((offset + 8u), asuint(value[1u])); +void sb_store_12(uint offset, float2x2 value) { + sb.Store2((offset + 0u), asuint(value[0u])); + sb.Store2((offset + 8u), asuint(value[1u])); } -void tint_symbol_15(RWByteAddressBuffer buffer, uint offset, float2x3 value) { - buffer.Store3((offset + 0u), asuint(value[0u])); - buffer.Store3((offset + 16u), asuint(value[1u])); +void sb_store_13(uint offset, float2x3 value) { + sb.Store3((offset + 0u), asuint(value[0u])); + sb.Store3((offset + 16u), asuint(value[1u])); } -void tint_symbol_16(RWByteAddressBuffer buffer, uint offset, float2x4 value) { - buffer.Store4((offset + 0u), asuint(value[0u])); - buffer.Store4((offset + 16u), asuint(value[1u])); +void sb_store_14(uint offset, float2x4 value) { + sb.Store4((offset + 0u), asuint(value[0u])); + sb.Store4((offset + 16u), asuint(value[1u])); } -void tint_symbol_17(RWByteAddressBuffer buffer, uint offset, float3x2 value) { - buffer.Store2((offset + 0u), asuint(value[0u])); - buffer.Store2((offset + 8u), asuint(value[1u])); - buffer.Store2((offset + 16u), asuint(value[2u])); +void sb_store_15(uint offset, float3x2 value) { + sb.Store2((offset + 0u), asuint(value[0u])); + sb.Store2((offset + 8u), asuint(value[1u])); + sb.Store2((offset + 16u), asuint(value[2u])); } -void tint_symbol_18(RWByteAddressBuffer buffer, uint offset, float3x3 value) { - buffer.Store3((offset + 0u), asuint(value[0u])); - buffer.Store3((offset + 16u), asuint(value[1u])); - buffer.Store3((offset + 32u), asuint(value[2u])); +void sb_store_16(uint offset, float3x3 value) { + sb.Store3((offset + 0u), asuint(value[0u])); + sb.Store3((offset + 16u), asuint(value[1u])); + sb.Store3((offset + 32u), asuint(value[2u])); } -void tint_symbol_19(RWByteAddressBuffer buffer, uint offset, float3x4 value) { - buffer.Store4((offset + 0u), asuint(value[0u])); - buffer.Store4((offset + 16u), asuint(value[1u])); - buffer.Store4((offset + 32u), asuint(value[2u])); +void sb_store_17(uint offset, float3x4 value) { + sb.Store4((offset + 0u), asuint(value[0u])); + sb.Store4((offset + 16u), asuint(value[1u])); + sb.Store4((offset + 32u), asuint(value[2u])); } -void tint_symbol_20(RWByteAddressBuffer buffer, uint offset, float4x2 value) { - buffer.Store2((offset + 0u), asuint(value[0u])); - buffer.Store2((offset + 8u), asuint(value[1u])); - buffer.Store2((offset + 16u), asuint(value[2u])); - buffer.Store2((offset + 24u), asuint(value[3u])); +void sb_store_18(uint offset, float4x2 value) { + sb.Store2((offset + 0u), asuint(value[0u])); + sb.Store2((offset + 8u), asuint(value[1u])); + sb.Store2((offset + 16u), asuint(value[2u])); + sb.Store2((offset + 24u), asuint(value[3u])); } -void tint_symbol_21(RWByteAddressBuffer buffer, uint offset, float4x3 value) { - buffer.Store3((offset + 0u), asuint(value[0u])); - buffer.Store3((offset + 16u), asuint(value[1u])); - buffer.Store3((offset + 32u), asuint(value[2u])); - buffer.Store3((offset + 48u), asuint(value[3u])); +void sb_store_19(uint offset, float4x3 value) { + sb.Store3((offset + 0u), asuint(value[0u])); + sb.Store3((offset + 16u), asuint(value[1u])); + sb.Store3((offset + 32u), asuint(value[2u])); + sb.Store3((offset + 48u), asuint(value[3u])); } -void tint_symbol_22(RWByteAddressBuffer buffer, uint offset, float4x4 value) { - buffer.Store4((offset + 0u), asuint(value[0u])); - buffer.Store4((offset + 16u), asuint(value[1u])); - buffer.Store4((offset + 32u), asuint(value[2u])); - buffer.Store4((offset + 48u), asuint(value[3u])); +void sb_store_20(uint offset, float4x4 value) { + sb.Store4((offset + 0u), asuint(value[0u])); + sb.Store4((offset + 16u), asuint(value[1u])); + sb.Store4((offset + 32u), asuint(value[2u])); + sb.Store4((offset + 48u), asuint(value[3u])); } -void tint_symbol_23(RWByteAddressBuffer buffer, uint offset, float3 value[2]) { +void sb_store_21(uint offset, float3 value[2]) { float3 array_1[2] = value; { for(uint i = 0u; (i < 2u); i = (i + 1u)) { - buffer.Store3((offset + (i * 16u)), asuint(array_1[i])); + sb.Store3((offset + (i * 16u)), asuint(array_1[i])); } } } @@ -80,17 +80,17 @@ void main_inner(uint idx) { sb.Store4(((544u * idx) + 96u), asuint((0.0f).xxxx)); sb.Store4(((544u * idx) + 112u), asuint((0).xxxx)); sb.Store4(((544u * idx) + 128u), asuint((0u).xxxx)); - tint_symbol_14(sb, ((544u * idx) + 144u), float2x2((0.0f).xx, (0.0f).xx)); - tint_symbol_15(sb, ((544u * idx) + 160u), float2x3((0.0f).xxx, (0.0f).xxx)); - tint_symbol_16(sb, ((544u * idx) + 192u), float2x4((0.0f).xxxx, (0.0f).xxxx)); - tint_symbol_17(sb, ((544u * idx) + 224u), float3x2((0.0f).xx, (0.0f).xx, (0.0f).xx)); - tint_symbol_18(sb, ((544u * idx) + 256u), float3x3((0.0f).xxx, (0.0f).xxx, (0.0f).xxx)); - tint_symbol_19(sb, ((544u * idx) + 304u), float3x4((0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx)); - tint_symbol_20(sb, ((544u * idx) + 352u), float4x2((0.0f).xx, (0.0f).xx, (0.0f).xx, (0.0f).xx)); - tint_symbol_21(sb, ((544u * idx) + 384u), float4x3((0.0f).xxx, (0.0f).xxx, (0.0f).xxx, (0.0f).xxx)); - tint_symbol_22(sb, ((544u * idx) + 448u), float4x4((0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx)); - const float3 tint_symbol_24[2] = (float3[2])0; - tint_symbol_23(sb, ((544u * idx) + 512u), tint_symbol_24); + sb_store_12(((544u * idx) + 144u), float2x2((0.0f).xx, (0.0f).xx)); + sb_store_13(((544u * idx) + 160u), float2x3((0.0f).xxx, (0.0f).xxx)); + sb_store_14(((544u * idx) + 192u), float2x4((0.0f).xxxx, (0.0f).xxxx)); + sb_store_15(((544u * idx) + 224u), float3x2((0.0f).xx, (0.0f).xx, (0.0f).xx)); + sb_store_16(((544u * idx) + 256u), float3x3((0.0f).xxx, (0.0f).xxx, (0.0f).xxx)); + sb_store_17(((544u * idx) + 304u), float3x4((0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx)); + sb_store_18(((544u * idx) + 352u), float4x2((0.0f).xx, (0.0f).xx, (0.0f).xx, (0.0f).xx)); + sb_store_19(((544u * idx) + 384u), float4x3((0.0f).xxx, (0.0f).xxx, (0.0f).xxx, (0.0f).xxx)); + sb_store_20(((544u * idx) + 448u), float4x4((0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx)); + const float3 tint_symbol_2[2] = (float3[2])0; + sb_store_21(((544u * idx) + 512u), tint_symbol_2); } [numthreads(1, 1, 1)] diff --git a/test/tint/buffer/storage/dynamic_index/write.wgsl.expected.fxc.hlsl b/test/tint/buffer/storage/dynamic_index/write.wgsl.expected.fxc.hlsl index 508e26972c..b3788964f1 100644 --- a/test/tint/buffer/storage/dynamic_index/write.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/storage/dynamic_index/write.wgsl.expected.fxc.hlsl @@ -4,65 +4,65 @@ struct tint_symbol_1 { uint idx : SV_GroupIndex; }; -void tint_symbol_14(RWByteAddressBuffer buffer, uint offset, float2x2 value) { - buffer.Store2((offset + 0u), asuint(value[0u])); - buffer.Store2((offset + 8u), asuint(value[1u])); +void sb_store_12(uint offset, float2x2 value) { + sb.Store2((offset + 0u), asuint(value[0u])); + sb.Store2((offset + 8u), asuint(value[1u])); } -void tint_symbol_15(RWByteAddressBuffer buffer, uint offset, float2x3 value) { - buffer.Store3((offset + 0u), asuint(value[0u])); - buffer.Store3((offset + 16u), asuint(value[1u])); +void sb_store_13(uint offset, float2x3 value) { + sb.Store3((offset + 0u), asuint(value[0u])); + sb.Store3((offset + 16u), asuint(value[1u])); } -void tint_symbol_16(RWByteAddressBuffer buffer, uint offset, float2x4 value) { - buffer.Store4((offset + 0u), asuint(value[0u])); - buffer.Store4((offset + 16u), asuint(value[1u])); +void sb_store_14(uint offset, float2x4 value) { + sb.Store4((offset + 0u), asuint(value[0u])); + sb.Store4((offset + 16u), asuint(value[1u])); } -void tint_symbol_17(RWByteAddressBuffer buffer, uint offset, float3x2 value) { - buffer.Store2((offset + 0u), asuint(value[0u])); - buffer.Store2((offset + 8u), asuint(value[1u])); - buffer.Store2((offset + 16u), asuint(value[2u])); +void sb_store_15(uint offset, float3x2 value) { + sb.Store2((offset + 0u), asuint(value[0u])); + sb.Store2((offset + 8u), asuint(value[1u])); + sb.Store2((offset + 16u), asuint(value[2u])); } -void tint_symbol_18(RWByteAddressBuffer buffer, uint offset, float3x3 value) { - buffer.Store3((offset + 0u), asuint(value[0u])); - buffer.Store3((offset + 16u), asuint(value[1u])); - buffer.Store3((offset + 32u), asuint(value[2u])); +void sb_store_16(uint offset, float3x3 value) { + sb.Store3((offset + 0u), asuint(value[0u])); + sb.Store3((offset + 16u), asuint(value[1u])); + sb.Store3((offset + 32u), asuint(value[2u])); } -void tint_symbol_19(RWByteAddressBuffer buffer, uint offset, float3x4 value) { - buffer.Store4((offset + 0u), asuint(value[0u])); - buffer.Store4((offset + 16u), asuint(value[1u])); - buffer.Store4((offset + 32u), asuint(value[2u])); +void sb_store_17(uint offset, float3x4 value) { + sb.Store4((offset + 0u), asuint(value[0u])); + sb.Store4((offset + 16u), asuint(value[1u])); + sb.Store4((offset + 32u), asuint(value[2u])); } -void tint_symbol_20(RWByteAddressBuffer buffer, uint offset, float4x2 value) { - buffer.Store2((offset + 0u), asuint(value[0u])); - buffer.Store2((offset + 8u), asuint(value[1u])); - buffer.Store2((offset + 16u), asuint(value[2u])); - buffer.Store2((offset + 24u), asuint(value[3u])); +void sb_store_18(uint offset, float4x2 value) { + sb.Store2((offset + 0u), asuint(value[0u])); + sb.Store2((offset + 8u), asuint(value[1u])); + sb.Store2((offset + 16u), asuint(value[2u])); + sb.Store2((offset + 24u), asuint(value[3u])); } -void tint_symbol_21(RWByteAddressBuffer buffer, uint offset, float4x3 value) { - buffer.Store3((offset + 0u), asuint(value[0u])); - buffer.Store3((offset + 16u), asuint(value[1u])); - buffer.Store3((offset + 32u), asuint(value[2u])); - buffer.Store3((offset + 48u), asuint(value[3u])); +void sb_store_19(uint offset, float4x3 value) { + sb.Store3((offset + 0u), asuint(value[0u])); + sb.Store3((offset + 16u), asuint(value[1u])); + sb.Store3((offset + 32u), asuint(value[2u])); + sb.Store3((offset + 48u), asuint(value[3u])); } -void tint_symbol_22(RWByteAddressBuffer buffer, uint offset, float4x4 value) { - buffer.Store4((offset + 0u), asuint(value[0u])); - buffer.Store4((offset + 16u), asuint(value[1u])); - buffer.Store4((offset + 32u), asuint(value[2u])); - buffer.Store4((offset + 48u), asuint(value[3u])); +void sb_store_20(uint offset, float4x4 value) { + sb.Store4((offset + 0u), asuint(value[0u])); + sb.Store4((offset + 16u), asuint(value[1u])); + sb.Store4((offset + 32u), asuint(value[2u])); + sb.Store4((offset + 48u), asuint(value[3u])); } -void tint_symbol_23(RWByteAddressBuffer buffer, uint offset, float3 value[2]) { +void sb_store_21(uint offset, float3 value[2]) { float3 array_1[2] = value; { for(uint i = 0u; (i < 2u); i = (i + 1u)) { - buffer.Store3((offset + (i * 16u)), asuint(array_1[i])); + sb.Store3((offset + (i * 16u)), asuint(array_1[i])); } } } @@ -80,17 +80,17 @@ void main_inner(uint idx) { sb.Store4(((544u * idx) + 96u), asuint((0.0f).xxxx)); sb.Store4(((544u * idx) + 112u), asuint((0).xxxx)); sb.Store4(((544u * idx) + 128u), asuint((0u).xxxx)); - tint_symbol_14(sb, ((544u * idx) + 144u), float2x2((0.0f).xx, (0.0f).xx)); - tint_symbol_15(sb, ((544u * idx) + 160u), float2x3((0.0f).xxx, (0.0f).xxx)); - tint_symbol_16(sb, ((544u * idx) + 192u), float2x4((0.0f).xxxx, (0.0f).xxxx)); - tint_symbol_17(sb, ((544u * idx) + 224u), float3x2((0.0f).xx, (0.0f).xx, (0.0f).xx)); - tint_symbol_18(sb, ((544u * idx) + 256u), float3x3((0.0f).xxx, (0.0f).xxx, (0.0f).xxx)); - tint_symbol_19(sb, ((544u * idx) + 304u), float3x4((0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx)); - tint_symbol_20(sb, ((544u * idx) + 352u), float4x2((0.0f).xx, (0.0f).xx, (0.0f).xx, (0.0f).xx)); - tint_symbol_21(sb, ((544u * idx) + 384u), float4x3((0.0f).xxx, (0.0f).xxx, (0.0f).xxx, (0.0f).xxx)); - tint_symbol_22(sb, ((544u * idx) + 448u), float4x4((0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx)); - const float3 tint_symbol_24[2] = (float3[2])0; - tint_symbol_23(sb, ((544u * idx) + 512u), tint_symbol_24); + sb_store_12(((544u * idx) + 144u), float2x2((0.0f).xx, (0.0f).xx)); + sb_store_13(((544u * idx) + 160u), float2x3((0.0f).xxx, (0.0f).xxx)); + sb_store_14(((544u * idx) + 192u), float2x4((0.0f).xxxx, (0.0f).xxxx)); + sb_store_15(((544u * idx) + 224u), float3x2((0.0f).xx, (0.0f).xx, (0.0f).xx)); + sb_store_16(((544u * idx) + 256u), float3x3((0.0f).xxx, (0.0f).xxx, (0.0f).xxx)); + sb_store_17(((544u * idx) + 304u), float3x4((0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx)); + sb_store_18(((544u * idx) + 352u), float4x2((0.0f).xx, (0.0f).xx, (0.0f).xx, (0.0f).xx)); + sb_store_19(((544u * idx) + 384u), float4x3((0.0f).xxx, (0.0f).xxx, (0.0f).xxx, (0.0f).xxx)); + sb_store_20(((544u * idx) + 448u), float4x4((0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx)); + const float3 tint_symbol_2[2] = (float3[2])0; + sb_store_21(((544u * idx) + 512u), tint_symbol_2); } [numthreads(1, 1, 1)] diff --git a/test/tint/buffer/storage/dynamic_index/write_f16.wgsl.expected.dxc.hlsl b/test/tint/buffer/storage/dynamic_index/write_f16.wgsl.expected.dxc.hlsl index 26888190c4..ec1c0f0a80 100644 --- a/test/tint/buffer/storage/dynamic_index/write_f16.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/storage/dynamic_index/write_f16.wgsl.expected.dxc.hlsl @@ -4,128 +4,128 @@ struct tint_symbol_1 { uint idx : SV_GroupIndex; }; -void tint_symbol_18(RWByteAddressBuffer buffer, uint offset, float2x2 value) { - buffer.Store2((offset + 0u), asuint(value[0u])); - buffer.Store2((offset + 8u), asuint(value[1u])); +void sb_store_16(uint offset, float2x2 value) { + sb.Store2((offset + 0u), asuint(value[0u])); + sb.Store2((offset + 8u), asuint(value[1u])); } -void tint_symbol_19(RWByteAddressBuffer buffer, uint offset, float2x3 value) { - buffer.Store3((offset + 0u), asuint(value[0u])); - buffer.Store3((offset + 16u), asuint(value[1u])); +void sb_store_17(uint offset, float2x3 value) { + sb.Store3((offset + 0u), asuint(value[0u])); + sb.Store3((offset + 16u), asuint(value[1u])); } -void tint_symbol_20(RWByteAddressBuffer buffer, uint offset, float2x4 value) { - buffer.Store4((offset + 0u), asuint(value[0u])); - buffer.Store4((offset + 16u), asuint(value[1u])); +void sb_store_18(uint offset, float2x4 value) { + sb.Store4((offset + 0u), asuint(value[0u])); + sb.Store4((offset + 16u), asuint(value[1u])); } -void tint_symbol_21(RWByteAddressBuffer buffer, uint offset, float3x2 value) { - buffer.Store2((offset + 0u), asuint(value[0u])); - buffer.Store2((offset + 8u), asuint(value[1u])); - buffer.Store2((offset + 16u), asuint(value[2u])); +void sb_store_19(uint offset, float3x2 value) { + sb.Store2((offset + 0u), asuint(value[0u])); + sb.Store2((offset + 8u), asuint(value[1u])); + sb.Store2((offset + 16u), asuint(value[2u])); } -void tint_symbol_22(RWByteAddressBuffer buffer, uint offset, float3x3 value) { - buffer.Store3((offset + 0u), asuint(value[0u])); - buffer.Store3((offset + 16u), asuint(value[1u])); - buffer.Store3((offset + 32u), asuint(value[2u])); +void sb_store_20(uint offset, float3x3 value) { + sb.Store3((offset + 0u), asuint(value[0u])); + sb.Store3((offset + 16u), asuint(value[1u])); + sb.Store3((offset + 32u), asuint(value[2u])); } -void tint_symbol_23(RWByteAddressBuffer buffer, uint offset, float3x4 value) { - buffer.Store4((offset + 0u), asuint(value[0u])); - buffer.Store4((offset + 16u), asuint(value[1u])); - buffer.Store4((offset + 32u), asuint(value[2u])); +void sb_store_21(uint offset, float3x4 value) { + sb.Store4((offset + 0u), asuint(value[0u])); + sb.Store4((offset + 16u), asuint(value[1u])); + sb.Store4((offset + 32u), asuint(value[2u])); } -void tint_symbol_24(RWByteAddressBuffer buffer, uint offset, float4x2 value) { - buffer.Store2((offset + 0u), asuint(value[0u])); - buffer.Store2((offset + 8u), asuint(value[1u])); - buffer.Store2((offset + 16u), asuint(value[2u])); - buffer.Store2((offset + 24u), asuint(value[3u])); +void sb_store_22(uint offset, float4x2 value) { + sb.Store2((offset + 0u), asuint(value[0u])); + sb.Store2((offset + 8u), asuint(value[1u])); + sb.Store2((offset + 16u), asuint(value[2u])); + sb.Store2((offset + 24u), asuint(value[3u])); } -void tint_symbol_25(RWByteAddressBuffer buffer, uint offset, float4x3 value) { - buffer.Store3((offset + 0u), asuint(value[0u])); - buffer.Store3((offset + 16u), asuint(value[1u])); - buffer.Store3((offset + 32u), asuint(value[2u])); - buffer.Store3((offset + 48u), asuint(value[3u])); +void sb_store_23(uint offset, float4x3 value) { + sb.Store3((offset + 0u), asuint(value[0u])); + sb.Store3((offset + 16u), asuint(value[1u])); + sb.Store3((offset + 32u), asuint(value[2u])); + sb.Store3((offset + 48u), asuint(value[3u])); } -void tint_symbol_26(RWByteAddressBuffer buffer, uint offset, float4x4 value) { - buffer.Store4((offset + 0u), asuint(value[0u])); - buffer.Store4((offset + 16u), asuint(value[1u])); - buffer.Store4((offset + 32u), asuint(value[2u])); - buffer.Store4((offset + 48u), asuint(value[3u])); +void sb_store_24(uint offset, float4x4 value) { + sb.Store4((offset + 0u), asuint(value[0u])); + sb.Store4((offset + 16u), asuint(value[1u])); + sb.Store4((offset + 32u), asuint(value[2u])); + sb.Store4((offset + 48u), asuint(value[3u])); } -void tint_symbol_27(RWByteAddressBuffer buffer, uint offset, matrix value) { - buffer.Store >((offset + 0u), value[0u]); - buffer.Store >((offset + 4u), value[1u]); +void sb_store_25(uint offset, matrix value) { + sb.Store >((offset + 0u), value[0u]); + sb.Store >((offset + 4u), value[1u]); } -void tint_symbol_28(RWByteAddressBuffer buffer, uint offset, matrix value) { - buffer.Store >((offset + 0u), value[0u]); - buffer.Store >((offset + 8u), value[1u]); +void sb_store_26(uint offset, matrix value) { + sb.Store >((offset + 0u), value[0u]); + sb.Store >((offset + 8u), value[1u]); } -void tint_symbol_29(RWByteAddressBuffer buffer, uint offset, matrix value) { - buffer.Store >((offset + 0u), value[0u]); - buffer.Store >((offset + 8u), value[1u]); +void sb_store_27(uint offset, matrix value) { + sb.Store >((offset + 0u), value[0u]); + sb.Store >((offset + 8u), value[1u]); } -void tint_symbol_30(RWByteAddressBuffer buffer, uint offset, matrix value) { - buffer.Store >((offset + 0u), value[0u]); - buffer.Store >((offset + 4u), value[1u]); - buffer.Store >((offset + 8u), value[2u]); +void sb_store_28(uint offset, matrix value) { + sb.Store >((offset + 0u), value[0u]); + sb.Store >((offset + 4u), value[1u]); + sb.Store >((offset + 8u), value[2u]); } -void tint_symbol_31(RWByteAddressBuffer buffer, uint offset, matrix value) { - buffer.Store >((offset + 0u), value[0u]); - buffer.Store >((offset + 8u), value[1u]); - buffer.Store >((offset + 16u), value[2u]); +void sb_store_29(uint offset, matrix value) { + sb.Store >((offset + 0u), value[0u]); + sb.Store >((offset + 8u), value[1u]); + sb.Store >((offset + 16u), value[2u]); } -void tint_symbol_32(RWByteAddressBuffer buffer, uint offset, matrix value) { - buffer.Store >((offset + 0u), value[0u]); - buffer.Store >((offset + 8u), value[1u]); - buffer.Store >((offset + 16u), value[2u]); +void sb_store_30(uint offset, matrix value) { + sb.Store >((offset + 0u), value[0u]); + sb.Store >((offset + 8u), value[1u]); + sb.Store >((offset + 16u), value[2u]); } -void tint_symbol_33(RWByteAddressBuffer buffer, uint offset, matrix value) { - buffer.Store >((offset + 0u), value[0u]); - buffer.Store >((offset + 4u), value[1u]); - buffer.Store >((offset + 8u), value[2u]); - buffer.Store >((offset + 12u), value[3u]); +void sb_store_31(uint offset, matrix value) { + sb.Store >((offset + 0u), value[0u]); + sb.Store >((offset + 4u), value[1u]); + sb.Store >((offset + 8u), value[2u]); + sb.Store >((offset + 12u), value[3u]); } -void tint_symbol_34(RWByteAddressBuffer buffer, uint offset, matrix value) { - buffer.Store >((offset + 0u), value[0u]); - buffer.Store >((offset + 8u), value[1u]); - buffer.Store >((offset + 16u), value[2u]); - buffer.Store >((offset + 24u), value[3u]); +void sb_store_32(uint offset, matrix value) { + sb.Store >((offset + 0u), value[0u]); + sb.Store >((offset + 8u), value[1u]); + sb.Store >((offset + 16u), value[2u]); + sb.Store >((offset + 24u), value[3u]); } -void tint_symbol_35(RWByteAddressBuffer buffer, uint offset, matrix value) { - buffer.Store >((offset + 0u), value[0u]); - buffer.Store >((offset + 8u), value[1u]); - buffer.Store >((offset + 16u), value[2u]); - buffer.Store >((offset + 24u), value[3u]); +void sb_store_33(uint offset, matrix value) { + sb.Store >((offset + 0u), value[0u]); + sb.Store >((offset + 8u), value[1u]); + sb.Store >((offset + 16u), value[2u]); + sb.Store >((offset + 24u), value[3u]); } -void tint_symbol_36(RWByteAddressBuffer buffer, uint offset, float3 value[2]) { +void sb_store_34(uint offset, float3 value[2]) { float3 array_1[2] = value; { for(uint i = 0u; (i < 2u); i = (i + 1u)) { - buffer.Store3((offset + (i * 16u)), asuint(array_1[i])); + sb.Store3((offset + (i * 16u)), asuint(array_1[i])); } } } -void tint_symbol_37(RWByteAddressBuffer buffer, uint offset, matrix value[2]) { +void sb_store_35(uint offset, matrix value[2]) { matrix array_2[2] = value; { for(uint i_1 = 0u; (i_1 < 2u); i_1 = (i_1 + 1u)) { - tint_symbol_33(buffer, (offset + (i_1 * 16u)), array_2[i_1]); + sb_store_31((offset + (i_1 * 16u)), array_2[i_1]); } } } @@ -147,28 +147,28 @@ void main_inner(uint idx) { sb.Store4(((800u * idx) + 128u), asuint((0).xxxx)); sb.Store4(((800u * idx) + 144u), asuint((0u).xxxx)); sb.Store >(((800u * idx) + 160u), (float16_t(0.0h)).xxxx); - tint_symbol_18(sb, ((800u * idx) + 168u), float2x2((0.0f).xx, (0.0f).xx)); - tint_symbol_19(sb, ((800u * idx) + 192u), float2x3((0.0f).xxx, (0.0f).xxx)); - tint_symbol_20(sb, ((800u * idx) + 224u), float2x4((0.0f).xxxx, (0.0f).xxxx)); - tint_symbol_21(sb, ((800u * idx) + 256u), float3x2((0.0f).xx, (0.0f).xx, (0.0f).xx)); - tint_symbol_22(sb, ((800u * idx) + 288u), float3x3((0.0f).xxx, (0.0f).xxx, (0.0f).xxx)); - tint_symbol_23(sb, ((800u * idx) + 336u), float3x4((0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx)); - tint_symbol_24(sb, ((800u * idx) + 384u), float4x2((0.0f).xx, (0.0f).xx, (0.0f).xx, (0.0f).xx)); - tint_symbol_25(sb, ((800u * idx) + 416u), float4x3((0.0f).xxx, (0.0f).xxx, (0.0f).xxx, (0.0f).xxx)); - tint_symbol_26(sb, ((800u * idx) + 480u), float4x4((0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx)); - tint_symbol_27(sb, ((800u * idx) + 544u), matrix((float16_t(0.0h)).xx, (float16_t(0.0h)).xx)); - tint_symbol_28(sb, ((800u * idx) + 552u), matrix((float16_t(0.0h)).xxx, (float16_t(0.0h)).xxx)); - tint_symbol_29(sb, ((800u * idx) + 568u), matrix((float16_t(0.0h)).xxxx, (float16_t(0.0h)).xxxx)); - tint_symbol_30(sb, ((800u * idx) + 584u), matrix((float16_t(0.0h)).xx, (float16_t(0.0h)).xx, (float16_t(0.0h)).xx)); - tint_symbol_31(sb, ((800u * idx) + 600u), matrix((float16_t(0.0h)).xxx, (float16_t(0.0h)).xxx, (float16_t(0.0h)).xxx)); - tint_symbol_32(sb, ((800u * idx) + 624u), matrix((float16_t(0.0h)).xxxx, (float16_t(0.0h)).xxxx, (float16_t(0.0h)).xxxx)); - tint_symbol_33(sb, ((800u * idx) + 648u), matrix((float16_t(0.0h)).xx, (float16_t(0.0h)).xx, (float16_t(0.0h)).xx, (float16_t(0.0h)).xx)); - tint_symbol_34(sb, ((800u * idx) + 664u), matrix((float16_t(0.0h)).xxx, (float16_t(0.0h)).xxx, (float16_t(0.0h)).xxx, (float16_t(0.0h)).xxx)); - tint_symbol_35(sb, ((800u * idx) + 696u), matrix((float16_t(0.0h)).xxxx, (float16_t(0.0h)).xxxx, (float16_t(0.0h)).xxxx, (float16_t(0.0h)).xxxx)); - const float3 tint_symbol_38[2] = (float3[2])0; - tint_symbol_36(sb, ((800u * idx) + 736u), tint_symbol_38); - const matrix tint_symbol_39[2] = (matrix[2])0; - tint_symbol_37(sb, ((800u * idx) + 768u), tint_symbol_39); + sb_store_16(((800u * idx) + 168u), float2x2((0.0f).xx, (0.0f).xx)); + sb_store_17(((800u * idx) + 192u), float2x3((0.0f).xxx, (0.0f).xxx)); + sb_store_18(((800u * idx) + 224u), float2x4((0.0f).xxxx, (0.0f).xxxx)); + sb_store_19(((800u * idx) + 256u), float3x2((0.0f).xx, (0.0f).xx, (0.0f).xx)); + sb_store_20(((800u * idx) + 288u), float3x3((0.0f).xxx, (0.0f).xxx, (0.0f).xxx)); + sb_store_21(((800u * idx) + 336u), float3x4((0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx)); + sb_store_22(((800u * idx) + 384u), float4x2((0.0f).xx, (0.0f).xx, (0.0f).xx, (0.0f).xx)); + sb_store_23(((800u * idx) + 416u), float4x3((0.0f).xxx, (0.0f).xxx, (0.0f).xxx, (0.0f).xxx)); + sb_store_24(((800u * idx) + 480u), float4x4((0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx)); + sb_store_25(((800u * idx) + 544u), matrix((float16_t(0.0h)).xx, (float16_t(0.0h)).xx)); + sb_store_26(((800u * idx) + 552u), matrix((float16_t(0.0h)).xxx, (float16_t(0.0h)).xxx)); + sb_store_27(((800u * idx) + 568u), matrix((float16_t(0.0h)).xxxx, (float16_t(0.0h)).xxxx)); + sb_store_28(((800u * idx) + 584u), matrix((float16_t(0.0h)).xx, (float16_t(0.0h)).xx, (float16_t(0.0h)).xx)); + sb_store_29(((800u * idx) + 600u), matrix((float16_t(0.0h)).xxx, (float16_t(0.0h)).xxx, (float16_t(0.0h)).xxx)); + sb_store_30(((800u * idx) + 624u), matrix((float16_t(0.0h)).xxxx, (float16_t(0.0h)).xxxx, (float16_t(0.0h)).xxxx)); + sb_store_31(((800u * idx) + 648u), matrix((float16_t(0.0h)).xx, (float16_t(0.0h)).xx, (float16_t(0.0h)).xx, (float16_t(0.0h)).xx)); + sb_store_32(((800u * idx) + 664u), matrix((float16_t(0.0h)).xxx, (float16_t(0.0h)).xxx, (float16_t(0.0h)).xxx, (float16_t(0.0h)).xxx)); + sb_store_33(((800u * idx) + 696u), matrix((float16_t(0.0h)).xxxx, (float16_t(0.0h)).xxxx, (float16_t(0.0h)).xxxx, (float16_t(0.0h)).xxxx)); + const float3 tint_symbol_2[2] = (float3[2])0; + sb_store_34(((800u * idx) + 736u), tint_symbol_2); + const matrix tint_symbol_3[2] = (matrix[2])0; + sb_store_35(((800u * idx) + 768u), tint_symbol_3); } [numthreads(1, 1, 1)] diff --git a/test/tint/buffer/storage/static_index/read.wgsl.expected.dxc.hlsl b/test/tint/buffer/storage/static_index/read.wgsl.expected.dxc.hlsl index 49b16b23d0..4bcc90ce15 100644 --- a/test/tint/buffer/storage/static_index/read.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/storage/static_index/read.wgsl.expected.dxc.hlsl @@ -5,64 +5,64 @@ struct Inner { ByteAddressBuffer sb : register(t0, space0); -float2x2 tint_symbol_12(ByteAddressBuffer buffer, uint offset) { - return float2x2(asfloat(buffer.Load2((offset + 0u))), asfloat(buffer.Load2((offset + 8u)))); +float2x2 sb_load_12(uint offset) { + return float2x2(asfloat(sb.Load2((offset + 0u))), asfloat(sb.Load2((offset + 8u)))); } -float2x3 tint_symbol_13(ByteAddressBuffer buffer, uint offset) { - return float2x3(asfloat(buffer.Load3((offset + 0u))), asfloat(buffer.Load3((offset + 16u)))); +float2x3 sb_load_13(uint offset) { + return float2x3(asfloat(sb.Load3((offset + 0u))), asfloat(sb.Load3((offset + 16u)))); } -float2x4 tint_symbol_14(ByteAddressBuffer buffer, uint offset) { - return float2x4(asfloat(buffer.Load4((offset + 0u))), asfloat(buffer.Load4((offset + 16u)))); +float2x4 sb_load_14(uint offset) { + return float2x4(asfloat(sb.Load4((offset + 0u))), asfloat(sb.Load4((offset + 16u)))); } -float3x2 tint_symbol_15(ByteAddressBuffer buffer, uint offset) { - return float3x2(asfloat(buffer.Load2((offset + 0u))), asfloat(buffer.Load2((offset + 8u))), asfloat(buffer.Load2((offset + 16u)))); +float3x2 sb_load_15(uint offset) { + return float3x2(asfloat(sb.Load2((offset + 0u))), asfloat(sb.Load2((offset + 8u))), asfloat(sb.Load2((offset + 16u)))); } -float3x3 tint_symbol_16(ByteAddressBuffer buffer, uint offset) { - return float3x3(asfloat(buffer.Load3((offset + 0u))), asfloat(buffer.Load3((offset + 16u))), asfloat(buffer.Load3((offset + 32u)))); +float3x3 sb_load_16(uint offset) { + return float3x3(asfloat(sb.Load3((offset + 0u))), asfloat(sb.Load3((offset + 16u))), asfloat(sb.Load3((offset + 32u)))); } -float3x4 tint_symbol_17(ByteAddressBuffer buffer, uint offset) { - return float3x4(asfloat(buffer.Load4((offset + 0u))), asfloat(buffer.Load4((offset + 16u))), asfloat(buffer.Load4((offset + 32u)))); +float3x4 sb_load_17(uint offset) { + return float3x4(asfloat(sb.Load4((offset + 0u))), asfloat(sb.Load4((offset + 16u))), asfloat(sb.Load4((offset + 32u)))); } -float4x2 tint_symbol_18(ByteAddressBuffer buffer, uint offset) { - return float4x2(asfloat(buffer.Load2((offset + 0u))), asfloat(buffer.Load2((offset + 8u))), asfloat(buffer.Load2((offset + 16u))), asfloat(buffer.Load2((offset + 24u)))); +float4x2 sb_load_18(uint offset) { + return float4x2(asfloat(sb.Load2((offset + 0u))), asfloat(sb.Load2((offset + 8u))), asfloat(sb.Load2((offset + 16u))), asfloat(sb.Load2((offset + 24u)))); } -float4x3 tint_symbol_19(ByteAddressBuffer buffer, uint offset) { - return float4x3(asfloat(buffer.Load3((offset + 0u))), asfloat(buffer.Load3((offset + 16u))), asfloat(buffer.Load3((offset + 32u))), asfloat(buffer.Load3((offset + 48u)))); +float4x3 sb_load_19(uint offset) { + return float4x3(asfloat(sb.Load3((offset + 0u))), asfloat(sb.Load3((offset + 16u))), asfloat(sb.Load3((offset + 32u))), asfloat(sb.Load3((offset + 48u)))); } -float4x4 tint_symbol_20(ByteAddressBuffer buffer, uint offset) { - return float4x4(asfloat(buffer.Load4((offset + 0u))), asfloat(buffer.Load4((offset + 16u))), asfloat(buffer.Load4((offset + 32u))), asfloat(buffer.Load4((offset + 48u)))); +float4x4 sb_load_20(uint offset) { + return float4x4(asfloat(sb.Load4((offset + 0u))), asfloat(sb.Load4((offset + 16u))), asfloat(sb.Load4((offset + 32u))), asfloat(sb.Load4((offset + 48u)))); } -typedef float3 tint_symbol_21_ret[2]; -tint_symbol_21_ret tint_symbol_21(ByteAddressBuffer buffer, uint offset) { +typedef float3 sb_load_21_ret[2]; +sb_load_21_ret sb_load_21(uint offset) { float3 arr[2] = (float3[2])0; { for(uint i = 0u; (i < 2u); i = (i + 1u)) { - arr[i] = asfloat(buffer.Load3((offset + (i * 16u)))); + arr[i] = asfloat(sb.Load3((offset + (i * 16u)))); } } return arr; } -Inner tint_symbol_22(ByteAddressBuffer buffer, uint offset) { - const Inner tint_symbol_24 = {asint(buffer.Load((offset + 0u))), asfloat(buffer.Load((offset + 4u)))}; - return tint_symbol_24; +Inner sb_load_22(uint offset) { + const Inner tint_symbol = {asint(sb.Load((offset + 0u))), asfloat(sb.Load((offset + 4u)))}; + return tint_symbol; } -typedef Inner tint_symbol_23_ret[4]; -tint_symbol_23_ret tint_symbol_23(ByteAddressBuffer buffer, uint offset) { +typedef Inner sb_load_23_ret[4]; +sb_load_23_ret sb_load_23(uint offset) { Inner arr_1[4] = (Inner[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr_1[i_1] = tint_symbol_22(buffer, (offset + (i_1 * 8u))); + arr_1[i_1] = sb_load_22((offset + (i_1 * 8u))); } } return arr_1; @@ -82,17 +82,17 @@ void main() { const float4 vec4_f32 = asfloat(sb.Load4(96u)); const int4 vec4_i32 = asint(sb.Load4(112u)); const uint4 vec4_u32 = sb.Load4(128u); - const float2x2 mat2x2_f32 = tint_symbol_12(sb, 144u); - const float2x3 mat2x3_f32 = tint_symbol_13(sb, 160u); - const float2x4 mat2x4_f32 = tint_symbol_14(sb, 192u); - const float3x2 mat3x2_f32 = tint_symbol_15(sb, 224u); - const float3x3 mat3x3_f32 = tint_symbol_16(sb, 256u); - const float3x4 mat3x4_f32 = tint_symbol_17(sb, 304u); - const float4x2 mat4x2_f32 = tint_symbol_18(sb, 352u); - const float4x3 mat4x3_f32 = tint_symbol_19(sb, 384u); - const float4x4 mat4x4_f32 = tint_symbol_20(sb, 448u); - const float3 arr2_vec3_f32[2] = tint_symbol_21(sb, 512u); - const Inner struct_inner = tint_symbol_22(sb, 544u); - const Inner array_struct_inner[4] = tint_symbol_23(sb, 552u); + const float2x2 mat2x2_f32 = sb_load_12(144u); + const float2x3 mat2x3_f32 = sb_load_13(160u); + const float2x4 mat2x4_f32 = sb_load_14(192u); + const float3x2 mat3x2_f32 = sb_load_15(224u); + const float3x3 mat3x3_f32 = sb_load_16(256u); + const float3x4 mat3x4_f32 = sb_load_17(304u); + const float4x2 mat4x2_f32 = sb_load_18(352u); + const float4x3 mat4x3_f32 = sb_load_19(384u); + const float4x4 mat4x4_f32 = sb_load_20(448u); + const float3 arr2_vec3_f32[2] = sb_load_21(512u); + const Inner struct_inner = sb_load_22(544u); + const Inner array_struct_inner[4] = sb_load_23(552u); return; } diff --git a/test/tint/buffer/storage/static_index/read.wgsl.expected.fxc.hlsl b/test/tint/buffer/storage/static_index/read.wgsl.expected.fxc.hlsl index 49b16b23d0..4bcc90ce15 100644 --- a/test/tint/buffer/storage/static_index/read.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/storage/static_index/read.wgsl.expected.fxc.hlsl @@ -5,64 +5,64 @@ struct Inner { ByteAddressBuffer sb : register(t0, space0); -float2x2 tint_symbol_12(ByteAddressBuffer buffer, uint offset) { - return float2x2(asfloat(buffer.Load2((offset + 0u))), asfloat(buffer.Load2((offset + 8u)))); +float2x2 sb_load_12(uint offset) { + return float2x2(asfloat(sb.Load2((offset + 0u))), asfloat(sb.Load2((offset + 8u)))); } -float2x3 tint_symbol_13(ByteAddressBuffer buffer, uint offset) { - return float2x3(asfloat(buffer.Load3((offset + 0u))), asfloat(buffer.Load3((offset + 16u)))); +float2x3 sb_load_13(uint offset) { + return float2x3(asfloat(sb.Load3((offset + 0u))), asfloat(sb.Load3((offset + 16u)))); } -float2x4 tint_symbol_14(ByteAddressBuffer buffer, uint offset) { - return float2x4(asfloat(buffer.Load4((offset + 0u))), asfloat(buffer.Load4((offset + 16u)))); +float2x4 sb_load_14(uint offset) { + return float2x4(asfloat(sb.Load4((offset + 0u))), asfloat(sb.Load4((offset + 16u)))); } -float3x2 tint_symbol_15(ByteAddressBuffer buffer, uint offset) { - return float3x2(asfloat(buffer.Load2((offset + 0u))), asfloat(buffer.Load2((offset + 8u))), asfloat(buffer.Load2((offset + 16u)))); +float3x2 sb_load_15(uint offset) { + return float3x2(asfloat(sb.Load2((offset + 0u))), asfloat(sb.Load2((offset + 8u))), asfloat(sb.Load2((offset + 16u)))); } -float3x3 tint_symbol_16(ByteAddressBuffer buffer, uint offset) { - return float3x3(asfloat(buffer.Load3((offset + 0u))), asfloat(buffer.Load3((offset + 16u))), asfloat(buffer.Load3((offset + 32u)))); +float3x3 sb_load_16(uint offset) { + return float3x3(asfloat(sb.Load3((offset + 0u))), asfloat(sb.Load3((offset + 16u))), asfloat(sb.Load3((offset + 32u)))); } -float3x4 tint_symbol_17(ByteAddressBuffer buffer, uint offset) { - return float3x4(asfloat(buffer.Load4((offset + 0u))), asfloat(buffer.Load4((offset + 16u))), asfloat(buffer.Load4((offset + 32u)))); +float3x4 sb_load_17(uint offset) { + return float3x4(asfloat(sb.Load4((offset + 0u))), asfloat(sb.Load4((offset + 16u))), asfloat(sb.Load4((offset + 32u)))); } -float4x2 tint_symbol_18(ByteAddressBuffer buffer, uint offset) { - return float4x2(asfloat(buffer.Load2((offset + 0u))), asfloat(buffer.Load2((offset + 8u))), asfloat(buffer.Load2((offset + 16u))), asfloat(buffer.Load2((offset + 24u)))); +float4x2 sb_load_18(uint offset) { + return float4x2(asfloat(sb.Load2((offset + 0u))), asfloat(sb.Load2((offset + 8u))), asfloat(sb.Load2((offset + 16u))), asfloat(sb.Load2((offset + 24u)))); } -float4x3 tint_symbol_19(ByteAddressBuffer buffer, uint offset) { - return float4x3(asfloat(buffer.Load3((offset + 0u))), asfloat(buffer.Load3((offset + 16u))), asfloat(buffer.Load3((offset + 32u))), asfloat(buffer.Load3((offset + 48u)))); +float4x3 sb_load_19(uint offset) { + return float4x3(asfloat(sb.Load3((offset + 0u))), asfloat(sb.Load3((offset + 16u))), asfloat(sb.Load3((offset + 32u))), asfloat(sb.Load3((offset + 48u)))); } -float4x4 tint_symbol_20(ByteAddressBuffer buffer, uint offset) { - return float4x4(asfloat(buffer.Load4((offset + 0u))), asfloat(buffer.Load4((offset + 16u))), asfloat(buffer.Load4((offset + 32u))), asfloat(buffer.Load4((offset + 48u)))); +float4x4 sb_load_20(uint offset) { + return float4x4(asfloat(sb.Load4((offset + 0u))), asfloat(sb.Load4((offset + 16u))), asfloat(sb.Load4((offset + 32u))), asfloat(sb.Load4((offset + 48u)))); } -typedef float3 tint_symbol_21_ret[2]; -tint_symbol_21_ret tint_symbol_21(ByteAddressBuffer buffer, uint offset) { +typedef float3 sb_load_21_ret[2]; +sb_load_21_ret sb_load_21(uint offset) { float3 arr[2] = (float3[2])0; { for(uint i = 0u; (i < 2u); i = (i + 1u)) { - arr[i] = asfloat(buffer.Load3((offset + (i * 16u)))); + arr[i] = asfloat(sb.Load3((offset + (i * 16u)))); } } return arr; } -Inner tint_symbol_22(ByteAddressBuffer buffer, uint offset) { - const Inner tint_symbol_24 = {asint(buffer.Load((offset + 0u))), asfloat(buffer.Load((offset + 4u)))}; - return tint_symbol_24; +Inner sb_load_22(uint offset) { + const Inner tint_symbol = {asint(sb.Load((offset + 0u))), asfloat(sb.Load((offset + 4u)))}; + return tint_symbol; } -typedef Inner tint_symbol_23_ret[4]; -tint_symbol_23_ret tint_symbol_23(ByteAddressBuffer buffer, uint offset) { +typedef Inner sb_load_23_ret[4]; +sb_load_23_ret sb_load_23(uint offset) { Inner arr_1[4] = (Inner[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr_1[i_1] = tint_symbol_22(buffer, (offset + (i_1 * 8u))); + arr_1[i_1] = sb_load_22((offset + (i_1 * 8u))); } } return arr_1; @@ -82,17 +82,17 @@ void main() { const float4 vec4_f32 = asfloat(sb.Load4(96u)); const int4 vec4_i32 = asint(sb.Load4(112u)); const uint4 vec4_u32 = sb.Load4(128u); - const float2x2 mat2x2_f32 = tint_symbol_12(sb, 144u); - const float2x3 mat2x3_f32 = tint_symbol_13(sb, 160u); - const float2x4 mat2x4_f32 = tint_symbol_14(sb, 192u); - const float3x2 mat3x2_f32 = tint_symbol_15(sb, 224u); - const float3x3 mat3x3_f32 = tint_symbol_16(sb, 256u); - const float3x4 mat3x4_f32 = tint_symbol_17(sb, 304u); - const float4x2 mat4x2_f32 = tint_symbol_18(sb, 352u); - const float4x3 mat4x3_f32 = tint_symbol_19(sb, 384u); - const float4x4 mat4x4_f32 = tint_symbol_20(sb, 448u); - const float3 arr2_vec3_f32[2] = tint_symbol_21(sb, 512u); - const Inner struct_inner = tint_symbol_22(sb, 544u); - const Inner array_struct_inner[4] = tint_symbol_23(sb, 552u); + const float2x2 mat2x2_f32 = sb_load_12(144u); + const float2x3 mat2x3_f32 = sb_load_13(160u); + const float2x4 mat2x4_f32 = sb_load_14(192u); + const float3x2 mat3x2_f32 = sb_load_15(224u); + const float3x3 mat3x3_f32 = sb_load_16(256u); + const float3x4 mat3x4_f32 = sb_load_17(304u); + const float4x2 mat4x2_f32 = sb_load_18(352u); + const float4x3 mat4x3_f32 = sb_load_19(384u); + const float4x4 mat4x4_f32 = sb_load_20(448u); + const float3 arr2_vec3_f32[2] = sb_load_21(512u); + const Inner struct_inner = sb_load_22(544u); + const Inner array_struct_inner[4] = sb_load_23(552u); return; } diff --git a/test/tint/buffer/storage/static_index/read_f16.wgsl.expected.dxc.hlsl b/test/tint/buffer/storage/static_index/read_f16.wgsl.expected.dxc.hlsl index e0be8a38f6..b5b0abf681 100644 --- a/test/tint/buffer/storage/static_index/read_f16.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/storage/static_index/read_f16.wgsl.expected.dxc.hlsl @@ -6,111 +6,111 @@ struct Inner { ByteAddressBuffer sb : register(t0, space0); -float2x2 tint_symbol_16(ByteAddressBuffer buffer, uint offset) { - return float2x2(asfloat(buffer.Load2((offset + 0u))), asfloat(buffer.Load2((offset + 8u)))); +float2x2 sb_load_16(uint offset) { + return float2x2(asfloat(sb.Load2((offset + 0u))), asfloat(sb.Load2((offset + 8u)))); } -float2x3 tint_symbol_17(ByteAddressBuffer buffer, uint offset) { - return float2x3(asfloat(buffer.Load3((offset + 0u))), asfloat(buffer.Load3((offset + 16u)))); +float2x3 sb_load_17(uint offset) { + return float2x3(asfloat(sb.Load3((offset + 0u))), asfloat(sb.Load3((offset + 16u)))); } -float2x4 tint_symbol_18(ByteAddressBuffer buffer, uint offset) { - return float2x4(asfloat(buffer.Load4((offset + 0u))), asfloat(buffer.Load4((offset + 16u)))); +float2x4 sb_load_18(uint offset) { + return float2x4(asfloat(sb.Load4((offset + 0u))), asfloat(sb.Load4((offset + 16u)))); } -float3x2 tint_symbol_19(ByteAddressBuffer buffer, uint offset) { - return float3x2(asfloat(buffer.Load2((offset + 0u))), asfloat(buffer.Load2((offset + 8u))), asfloat(buffer.Load2((offset + 16u)))); +float3x2 sb_load_19(uint offset) { + return float3x2(asfloat(sb.Load2((offset + 0u))), asfloat(sb.Load2((offset + 8u))), asfloat(sb.Load2((offset + 16u)))); } -float3x3 tint_symbol_20(ByteAddressBuffer buffer, uint offset) { - return float3x3(asfloat(buffer.Load3((offset + 0u))), asfloat(buffer.Load3((offset + 16u))), asfloat(buffer.Load3((offset + 32u)))); +float3x3 sb_load_20(uint offset) { + return float3x3(asfloat(sb.Load3((offset + 0u))), asfloat(sb.Load3((offset + 16u))), asfloat(sb.Load3((offset + 32u)))); } -float3x4 tint_symbol_21(ByteAddressBuffer buffer, uint offset) { - return float3x4(asfloat(buffer.Load4((offset + 0u))), asfloat(buffer.Load4((offset + 16u))), asfloat(buffer.Load4((offset + 32u)))); +float3x4 sb_load_21(uint offset) { + return float3x4(asfloat(sb.Load4((offset + 0u))), asfloat(sb.Load4((offset + 16u))), asfloat(sb.Load4((offset + 32u)))); } -float4x2 tint_symbol_22(ByteAddressBuffer buffer, uint offset) { - return float4x2(asfloat(buffer.Load2((offset + 0u))), asfloat(buffer.Load2((offset + 8u))), asfloat(buffer.Load2((offset + 16u))), asfloat(buffer.Load2((offset + 24u)))); +float4x2 sb_load_22(uint offset) { + return float4x2(asfloat(sb.Load2((offset + 0u))), asfloat(sb.Load2((offset + 8u))), asfloat(sb.Load2((offset + 16u))), asfloat(sb.Load2((offset + 24u)))); } -float4x3 tint_symbol_23(ByteAddressBuffer buffer, uint offset) { - return float4x3(asfloat(buffer.Load3((offset + 0u))), asfloat(buffer.Load3((offset + 16u))), asfloat(buffer.Load3((offset + 32u))), asfloat(buffer.Load3((offset + 48u)))); +float4x3 sb_load_23(uint offset) { + return float4x3(asfloat(sb.Load3((offset + 0u))), asfloat(sb.Load3((offset + 16u))), asfloat(sb.Load3((offset + 32u))), asfloat(sb.Load3((offset + 48u)))); } -float4x4 tint_symbol_24(ByteAddressBuffer buffer, uint offset) { - return float4x4(asfloat(buffer.Load4((offset + 0u))), asfloat(buffer.Load4((offset + 16u))), asfloat(buffer.Load4((offset + 32u))), asfloat(buffer.Load4((offset + 48u)))); +float4x4 sb_load_24(uint offset) { + return float4x4(asfloat(sb.Load4((offset + 0u))), asfloat(sb.Load4((offset + 16u))), asfloat(sb.Load4((offset + 32u))), asfloat(sb.Load4((offset + 48u)))); } -matrix tint_symbol_25(ByteAddressBuffer buffer, uint offset) { - return matrix(buffer.Load >((offset + 0u)), buffer.Load >((offset + 4u))); +matrix sb_load_25(uint offset) { + return matrix(sb.Load >((offset + 0u)), sb.Load >((offset + 4u))); } -matrix tint_symbol_26(ByteAddressBuffer buffer, uint offset) { - return matrix(buffer.Load >((offset + 0u)), buffer.Load >((offset + 8u))); +matrix sb_load_26(uint offset) { + return matrix(sb.Load >((offset + 0u)), sb.Load >((offset + 8u))); } -matrix tint_symbol_27(ByteAddressBuffer buffer, uint offset) { - return matrix(buffer.Load >((offset + 0u)), buffer.Load >((offset + 8u))); +matrix sb_load_27(uint offset) { + return matrix(sb.Load >((offset + 0u)), sb.Load >((offset + 8u))); } -matrix tint_symbol_28(ByteAddressBuffer buffer, uint offset) { - return matrix(buffer.Load >((offset + 0u)), buffer.Load >((offset + 4u)), buffer.Load >((offset + 8u))); +matrix sb_load_28(uint offset) { + return matrix(sb.Load >((offset + 0u)), sb.Load >((offset + 4u)), sb.Load >((offset + 8u))); } -matrix tint_symbol_29(ByteAddressBuffer buffer, uint offset) { - return matrix(buffer.Load >((offset + 0u)), buffer.Load >((offset + 8u)), buffer.Load >((offset + 16u))); +matrix sb_load_29(uint offset) { + return matrix(sb.Load >((offset + 0u)), sb.Load >((offset + 8u)), sb.Load >((offset + 16u))); } -matrix tint_symbol_30(ByteAddressBuffer buffer, uint offset) { - return matrix(buffer.Load >((offset + 0u)), buffer.Load >((offset + 8u)), buffer.Load >((offset + 16u))); +matrix sb_load_30(uint offset) { + return matrix(sb.Load >((offset + 0u)), sb.Load >((offset + 8u)), sb.Load >((offset + 16u))); } -matrix tint_symbol_31(ByteAddressBuffer buffer, uint offset) { - return matrix(buffer.Load >((offset + 0u)), buffer.Load >((offset + 4u)), buffer.Load >((offset + 8u)), buffer.Load >((offset + 12u))); +matrix sb_load_31(uint offset) { + return matrix(sb.Load >((offset + 0u)), sb.Load >((offset + 4u)), sb.Load >((offset + 8u)), sb.Load >((offset + 12u))); } -matrix tint_symbol_32(ByteAddressBuffer buffer, uint offset) { - return matrix(buffer.Load >((offset + 0u)), buffer.Load >((offset + 8u)), buffer.Load >((offset + 16u)), buffer.Load >((offset + 24u))); +matrix sb_load_32(uint offset) { + return matrix(sb.Load >((offset + 0u)), sb.Load >((offset + 8u)), sb.Load >((offset + 16u)), sb.Load >((offset + 24u))); } -matrix tint_symbol_33(ByteAddressBuffer buffer, uint offset) { - return matrix(buffer.Load >((offset + 0u)), buffer.Load >((offset + 8u)), buffer.Load >((offset + 16u)), buffer.Load >((offset + 24u))); +matrix sb_load_33(uint offset) { + return matrix(sb.Load >((offset + 0u)), sb.Load >((offset + 8u)), sb.Load >((offset + 16u)), sb.Load >((offset + 24u))); } -typedef float3 tint_symbol_34_ret[2]; -tint_symbol_34_ret tint_symbol_34(ByteAddressBuffer buffer, uint offset) { +typedef float3 sb_load_34_ret[2]; +sb_load_34_ret sb_load_34(uint offset) { float3 arr[2] = (float3[2])0; { for(uint i = 0u; (i < 2u); i = (i + 1u)) { - arr[i] = asfloat(buffer.Load3((offset + (i * 16u)))); + arr[i] = asfloat(sb.Load3((offset + (i * 16u)))); } } return arr; } -typedef matrix tint_symbol_35_ret[2]; -tint_symbol_35_ret tint_symbol_35(ByteAddressBuffer buffer, uint offset) { +typedef matrix sb_load_35_ret[2]; +sb_load_35_ret sb_load_35(uint offset) { matrix arr_1[2] = (matrix[2])0; { for(uint i_1 = 0u; (i_1 < 2u); i_1 = (i_1 + 1u)) { - arr_1[i_1] = tint_symbol_31(buffer, (offset + (i_1 * 16u))); + arr_1[i_1] = sb_load_31((offset + (i_1 * 16u))); } } return arr_1; } -Inner tint_symbol_36(ByteAddressBuffer buffer, uint offset) { - const Inner tint_symbol_38 = {asint(buffer.Load((offset + 0u))), asfloat(buffer.Load((offset + 4u))), buffer.Load((offset + 8u))}; - return tint_symbol_38; +Inner sb_load_36(uint offset) { + const Inner tint_symbol = {asint(sb.Load((offset + 0u))), asfloat(sb.Load((offset + 4u))), sb.Load((offset + 8u))}; + return tint_symbol; } -typedef Inner tint_symbol_37_ret[4]; -tint_symbol_37_ret tint_symbol_37(ByteAddressBuffer buffer, uint offset) { +typedef Inner sb_load_37_ret[4]; +sb_load_37_ret sb_load_37(uint offset) { Inner arr_2[4] = (Inner[4])0; { for(uint i_2 = 0u; (i_2 < 4u); i_2 = (i_2 + 1u)) { - arr_2[i_2] = tint_symbol_36(buffer, (offset + (i_2 * 12u))); + arr_2[i_2] = sb_load_36((offset + (i_2 * 12u))); } } return arr_2; @@ -134,27 +134,27 @@ void main() { const int4 vec4_i32 = asint(sb.Load4(128u)); const uint4 vec4_u32 = sb.Load4(144u); const vector vec4_f16 = sb.Load >(160u); - const float2x2 mat2x2_f32 = tint_symbol_16(sb, 168u); - const float2x3 mat2x3_f32 = tint_symbol_17(sb, 192u); - const float2x4 mat2x4_f32 = tint_symbol_18(sb, 224u); - const float3x2 mat3x2_f32 = tint_symbol_19(sb, 256u); - const float3x3 mat3x3_f32 = tint_symbol_20(sb, 288u); - const float3x4 mat3x4_f32 = tint_symbol_21(sb, 336u); - const float4x2 mat4x2_f32 = tint_symbol_22(sb, 384u); - const float4x3 mat4x3_f32 = tint_symbol_23(sb, 416u); - const float4x4 mat4x4_f32 = tint_symbol_24(sb, 480u); - const matrix mat2x2_f16 = tint_symbol_25(sb, 544u); - const matrix mat2x3_f16 = tint_symbol_26(sb, 552u); - const matrix mat2x4_f16 = tint_symbol_27(sb, 568u); - const matrix mat3x2_f16 = tint_symbol_28(sb, 584u); - const matrix mat3x3_f16 = tint_symbol_29(sb, 600u); - const matrix mat3x4_f16 = tint_symbol_30(sb, 624u); - const matrix mat4x2_f16 = tint_symbol_31(sb, 648u); - const matrix mat4x3_f16 = tint_symbol_32(sb, 664u); - const matrix mat4x4_f16 = tint_symbol_33(sb, 696u); - const float3 arr2_vec3_f32[2] = tint_symbol_34(sb, 736u); - const matrix arr2_mat4x2_f16[2] = tint_symbol_35(sb, 768u); - const Inner struct_inner = tint_symbol_36(sb, 800u); - const Inner array_struct_inner[4] = tint_symbol_37(sb, 812u); + const float2x2 mat2x2_f32 = sb_load_16(168u); + const float2x3 mat2x3_f32 = sb_load_17(192u); + const float2x4 mat2x4_f32 = sb_load_18(224u); + const float3x2 mat3x2_f32 = sb_load_19(256u); + const float3x3 mat3x3_f32 = sb_load_20(288u); + const float3x4 mat3x4_f32 = sb_load_21(336u); + const float4x2 mat4x2_f32 = sb_load_22(384u); + const float4x3 mat4x3_f32 = sb_load_23(416u); + const float4x4 mat4x4_f32 = sb_load_24(480u); + const matrix mat2x2_f16 = sb_load_25(544u); + const matrix mat2x3_f16 = sb_load_26(552u); + const matrix mat2x4_f16 = sb_load_27(568u); + const matrix mat3x2_f16 = sb_load_28(584u); + const matrix mat3x3_f16 = sb_load_29(600u); + const matrix mat3x4_f16 = sb_load_30(624u); + const matrix mat4x2_f16 = sb_load_31(648u); + const matrix mat4x3_f16 = sb_load_32(664u); + const matrix mat4x4_f16 = sb_load_33(696u); + const float3 arr2_vec3_f32[2] = sb_load_34(736u); + const matrix arr2_mat4x2_f16[2] = sb_load_35(768u); + const Inner struct_inner = sb_load_36(800u); + const Inner array_struct_inner[4] = sb_load_37(812u); return; } diff --git a/test/tint/buffer/storage/static_index/write.wgsl.expected.dxc.hlsl b/test/tint/buffer/storage/static_index/write.wgsl.expected.dxc.hlsl index 9bf75ff89e..9f3c51de9d 100644 --- a/test/tint/buffer/storage/static_index/write.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/storage/static_index/write.wgsl.expected.dxc.hlsl @@ -5,79 +5,79 @@ struct Inner { RWByteAddressBuffer sb : register(u0, space0); -void tint_symbol_12(RWByteAddressBuffer buffer, uint offset, float2x2 value) { - buffer.Store2((offset + 0u), asuint(value[0u])); - buffer.Store2((offset + 8u), asuint(value[1u])); +void sb_store_12(uint offset, float2x2 value) { + sb.Store2((offset + 0u), asuint(value[0u])); + sb.Store2((offset + 8u), asuint(value[1u])); } -void tint_symbol_13(RWByteAddressBuffer buffer, uint offset, float2x3 value) { - buffer.Store3((offset + 0u), asuint(value[0u])); - buffer.Store3((offset + 16u), asuint(value[1u])); +void sb_store_13(uint offset, float2x3 value) { + sb.Store3((offset + 0u), asuint(value[0u])); + sb.Store3((offset + 16u), asuint(value[1u])); } -void tint_symbol_14(RWByteAddressBuffer buffer, uint offset, float2x4 value) { - buffer.Store4((offset + 0u), asuint(value[0u])); - buffer.Store4((offset + 16u), asuint(value[1u])); +void sb_store_14(uint offset, float2x4 value) { + sb.Store4((offset + 0u), asuint(value[0u])); + sb.Store4((offset + 16u), asuint(value[1u])); } -void tint_symbol_15(RWByteAddressBuffer buffer, uint offset, float3x2 value) { - buffer.Store2((offset + 0u), asuint(value[0u])); - buffer.Store2((offset + 8u), asuint(value[1u])); - buffer.Store2((offset + 16u), asuint(value[2u])); +void sb_store_15(uint offset, float3x2 value) { + sb.Store2((offset + 0u), asuint(value[0u])); + sb.Store2((offset + 8u), asuint(value[1u])); + sb.Store2((offset + 16u), asuint(value[2u])); } -void tint_symbol_16(RWByteAddressBuffer buffer, uint offset, float3x3 value) { - buffer.Store3((offset + 0u), asuint(value[0u])); - buffer.Store3((offset + 16u), asuint(value[1u])); - buffer.Store3((offset + 32u), asuint(value[2u])); +void sb_store_16(uint offset, float3x3 value) { + sb.Store3((offset + 0u), asuint(value[0u])); + sb.Store3((offset + 16u), asuint(value[1u])); + sb.Store3((offset + 32u), asuint(value[2u])); } -void tint_symbol_17(RWByteAddressBuffer buffer, uint offset, float3x4 value) { - buffer.Store4((offset + 0u), asuint(value[0u])); - buffer.Store4((offset + 16u), asuint(value[1u])); - buffer.Store4((offset + 32u), asuint(value[2u])); +void sb_store_17(uint offset, float3x4 value) { + sb.Store4((offset + 0u), asuint(value[0u])); + sb.Store4((offset + 16u), asuint(value[1u])); + sb.Store4((offset + 32u), asuint(value[2u])); } -void tint_symbol_18(RWByteAddressBuffer buffer, uint offset, float4x2 value) { - buffer.Store2((offset + 0u), asuint(value[0u])); - buffer.Store2((offset + 8u), asuint(value[1u])); - buffer.Store2((offset + 16u), asuint(value[2u])); - buffer.Store2((offset + 24u), asuint(value[3u])); +void sb_store_18(uint offset, float4x2 value) { + sb.Store2((offset + 0u), asuint(value[0u])); + sb.Store2((offset + 8u), asuint(value[1u])); + sb.Store2((offset + 16u), asuint(value[2u])); + sb.Store2((offset + 24u), asuint(value[3u])); } -void tint_symbol_19(RWByteAddressBuffer buffer, uint offset, float4x3 value) { - buffer.Store3((offset + 0u), asuint(value[0u])); - buffer.Store3((offset + 16u), asuint(value[1u])); - buffer.Store3((offset + 32u), asuint(value[2u])); - buffer.Store3((offset + 48u), asuint(value[3u])); +void sb_store_19(uint offset, float4x3 value) { + sb.Store3((offset + 0u), asuint(value[0u])); + sb.Store3((offset + 16u), asuint(value[1u])); + sb.Store3((offset + 32u), asuint(value[2u])); + sb.Store3((offset + 48u), asuint(value[3u])); } -void tint_symbol_20(RWByteAddressBuffer buffer, uint offset, float4x4 value) { - buffer.Store4((offset + 0u), asuint(value[0u])); - buffer.Store4((offset + 16u), asuint(value[1u])); - buffer.Store4((offset + 32u), asuint(value[2u])); - buffer.Store4((offset + 48u), asuint(value[3u])); +void sb_store_20(uint offset, float4x4 value) { + sb.Store4((offset + 0u), asuint(value[0u])); + sb.Store4((offset + 16u), asuint(value[1u])); + sb.Store4((offset + 32u), asuint(value[2u])); + sb.Store4((offset + 48u), asuint(value[3u])); } -void tint_symbol_21(RWByteAddressBuffer buffer, uint offset, float3 value[2]) { +void sb_store_21(uint offset, float3 value[2]) { float3 array_1[2] = value; { for(uint i = 0u; (i < 2u); i = (i + 1u)) { - buffer.Store3((offset + (i * 16u)), asuint(array_1[i])); + sb.Store3((offset + (i * 16u)), asuint(array_1[i])); } } } -void tint_symbol_22(RWByteAddressBuffer buffer, uint offset, Inner value) { - buffer.Store((offset + 0u), asuint(value.scalar_i32)); - buffer.Store((offset + 4u), asuint(value.scalar_f32)); +void sb_store_22(uint offset, Inner value) { + sb.Store((offset + 0u), asuint(value.scalar_i32)); + sb.Store((offset + 4u), asuint(value.scalar_f32)); } -void tint_symbol_23(RWByteAddressBuffer buffer, uint offset, Inner value[4]) { +void sb_store_23(uint offset, Inner value[4]) { Inner array_2[4] = value; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - tint_symbol_22(buffer, (offset + (i_1 * 8u)), array_2[i_1]); + sb_store_22((offset + (i_1 * 8u)), array_2[i_1]); } } } @@ -96,20 +96,20 @@ void main() { sb.Store4(96u, asuint((0.0f).xxxx)); sb.Store4(112u, asuint((0).xxxx)); sb.Store4(128u, asuint((0u).xxxx)); - tint_symbol_12(sb, 144u, float2x2((0.0f).xx, (0.0f).xx)); - tint_symbol_13(sb, 160u, float2x3((0.0f).xxx, (0.0f).xxx)); - tint_symbol_14(sb, 192u, float2x4((0.0f).xxxx, (0.0f).xxxx)); - tint_symbol_15(sb, 224u, float3x2((0.0f).xx, (0.0f).xx, (0.0f).xx)); - tint_symbol_16(sb, 256u, float3x3((0.0f).xxx, (0.0f).xxx, (0.0f).xxx)); - tint_symbol_17(sb, 304u, float3x4((0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx)); - tint_symbol_18(sb, 352u, float4x2((0.0f).xx, (0.0f).xx, (0.0f).xx, (0.0f).xx)); - tint_symbol_19(sb, 384u, float4x3((0.0f).xxx, (0.0f).xxx, (0.0f).xxx, (0.0f).xxx)); - tint_symbol_20(sb, 448u, float4x4((0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx)); - const float3 tint_symbol_24[2] = (float3[2])0; - tint_symbol_21(sb, 512u, tint_symbol_24); - const Inner tint_symbol_25 = (Inner)0; - tint_symbol_22(sb, 544u, tint_symbol_25); - const Inner tint_symbol_26[4] = (Inner[4])0; - tint_symbol_23(sb, 552u, tint_symbol_26); + sb_store_12(144u, float2x2((0.0f).xx, (0.0f).xx)); + sb_store_13(160u, float2x3((0.0f).xxx, (0.0f).xxx)); + sb_store_14(192u, float2x4((0.0f).xxxx, (0.0f).xxxx)); + sb_store_15(224u, float3x2((0.0f).xx, (0.0f).xx, (0.0f).xx)); + sb_store_16(256u, float3x3((0.0f).xxx, (0.0f).xxx, (0.0f).xxx)); + sb_store_17(304u, float3x4((0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx)); + sb_store_18(352u, float4x2((0.0f).xx, (0.0f).xx, (0.0f).xx, (0.0f).xx)); + sb_store_19(384u, float4x3((0.0f).xxx, (0.0f).xxx, (0.0f).xxx, (0.0f).xxx)); + sb_store_20(448u, float4x4((0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx)); + const float3 tint_symbol[2] = (float3[2])0; + sb_store_21(512u, tint_symbol); + const Inner tint_symbol_1 = (Inner)0; + sb_store_22(544u, tint_symbol_1); + const Inner tint_symbol_2[4] = (Inner[4])0; + sb_store_23(552u, tint_symbol_2); return; } diff --git a/test/tint/buffer/storage/static_index/write.wgsl.expected.fxc.hlsl b/test/tint/buffer/storage/static_index/write.wgsl.expected.fxc.hlsl index 9bf75ff89e..9f3c51de9d 100644 --- a/test/tint/buffer/storage/static_index/write.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/storage/static_index/write.wgsl.expected.fxc.hlsl @@ -5,79 +5,79 @@ struct Inner { RWByteAddressBuffer sb : register(u0, space0); -void tint_symbol_12(RWByteAddressBuffer buffer, uint offset, float2x2 value) { - buffer.Store2((offset + 0u), asuint(value[0u])); - buffer.Store2((offset + 8u), asuint(value[1u])); +void sb_store_12(uint offset, float2x2 value) { + sb.Store2((offset + 0u), asuint(value[0u])); + sb.Store2((offset + 8u), asuint(value[1u])); } -void tint_symbol_13(RWByteAddressBuffer buffer, uint offset, float2x3 value) { - buffer.Store3((offset + 0u), asuint(value[0u])); - buffer.Store3((offset + 16u), asuint(value[1u])); +void sb_store_13(uint offset, float2x3 value) { + sb.Store3((offset + 0u), asuint(value[0u])); + sb.Store3((offset + 16u), asuint(value[1u])); } -void tint_symbol_14(RWByteAddressBuffer buffer, uint offset, float2x4 value) { - buffer.Store4((offset + 0u), asuint(value[0u])); - buffer.Store4((offset + 16u), asuint(value[1u])); +void sb_store_14(uint offset, float2x4 value) { + sb.Store4((offset + 0u), asuint(value[0u])); + sb.Store4((offset + 16u), asuint(value[1u])); } -void tint_symbol_15(RWByteAddressBuffer buffer, uint offset, float3x2 value) { - buffer.Store2((offset + 0u), asuint(value[0u])); - buffer.Store2((offset + 8u), asuint(value[1u])); - buffer.Store2((offset + 16u), asuint(value[2u])); +void sb_store_15(uint offset, float3x2 value) { + sb.Store2((offset + 0u), asuint(value[0u])); + sb.Store2((offset + 8u), asuint(value[1u])); + sb.Store2((offset + 16u), asuint(value[2u])); } -void tint_symbol_16(RWByteAddressBuffer buffer, uint offset, float3x3 value) { - buffer.Store3((offset + 0u), asuint(value[0u])); - buffer.Store3((offset + 16u), asuint(value[1u])); - buffer.Store3((offset + 32u), asuint(value[2u])); +void sb_store_16(uint offset, float3x3 value) { + sb.Store3((offset + 0u), asuint(value[0u])); + sb.Store3((offset + 16u), asuint(value[1u])); + sb.Store3((offset + 32u), asuint(value[2u])); } -void tint_symbol_17(RWByteAddressBuffer buffer, uint offset, float3x4 value) { - buffer.Store4((offset + 0u), asuint(value[0u])); - buffer.Store4((offset + 16u), asuint(value[1u])); - buffer.Store4((offset + 32u), asuint(value[2u])); +void sb_store_17(uint offset, float3x4 value) { + sb.Store4((offset + 0u), asuint(value[0u])); + sb.Store4((offset + 16u), asuint(value[1u])); + sb.Store4((offset + 32u), asuint(value[2u])); } -void tint_symbol_18(RWByteAddressBuffer buffer, uint offset, float4x2 value) { - buffer.Store2((offset + 0u), asuint(value[0u])); - buffer.Store2((offset + 8u), asuint(value[1u])); - buffer.Store2((offset + 16u), asuint(value[2u])); - buffer.Store2((offset + 24u), asuint(value[3u])); +void sb_store_18(uint offset, float4x2 value) { + sb.Store2((offset + 0u), asuint(value[0u])); + sb.Store2((offset + 8u), asuint(value[1u])); + sb.Store2((offset + 16u), asuint(value[2u])); + sb.Store2((offset + 24u), asuint(value[3u])); } -void tint_symbol_19(RWByteAddressBuffer buffer, uint offset, float4x3 value) { - buffer.Store3((offset + 0u), asuint(value[0u])); - buffer.Store3((offset + 16u), asuint(value[1u])); - buffer.Store3((offset + 32u), asuint(value[2u])); - buffer.Store3((offset + 48u), asuint(value[3u])); +void sb_store_19(uint offset, float4x3 value) { + sb.Store3((offset + 0u), asuint(value[0u])); + sb.Store3((offset + 16u), asuint(value[1u])); + sb.Store3((offset + 32u), asuint(value[2u])); + sb.Store3((offset + 48u), asuint(value[3u])); } -void tint_symbol_20(RWByteAddressBuffer buffer, uint offset, float4x4 value) { - buffer.Store4((offset + 0u), asuint(value[0u])); - buffer.Store4((offset + 16u), asuint(value[1u])); - buffer.Store4((offset + 32u), asuint(value[2u])); - buffer.Store4((offset + 48u), asuint(value[3u])); +void sb_store_20(uint offset, float4x4 value) { + sb.Store4((offset + 0u), asuint(value[0u])); + sb.Store4((offset + 16u), asuint(value[1u])); + sb.Store4((offset + 32u), asuint(value[2u])); + sb.Store4((offset + 48u), asuint(value[3u])); } -void tint_symbol_21(RWByteAddressBuffer buffer, uint offset, float3 value[2]) { +void sb_store_21(uint offset, float3 value[2]) { float3 array_1[2] = value; { for(uint i = 0u; (i < 2u); i = (i + 1u)) { - buffer.Store3((offset + (i * 16u)), asuint(array_1[i])); + sb.Store3((offset + (i * 16u)), asuint(array_1[i])); } } } -void tint_symbol_22(RWByteAddressBuffer buffer, uint offset, Inner value) { - buffer.Store((offset + 0u), asuint(value.scalar_i32)); - buffer.Store((offset + 4u), asuint(value.scalar_f32)); +void sb_store_22(uint offset, Inner value) { + sb.Store((offset + 0u), asuint(value.scalar_i32)); + sb.Store((offset + 4u), asuint(value.scalar_f32)); } -void tint_symbol_23(RWByteAddressBuffer buffer, uint offset, Inner value[4]) { +void sb_store_23(uint offset, Inner value[4]) { Inner array_2[4] = value; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - tint_symbol_22(buffer, (offset + (i_1 * 8u)), array_2[i_1]); + sb_store_22((offset + (i_1 * 8u)), array_2[i_1]); } } } @@ -96,20 +96,20 @@ void main() { sb.Store4(96u, asuint((0.0f).xxxx)); sb.Store4(112u, asuint((0).xxxx)); sb.Store4(128u, asuint((0u).xxxx)); - tint_symbol_12(sb, 144u, float2x2((0.0f).xx, (0.0f).xx)); - tint_symbol_13(sb, 160u, float2x3((0.0f).xxx, (0.0f).xxx)); - tint_symbol_14(sb, 192u, float2x4((0.0f).xxxx, (0.0f).xxxx)); - tint_symbol_15(sb, 224u, float3x2((0.0f).xx, (0.0f).xx, (0.0f).xx)); - tint_symbol_16(sb, 256u, float3x3((0.0f).xxx, (0.0f).xxx, (0.0f).xxx)); - tint_symbol_17(sb, 304u, float3x4((0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx)); - tint_symbol_18(sb, 352u, float4x2((0.0f).xx, (0.0f).xx, (0.0f).xx, (0.0f).xx)); - tint_symbol_19(sb, 384u, float4x3((0.0f).xxx, (0.0f).xxx, (0.0f).xxx, (0.0f).xxx)); - tint_symbol_20(sb, 448u, float4x4((0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx)); - const float3 tint_symbol_24[2] = (float3[2])0; - tint_symbol_21(sb, 512u, tint_symbol_24); - const Inner tint_symbol_25 = (Inner)0; - tint_symbol_22(sb, 544u, tint_symbol_25); - const Inner tint_symbol_26[4] = (Inner[4])0; - tint_symbol_23(sb, 552u, tint_symbol_26); + sb_store_12(144u, float2x2((0.0f).xx, (0.0f).xx)); + sb_store_13(160u, float2x3((0.0f).xxx, (0.0f).xxx)); + sb_store_14(192u, float2x4((0.0f).xxxx, (0.0f).xxxx)); + sb_store_15(224u, float3x2((0.0f).xx, (0.0f).xx, (0.0f).xx)); + sb_store_16(256u, float3x3((0.0f).xxx, (0.0f).xxx, (0.0f).xxx)); + sb_store_17(304u, float3x4((0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx)); + sb_store_18(352u, float4x2((0.0f).xx, (0.0f).xx, (0.0f).xx, (0.0f).xx)); + sb_store_19(384u, float4x3((0.0f).xxx, (0.0f).xxx, (0.0f).xxx, (0.0f).xxx)); + sb_store_20(448u, float4x4((0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx)); + const float3 tint_symbol[2] = (float3[2])0; + sb_store_21(512u, tint_symbol); + const Inner tint_symbol_1 = (Inner)0; + sb_store_22(544u, tint_symbol_1); + const Inner tint_symbol_2[4] = (Inner[4])0; + sb_store_23(552u, tint_symbol_2); return; } diff --git a/test/tint/buffer/storage/static_index/write_f16.wgsl.expected.dxc.hlsl b/test/tint/buffer/storage/static_index/write_f16.wgsl.expected.dxc.hlsl index 121700ab9c..0ff24fe5fd 100644 --- a/test/tint/buffer/storage/static_index/write_f16.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/storage/static_index/write_f16.wgsl.expected.dxc.hlsl @@ -6,143 +6,143 @@ struct Inner { RWByteAddressBuffer sb : register(u0, space0); -void tint_symbol_16(RWByteAddressBuffer buffer, uint offset, float2x2 value) { - buffer.Store2((offset + 0u), asuint(value[0u])); - buffer.Store2((offset + 8u), asuint(value[1u])); +void sb_store_16(uint offset, float2x2 value) { + sb.Store2((offset + 0u), asuint(value[0u])); + sb.Store2((offset + 8u), asuint(value[1u])); } -void tint_symbol_17(RWByteAddressBuffer buffer, uint offset, float2x3 value) { - buffer.Store3((offset + 0u), asuint(value[0u])); - buffer.Store3((offset + 16u), asuint(value[1u])); +void sb_store_17(uint offset, float2x3 value) { + sb.Store3((offset + 0u), asuint(value[0u])); + sb.Store3((offset + 16u), asuint(value[1u])); } -void tint_symbol_18(RWByteAddressBuffer buffer, uint offset, float2x4 value) { - buffer.Store4((offset + 0u), asuint(value[0u])); - buffer.Store4((offset + 16u), asuint(value[1u])); +void sb_store_18(uint offset, float2x4 value) { + sb.Store4((offset + 0u), asuint(value[0u])); + sb.Store4((offset + 16u), asuint(value[1u])); } -void tint_symbol_19(RWByteAddressBuffer buffer, uint offset, float3x2 value) { - buffer.Store2((offset + 0u), asuint(value[0u])); - buffer.Store2((offset + 8u), asuint(value[1u])); - buffer.Store2((offset + 16u), asuint(value[2u])); +void sb_store_19(uint offset, float3x2 value) { + sb.Store2((offset + 0u), asuint(value[0u])); + sb.Store2((offset + 8u), asuint(value[1u])); + sb.Store2((offset + 16u), asuint(value[2u])); } -void tint_symbol_20(RWByteAddressBuffer buffer, uint offset, float3x3 value) { - buffer.Store3((offset + 0u), asuint(value[0u])); - buffer.Store3((offset + 16u), asuint(value[1u])); - buffer.Store3((offset + 32u), asuint(value[2u])); +void sb_store_20(uint offset, float3x3 value) { + sb.Store3((offset + 0u), asuint(value[0u])); + sb.Store3((offset + 16u), asuint(value[1u])); + sb.Store3((offset + 32u), asuint(value[2u])); } -void tint_symbol_21(RWByteAddressBuffer buffer, uint offset, float3x4 value) { - buffer.Store4((offset + 0u), asuint(value[0u])); - buffer.Store4((offset + 16u), asuint(value[1u])); - buffer.Store4((offset + 32u), asuint(value[2u])); +void sb_store_21(uint offset, float3x4 value) { + sb.Store4((offset + 0u), asuint(value[0u])); + sb.Store4((offset + 16u), asuint(value[1u])); + sb.Store4((offset + 32u), asuint(value[2u])); } -void tint_symbol_22(RWByteAddressBuffer buffer, uint offset, float4x2 value) { - buffer.Store2((offset + 0u), asuint(value[0u])); - buffer.Store2((offset + 8u), asuint(value[1u])); - buffer.Store2((offset + 16u), asuint(value[2u])); - buffer.Store2((offset + 24u), asuint(value[3u])); +void sb_store_22(uint offset, float4x2 value) { + sb.Store2((offset + 0u), asuint(value[0u])); + sb.Store2((offset + 8u), asuint(value[1u])); + sb.Store2((offset + 16u), asuint(value[2u])); + sb.Store2((offset + 24u), asuint(value[3u])); } -void tint_symbol_23(RWByteAddressBuffer buffer, uint offset, float4x3 value) { - buffer.Store3((offset + 0u), asuint(value[0u])); - buffer.Store3((offset + 16u), asuint(value[1u])); - buffer.Store3((offset + 32u), asuint(value[2u])); - buffer.Store3((offset + 48u), asuint(value[3u])); +void sb_store_23(uint offset, float4x3 value) { + sb.Store3((offset + 0u), asuint(value[0u])); + sb.Store3((offset + 16u), asuint(value[1u])); + sb.Store3((offset + 32u), asuint(value[2u])); + sb.Store3((offset + 48u), asuint(value[3u])); } -void tint_symbol_24(RWByteAddressBuffer buffer, uint offset, float4x4 value) { - buffer.Store4((offset + 0u), asuint(value[0u])); - buffer.Store4((offset + 16u), asuint(value[1u])); - buffer.Store4((offset + 32u), asuint(value[2u])); - buffer.Store4((offset + 48u), asuint(value[3u])); +void sb_store_24(uint offset, float4x4 value) { + sb.Store4((offset + 0u), asuint(value[0u])); + sb.Store4((offset + 16u), asuint(value[1u])); + sb.Store4((offset + 32u), asuint(value[2u])); + sb.Store4((offset + 48u), asuint(value[3u])); } -void tint_symbol_25(RWByteAddressBuffer buffer, uint offset, matrix value) { - buffer.Store >((offset + 0u), value[0u]); - buffer.Store >((offset + 4u), value[1u]); +void sb_store_25(uint offset, matrix value) { + sb.Store >((offset + 0u), value[0u]); + sb.Store >((offset + 4u), value[1u]); } -void tint_symbol_26(RWByteAddressBuffer buffer, uint offset, matrix value) { - buffer.Store >((offset + 0u), value[0u]); - buffer.Store >((offset + 8u), value[1u]); +void sb_store_26(uint offset, matrix value) { + sb.Store >((offset + 0u), value[0u]); + sb.Store >((offset + 8u), value[1u]); } -void tint_symbol_27(RWByteAddressBuffer buffer, uint offset, matrix value) { - buffer.Store >((offset + 0u), value[0u]); - buffer.Store >((offset + 8u), value[1u]); +void sb_store_27(uint offset, matrix value) { + sb.Store >((offset + 0u), value[0u]); + sb.Store >((offset + 8u), value[1u]); } -void tint_symbol_28(RWByteAddressBuffer buffer, uint offset, matrix value) { - buffer.Store >((offset + 0u), value[0u]); - buffer.Store >((offset + 4u), value[1u]); - buffer.Store >((offset + 8u), value[2u]); +void sb_store_28(uint offset, matrix value) { + sb.Store >((offset + 0u), value[0u]); + sb.Store >((offset + 4u), value[1u]); + sb.Store >((offset + 8u), value[2u]); } -void tint_symbol_29(RWByteAddressBuffer buffer, uint offset, matrix value) { - buffer.Store >((offset + 0u), value[0u]); - buffer.Store >((offset + 8u), value[1u]); - buffer.Store >((offset + 16u), value[2u]); +void sb_store_29(uint offset, matrix value) { + sb.Store >((offset + 0u), value[0u]); + sb.Store >((offset + 8u), value[1u]); + sb.Store >((offset + 16u), value[2u]); } -void tint_symbol_30(RWByteAddressBuffer buffer, uint offset, matrix value) { - buffer.Store >((offset + 0u), value[0u]); - buffer.Store >((offset + 8u), value[1u]); - buffer.Store >((offset + 16u), value[2u]); +void sb_store_30(uint offset, matrix value) { + sb.Store >((offset + 0u), value[0u]); + sb.Store >((offset + 8u), value[1u]); + sb.Store >((offset + 16u), value[2u]); } -void tint_symbol_31(RWByteAddressBuffer buffer, uint offset, matrix value) { - buffer.Store >((offset + 0u), value[0u]); - buffer.Store >((offset + 4u), value[1u]); - buffer.Store >((offset + 8u), value[2u]); - buffer.Store >((offset + 12u), value[3u]); +void sb_store_31(uint offset, matrix value) { + sb.Store >((offset + 0u), value[0u]); + sb.Store >((offset + 4u), value[1u]); + sb.Store >((offset + 8u), value[2u]); + sb.Store >((offset + 12u), value[3u]); } -void tint_symbol_32(RWByteAddressBuffer buffer, uint offset, matrix value) { - buffer.Store >((offset + 0u), value[0u]); - buffer.Store >((offset + 8u), value[1u]); - buffer.Store >((offset + 16u), value[2u]); - buffer.Store >((offset + 24u), value[3u]); +void sb_store_32(uint offset, matrix value) { + sb.Store >((offset + 0u), value[0u]); + sb.Store >((offset + 8u), value[1u]); + sb.Store >((offset + 16u), value[2u]); + sb.Store >((offset + 24u), value[3u]); } -void tint_symbol_33(RWByteAddressBuffer buffer, uint offset, matrix value) { - buffer.Store >((offset + 0u), value[0u]); - buffer.Store >((offset + 8u), value[1u]); - buffer.Store >((offset + 16u), value[2u]); - buffer.Store >((offset + 24u), value[3u]); +void sb_store_33(uint offset, matrix value) { + sb.Store >((offset + 0u), value[0u]); + sb.Store >((offset + 8u), value[1u]); + sb.Store >((offset + 16u), value[2u]); + sb.Store >((offset + 24u), value[3u]); } -void tint_symbol_34(RWByteAddressBuffer buffer, uint offset, float3 value[2]) { +void sb_store_34(uint offset, float3 value[2]) { float3 array_1[2] = value; { for(uint i = 0u; (i < 2u); i = (i + 1u)) { - buffer.Store3((offset + (i * 16u)), asuint(array_1[i])); + sb.Store3((offset + (i * 16u)), asuint(array_1[i])); } } } -void tint_symbol_35(RWByteAddressBuffer buffer, uint offset, matrix value[2]) { +void sb_store_35(uint offset, matrix value[2]) { matrix array_2[2] = value; { for(uint i_1 = 0u; (i_1 < 2u); i_1 = (i_1 + 1u)) { - tint_symbol_31(buffer, (offset + (i_1 * 16u)), array_2[i_1]); + sb_store_31((offset + (i_1 * 16u)), array_2[i_1]); } } } -void tint_symbol_36(RWByteAddressBuffer buffer, uint offset, Inner value) { - buffer.Store((offset + 0u), asuint(value.scalar_i32)); - buffer.Store((offset + 4u), asuint(value.scalar_f32)); - buffer.Store((offset + 8u), value.scalar_f16); +void sb_store_36(uint offset, Inner value) { + sb.Store((offset + 0u), asuint(value.scalar_i32)); + sb.Store((offset + 4u), asuint(value.scalar_f32)); + sb.Store((offset + 8u), value.scalar_f16); } -void tint_symbol_37(RWByteAddressBuffer buffer, uint offset, Inner value[4]) { +void sb_store_37(uint offset, Inner value[4]) { Inner array_3[4] = value; { for(uint i_2 = 0u; (i_2 < 4u); i_2 = (i_2 + 1u)) { - tint_symbol_36(buffer, (offset + (i_2 * 12u)), array_3[i_2]); + sb_store_36((offset + (i_2 * 12u)), array_3[i_2]); } } } @@ -165,31 +165,31 @@ void main() { sb.Store4(128u, asuint((0).xxxx)); sb.Store4(144u, asuint((0u).xxxx)); sb.Store >(160u, (float16_t(0.0h)).xxxx); - tint_symbol_16(sb, 168u, float2x2((0.0f).xx, (0.0f).xx)); - tint_symbol_17(sb, 192u, float2x3((0.0f).xxx, (0.0f).xxx)); - tint_symbol_18(sb, 224u, float2x4((0.0f).xxxx, (0.0f).xxxx)); - tint_symbol_19(sb, 256u, float3x2((0.0f).xx, (0.0f).xx, (0.0f).xx)); - tint_symbol_20(sb, 288u, float3x3((0.0f).xxx, (0.0f).xxx, (0.0f).xxx)); - tint_symbol_21(sb, 336u, float3x4((0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx)); - tint_symbol_22(sb, 384u, float4x2((0.0f).xx, (0.0f).xx, (0.0f).xx, (0.0f).xx)); - tint_symbol_23(sb, 416u, float4x3((0.0f).xxx, (0.0f).xxx, (0.0f).xxx, (0.0f).xxx)); - tint_symbol_24(sb, 480u, float4x4((0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx)); - tint_symbol_25(sb, 544u, matrix((float16_t(0.0h)).xx, (float16_t(0.0h)).xx)); - tint_symbol_26(sb, 552u, matrix((float16_t(0.0h)).xxx, (float16_t(0.0h)).xxx)); - tint_symbol_27(sb, 568u, matrix((float16_t(0.0h)).xxxx, (float16_t(0.0h)).xxxx)); - tint_symbol_28(sb, 584u, matrix((float16_t(0.0h)).xx, (float16_t(0.0h)).xx, (float16_t(0.0h)).xx)); - tint_symbol_29(sb, 600u, matrix((float16_t(0.0h)).xxx, (float16_t(0.0h)).xxx, (float16_t(0.0h)).xxx)); - tint_symbol_30(sb, 624u, matrix((float16_t(0.0h)).xxxx, (float16_t(0.0h)).xxxx, (float16_t(0.0h)).xxxx)); - tint_symbol_31(sb, 648u, matrix((float16_t(0.0h)).xx, (float16_t(0.0h)).xx, (float16_t(0.0h)).xx, (float16_t(0.0h)).xx)); - tint_symbol_32(sb, 664u, matrix((float16_t(0.0h)).xxx, (float16_t(0.0h)).xxx, (float16_t(0.0h)).xxx, (float16_t(0.0h)).xxx)); - tint_symbol_33(sb, 696u, matrix((float16_t(0.0h)).xxxx, (float16_t(0.0h)).xxxx, (float16_t(0.0h)).xxxx, (float16_t(0.0h)).xxxx)); - const float3 tint_symbol_38[2] = (float3[2])0; - tint_symbol_34(sb, 736u, tint_symbol_38); - const matrix tint_symbol_39[2] = (matrix[2])0; - tint_symbol_35(sb, 768u, tint_symbol_39); - const Inner tint_symbol_40 = (Inner)0; - tint_symbol_36(sb, 800u, tint_symbol_40); - const Inner tint_symbol_41[4] = (Inner[4])0; - tint_symbol_37(sb, 812u, tint_symbol_41); + sb_store_16(168u, float2x2((0.0f).xx, (0.0f).xx)); + sb_store_17(192u, float2x3((0.0f).xxx, (0.0f).xxx)); + sb_store_18(224u, float2x4((0.0f).xxxx, (0.0f).xxxx)); + sb_store_19(256u, float3x2((0.0f).xx, (0.0f).xx, (0.0f).xx)); + sb_store_20(288u, float3x3((0.0f).xxx, (0.0f).xxx, (0.0f).xxx)); + sb_store_21(336u, float3x4((0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx)); + sb_store_22(384u, float4x2((0.0f).xx, (0.0f).xx, (0.0f).xx, (0.0f).xx)); + sb_store_23(416u, float4x3((0.0f).xxx, (0.0f).xxx, (0.0f).xxx, (0.0f).xxx)); + sb_store_24(480u, float4x4((0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx)); + sb_store_25(544u, matrix((float16_t(0.0h)).xx, (float16_t(0.0h)).xx)); + sb_store_26(552u, matrix((float16_t(0.0h)).xxx, (float16_t(0.0h)).xxx)); + sb_store_27(568u, matrix((float16_t(0.0h)).xxxx, (float16_t(0.0h)).xxxx)); + sb_store_28(584u, matrix((float16_t(0.0h)).xx, (float16_t(0.0h)).xx, (float16_t(0.0h)).xx)); + sb_store_29(600u, matrix((float16_t(0.0h)).xxx, (float16_t(0.0h)).xxx, (float16_t(0.0h)).xxx)); + sb_store_30(624u, matrix((float16_t(0.0h)).xxxx, (float16_t(0.0h)).xxxx, (float16_t(0.0h)).xxxx)); + sb_store_31(648u, matrix((float16_t(0.0h)).xx, (float16_t(0.0h)).xx, (float16_t(0.0h)).xx, (float16_t(0.0h)).xx)); + sb_store_32(664u, matrix((float16_t(0.0h)).xxx, (float16_t(0.0h)).xxx, (float16_t(0.0h)).xxx, (float16_t(0.0h)).xxx)); + sb_store_33(696u, matrix((float16_t(0.0h)).xxxx, (float16_t(0.0h)).xxxx, (float16_t(0.0h)).xxxx, (float16_t(0.0h)).xxxx)); + const float3 tint_symbol[2] = (float3[2])0; + sb_store_34(736u, tint_symbol); + const matrix tint_symbol_1[2] = (matrix[2])0; + sb_store_35(768u, tint_symbol_1); + const Inner tint_symbol_2 = (Inner)0; + sb_store_36(800u, tint_symbol_2); + const Inner tint_symbol_3[4] = (Inner[4])0; + sb_store_37(812u, tint_symbol_3); return; } diff --git a/test/tint/buffer/storage/types/array4_f16.wgsl.expected.dxc.hlsl b/test/tint/buffer/storage/types/array4_f16.wgsl.expected.dxc.hlsl index ac93313fa8..41743d1ed5 100644 --- a/test/tint/buffer/storage/types/array4_f16.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/storage/types/array4_f16.wgsl.expected.dxc.hlsl @@ -1,21 +1,21 @@ ByteAddressBuffer tint_symbol : register(t0, space0); RWByteAddressBuffer tint_symbol_1 : register(u1, space0); -void tint_symbol_2(RWByteAddressBuffer buffer, uint offset, float16_t value[4]) { +void tint_symbol_1_store(uint offset, float16_t value[4]) { float16_t array_1[4] = value; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - buffer.Store((offset + (i * 2u)), array_1[i]); + tint_symbol_1.Store((offset + (i * 2u)), array_1[i]); } } } -typedef float16_t tint_symbol_4_ret[4]; -tint_symbol_4_ret tint_symbol_4(ByteAddressBuffer buffer, uint offset) { +typedef float16_t tint_symbol_load_ret[4]; +tint_symbol_load_ret tint_symbol_load(uint offset) { float16_t arr[4] = (float16_t[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = buffer.Load((offset + (i_1 * 2u))); + arr[i_1] = tint_symbol.Load((offset + (i_1 * 2u))); } } return arr; @@ -23,6 +23,6 @@ tint_symbol_4_ret tint_symbol_4(ByteAddressBuffer buffer, uint offset) { [numthreads(1, 1, 1)] void main() { - tint_symbol_2(tint_symbol_1, 0u, tint_symbol_4(tint_symbol, 0u)); + tint_symbol_1_store(0u, tint_symbol_load(0u)); return; } diff --git a/test/tint/buffer/storage/types/array4_f32.wgsl.expected.dxc.hlsl b/test/tint/buffer/storage/types/array4_f32.wgsl.expected.dxc.hlsl index b1f25b27ae..23ced88511 100644 --- a/test/tint/buffer/storage/types/array4_f32.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/storage/types/array4_f32.wgsl.expected.dxc.hlsl @@ -1,21 +1,21 @@ ByteAddressBuffer tint_symbol : register(t0, space0); RWByteAddressBuffer tint_symbol_1 : register(u1, space0); -void tint_symbol_2(RWByteAddressBuffer buffer, uint offset, float value[4]) { +void tint_symbol_1_store(uint offset, float value[4]) { float array_1[4] = value; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - buffer.Store((offset + (i * 4u)), asuint(array_1[i])); + tint_symbol_1.Store((offset + (i * 4u)), asuint(array_1[i])); } } } -typedef float tint_symbol_4_ret[4]; -tint_symbol_4_ret tint_symbol_4(ByteAddressBuffer buffer, uint offset) { +typedef float tint_symbol_load_ret[4]; +tint_symbol_load_ret tint_symbol_load(uint offset) { float arr[4] = (float[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = asfloat(buffer.Load((offset + (i_1 * 4u)))); + arr[i_1] = asfloat(tint_symbol.Load((offset + (i_1 * 4u)))); } } return arr; @@ -23,6 +23,6 @@ tint_symbol_4_ret tint_symbol_4(ByteAddressBuffer buffer, uint offset) { [numthreads(1, 1, 1)] void main() { - tint_symbol_2(tint_symbol_1, 0u, tint_symbol_4(tint_symbol, 0u)); + tint_symbol_1_store(0u, tint_symbol_load(0u)); return; } diff --git a/test/tint/buffer/storage/types/array4_f32.wgsl.expected.fxc.hlsl b/test/tint/buffer/storage/types/array4_f32.wgsl.expected.fxc.hlsl index b1f25b27ae..23ced88511 100644 --- a/test/tint/buffer/storage/types/array4_f32.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/storage/types/array4_f32.wgsl.expected.fxc.hlsl @@ -1,21 +1,21 @@ ByteAddressBuffer tint_symbol : register(t0, space0); RWByteAddressBuffer tint_symbol_1 : register(u1, space0); -void tint_symbol_2(RWByteAddressBuffer buffer, uint offset, float value[4]) { +void tint_symbol_1_store(uint offset, float value[4]) { float array_1[4] = value; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - buffer.Store((offset + (i * 4u)), asuint(array_1[i])); + tint_symbol_1.Store((offset + (i * 4u)), asuint(array_1[i])); } } } -typedef float tint_symbol_4_ret[4]; -tint_symbol_4_ret tint_symbol_4(ByteAddressBuffer buffer, uint offset) { +typedef float tint_symbol_load_ret[4]; +tint_symbol_load_ret tint_symbol_load(uint offset) { float arr[4] = (float[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = asfloat(buffer.Load((offset + (i_1 * 4u)))); + arr[i_1] = asfloat(tint_symbol.Load((offset + (i_1 * 4u)))); } } return arr; @@ -23,6 +23,6 @@ tint_symbol_4_ret tint_symbol_4(ByteAddressBuffer buffer, uint offset) { [numthreads(1, 1, 1)] void main() { - tint_symbol_2(tint_symbol_1, 0u, tint_symbol_4(tint_symbol, 0u)); + tint_symbol_1_store(0u, tint_symbol_load(0u)); return; } diff --git a/test/tint/buffer/storage/types/mat2x2_f16.wgsl.expected.dxc.hlsl b/test/tint/buffer/storage/types/mat2x2_f16.wgsl.expected.dxc.hlsl index 3730b985bf..b49affffaf 100644 --- a/test/tint/buffer/storage/types/mat2x2_f16.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/storage/types/mat2x2_f16.wgsl.expected.dxc.hlsl @@ -1,17 +1,17 @@ ByteAddressBuffer tint_symbol : register(t0, space0); RWByteAddressBuffer tint_symbol_1 : register(u1, space0); -void tint_symbol_2(RWByteAddressBuffer buffer, uint offset, matrix value) { - buffer.Store >((offset + 0u), value[0u]); - buffer.Store >((offset + 4u), value[1u]); +void tint_symbol_1_store(uint offset, matrix value) { + tint_symbol_1.Store >((offset + 0u), value[0u]); + tint_symbol_1.Store >((offset + 4u), value[1u]); } -matrix tint_symbol_4(ByteAddressBuffer buffer, uint offset) { - return matrix(buffer.Load >((offset + 0u)), buffer.Load >((offset + 4u))); +matrix tint_symbol_load(uint offset) { + return matrix(tint_symbol.Load >((offset + 0u)), tint_symbol.Load >((offset + 4u))); } [numthreads(1, 1, 1)] void main() { - tint_symbol_2(tint_symbol_1, 0u, tint_symbol_4(tint_symbol, 0u)); + tint_symbol_1_store(0u, tint_symbol_load(0u)); return; } diff --git a/test/tint/buffer/storage/types/mat2x2_f32.wgsl.expected.dxc.hlsl b/test/tint/buffer/storage/types/mat2x2_f32.wgsl.expected.dxc.hlsl index a1fc1b643f..3d238492a8 100644 --- a/test/tint/buffer/storage/types/mat2x2_f32.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/storage/types/mat2x2_f32.wgsl.expected.dxc.hlsl @@ -1,17 +1,17 @@ ByteAddressBuffer tint_symbol : register(t0, space0); RWByteAddressBuffer tint_symbol_1 : register(u1, space0); -void tint_symbol_2(RWByteAddressBuffer buffer, uint offset, float2x2 value) { - buffer.Store2((offset + 0u), asuint(value[0u])); - buffer.Store2((offset + 8u), asuint(value[1u])); +void tint_symbol_1_store(uint offset, float2x2 value) { + tint_symbol_1.Store2((offset + 0u), asuint(value[0u])); + tint_symbol_1.Store2((offset + 8u), asuint(value[1u])); } -float2x2 tint_symbol_4(ByteAddressBuffer buffer, uint offset) { - return float2x2(asfloat(buffer.Load2((offset + 0u))), asfloat(buffer.Load2((offset + 8u)))); +float2x2 tint_symbol_load(uint offset) { + return float2x2(asfloat(tint_symbol.Load2((offset + 0u))), asfloat(tint_symbol.Load2((offset + 8u)))); } [numthreads(1, 1, 1)] void main() { - tint_symbol_2(tint_symbol_1, 0u, tint_symbol_4(tint_symbol, 0u)); + tint_symbol_1_store(0u, tint_symbol_load(0u)); return; } diff --git a/test/tint/buffer/storage/types/mat2x2_f32.wgsl.expected.fxc.hlsl b/test/tint/buffer/storage/types/mat2x2_f32.wgsl.expected.fxc.hlsl index a1fc1b643f..3d238492a8 100644 --- a/test/tint/buffer/storage/types/mat2x2_f32.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/storage/types/mat2x2_f32.wgsl.expected.fxc.hlsl @@ -1,17 +1,17 @@ ByteAddressBuffer tint_symbol : register(t0, space0); RWByteAddressBuffer tint_symbol_1 : register(u1, space0); -void tint_symbol_2(RWByteAddressBuffer buffer, uint offset, float2x2 value) { - buffer.Store2((offset + 0u), asuint(value[0u])); - buffer.Store2((offset + 8u), asuint(value[1u])); +void tint_symbol_1_store(uint offset, float2x2 value) { + tint_symbol_1.Store2((offset + 0u), asuint(value[0u])); + tint_symbol_1.Store2((offset + 8u), asuint(value[1u])); } -float2x2 tint_symbol_4(ByteAddressBuffer buffer, uint offset) { - return float2x2(asfloat(buffer.Load2((offset + 0u))), asfloat(buffer.Load2((offset + 8u)))); +float2x2 tint_symbol_load(uint offset) { + return float2x2(asfloat(tint_symbol.Load2((offset + 0u))), asfloat(tint_symbol.Load2((offset + 8u)))); } [numthreads(1, 1, 1)] void main() { - tint_symbol_2(tint_symbol_1, 0u, tint_symbol_4(tint_symbol, 0u)); + tint_symbol_1_store(0u, tint_symbol_load(0u)); return; } diff --git a/test/tint/buffer/storage/types/mat2x3_f16.wgsl.expected.dxc.hlsl b/test/tint/buffer/storage/types/mat2x3_f16.wgsl.expected.dxc.hlsl index 0411bf3084..868abbd968 100644 --- a/test/tint/buffer/storage/types/mat2x3_f16.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/storage/types/mat2x3_f16.wgsl.expected.dxc.hlsl @@ -1,17 +1,17 @@ ByteAddressBuffer tint_symbol : register(t0, space0); RWByteAddressBuffer tint_symbol_1 : register(u1, space0); -void tint_symbol_2(RWByteAddressBuffer buffer, uint offset, matrix value) { - buffer.Store >((offset + 0u), value[0u]); - buffer.Store >((offset + 8u), value[1u]); +void tint_symbol_1_store(uint offset, matrix value) { + tint_symbol_1.Store >((offset + 0u), value[0u]); + tint_symbol_1.Store >((offset + 8u), value[1u]); } -matrix tint_symbol_4(ByteAddressBuffer buffer, uint offset) { - return matrix(buffer.Load >((offset + 0u)), buffer.Load >((offset + 8u))); +matrix tint_symbol_load(uint offset) { + return matrix(tint_symbol.Load >((offset + 0u)), tint_symbol.Load >((offset + 8u))); } [numthreads(1, 1, 1)] void main() { - tint_symbol_2(tint_symbol_1, 0u, tint_symbol_4(tint_symbol, 0u)); + tint_symbol_1_store(0u, tint_symbol_load(0u)); return; } diff --git a/test/tint/buffer/storage/types/mat2x3_f32.wgsl.expected.dxc.hlsl b/test/tint/buffer/storage/types/mat2x3_f32.wgsl.expected.dxc.hlsl index baff4c5904..a45a2fcc9c 100644 --- a/test/tint/buffer/storage/types/mat2x3_f32.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/storage/types/mat2x3_f32.wgsl.expected.dxc.hlsl @@ -1,17 +1,17 @@ ByteAddressBuffer tint_symbol : register(t0, space0); RWByteAddressBuffer tint_symbol_1 : register(u1, space0); -void tint_symbol_2(RWByteAddressBuffer buffer, uint offset, float2x3 value) { - buffer.Store3((offset + 0u), asuint(value[0u])); - buffer.Store3((offset + 16u), asuint(value[1u])); +void tint_symbol_1_store(uint offset, float2x3 value) { + tint_symbol_1.Store3((offset + 0u), asuint(value[0u])); + tint_symbol_1.Store3((offset + 16u), asuint(value[1u])); } -float2x3 tint_symbol_4(ByteAddressBuffer buffer, uint offset) { - return float2x3(asfloat(buffer.Load3((offset + 0u))), asfloat(buffer.Load3((offset + 16u)))); +float2x3 tint_symbol_load(uint offset) { + return float2x3(asfloat(tint_symbol.Load3((offset + 0u))), asfloat(tint_symbol.Load3((offset + 16u)))); } [numthreads(1, 1, 1)] void main() { - tint_symbol_2(tint_symbol_1, 0u, tint_symbol_4(tint_symbol, 0u)); + tint_symbol_1_store(0u, tint_symbol_load(0u)); return; } diff --git a/test/tint/buffer/storage/types/mat2x3_f32.wgsl.expected.fxc.hlsl b/test/tint/buffer/storage/types/mat2x3_f32.wgsl.expected.fxc.hlsl index baff4c5904..a45a2fcc9c 100644 --- a/test/tint/buffer/storage/types/mat2x3_f32.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/storage/types/mat2x3_f32.wgsl.expected.fxc.hlsl @@ -1,17 +1,17 @@ ByteAddressBuffer tint_symbol : register(t0, space0); RWByteAddressBuffer tint_symbol_1 : register(u1, space0); -void tint_symbol_2(RWByteAddressBuffer buffer, uint offset, float2x3 value) { - buffer.Store3((offset + 0u), asuint(value[0u])); - buffer.Store3((offset + 16u), asuint(value[1u])); +void tint_symbol_1_store(uint offset, float2x3 value) { + tint_symbol_1.Store3((offset + 0u), asuint(value[0u])); + tint_symbol_1.Store3((offset + 16u), asuint(value[1u])); } -float2x3 tint_symbol_4(ByteAddressBuffer buffer, uint offset) { - return float2x3(asfloat(buffer.Load3((offset + 0u))), asfloat(buffer.Load3((offset + 16u)))); +float2x3 tint_symbol_load(uint offset) { + return float2x3(asfloat(tint_symbol.Load3((offset + 0u))), asfloat(tint_symbol.Load3((offset + 16u)))); } [numthreads(1, 1, 1)] void main() { - tint_symbol_2(tint_symbol_1, 0u, tint_symbol_4(tint_symbol, 0u)); + tint_symbol_1_store(0u, tint_symbol_load(0u)); return; } diff --git a/test/tint/buffer/storage/types/mat2x4_f16.wgsl.expected.dxc.hlsl b/test/tint/buffer/storage/types/mat2x4_f16.wgsl.expected.dxc.hlsl index ac4058f9c9..f4315535ef 100644 --- a/test/tint/buffer/storage/types/mat2x4_f16.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/storage/types/mat2x4_f16.wgsl.expected.dxc.hlsl @@ -1,17 +1,17 @@ ByteAddressBuffer tint_symbol : register(t0, space0); RWByteAddressBuffer tint_symbol_1 : register(u1, space0); -void tint_symbol_2(RWByteAddressBuffer buffer, uint offset, matrix value) { - buffer.Store >((offset + 0u), value[0u]); - buffer.Store >((offset + 8u), value[1u]); +void tint_symbol_1_store(uint offset, matrix value) { + tint_symbol_1.Store >((offset + 0u), value[0u]); + tint_symbol_1.Store >((offset + 8u), value[1u]); } -matrix tint_symbol_4(ByteAddressBuffer buffer, uint offset) { - return matrix(buffer.Load >((offset + 0u)), buffer.Load >((offset + 8u))); +matrix tint_symbol_load(uint offset) { + return matrix(tint_symbol.Load >((offset + 0u)), tint_symbol.Load >((offset + 8u))); } [numthreads(1, 1, 1)] void main() { - tint_symbol_2(tint_symbol_1, 0u, tint_symbol_4(tint_symbol, 0u)); + tint_symbol_1_store(0u, tint_symbol_load(0u)); return; } diff --git a/test/tint/buffer/storage/types/mat2x4_f32.wgsl.expected.dxc.hlsl b/test/tint/buffer/storage/types/mat2x4_f32.wgsl.expected.dxc.hlsl index 2776e89507..ed2a9baca5 100644 --- a/test/tint/buffer/storage/types/mat2x4_f32.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/storage/types/mat2x4_f32.wgsl.expected.dxc.hlsl @@ -1,17 +1,17 @@ ByteAddressBuffer tint_symbol : register(t0, space0); RWByteAddressBuffer tint_symbol_1 : register(u1, space0); -void tint_symbol_2(RWByteAddressBuffer buffer, uint offset, float2x4 value) { - buffer.Store4((offset + 0u), asuint(value[0u])); - buffer.Store4((offset + 16u), asuint(value[1u])); +void tint_symbol_1_store(uint offset, float2x4 value) { + tint_symbol_1.Store4((offset + 0u), asuint(value[0u])); + tint_symbol_1.Store4((offset + 16u), asuint(value[1u])); } -float2x4 tint_symbol_4(ByteAddressBuffer buffer, uint offset) { - return float2x4(asfloat(buffer.Load4((offset + 0u))), asfloat(buffer.Load4((offset + 16u)))); +float2x4 tint_symbol_load(uint offset) { + return float2x4(asfloat(tint_symbol.Load4((offset + 0u))), asfloat(tint_symbol.Load4((offset + 16u)))); } [numthreads(1, 1, 1)] void main() { - tint_symbol_2(tint_symbol_1, 0u, tint_symbol_4(tint_symbol, 0u)); + tint_symbol_1_store(0u, tint_symbol_load(0u)); return; } diff --git a/test/tint/buffer/storage/types/mat2x4_f32.wgsl.expected.fxc.hlsl b/test/tint/buffer/storage/types/mat2x4_f32.wgsl.expected.fxc.hlsl index 2776e89507..ed2a9baca5 100644 --- a/test/tint/buffer/storage/types/mat2x4_f32.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/storage/types/mat2x4_f32.wgsl.expected.fxc.hlsl @@ -1,17 +1,17 @@ ByteAddressBuffer tint_symbol : register(t0, space0); RWByteAddressBuffer tint_symbol_1 : register(u1, space0); -void tint_symbol_2(RWByteAddressBuffer buffer, uint offset, float2x4 value) { - buffer.Store4((offset + 0u), asuint(value[0u])); - buffer.Store4((offset + 16u), asuint(value[1u])); +void tint_symbol_1_store(uint offset, float2x4 value) { + tint_symbol_1.Store4((offset + 0u), asuint(value[0u])); + tint_symbol_1.Store4((offset + 16u), asuint(value[1u])); } -float2x4 tint_symbol_4(ByteAddressBuffer buffer, uint offset) { - return float2x4(asfloat(buffer.Load4((offset + 0u))), asfloat(buffer.Load4((offset + 16u)))); +float2x4 tint_symbol_load(uint offset) { + return float2x4(asfloat(tint_symbol.Load4((offset + 0u))), asfloat(tint_symbol.Load4((offset + 16u)))); } [numthreads(1, 1, 1)] void main() { - tint_symbol_2(tint_symbol_1, 0u, tint_symbol_4(tint_symbol, 0u)); + tint_symbol_1_store(0u, tint_symbol_load(0u)); return; } diff --git a/test/tint/buffer/storage/types/mat3x2_f16.wgsl.expected.dxc.hlsl b/test/tint/buffer/storage/types/mat3x2_f16.wgsl.expected.dxc.hlsl index f5984aea1c..e2bbcc396e 100644 --- a/test/tint/buffer/storage/types/mat3x2_f16.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/storage/types/mat3x2_f16.wgsl.expected.dxc.hlsl @@ -1,18 +1,18 @@ ByteAddressBuffer tint_symbol : register(t0, space0); RWByteAddressBuffer tint_symbol_1 : register(u1, space0); -void tint_symbol_2(RWByteAddressBuffer buffer, uint offset, matrix value) { - buffer.Store >((offset + 0u), value[0u]); - buffer.Store >((offset + 4u), value[1u]); - buffer.Store >((offset + 8u), value[2u]); +void tint_symbol_1_store(uint offset, matrix value) { + tint_symbol_1.Store >((offset + 0u), value[0u]); + tint_symbol_1.Store >((offset + 4u), value[1u]); + tint_symbol_1.Store >((offset + 8u), value[2u]); } -matrix tint_symbol_4(ByteAddressBuffer buffer, uint offset) { - return matrix(buffer.Load >((offset + 0u)), buffer.Load >((offset + 4u)), buffer.Load >((offset + 8u))); +matrix tint_symbol_load(uint offset) { + return matrix(tint_symbol.Load >((offset + 0u)), tint_symbol.Load >((offset + 4u)), tint_symbol.Load >((offset + 8u))); } [numthreads(1, 1, 1)] void main() { - tint_symbol_2(tint_symbol_1, 0u, tint_symbol_4(tint_symbol, 0u)); + tint_symbol_1_store(0u, tint_symbol_load(0u)); return; } diff --git a/test/tint/buffer/storage/types/mat3x2_f32.wgsl.expected.dxc.hlsl b/test/tint/buffer/storage/types/mat3x2_f32.wgsl.expected.dxc.hlsl index 31d606bf03..6b0f9b39b4 100644 --- a/test/tint/buffer/storage/types/mat3x2_f32.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/storage/types/mat3x2_f32.wgsl.expected.dxc.hlsl @@ -1,18 +1,18 @@ ByteAddressBuffer tint_symbol : register(t0, space0); RWByteAddressBuffer tint_symbol_1 : register(u1, space0); -void tint_symbol_2(RWByteAddressBuffer buffer, uint offset, float3x2 value) { - buffer.Store2((offset + 0u), asuint(value[0u])); - buffer.Store2((offset + 8u), asuint(value[1u])); - buffer.Store2((offset + 16u), asuint(value[2u])); +void tint_symbol_1_store(uint offset, float3x2 value) { + tint_symbol_1.Store2((offset + 0u), asuint(value[0u])); + tint_symbol_1.Store2((offset + 8u), asuint(value[1u])); + tint_symbol_1.Store2((offset + 16u), asuint(value[2u])); } -float3x2 tint_symbol_4(ByteAddressBuffer buffer, uint offset) { - return float3x2(asfloat(buffer.Load2((offset + 0u))), asfloat(buffer.Load2((offset + 8u))), asfloat(buffer.Load2((offset + 16u)))); +float3x2 tint_symbol_load(uint offset) { + return float3x2(asfloat(tint_symbol.Load2((offset + 0u))), asfloat(tint_symbol.Load2((offset + 8u))), asfloat(tint_symbol.Load2((offset + 16u)))); } [numthreads(1, 1, 1)] void main() { - tint_symbol_2(tint_symbol_1, 0u, tint_symbol_4(tint_symbol, 0u)); + tint_symbol_1_store(0u, tint_symbol_load(0u)); return; } diff --git a/test/tint/buffer/storage/types/mat3x2_f32.wgsl.expected.fxc.hlsl b/test/tint/buffer/storage/types/mat3x2_f32.wgsl.expected.fxc.hlsl index 31d606bf03..6b0f9b39b4 100644 --- a/test/tint/buffer/storage/types/mat3x2_f32.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/storage/types/mat3x2_f32.wgsl.expected.fxc.hlsl @@ -1,18 +1,18 @@ ByteAddressBuffer tint_symbol : register(t0, space0); RWByteAddressBuffer tint_symbol_1 : register(u1, space0); -void tint_symbol_2(RWByteAddressBuffer buffer, uint offset, float3x2 value) { - buffer.Store2((offset + 0u), asuint(value[0u])); - buffer.Store2((offset + 8u), asuint(value[1u])); - buffer.Store2((offset + 16u), asuint(value[2u])); +void tint_symbol_1_store(uint offset, float3x2 value) { + tint_symbol_1.Store2((offset + 0u), asuint(value[0u])); + tint_symbol_1.Store2((offset + 8u), asuint(value[1u])); + tint_symbol_1.Store2((offset + 16u), asuint(value[2u])); } -float3x2 tint_symbol_4(ByteAddressBuffer buffer, uint offset) { - return float3x2(asfloat(buffer.Load2((offset + 0u))), asfloat(buffer.Load2((offset + 8u))), asfloat(buffer.Load2((offset + 16u)))); +float3x2 tint_symbol_load(uint offset) { + return float3x2(asfloat(tint_symbol.Load2((offset + 0u))), asfloat(tint_symbol.Load2((offset + 8u))), asfloat(tint_symbol.Load2((offset + 16u)))); } [numthreads(1, 1, 1)] void main() { - tint_symbol_2(tint_symbol_1, 0u, tint_symbol_4(tint_symbol, 0u)); + tint_symbol_1_store(0u, tint_symbol_load(0u)); return; } diff --git a/test/tint/buffer/storage/types/mat3x3_f16.wgsl.expected.dxc.hlsl b/test/tint/buffer/storage/types/mat3x3_f16.wgsl.expected.dxc.hlsl index 01aa7ad6cd..f5a51d5bd3 100644 --- a/test/tint/buffer/storage/types/mat3x3_f16.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/storage/types/mat3x3_f16.wgsl.expected.dxc.hlsl @@ -1,18 +1,18 @@ ByteAddressBuffer tint_symbol : register(t0, space0); RWByteAddressBuffer tint_symbol_1 : register(u1, space0); -void tint_symbol_2(RWByteAddressBuffer buffer, uint offset, matrix value) { - buffer.Store >((offset + 0u), value[0u]); - buffer.Store >((offset + 8u), value[1u]); - buffer.Store >((offset + 16u), value[2u]); +void tint_symbol_1_store(uint offset, matrix value) { + tint_symbol_1.Store >((offset + 0u), value[0u]); + tint_symbol_1.Store >((offset + 8u), value[1u]); + tint_symbol_1.Store >((offset + 16u), value[2u]); } -matrix tint_symbol_4(ByteAddressBuffer buffer, uint offset) { - return matrix(buffer.Load >((offset + 0u)), buffer.Load >((offset + 8u)), buffer.Load >((offset + 16u))); +matrix tint_symbol_load(uint offset) { + return matrix(tint_symbol.Load >((offset + 0u)), tint_symbol.Load >((offset + 8u)), tint_symbol.Load >((offset + 16u))); } [numthreads(1, 1, 1)] void main() { - tint_symbol_2(tint_symbol_1, 0u, tint_symbol_4(tint_symbol, 0u)); + tint_symbol_1_store(0u, tint_symbol_load(0u)); return; } diff --git a/test/tint/buffer/storage/types/mat3x3_f32.wgsl.expected.dxc.hlsl b/test/tint/buffer/storage/types/mat3x3_f32.wgsl.expected.dxc.hlsl index 086d35a650..9be27c9426 100644 --- a/test/tint/buffer/storage/types/mat3x3_f32.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/storage/types/mat3x3_f32.wgsl.expected.dxc.hlsl @@ -1,18 +1,18 @@ ByteAddressBuffer tint_symbol : register(t0, space0); RWByteAddressBuffer tint_symbol_1 : register(u1, space0); -void tint_symbol_2(RWByteAddressBuffer buffer, uint offset, float3x3 value) { - buffer.Store3((offset + 0u), asuint(value[0u])); - buffer.Store3((offset + 16u), asuint(value[1u])); - buffer.Store3((offset + 32u), asuint(value[2u])); +void tint_symbol_1_store(uint offset, float3x3 value) { + tint_symbol_1.Store3((offset + 0u), asuint(value[0u])); + tint_symbol_1.Store3((offset + 16u), asuint(value[1u])); + tint_symbol_1.Store3((offset + 32u), asuint(value[2u])); } -float3x3 tint_symbol_4(ByteAddressBuffer buffer, uint offset) { - return float3x3(asfloat(buffer.Load3((offset + 0u))), asfloat(buffer.Load3((offset + 16u))), asfloat(buffer.Load3((offset + 32u)))); +float3x3 tint_symbol_load(uint offset) { + return float3x3(asfloat(tint_symbol.Load3((offset + 0u))), asfloat(tint_symbol.Load3((offset + 16u))), asfloat(tint_symbol.Load3((offset + 32u)))); } [numthreads(1, 1, 1)] void main() { - tint_symbol_2(tint_symbol_1, 0u, tint_symbol_4(tint_symbol, 0u)); + tint_symbol_1_store(0u, tint_symbol_load(0u)); return; } diff --git a/test/tint/buffer/storage/types/mat3x3_f32.wgsl.expected.fxc.hlsl b/test/tint/buffer/storage/types/mat3x3_f32.wgsl.expected.fxc.hlsl index 086d35a650..9be27c9426 100644 --- a/test/tint/buffer/storage/types/mat3x3_f32.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/storage/types/mat3x3_f32.wgsl.expected.fxc.hlsl @@ -1,18 +1,18 @@ ByteAddressBuffer tint_symbol : register(t0, space0); RWByteAddressBuffer tint_symbol_1 : register(u1, space0); -void tint_symbol_2(RWByteAddressBuffer buffer, uint offset, float3x3 value) { - buffer.Store3((offset + 0u), asuint(value[0u])); - buffer.Store3((offset + 16u), asuint(value[1u])); - buffer.Store3((offset + 32u), asuint(value[2u])); +void tint_symbol_1_store(uint offset, float3x3 value) { + tint_symbol_1.Store3((offset + 0u), asuint(value[0u])); + tint_symbol_1.Store3((offset + 16u), asuint(value[1u])); + tint_symbol_1.Store3((offset + 32u), asuint(value[2u])); } -float3x3 tint_symbol_4(ByteAddressBuffer buffer, uint offset) { - return float3x3(asfloat(buffer.Load3((offset + 0u))), asfloat(buffer.Load3((offset + 16u))), asfloat(buffer.Load3((offset + 32u)))); +float3x3 tint_symbol_load(uint offset) { + return float3x3(asfloat(tint_symbol.Load3((offset + 0u))), asfloat(tint_symbol.Load3((offset + 16u))), asfloat(tint_symbol.Load3((offset + 32u)))); } [numthreads(1, 1, 1)] void main() { - tint_symbol_2(tint_symbol_1, 0u, tint_symbol_4(tint_symbol, 0u)); + tint_symbol_1_store(0u, tint_symbol_load(0u)); return; } diff --git a/test/tint/buffer/storage/types/mat3x4_f16.wgsl.expected.dxc.hlsl b/test/tint/buffer/storage/types/mat3x4_f16.wgsl.expected.dxc.hlsl index c788defb40..d85296a096 100644 --- a/test/tint/buffer/storage/types/mat3x4_f16.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/storage/types/mat3x4_f16.wgsl.expected.dxc.hlsl @@ -1,18 +1,18 @@ ByteAddressBuffer tint_symbol : register(t0, space0); RWByteAddressBuffer tint_symbol_1 : register(u1, space0); -void tint_symbol_2(RWByteAddressBuffer buffer, uint offset, matrix value) { - buffer.Store >((offset + 0u), value[0u]); - buffer.Store >((offset + 8u), value[1u]); - buffer.Store >((offset + 16u), value[2u]); +void tint_symbol_1_store(uint offset, matrix value) { + tint_symbol_1.Store >((offset + 0u), value[0u]); + tint_symbol_1.Store >((offset + 8u), value[1u]); + tint_symbol_1.Store >((offset + 16u), value[2u]); } -matrix tint_symbol_4(ByteAddressBuffer buffer, uint offset) { - return matrix(buffer.Load >((offset + 0u)), buffer.Load >((offset + 8u)), buffer.Load >((offset + 16u))); +matrix tint_symbol_load(uint offset) { + return matrix(tint_symbol.Load >((offset + 0u)), tint_symbol.Load >((offset + 8u)), tint_symbol.Load >((offset + 16u))); } [numthreads(1, 1, 1)] void main() { - tint_symbol_2(tint_symbol_1, 0u, tint_symbol_4(tint_symbol, 0u)); + tint_symbol_1_store(0u, tint_symbol_load(0u)); return; } diff --git a/test/tint/buffer/storage/types/mat3x4_f32.wgsl.expected.dxc.hlsl b/test/tint/buffer/storage/types/mat3x4_f32.wgsl.expected.dxc.hlsl index 2d8f11b56d..fd2ea5b55c 100644 --- a/test/tint/buffer/storage/types/mat3x4_f32.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/storage/types/mat3x4_f32.wgsl.expected.dxc.hlsl @@ -1,18 +1,18 @@ ByteAddressBuffer tint_symbol : register(t0, space0); RWByteAddressBuffer tint_symbol_1 : register(u1, space0); -void tint_symbol_2(RWByteAddressBuffer buffer, uint offset, float3x4 value) { - buffer.Store4((offset + 0u), asuint(value[0u])); - buffer.Store4((offset + 16u), asuint(value[1u])); - buffer.Store4((offset + 32u), asuint(value[2u])); +void tint_symbol_1_store(uint offset, float3x4 value) { + tint_symbol_1.Store4((offset + 0u), asuint(value[0u])); + tint_symbol_1.Store4((offset + 16u), asuint(value[1u])); + tint_symbol_1.Store4((offset + 32u), asuint(value[2u])); } -float3x4 tint_symbol_4(ByteAddressBuffer buffer, uint offset) { - return float3x4(asfloat(buffer.Load4((offset + 0u))), asfloat(buffer.Load4((offset + 16u))), asfloat(buffer.Load4((offset + 32u)))); +float3x4 tint_symbol_load(uint offset) { + return float3x4(asfloat(tint_symbol.Load4((offset + 0u))), asfloat(tint_symbol.Load4((offset + 16u))), asfloat(tint_symbol.Load4((offset + 32u)))); } [numthreads(1, 1, 1)] void main() { - tint_symbol_2(tint_symbol_1, 0u, tint_symbol_4(tint_symbol, 0u)); + tint_symbol_1_store(0u, tint_symbol_load(0u)); return; } diff --git a/test/tint/buffer/storage/types/mat3x4_f32.wgsl.expected.fxc.hlsl b/test/tint/buffer/storage/types/mat3x4_f32.wgsl.expected.fxc.hlsl index 2d8f11b56d..fd2ea5b55c 100644 --- a/test/tint/buffer/storage/types/mat3x4_f32.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/storage/types/mat3x4_f32.wgsl.expected.fxc.hlsl @@ -1,18 +1,18 @@ ByteAddressBuffer tint_symbol : register(t0, space0); RWByteAddressBuffer tint_symbol_1 : register(u1, space0); -void tint_symbol_2(RWByteAddressBuffer buffer, uint offset, float3x4 value) { - buffer.Store4((offset + 0u), asuint(value[0u])); - buffer.Store4((offset + 16u), asuint(value[1u])); - buffer.Store4((offset + 32u), asuint(value[2u])); +void tint_symbol_1_store(uint offset, float3x4 value) { + tint_symbol_1.Store4((offset + 0u), asuint(value[0u])); + tint_symbol_1.Store4((offset + 16u), asuint(value[1u])); + tint_symbol_1.Store4((offset + 32u), asuint(value[2u])); } -float3x4 tint_symbol_4(ByteAddressBuffer buffer, uint offset) { - return float3x4(asfloat(buffer.Load4((offset + 0u))), asfloat(buffer.Load4((offset + 16u))), asfloat(buffer.Load4((offset + 32u)))); +float3x4 tint_symbol_load(uint offset) { + return float3x4(asfloat(tint_symbol.Load4((offset + 0u))), asfloat(tint_symbol.Load4((offset + 16u))), asfloat(tint_symbol.Load4((offset + 32u)))); } [numthreads(1, 1, 1)] void main() { - tint_symbol_2(tint_symbol_1, 0u, tint_symbol_4(tint_symbol, 0u)); + tint_symbol_1_store(0u, tint_symbol_load(0u)); return; } diff --git a/test/tint/buffer/storage/types/mat4x2_f16.wgsl.expected.dxc.hlsl b/test/tint/buffer/storage/types/mat4x2_f16.wgsl.expected.dxc.hlsl index 8dce8445a6..f31fc10961 100644 --- a/test/tint/buffer/storage/types/mat4x2_f16.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/storage/types/mat4x2_f16.wgsl.expected.dxc.hlsl @@ -1,19 +1,19 @@ ByteAddressBuffer tint_symbol : register(t0, space0); RWByteAddressBuffer tint_symbol_1 : register(u1, space0); -void tint_symbol_2(RWByteAddressBuffer buffer, uint offset, matrix value) { - buffer.Store >((offset + 0u), value[0u]); - buffer.Store >((offset + 4u), value[1u]); - buffer.Store >((offset + 8u), value[2u]); - buffer.Store >((offset + 12u), value[3u]); +void tint_symbol_1_store(uint offset, matrix value) { + tint_symbol_1.Store >((offset + 0u), value[0u]); + tint_symbol_1.Store >((offset + 4u), value[1u]); + tint_symbol_1.Store >((offset + 8u), value[2u]); + tint_symbol_1.Store >((offset + 12u), value[3u]); } -matrix tint_symbol_4(ByteAddressBuffer buffer, uint offset) { - return matrix(buffer.Load >((offset + 0u)), buffer.Load >((offset + 4u)), buffer.Load >((offset + 8u)), buffer.Load >((offset + 12u))); +matrix tint_symbol_load(uint offset) { + return matrix(tint_symbol.Load >((offset + 0u)), tint_symbol.Load >((offset + 4u)), tint_symbol.Load >((offset + 8u)), tint_symbol.Load >((offset + 12u))); } [numthreads(1, 1, 1)] void main() { - tint_symbol_2(tint_symbol_1, 0u, tint_symbol_4(tint_symbol, 0u)); + tint_symbol_1_store(0u, tint_symbol_load(0u)); return; } diff --git a/test/tint/buffer/storage/types/mat4x2_f32.wgsl.expected.dxc.hlsl b/test/tint/buffer/storage/types/mat4x2_f32.wgsl.expected.dxc.hlsl index a8ca4f5a0e..747312e477 100644 --- a/test/tint/buffer/storage/types/mat4x2_f32.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/storage/types/mat4x2_f32.wgsl.expected.dxc.hlsl @@ -1,19 +1,19 @@ ByteAddressBuffer tint_symbol : register(t0, space0); RWByteAddressBuffer tint_symbol_1 : register(u1, space0); -void tint_symbol_2(RWByteAddressBuffer buffer, uint offset, float4x2 value) { - buffer.Store2((offset + 0u), asuint(value[0u])); - buffer.Store2((offset + 8u), asuint(value[1u])); - buffer.Store2((offset + 16u), asuint(value[2u])); - buffer.Store2((offset + 24u), asuint(value[3u])); +void tint_symbol_1_store(uint offset, float4x2 value) { + tint_symbol_1.Store2((offset + 0u), asuint(value[0u])); + tint_symbol_1.Store2((offset + 8u), asuint(value[1u])); + tint_symbol_1.Store2((offset + 16u), asuint(value[2u])); + tint_symbol_1.Store2((offset + 24u), asuint(value[3u])); } -float4x2 tint_symbol_4(ByteAddressBuffer buffer, uint offset) { - return float4x2(asfloat(buffer.Load2((offset + 0u))), asfloat(buffer.Load2((offset + 8u))), asfloat(buffer.Load2((offset + 16u))), asfloat(buffer.Load2((offset + 24u)))); +float4x2 tint_symbol_load(uint offset) { + return float4x2(asfloat(tint_symbol.Load2((offset + 0u))), asfloat(tint_symbol.Load2((offset + 8u))), asfloat(tint_symbol.Load2((offset + 16u))), asfloat(tint_symbol.Load2((offset + 24u)))); } [numthreads(1, 1, 1)] void main() { - tint_symbol_2(tint_symbol_1, 0u, tint_symbol_4(tint_symbol, 0u)); + tint_symbol_1_store(0u, tint_symbol_load(0u)); return; } diff --git a/test/tint/buffer/storage/types/mat4x2_f32.wgsl.expected.fxc.hlsl b/test/tint/buffer/storage/types/mat4x2_f32.wgsl.expected.fxc.hlsl index a8ca4f5a0e..747312e477 100644 --- a/test/tint/buffer/storage/types/mat4x2_f32.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/storage/types/mat4x2_f32.wgsl.expected.fxc.hlsl @@ -1,19 +1,19 @@ ByteAddressBuffer tint_symbol : register(t0, space0); RWByteAddressBuffer tint_symbol_1 : register(u1, space0); -void tint_symbol_2(RWByteAddressBuffer buffer, uint offset, float4x2 value) { - buffer.Store2((offset + 0u), asuint(value[0u])); - buffer.Store2((offset + 8u), asuint(value[1u])); - buffer.Store2((offset + 16u), asuint(value[2u])); - buffer.Store2((offset + 24u), asuint(value[3u])); +void tint_symbol_1_store(uint offset, float4x2 value) { + tint_symbol_1.Store2((offset + 0u), asuint(value[0u])); + tint_symbol_1.Store2((offset + 8u), asuint(value[1u])); + tint_symbol_1.Store2((offset + 16u), asuint(value[2u])); + tint_symbol_1.Store2((offset + 24u), asuint(value[3u])); } -float4x2 tint_symbol_4(ByteAddressBuffer buffer, uint offset) { - return float4x2(asfloat(buffer.Load2((offset + 0u))), asfloat(buffer.Load2((offset + 8u))), asfloat(buffer.Load2((offset + 16u))), asfloat(buffer.Load2((offset + 24u)))); +float4x2 tint_symbol_load(uint offset) { + return float4x2(asfloat(tint_symbol.Load2((offset + 0u))), asfloat(tint_symbol.Load2((offset + 8u))), asfloat(tint_symbol.Load2((offset + 16u))), asfloat(tint_symbol.Load2((offset + 24u)))); } [numthreads(1, 1, 1)] void main() { - tint_symbol_2(tint_symbol_1, 0u, tint_symbol_4(tint_symbol, 0u)); + tint_symbol_1_store(0u, tint_symbol_load(0u)); return; } diff --git a/test/tint/buffer/storage/types/mat4x3_f16.wgsl.expected.dxc.hlsl b/test/tint/buffer/storage/types/mat4x3_f16.wgsl.expected.dxc.hlsl index 29a2a903e3..4d7ed8be17 100644 --- a/test/tint/buffer/storage/types/mat4x3_f16.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/storage/types/mat4x3_f16.wgsl.expected.dxc.hlsl @@ -1,19 +1,19 @@ ByteAddressBuffer tint_symbol : register(t0, space0); RWByteAddressBuffer tint_symbol_1 : register(u1, space0); -void tint_symbol_2(RWByteAddressBuffer buffer, uint offset, matrix value) { - buffer.Store >((offset + 0u), value[0u]); - buffer.Store >((offset + 8u), value[1u]); - buffer.Store >((offset + 16u), value[2u]); - buffer.Store >((offset + 24u), value[3u]); +void tint_symbol_1_store(uint offset, matrix value) { + tint_symbol_1.Store >((offset + 0u), value[0u]); + tint_symbol_1.Store >((offset + 8u), value[1u]); + tint_symbol_1.Store >((offset + 16u), value[2u]); + tint_symbol_1.Store >((offset + 24u), value[3u]); } -matrix tint_symbol_4(ByteAddressBuffer buffer, uint offset) { - return matrix(buffer.Load >((offset + 0u)), buffer.Load >((offset + 8u)), buffer.Load >((offset + 16u)), buffer.Load >((offset + 24u))); +matrix tint_symbol_load(uint offset) { + return matrix(tint_symbol.Load >((offset + 0u)), tint_symbol.Load >((offset + 8u)), tint_symbol.Load >((offset + 16u)), tint_symbol.Load >((offset + 24u))); } [numthreads(1, 1, 1)] void main() { - tint_symbol_2(tint_symbol_1, 0u, tint_symbol_4(tint_symbol, 0u)); + tint_symbol_1_store(0u, tint_symbol_load(0u)); return; } diff --git a/test/tint/buffer/storage/types/mat4x3_f32.wgsl.expected.dxc.hlsl b/test/tint/buffer/storage/types/mat4x3_f32.wgsl.expected.dxc.hlsl index 44051daa37..0d143708a1 100644 --- a/test/tint/buffer/storage/types/mat4x3_f32.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/storage/types/mat4x3_f32.wgsl.expected.dxc.hlsl @@ -1,19 +1,19 @@ ByteAddressBuffer tint_symbol : register(t0, space0); RWByteAddressBuffer tint_symbol_1 : register(u1, space0); -void tint_symbol_2(RWByteAddressBuffer buffer, uint offset, float4x3 value) { - buffer.Store3((offset + 0u), asuint(value[0u])); - buffer.Store3((offset + 16u), asuint(value[1u])); - buffer.Store3((offset + 32u), asuint(value[2u])); - buffer.Store3((offset + 48u), asuint(value[3u])); +void tint_symbol_1_store(uint offset, float4x3 value) { + tint_symbol_1.Store3((offset + 0u), asuint(value[0u])); + tint_symbol_1.Store3((offset + 16u), asuint(value[1u])); + tint_symbol_1.Store3((offset + 32u), asuint(value[2u])); + tint_symbol_1.Store3((offset + 48u), asuint(value[3u])); } -float4x3 tint_symbol_4(ByteAddressBuffer buffer, uint offset) { - return float4x3(asfloat(buffer.Load3((offset + 0u))), asfloat(buffer.Load3((offset + 16u))), asfloat(buffer.Load3((offset + 32u))), asfloat(buffer.Load3((offset + 48u)))); +float4x3 tint_symbol_load(uint offset) { + return float4x3(asfloat(tint_symbol.Load3((offset + 0u))), asfloat(tint_symbol.Load3((offset + 16u))), asfloat(tint_symbol.Load3((offset + 32u))), asfloat(tint_symbol.Load3((offset + 48u)))); } [numthreads(1, 1, 1)] void main() { - tint_symbol_2(tint_symbol_1, 0u, tint_symbol_4(tint_symbol, 0u)); + tint_symbol_1_store(0u, tint_symbol_load(0u)); return; } diff --git a/test/tint/buffer/storage/types/mat4x3_f32.wgsl.expected.fxc.hlsl b/test/tint/buffer/storage/types/mat4x3_f32.wgsl.expected.fxc.hlsl index 44051daa37..0d143708a1 100644 --- a/test/tint/buffer/storage/types/mat4x3_f32.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/storage/types/mat4x3_f32.wgsl.expected.fxc.hlsl @@ -1,19 +1,19 @@ ByteAddressBuffer tint_symbol : register(t0, space0); RWByteAddressBuffer tint_symbol_1 : register(u1, space0); -void tint_symbol_2(RWByteAddressBuffer buffer, uint offset, float4x3 value) { - buffer.Store3((offset + 0u), asuint(value[0u])); - buffer.Store3((offset + 16u), asuint(value[1u])); - buffer.Store3((offset + 32u), asuint(value[2u])); - buffer.Store3((offset + 48u), asuint(value[3u])); +void tint_symbol_1_store(uint offset, float4x3 value) { + tint_symbol_1.Store3((offset + 0u), asuint(value[0u])); + tint_symbol_1.Store3((offset + 16u), asuint(value[1u])); + tint_symbol_1.Store3((offset + 32u), asuint(value[2u])); + tint_symbol_1.Store3((offset + 48u), asuint(value[3u])); } -float4x3 tint_symbol_4(ByteAddressBuffer buffer, uint offset) { - return float4x3(asfloat(buffer.Load3((offset + 0u))), asfloat(buffer.Load3((offset + 16u))), asfloat(buffer.Load3((offset + 32u))), asfloat(buffer.Load3((offset + 48u)))); +float4x3 tint_symbol_load(uint offset) { + return float4x3(asfloat(tint_symbol.Load3((offset + 0u))), asfloat(tint_symbol.Load3((offset + 16u))), asfloat(tint_symbol.Load3((offset + 32u))), asfloat(tint_symbol.Load3((offset + 48u)))); } [numthreads(1, 1, 1)] void main() { - tint_symbol_2(tint_symbol_1, 0u, tint_symbol_4(tint_symbol, 0u)); + tint_symbol_1_store(0u, tint_symbol_load(0u)); return; } diff --git a/test/tint/buffer/storage/types/mat4x4_f16.wgsl.expected.dxc.hlsl b/test/tint/buffer/storage/types/mat4x4_f16.wgsl.expected.dxc.hlsl index 3931c45f53..2bd3ee53dc 100644 --- a/test/tint/buffer/storage/types/mat4x4_f16.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/storage/types/mat4x4_f16.wgsl.expected.dxc.hlsl @@ -1,19 +1,19 @@ ByteAddressBuffer tint_symbol : register(t0, space0); RWByteAddressBuffer tint_symbol_1 : register(u1, space0); -void tint_symbol_2(RWByteAddressBuffer buffer, uint offset, matrix value) { - buffer.Store >((offset + 0u), value[0u]); - buffer.Store >((offset + 8u), value[1u]); - buffer.Store >((offset + 16u), value[2u]); - buffer.Store >((offset + 24u), value[3u]); +void tint_symbol_1_store(uint offset, matrix value) { + tint_symbol_1.Store >((offset + 0u), value[0u]); + tint_symbol_1.Store >((offset + 8u), value[1u]); + tint_symbol_1.Store >((offset + 16u), value[2u]); + tint_symbol_1.Store >((offset + 24u), value[3u]); } -matrix tint_symbol_4(ByteAddressBuffer buffer, uint offset) { - return matrix(buffer.Load >((offset + 0u)), buffer.Load >((offset + 8u)), buffer.Load >((offset + 16u)), buffer.Load >((offset + 24u))); +matrix tint_symbol_load(uint offset) { + return matrix(tint_symbol.Load >((offset + 0u)), tint_symbol.Load >((offset + 8u)), tint_symbol.Load >((offset + 16u)), tint_symbol.Load >((offset + 24u))); } [numthreads(1, 1, 1)] void main() { - tint_symbol_2(tint_symbol_1, 0u, tint_symbol_4(tint_symbol, 0u)); + tint_symbol_1_store(0u, tint_symbol_load(0u)); return; } diff --git a/test/tint/buffer/storage/types/mat4x4_f32.wgsl.expected.dxc.hlsl b/test/tint/buffer/storage/types/mat4x4_f32.wgsl.expected.dxc.hlsl index e818c0922d..f40d5de2d0 100644 --- a/test/tint/buffer/storage/types/mat4x4_f32.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/storage/types/mat4x4_f32.wgsl.expected.dxc.hlsl @@ -1,19 +1,19 @@ ByteAddressBuffer tint_symbol : register(t0, space0); RWByteAddressBuffer tint_symbol_1 : register(u1, space0); -void tint_symbol_2(RWByteAddressBuffer buffer, uint offset, float4x4 value) { - buffer.Store4((offset + 0u), asuint(value[0u])); - buffer.Store4((offset + 16u), asuint(value[1u])); - buffer.Store4((offset + 32u), asuint(value[2u])); - buffer.Store4((offset + 48u), asuint(value[3u])); +void tint_symbol_1_store(uint offset, float4x4 value) { + tint_symbol_1.Store4((offset + 0u), asuint(value[0u])); + tint_symbol_1.Store4((offset + 16u), asuint(value[1u])); + tint_symbol_1.Store4((offset + 32u), asuint(value[2u])); + tint_symbol_1.Store4((offset + 48u), asuint(value[3u])); } -float4x4 tint_symbol_4(ByteAddressBuffer buffer, uint offset) { - return float4x4(asfloat(buffer.Load4((offset + 0u))), asfloat(buffer.Load4((offset + 16u))), asfloat(buffer.Load4((offset + 32u))), asfloat(buffer.Load4((offset + 48u)))); +float4x4 tint_symbol_load(uint offset) { + return float4x4(asfloat(tint_symbol.Load4((offset + 0u))), asfloat(tint_symbol.Load4((offset + 16u))), asfloat(tint_symbol.Load4((offset + 32u))), asfloat(tint_symbol.Load4((offset + 48u)))); } [numthreads(1, 1, 1)] void main() { - tint_symbol_2(tint_symbol_1, 0u, tint_symbol_4(tint_symbol, 0u)); + tint_symbol_1_store(0u, tint_symbol_load(0u)); return; } diff --git a/test/tint/buffer/storage/types/mat4x4_f32.wgsl.expected.fxc.hlsl b/test/tint/buffer/storage/types/mat4x4_f32.wgsl.expected.fxc.hlsl index e818c0922d..f40d5de2d0 100644 --- a/test/tint/buffer/storage/types/mat4x4_f32.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/storage/types/mat4x4_f32.wgsl.expected.fxc.hlsl @@ -1,19 +1,19 @@ ByteAddressBuffer tint_symbol : register(t0, space0); RWByteAddressBuffer tint_symbol_1 : register(u1, space0); -void tint_symbol_2(RWByteAddressBuffer buffer, uint offset, float4x4 value) { - buffer.Store4((offset + 0u), asuint(value[0u])); - buffer.Store4((offset + 16u), asuint(value[1u])); - buffer.Store4((offset + 32u), asuint(value[2u])); - buffer.Store4((offset + 48u), asuint(value[3u])); +void tint_symbol_1_store(uint offset, float4x4 value) { + tint_symbol_1.Store4((offset + 0u), asuint(value[0u])); + tint_symbol_1.Store4((offset + 16u), asuint(value[1u])); + tint_symbol_1.Store4((offset + 32u), asuint(value[2u])); + tint_symbol_1.Store4((offset + 48u), asuint(value[3u])); } -float4x4 tint_symbol_4(ByteAddressBuffer buffer, uint offset) { - return float4x4(asfloat(buffer.Load4((offset + 0u))), asfloat(buffer.Load4((offset + 16u))), asfloat(buffer.Load4((offset + 32u))), asfloat(buffer.Load4((offset + 48u)))); +float4x4 tint_symbol_load(uint offset) { + return float4x4(asfloat(tint_symbol.Load4((offset + 0u))), asfloat(tint_symbol.Load4((offset + 16u))), asfloat(tint_symbol.Load4((offset + 32u))), asfloat(tint_symbol.Load4((offset + 48u)))); } [numthreads(1, 1, 1)] void main() { - tint_symbol_2(tint_symbol_1, 0u, tint_symbol_4(tint_symbol, 0u)); + tint_symbol_1_store(0u, tint_symbol_load(0u)); return; } diff --git a/test/tint/buffer/storage/types/struct_f16.wgsl.expected.dxc.hlsl b/test/tint/buffer/storage/types/struct_f16.wgsl.expected.dxc.hlsl index 9a489404aa..0c177ffe85 100644 --- a/test/tint/buffer/storage/types/struct_f16.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/storage/types/struct_f16.wgsl.expected.dxc.hlsl @@ -10,38 +10,38 @@ struct S { ByteAddressBuffer tint_symbol : register(t0, space0); RWByteAddressBuffer tint_symbol_1 : register(u1, space0); -matrix tint_symbol_6(ByteAddressBuffer buffer, uint offset) { - return matrix(buffer.Load >((offset + 0u)), buffer.Load >((offset + 8u))); +matrix tint_symbol_load_4(uint offset) { + return matrix(tint_symbol.Load >((offset + 0u)), tint_symbol.Load >((offset + 8u))); } -Inner tint_symbol_3(ByteAddressBuffer buffer, uint offset) { - const Inner tint_symbol_14 = {buffer.Load((offset + 0u)), buffer.Load >((offset + 8u)), tint_symbol_6(buffer, (offset + 16u))}; - return tint_symbol_14; +Inner tint_symbol_load_1(uint offset) { + const Inner tint_symbol_2 = {tint_symbol.Load((offset + 0u)), tint_symbol.Load >((offset + 8u)), tint_symbol_load_4((offset + 16u))}; + return tint_symbol_2; } -S tint_symbol_2(ByteAddressBuffer buffer, uint offset) { - const S tint_symbol_15 = {tint_symbol_3(buffer, (offset + 0u))}; - return tint_symbol_15; +S tint_symbol_load(uint offset) { + const S tint_symbol_3 = {tint_symbol_load_1((offset + 0u))}; + return tint_symbol_3; } -void tint_symbol_12(RWByteAddressBuffer buffer, uint offset, matrix value) { - buffer.Store >((offset + 0u), value[0u]); - buffer.Store >((offset + 8u), value[1u]); +void tint_symbol_1_store_4(uint offset, matrix value) { + tint_symbol_1.Store >((offset + 0u), value[0u]); + tint_symbol_1.Store >((offset + 8u), value[1u]); } -void tint_symbol_9(RWByteAddressBuffer buffer, uint offset, Inner value) { - buffer.Store((offset + 0u), value.scalar_f16); - buffer.Store >((offset + 8u), value.vec3_f16); - tint_symbol_12(buffer, (offset + 16u), value.mat2x4_f16); +void tint_symbol_1_store_1(uint offset, Inner value) { + tint_symbol_1.Store((offset + 0u), value.scalar_f16); + tint_symbol_1.Store >((offset + 8u), value.vec3_f16); + tint_symbol_1_store_4((offset + 16u), value.mat2x4_f16); } -void tint_symbol_8(RWByteAddressBuffer buffer, uint offset, S value) { - tint_symbol_9(buffer, (offset + 0u), value.inner); +void tint_symbol_1_store(uint offset, S value) { + tint_symbol_1_store_1((offset + 0u), value.inner); } [numthreads(1, 1, 1)] void main() { - const S t = tint_symbol_2(tint_symbol, 0u); - tint_symbol_8(tint_symbol_1, 0u, t); + const S t = tint_symbol_load(0u); + tint_symbol_1_store(0u, t); return; } diff --git a/test/tint/buffer/storage/types/struct_f32.wgsl.expected.dxc.hlsl b/test/tint/buffer/storage/types/struct_f32.wgsl.expected.dxc.hlsl index b32317fc4c..6e8702b9d9 100644 --- a/test/tint/buffer/storage/types/struct_f32.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/storage/types/struct_f32.wgsl.expected.dxc.hlsl @@ -10,38 +10,38 @@ struct S { ByteAddressBuffer tint_symbol : register(t0, space0); RWByteAddressBuffer tint_symbol_1 : register(u1, space0); -float2x4 tint_symbol_6(ByteAddressBuffer buffer, uint offset) { - return float2x4(asfloat(buffer.Load4((offset + 0u))), asfloat(buffer.Load4((offset + 16u)))); +float2x4 tint_symbol_load_4(uint offset) { + return float2x4(asfloat(tint_symbol.Load4((offset + 0u))), asfloat(tint_symbol.Load4((offset + 16u)))); } -Inner tint_symbol_3(ByteAddressBuffer buffer, uint offset) { - const Inner tint_symbol_14 = {asfloat(buffer.Load((offset + 0u))), asfloat(buffer.Load3((offset + 16u))), tint_symbol_6(buffer, (offset + 32u))}; - return tint_symbol_14; +Inner tint_symbol_load_1(uint offset) { + const Inner tint_symbol_2 = {asfloat(tint_symbol.Load((offset + 0u))), asfloat(tint_symbol.Load3((offset + 16u))), tint_symbol_load_4((offset + 32u))}; + return tint_symbol_2; } -S tint_symbol_2(ByteAddressBuffer buffer, uint offset) { - const S tint_symbol_15 = {tint_symbol_3(buffer, (offset + 0u))}; - return tint_symbol_15; +S tint_symbol_load(uint offset) { + const S tint_symbol_3 = {tint_symbol_load_1((offset + 0u))}; + return tint_symbol_3; } -void tint_symbol_12(RWByteAddressBuffer buffer, uint offset, float2x4 value) { - buffer.Store4((offset + 0u), asuint(value[0u])); - buffer.Store4((offset + 16u), asuint(value[1u])); +void tint_symbol_1_store_4(uint offset, float2x4 value) { + tint_symbol_1.Store4((offset + 0u), asuint(value[0u])); + tint_symbol_1.Store4((offset + 16u), asuint(value[1u])); } -void tint_symbol_9(RWByteAddressBuffer buffer, uint offset, Inner value) { - buffer.Store((offset + 0u), asuint(value.scalar_f32)); - buffer.Store3((offset + 16u), asuint(value.vec3_f32)); - tint_symbol_12(buffer, (offset + 32u), value.mat2x4_f32); +void tint_symbol_1_store_1(uint offset, Inner value) { + tint_symbol_1.Store((offset + 0u), asuint(value.scalar_f32)); + tint_symbol_1.Store3((offset + 16u), asuint(value.vec3_f32)); + tint_symbol_1_store_4((offset + 32u), value.mat2x4_f32); } -void tint_symbol_8(RWByteAddressBuffer buffer, uint offset, S value) { - tint_symbol_9(buffer, (offset + 0u), value.inner); +void tint_symbol_1_store(uint offset, S value) { + tint_symbol_1_store_1((offset + 0u), value.inner); } [numthreads(1, 1, 1)] void main() { - const S t = tint_symbol_2(tint_symbol, 0u); - tint_symbol_8(tint_symbol_1, 0u, t); + const S t = tint_symbol_load(0u); + tint_symbol_1_store(0u, t); return; } diff --git a/test/tint/buffer/storage/types/struct_f32.wgsl.expected.fxc.hlsl b/test/tint/buffer/storage/types/struct_f32.wgsl.expected.fxc.hlsl index b32317fc4c..6e8702b9d9 100644 --- a/test/tint/buffer/storage/types/struct_f32.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/storage/types/struct_f32.wgsl.expected.fxc.hlsl @@ -10,38 +10,38 @@ struct S { ByteAddressBuffer tint_symbol : register(t0, space0); RWByteAddressBuffer tint_symbol_1 : register(u1, space0); -float2x4 tint_symbol_6(ByteAddressBuffer buffer, uint offset) { - return float2x4(asfloat(buffer.Load4((offset + 0u))), asfloat(buffer.Load4((offset + 16u)))); +float2x4 tint_symbol_load_4(uint offset) { + return float2x4(asfloat(tint_symbol.Load4((offset + 0u))), asfloat(tint_symbol.Load4((offset + 16u)))); } -Inner tint_symbol_3(ByteAddressBuffer buffer, uint offset) { - const Inner tint_symbol_14 = {asfloat(buffer.Load((offset + 0u))), asfloat(buffer.Load3((offset + 16u))), tint_symbol_6(buffer, (offset + 32u))}; - return tint_symbol_14; +Inner tint_symbol_load_1(uint offset) { + const Inner tint_symbol_2 = {asfloat(tint_symbol.Load((offset + 0u))), asfloat(tint_symbol.Load3((offset + 16u))), tint_symbol_load_4((offset + 32u))}; + return tint_symbol_2; } -S tint_symbol_2(ByteAddressBuffer buffer, uint offset) { - const S tint_symbol_15 = {tint_symbol_3(buffer, (offset + 0u))}; - return tint_symbol_15; +S tint_symbol_load(uint offset) { + const S tint_symbol_3 = {tint_symbol_load_1((offset + 0u))}; + return tint_symbol_3; } -void tint_symbol_12(RWByteAddressBuffer buffer, uint offset, float2x4 value) { - buffer.Store4((offset + 0u), asuint(value[0u])); - buffer.Store4((offset + 16u), asuint(value[1u])); +void tint_symbol_1_store_4(uint offset, float2x4 value) { + tint_symbol_1.Store4((offset + 0u), asuint(value[0u])); + tint_symbol_1.Store4((offset + 16u), asuint(value[1u])); } -void tint_symbol_9(RWByteAddressBuffer buffer, uint offset, Inner value) { - buffer.Store((offset + 0u), asuint(value.scalar_f32)); - buffer.Store3((offset + 16u), asuint(value.vec3_f32)); - tint_symbol_12(buffer, (offset + 32u), value.mat2x4_f32); +void tint_symbol_1_store_1(uint offset, Inner value) { + tint_symbol_1.Store((offset + 0u), asuint(value.scalar_f32)); + tint_symbol_1.Store3((offset + 16u), asuint(value.vec3_f32)); + tint_symbol_1_store_4((offset + 32u), value.mat2x4_f32); } -void tint_symbol_8(RWByteAddressBuffer buffer, uint offset, S value) { - tint_symbol_9(buffer, (offset + 0u), value.inner); +void tint_symbol_1_store(uint offset, S value) { + tint_symbol_1_store_1((offset + 0u), value.inner); } [numthreads(1, 1, 1)] void main() { - const S t = tint_symbol_2(tint_symbol, 0u); - tint_symbol_8(tint_symbol_1, 0u, t); + const S t = tint_symbol_load(0u); + tint_symbol_1_store(0u, t); return; } diff --git a/test/tint/buffer/uniform/dynamic_index/read.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/dynamic_index/read.wgsl.expected.dxc.hlsl index 4e80c66530..35a9c30794 100644 --- a/test/tint/buffer/uniform/dynamic_index/read.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/dynamic_index/read.wgsl.expected.dxc.hlsl @@ -6,85 +6,85 @@ struct tint_symbol_1 { uint idx : SV_GroupIndex; }; -float2x2 tint_symbol_14(uint4 buffer[272], uint offset) { +float2x2 ub_load_12(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = ub[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = ub[scalar_offset_1 / 4]; return float2x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy))); } -float2x3 tint_symbol_15(uint4 buffer[272], uint offset) { +float2x3 ub_load_13(uint offset) { const uint scalar_offset_2 = ((offset + 0u)) / 4; const uint scalar_offset_3 = ((offset + 16u)) / 4; - return float2x3(asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz)); + return float2x3(asfloat(ub[scalar_offset_2 / 4].xyz), asfloat(ub[scalar_offset_3 / 4].xyz)); } -float2x4 tint_symbol_16(uint4 buffer[272], uint offset) { +float2x4 ub_load_14(uint offset) { const uint scalar_offset_4 = ((offset + 0u)) / 4; const uint scalar_offset_5 = ((offset + 16u)) / 4; - return float2x4(asfloat(buffer[scalar_offset_4 / 4]), asfloat(buffer[scalar_offset_5 / 4])); + return float2x4(asfloat(ub[scalar_offset_4 / 4]), asfloat(ub[scalar_offset_5 / 4])); } -float3x2 tint_symbol_17(uint4 buffer[272], uint offset) { +float3x2 ub_load_15(uint offset) { const uint scalar_offset_6 = ((offset + 0u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_6 / 4]; + uint4 ubo_load_2 = ub[scalar_offset_6 / 4]; const uint scalar_offset_7 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_7 / 4]; + uint4 ubo_load_3 = ub[scalar_offset_7 / 4]; const uint scalar_offset_8 = ((offset + 16u)) / 4; - uint4 ubo_load_4 = buffer[scalar_offset_8 / 4]; + uint4 ubo_load_4 = ub[scalar_offset_8 / 4]; return float3x2(asfloat(((scalar_offset_6 & 2) ? ubo_load_2.zw : ubo_load_2.xy)), asfloat(((scalar_offset_7 & 2) ? ubo_load_3.zw : ubo_load_3.xy)), asfloat(((scalar_offset_8 & 2) ? ubo_load_4.zw : ubo_load_4.xy))); } -float3x3 tint_symbol_18(uint4 buffer[272], uint offset) { +float3x3 ub_load_16(uint offset) { const uint scalar_offset_9 = ((offset + 0u)) / 4; const uint scalar_offset_10 = ((offset + 16u)) / 4; const uint scalar_offset_11 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset_9 / 4].xyz), asfloat(buffer[scalar_offset_10 / 4].xyz), asfloat(buffer[scalar_offset_11 / 4].xyz)); + return float3x3(asfloat(ub[scalar_offset_9 / 4].xyz), asfloat(ub[scalar_offset_10 / 4].xyz), asfloat(ub[scalar_offset_11 / 4].xyz)); } -float3x4 tint_symbol_19(uint4 buffer[272], uint offset) { +float3x4 ub_load_17(uint offset) { const uint scalar_offset_12 = ((offset + 0u)) / 4; const uint scalar_offset_13 = ((offset + 16u)) / 4; const uint scalar_offset_14 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset_12 / 4]), asfloat(buffer[scalar_offset_13 / 4]), asfloat(buffer[scalar_offset_14 / 4])); + return float3x4(asfloat(ub[scalar_offset_12 / 4]), asfloat(ub[scalar_offset_13 / 4]), asfloat(ub[scalar_offset_14 / 4])); } -float4x2 tint_symbol_20(uint4 buffer[272], uint offset) { +float4x2 ub_load_18(uint offset) { const uint scalar_offset_15 = ((offset + 0u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_15 / 4]; + uint4 ubo_load_5 = ub[scalar_offset_15 / 4]; const uint scalar_offset_16 = ((offset + 8u)) / 4; - uint4 ubo_load_6 = buffer[scalar_offset_16 / 4]; + uint4 ubo_load_6 = ub[scalar_offset_16 / 4]; const uint scalar_offset_17 = ((offset + 16u)) / 4; - uint4 ubo_load_7 = buffer[scalar_offset_17 / 4]; + uint4 ubo_load_7 = ub[scalar_offset_17 / 4]; const uint scalar_offset_18 = ((offset + 24u)) / 4; - uint4 ubo_load_8 = buffer[scalar_offset_18 / 4]; + uint4 ubo_load_8 = ub[scalar_offset_18 / 4]; return float4x2(asfloat(((scalar_offset_15 & 2) ? ubo_load_5.zw : ubo_load_5.xy)), asfloat(((scalar_offset_16 & 2) ? ubo_load_6.zw : ubo_load_6.xy)), asfloat(((scalar_offset_17 & 2) ? ubo_load_7.zw : ubo_load_7.xy)), asfloat(((scalar_offset_18 & 2) ? ubo_load_8.zw : ubo_load_8.xy))); } -float4x3 tint_symbol_21(uint4 buffer[272], uint offset) { +float4x3 ub_load_19(uint offset) { const uint scalar_offset_19 = ((offset + 0u)) / 4; const uint scalar_offset_20 = ((offset + 16u)) / 4; const uint scalar_offset_21 = ((offset + 32u)) / 4; const uint scalar_offset_22 = ((offset + 48u)) / 4; - return float4x3(asfloat(buffer[scalar_offset_19 / 4].xyz), asfloat(buffer[scalar_offset_20 / 4].xyz), asfloat(buffer[scalar_offset_21 / 4].xyz), asfloat(buffer[scalar_offset_22 / 4].xyz)); + return float4x3(asfloat(ub[scalar_offset_19 / 4].xyz), asfloat(ub[scalar_offset_20 / 4].xyz), asfloat(ub[scalar_offset_21 / 4].xyz), asfloat(ub[scalar_offset_22 / 4].xyz)); } -float4x4 tint_symbol_22(uint4 buffer[272], uint offset) { +float4x4 ub_load_20(uint offset) { const uint scalar_offset_23 = ((offset + 0u)) / 4; const uint scalar_offset_24 = ((offset + 16u)) / 4; const uint scalar_offset_25 = ((offset + 32u)) / 4; const uint scalar_offset_26 = ((offset + 48u)) / 4; - return float4x4(asfloat(buffer[scalar_offset_23 / 4]), asfloat(buffer[scalar_offset_24 / 4]), asfloat(buffer[scalar_offset_25 / 4]), asfloat(buffer[scalar_offset_26 / 4])); + return float4x4(asfloat(ub[scalar_offset_23 / 4]), asfloat(ub[scalar_offset_24 / 4]), asfloat(ub[scalar_offset_25 / 4]), asfloat(ub[scalar_offset_26 / 4])); } -typedef float3 tint_symbol_23_ret[2]; -tint_symbol_23_ret tint_symbol_23(uint4 buffer[272], uint offset) { +typedef float3 ub_load_21_ret[2]; +ub_load_21_ret ub_load_21(uint offset) { float3 arr_1[2] = (float3[2])0; { for(uint i = 0u; (i < 2u); i = (i + 1u)) { const uint scalar_offset_27 = ((offset + (i * 16u))) / 4; - arr_1[i] = asfloat(buffer[scalar_offset_27 / 4].xyz); + arr_1[i] = asfloat(ub[scalar_offset_27 / 4].xyz); } } return arr_1; @@ -118,16 +118,16 @@ void main_inner(uint idx) { const int4 vec4_i32 = asint(ub[scalar_offset_38 / 4]); const uint scalar_offset_39 = (((544u * idx) + 128u)) / 4; const uint4 vec4_u32 = ub[scalar_offset_39 / 4]; - const float2x2 mat2x2_f32 = tint_symbol_14(ub, ((544u * idx) + 144u)); - const float2x3 mat2x3_f32 = tint_symbol_15(ub, ((544u * idx) + 160u)); - const float2x4 mat2x4_f32 = tint_symbol_16(ub, ((544u * idx) + 192u)); - const float3x2 mat3x2_f32 = tint_symbol_17(ub, ((544u * idx) + 224u)); - const float3x3 mat3x3_f32 = tint_symbol_18(ub, ((544u * idx) + 256u)); - const float3x4 mat3x4_f32 = tint_symbol_19(ub, ((544u * idx) + 304u)); - const float4x2 mat4x2_f32 = tint_symbol_20(ub, ((544u * idx) + 352u)); - const float4x3 mat4x3_f32 = tint_symbol_21(ub, ((544u * idx) + 384u)); - const float4x4 mat4x4_f32 = tint_symbol_22(ub, ((544u * idx) + 448u)); - const float3 arr2_vec3_f32[2] = tint_symbol_23(ub, ((544u * idx) + 512u)); + const float2x2 mat2x2_f32 = ub_load_12(((544u * idx) + 144u)); + const float2x3 mat2x3_f32 = ub_load_13(((544u * idx) + 160u)); + const float2x4 mat2x4_f32 = ub_load_14(((544u * idx) + 192u)); + const float3x2 mat3x2_f32 = ub_load_15(((544u * idx) + 224u)); + const float3x3 mat3x3_f32 = ub_load_16(((544u * idx) + 256u)); + const float3x4 mat3x4_f32 = ub_load_17(((544u * idx) + 304u)); + const float4x2 mat4x2_f32 = ub_load_18(((544u * idx) + 352u)); + const float4x3 mat4x3_f32 = ub_load_19(((544u * idx) + 384u)); + const float4x4 mat4x4_f32 = ub_load_20(((544u * idx) + 448u)); + const float3 arr2_vec3_f32[2] = ub_load_21(((544u * idx) + 512u)); } [numthreads(1, 1, 1)] diff --git a/test/tint/buffer/uniform/dynamic_index/read.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/dynamic_index/read.wgsl.expected.fxc.hlsl index 4e80c66530..35a9c30794 100644 --- a/test/tint/buffer/uniform/dynamic_index/read.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/dynamic_index/read.wgsl.expected.fxc.hlsl @@ -6,85 +6,85 @@ struct tint_symbol_1 { uint idx : SV_GroupIndex; }; -float2x2 tint_symbol_14(uint4 buffer[272], uint offset) { +float2x2 ub_load_12(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = ub[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = ub[scalar_offset_1 / 4]; return float2x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy))); } -float2x3 tint_symbol_15(uint4 buffer[272], uint offset) { +float2x3 ub_load_13(uint offset) { const uint scalar_offset_2 = ((offset + 0u)) / 4; const uint scalar_offset_3 = ((offset + 16u)) / 4; - return float2x3(asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz)); + return float2x3(asfloat(ub[scalar_offset_2 / 4].xyz), asfloat(ub[scalar_offset_3 / 4].xyz)); } -float2x4 tint_symbol_16(uint4 buffer[272], uint offset) { +float2x4 ub_load_14(uint offset) { const uint scalar_offset_4 = ((offset + 0u)) / 4; const uint scalar_offset_5 = ((offset + 16u)) / 4; - return float2x4(asfloat(buffer[scalar_offset_4 / 4]), asfloat(buffer[scalar_offset_5 / 4])); + return float2x4(asfloat(ub[scalar_offset_4 / 4]), asfloat(ub[scalar_offset_5 / 4])); } -float3x2 tint_symbol_17(uint4 buffer[272], uint offset) { +float3x2 ub_load_15(uint offset) { const uint scalar_offset_6 = ((offset + 0u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_6 / 4]; + uint4 ubo_load_2 = ub[scalar_offset_6 / 4]; const uint scalar_offset_7 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_7 / 4]; + uint4 ubo_load_3 = ub[scalar_offset_7 / 4]; const uint scalar_offset_8 = ((offset + 16u)) / 4; - uint4 ubo_load_4 = buffer[scalar_offset_8 / 4]; + uint4 ubo_load_4 = ub[scalar_offset_8 / 4]; return float3x2(asfloat(((scalar_offset_6 & 2) ? ubo_load_2.zw : ubo_load_2.xy)), asfloat(((scalar_offset_7 & 2) ? ubo_load_3.zw : ubo_load_3.xy)), asfloat(((scalar_offset_8 & 2) ? ubo_load_4.zw : ubo_load_4.xy))); } -float3x3 tint_symbol_18(uint4 buffer[272], uint offset) { +float3x3 ub_load_16(uint offset) { const uint scalar_offset_9 = ((offset + 0u)) / 4; const uint scalar_offset_10 = ((offset + 16u)) / 4; const uint scalar_offset_11 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset_9 / 4].xyz), asfloat(buffer[scalar_offset_10 / 4].xyz), asfloat(buffer[scalar_offset_11 / 4].xyz)); + return float3x3(asfloat(ub[scalar_offset_9 / 4].xyz), asfloat(ub[scalar_offset_10 / 4].xyz), asfloat(ub[scalar_offset_11 / 4].xyz)); } -float3x4 tint_symbol_19(uint4 buffer[272], uint offset) { +float3x4 ub_load_17(uint offset) { const uint scalar_offset_12 = ((offset + 0u)) / 4; const uint scalar_offset_13 = ((offset + 16u)) / 4; const uint scalar_offset_14 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset_12 / 4]), asfloat(buffer[scalar_offset_13 / 4]), asfloat(buffer[scalar_offset_14 / 4])); + return float3x4(asfloat(ub[scalar_offset_12 / 4]), asfloat(ub[scalar_offset_13 / 4]), asfloat(ub[scalar_offset_14 / 4])); } -float4x2 tint_symbol_20(uint4 buffer[272], uint offset) { +float4x2 ub_load_18(uint offset) { const uint scalar_offset_15 = ((offset + 0u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_15 / 4]; + uint4 ubo_load_5 = ub[scalar_offset_15 / 4]; const uint scalar_offset_16 = ((offset + 8u)) / 4; - uint4 ubo_load_6 = buffer[scalar_offset_16 / 4]; + uint4 ubo_load_6 = ub[scalar_offset_16 / 4]; const uint scalar_offset_17 = ((offset + 16u)) / 4; - uint4 ubo_load_7 = buffer[scalar_offset_17 / 4]; + uint4 ubo_load_7 = ub[scalar_offset_17 / 4]; const uint scalar_offset_18 = ((offset + 24u)) / 4; - uint4 ubo_load_8 = buffer[scalar_offset_18 / 4]; + uint4 ubo_load_8 = ub[scalar_offset_18 / 4]; return float4x2(asfloat(((scalar_offset_15 & 2) ? ubo_load_5.zw : ubo_load_5.xy)), asfloat(((scalar_offset_16 & 2) ? ubo_load_6.zw : ubo_load_6.xy)), asfloat(((scalar_offset_17 & 2) ? ubo_load_7.zw : ubo_load_7.xy)), asfloat(((scalar_offset_18 & 2) ? ubo_load_8.zw : ubo_load_8.xy))); } -float4x3 tint_symbol_21(uint4 buffer[272], uint offset) { +float4x3 ub_load_19(uint offset) { const uint scalar_offset_19 = ((offset + 0u)) / 4; const uint scalar_offset_20 = ((offset + 16u)) / 4; const uint scalar_offset_21 = ((offset + 32u)) / 4; const uint scalar_offset_22 = ((offset + 48u)) / 4; - return float4x3(asfloat(buffer[scalar_offset_19 / 4].xyz), asfloat(buffer[scalar_offset_20 / 4].xyz), asfloat(buffer[scalar_offset_21 / 4].xyz), asfloat(buffer[scalar_offset_22 / 4].xyz)); + return float4x3(asfloat(ub[scalar_offset_19 / 4].xyz), asfloat(ub[scalar_offset_20 / 4].xyz), asfloat(ub[scalar_offset_21 / 4].xyz), asfloat(ub[scalar_offset_22 / 4].xyz)); } -float4x4 tint_symbol_22(uint4 buffer[272], uint offset) { +float4x4 ub_load_20(uint offset) { const uint scalar_offset_23 = ((offset + 0u)) / 4; const uint scalar_offset_24 = ((offset + 16u)) / 4; const uint scalar_offset_25 = ((offset + 32u)) / 4; const uint scalar_offset_26 = ((offset + 48u)) / 4; - return float4x4(asfloat(buffer[scalar_offset_23 / 4]), asfloat(buffer[scalar_offset_24 / 4]), asfloat(buffer[scalar_offset_25 / 4]), asfloat(buffer[scalar_offset_26 / 4])); + return float4x4(asfloat(ub[scalar_offset_23 / 4]), asfloat(ub[scalar_offset_24 / 4]), asfloat(ub[scalar_offset_25 / 4]), asfloat(ub[scalar_offset_26 / 4])); } -typedef float3 tint_symbol_23_ret[2]; -tint_symbol_23_ret tint_symbol_23(uint4 buffer[272], uint offset) { +typedef float3 ub_load_21_ret[2]; +ub_load_21_ret ub_load_21(uint offset) { float3 arr_1[2] = (float3[2])0; { for(uint i = 0u; (i < 2u); i = (i + 1u)) { const uint scalar_offset_27 = ((offset + (i * 16u))) / 4; - arr_1[i] = asfloat(buffer[scalar_offset_27 / 4].xyz); + arr_1[i] = asfloat(ub[scalar_offset_27 / 4].xyz); } } return arr_1; @@ -118,16 +118,16 @@ void main_inner(uint idx) { const int4 vec4_i32 = asint(ub[scalar_offset_38 / 4]); const uint scalar_offset_39 = (((544u * idx) + 128u)) / 4; const uint4 vec4_u32 = ub[scalar_offset_39 / 4]; - const float2x2 mat2x2_f32 = tint_symbol_14(ub, ((544u * idx) + 144u)); - const float2x3 mat2x3_f32 = tint_symbol_15(ub, ((544u * idx) + 160u)); - const float2x4 mat2x4_f32 = tint_symbol_16(ub, ((544u * idx) + 192u)); - const float3x2 mat3x2_f32 = tint_symbol_17(ub, ((544u * idx) + 224u)); - const float3x3 mat3x3_f32 = tint_symbol_18(ub, ((544u * idx) + 256u)); - const float3x4 mat3x4_f32 = tint_symbol_19(ub, ((544u * idx) + 304u)); - const float4x2 mat4x2_f32 = tint_symbol_20(ub, ((544u * idx) + 352u)); - const float4x3 mat4x3_f32 = tint_symbol_21(ub, ((544u * idx) + 384u)); - const float4x4 mat4x4_f32 = tint_symbol_22(ub, ((544u * idx) + 448u)); - const float3 arr2_vec3_f32[2] = tint_symbol_23(ub, ((544u * idx) + 512u)); + const float2x2 mat2x2_f32 = ub_load_12(((544u * idx) + 144u)); + const float2x3 mat2x3_f32 = ub_load_13(((544u * idx) + 160u)); + const float2x4 mat2x4_f32 = ub_load_14(((544u * idx) + 192u)); + const float3x2 mat3x2_f32 = ub_load_15(((544u * idx) + 224u)); + const float3x3 mat3x3_f32 = ub_load_16(((544u * idx) + 256u)); + const float3x4 mat3x4_f32 = ub_load_17(((544u * idx) + 304u)); + const float4x2 mat4x2_f32 = ub_load_18(((544u * idx) + 352u)); + const float4x3 mat4x3_f32 = ub_load_19(((544u * idx) + 384u)); + const float4x4 mat4x4_f32 = ub_load_20(((544u * idx) + 448u)); + const float3 arr2_vec3_f32[2] = ub_load_21(((544u * idx) + 512u)); } [numthreads(1, 1, 1)] diff --git a/test/tint/buffer/uniform/dynamic_index/read_f16.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/dynamic_index/read_f16.wgsl.expected.dxc.hlsl index 5ba1911db9..e6596bed56 100644 --- a/test/tint/buffer/uniform/dynamic_index/read_f16.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/dynamic_index/read_f16.wgsl.expected.dxc.hlsl @@ -6,240 +6,240 @@ struct tint_symbol_1 { uint idx : SV_GroupIndex; }; -float2x2 tint_symbol_18(uint4 buffer[400], uint offset) { +float2x2 ub_load_16(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = ub[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = ub[scalar_offset_1 / 4]; return float2x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy))); } -float2x3 tint_symbol_19(uint4 buffer[400], uint offset) { +float2x3 ub_load_17(uint offset) { const uint scalar_offset_2 = ((offset + 0u)) / 4; const uint scalar_offset_3 = ((offset + 16u)) / 4; - return float2x3(asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz)); + return float2x3(asfloat(ub[scalar_offset_2 / 4].xyz), asfloat(ub[scalar_offset_3 / 4].xyz)); } -float2x4 tint_symbol_20(uint4 buffer[400], uint offset) { +float2x4 ub_load_18(uint offset) { const uint scalar_offset_4 = ((offset + 0u)) / 4; const uint scalar_offset_5 = ((offset + 16u)) / 4; - return float2x4(asfloat(buffer[scalar_offset_4 / 4]), asfloat(buffer[scalar_offset_5 / 4])); + return float2x4(asfloat(ub[scalar_offset_4 / 4]), asfloat(ub[scalar_offset_5 / 4])); } -float3x2 tint_symbol_21(uint4 buffer[400], uint offset) { +float3x2 ub_load_19(uint offset) { const uint scalar_offset_6 = ((offset + 0u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_6 / 4]; + uint4 ubo_load_2 = ub[scalar_offset_6 / 4]; const uint scalar_offset_7 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_7 / 4]; + uint4 ubo_load_3 = ub[scalar_offset_7 / 4]; const uint scalar_offset_8 = ((offset + 16u)) / 4; - uint4 ubo_load_4 = buffer[scalar_offset_8 / 4]; + uint4 ubo_load_4 = ub[scalar_offset_8 / 4]; return float3x2(asfloat(((scalar_offset_6 & 2) ? ubo_load_2.zw : ubo_load_2.xy)), asfloat(((scalar_offset_7 & 2) ? ubo_load_3.zw : ubo_load_3.xy)), asfloat(((scalar_offset_8 & 2) ? ubo_load_4.zw : ubo_load_4.xy))); } -float3x3 tint_symbol_22(uint4 buffer[400], uint offset) { +float3x3 ub_load_20(uint offset) { const uint scalar_offset_9 = ((offset + 0u)) / 4; const uint scalar_offset_10 = ((offset + 16u)) / 4; const uint scalar_offset_11 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset_9 / 4].xyz), asfloat(buffer[scalar_offset_10 / 4].xyz), asfloat(buffer[scalar_offset_11 / 4].xyz)); + return float3x3(asfloat(ub[scalar_offset_9 / 4].xyz), asfloat(ub[scalar_offset_10 / 4].xyz), asfloat(ub[scalar_offset_11 / 4].xyz)); } -float3x4 tint_symbol_23(uint4 buffer[400], uint offset) { +float3x4 ub_load_21(uint offset) { const uint scalar_offset_12 = ((offset + 0u)) / 4; const uint scalar_offset_13 = ((offset + 16u)) / 4; const uint scalar_offset_14 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset_12 / 4]), asfloat(buffer[scalar_offset_13 / 4]), asfloat(buffer[scalar_offset_14 / 4])); + return float3x4(asfloat(ub[scalar_offset_12 / 4]), asfloat(ub[scalar_offset_13 / 4]), asfloat(ub[scalar_offset_14 / 4])); } -float4x2 tint_symbol_24(uint4 buffer[400], uint offset) { +float4x2 ub_load_22(uint offset) { const uint scalar_offset_15 = ((offset + 0u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_15 / 4]; + uint4 ubo_load_5 = ub[scalar_offset_15 / 4]; const uint scalar_offset_16 = ((offset + 8u)) / 4; - uint4 ubo_load_6 = buffer[scalar_offset_16 / 4]; + uint4 ubo_load_6 = ub[scalar_offset_16 / 4]; const uint scalar_offset_17 = ((offset + 16u)) / 4; - uint4 ubo_load_7 = buffer[scalar_offset_17 / 4]; + uint4 ubo_load_7 = ub[scalar_offset_17 / 4]; const uint scalar_offset_18 = ((offset + 24u)) / 4; - uint4 ubo_load_8 = buffer[scalar_offset_18 / 4]; + uint4 ubo_load_8 = ub[scalar_offset_18 / 4]; return float4x2(asfloat(((scalar_offset_15 & 2) ? ubo_load_5.zw : ubo_load_5.xy)), asfloat(((scalar_offset_16 & 2) ? ubo_load_6.zw : ubo_load_6.xy)), asfloat(((scalar_offset_17 & 2) ? ubo_load_7.zw : ubo_load_7.xy)), asfloat(((scalar_offset_18 & 2) ? ubo_load_8.zw : ubo_load_8.xy))); } -float4x3 tint_symbol_25(uint4 buffer[400], uint offset) { +float4x3 ub_load_23(uint offset) { const uint scalar_offset_19 = ((offset + 0u)) / 4; const uint scalar_offset_20 = ((offset + 16u)) / 4; const uint scalar_offset_21 = ((offset + 32u)) / 4; const uint scalar_offset_22 = ((offset + 48u)) / 4; - return float4x3(asfloat(buffer[scalar_offset_19 / 4].xyz), asfloat(buffer[scalar_offset_20 / 4].xyz), asfloat(buffer[scalar_offset_21 / 4].xyz), asfloat(buffer[scalar_offset_22 / 4].xyz)); + return float4x3(asfloat(ub[scalar_offset_19 / 4].xyz), asfloat(ub[scalar_offset_20 / 4].xyz), asfloat(ub[scalar_offset_21 / 4].xyz), asfloat(ub[scalar_offset_22 / 4].xyz)); } -float4x4 tint_symbol_26(uint4 buffer[400], uint offset) { +float4x4 ub_load_24(uint offset) { const uint scalar_offset_23 = ((offset + 0u)) / 4; const uint scalar_offset_24 = ((offset + 16u)) / 4; const uint scalar_offset_25 = ((offset + 32u)) / 4; const uint scalar_offset_26 = ((offset + 48u)) / 4; - return float4x4(asfloat(buffer[scalar_offset_23 / 4]), asfloat(buffer[scalar_offset_24 / 4]), asfloat(buffer[scalar_offset_25 / 4]), asfloat(buffer[scalar_offset_26 / 4])); + return float4x4(asfloat(ub[scalar_offset_23 / 4]), asfloat(ub[scalar_offset_24 / 4]), asfloat(ub[scalar_offset_25 / 4]), asfloat(ub[scalar_offset_26 / 4])); } -matrix tint_symbol_27(uint4 buffer[400], uint offset) { +matrix ub_load_25(uint offset) { const uint scalar_offset_27 = ((offset + 0u)) / 4; - uint ubo_load_9 = buffer[scalar_offset_27 / 4][scalar_offset_27 % 4]; + uint ubo_load_9 = ub[scalar_offset_27 / 4][scalar_offset_27 % 4]; const uint scalar_offset_28 = ((offset + 4u)) / 4; - uint ubo_load_10 = buffer[scalar_offset_28 / 4][scalar_offset_28 % 4]; + uint ubo_load_10 = ub[scalar_offset_28 / 4][scalar_offset_28 % 4]; return matrix(vector(float16_t(f16tof32(ubo_load_9 & 0xFFFF)), float16_t(f16tof32(ubo_load_9 >> 16))), vector(float16_t(f16tof32(ubo_load_10 & 0xFFFF)), float16_t(f16tof32(ubo_load_10 >> 16)))); } -matrix tint_symbol_28(uint4 buffer[400], uint offset) { +matrix ub_load_26(uint offset) { const uint scalar_offset_29 = ((offset + 0u)) / 4; - uint4 ubo_load_12 = buffer[scalar_offset_29 / 4]; + uint4 ubo_load_12 = ub[scalar_offset_29 / 4]; uint2 ubo_load_11 = ((scalar_offset_29 & 2) ? ubo_load_12.zw : ubo_load_12.xy); vector ubo_load_11_xz = vector(f16tof32(ubo_load_11 & 0xFFFF)); float16_t ubo_load_11_y = f16tof32(ubo_load_11[0] >> 16); const uint scalar_offset_30 = ((offset + 8u)) / 4; - uint4 ubo_load_14 = buffer[scalar_offset_30 / 4]; + uint4 ubo_load_14 = ub[scalar_offset_30 / 4]; uint2 ubo_load_13 = ((scalar_offset_30 & 2) ? ubo_load_14.zw : ubo_load_14.xy); vector ubo_load_13_xz = vector(f16tof32(ubo_load_13 & 0xFFFF)); float16_t ubo_load_13_y = f16tof32(ubo_load_13[0] >> 16); return matrix(vector(ubo_load_11_xz[0], ubo_load_11_y, ubo_load_11_xz[1]), vector(ubo_load_13_xz[0], ubo_load_13_y, ubo_load_13_xz[1])); } -matrix tint_symbol_29(uint4 buffer[400], uint offset) { +matrix ub_load_27(uint offset) { const uint scalar_offset_31 = ((offset + 0u)) / 4; - uint4 ubo_load_16 = buffer[scalar_offset_31 / 4]; + uint4 ubo_load_16 = ub[scalar_offset_31 / 4]; uint2 ubo_load_15 = ((scalar_offset_31 & 2) ? ubo_load_16.zw : ubo_load_16.xy); vector ubo_load_15_xz = vector(f16tof32(ubo_load_15 & 0xFFFF)); vector ubo_load_15_yw = vector(f16tof32(ubo_load_15 >> 16)); const uint scalar_offset_32 = ((offset + 8u)) / 4; - uint4 ubo_load_18 = buffer[scalar_offset_32 / 4]; + uint4 ubo_load_18 = ub[scalar_offset_32 / 4]; uint2 ubo_load_17 = ((scalar_offset_32 & 2) ? ubo_load_18.zw : ubo_load_18.xy); vector ubo_load_17_xz = vector(f16tof32(ubo_load_17 & 0xFFFF)); vector ubo_load_17_yw = vector(f16tof32(ubo_load_17 >> 16)); return matrix(vector(ubo_load_15_xz[0], ubo_load_15_yw[0], ubo_load_15_xz[1], ubo_load_15_yw[1]), vector(ubo_load_17_xz[0], ubo_load_17_yw[0], ubo_load_17_xz[1], ubo_load_17_yw[1])); } -matrix tint_symbol_30(uint4 buffer[400], uint offset) { +matrix ub_load_28(uint offset) { const uint scalar_offset_33 = ((offset + 0u)) / 4; - uint ubo_load_19 = buffer[scalar_offset_33 / 4][scalar_offset_33 % 4]; + uint ubo_load_19 = ub[scalar_offset_33 / 4][scalar_offset_33 % 4]; const uint scalar_offset_34 = ((offset + 4u)) / 4; - uint ubo_load_20 = buffer[scalar_offset_34 / 4][scalar_offset_34 % 4]; + uint ubo_load_20 = ub[scalar_offset_34 / 4][scalar_offset_34 % 4]; const uint scalar_offset_35 = ((offset + 8u)) / 4; - uint ubo_load_21 = buffer[scalar_offset_35 / 4][scalar_offset_35 % 4]; + uint ubo_load_21 = ub[scalar_offset_35 / 4][scalar_offset_35 % 4]; return matrix(vector(float16_t(f16tof32(ubo_load_19 & 0xFFFF)), float16_t(f16tof32(ubo_load_19 >> 16))), vector(float16_t(f16tof32(ubo_load_20 & 0xFFFF)), float16_t(f16tof32(ubo_load_20 >> 16))), vector(float16_t(f16tof32(ubo_load_21 & 0xFFFF)), float16_t(f16tof32(ubo_load_21 >> 16)))); } -matrix tint_symbol_31(uint4 buffer[400], uint offset) { +matrix ub_load_29(uint offset) { const uint scalar_offset_36 = ((offset + 0u)) / 4; - uint4 ubo_load_23 = buffer[scalar_offset_36 / 4]; + uint4 ubo_load_23 = ub[scalar_offset_36 / 4]; uint2 ubo_load_22 = ((scalar_offset_36 & 2) ? ubo_load_23.zw : ubo_load_23.xy); vector ubo_load_22_xz = vector(f16tof32(ubo_load_22 & 0xFFFF)); float16_t ubo_load_22_y = f16tof32(ubo_load_22[0] >> 16); const uint scalar_offset_37 = ((offset + 8u)) / 4; - uint4 ubo_load_25 = buffer[scalar_offset_37 / 4]; + uint4 ubo_load_25 = ub[scalar_offset_37 / 4]; uint2 ubo_load_24 = ((scalar_offset_37 & 2) ? ubo_load_25.zw : ubo_load_25.xy); vector ubo_load_24_xz = vector(f16tof32(ubo_load_24 & 0xFFFF)); float16_t ubo_load_24_y = f16tof32(ubo_load_24[0] >> 16); const uint scalar_offset_38 = ((offset + 16u)) / 4; - uint4 ubo_load_27 = buffer[scalar_offset_38 / 4]; + uint4 ubo_load_27 = ub[scalar_offset_38 / 4]; uint2 ubo_load_26 = ((scalar_offset_38 & 2) ? ubo_load_27.zw : ubo_load_27.xy); vector ubo_load_26_xz = vector(f16tof32(ubo_load_26 & 0xFFFF)); float16_t ubo_load_26_y = f16tof32(ubo_load_26[0] >> 16); return matrix(vector(ubo_load_22_xz[0], ubo_load_22_y, ubo_load_22_xz[1]), vector(ubo_load_24_xz[0], ubo_load_24_y, ubo_load_24_xz[1]), vector(ubo_load_26_xz[0], ubo_load_26_y, ubo_load_26_xz[1])); } -matrix tint_symbol_32(uint4 buffer[400], uint offset) { +matrix ub_load_30(uint offset) { const uint scalar_offset_39 = ((offset + 0u)) / 4; - uint4 ubo_load_29 = buffer[scalar_offset_39 / 4]; + uint4 ubo_load_29 = ub[scalar_offset_39 / 4]; uint2 ubo_load_28 = ((scalar_offset_39 & 2) ? ubo_load_29.zw : ubo_load_29.xy); vector ubo_load_28_xz = vector(f16tof32(ubo_load_28 & 0xFFFF)); vector ubo_load_28_yw = vector(f16tof32(ubo_load_28 >> 16)); const uint scalar_offset_40 = ((offset + 8u)) / 4; - uint4 ubo_load_31 = buffer[scalar_offset_40 / 4]; + uint4 ubo_load_31 = ub[scalar_offset_40 / 4]; uint2 ubo_load_30 = ((scalar_offset_40 & 2) ? ubo_load_31.zw : ubo_load_31.xy); vector ubo_load_30_xz = vector(f16tof32(ubo_load_30 & 0xFFFF)); vector ubo_load_30_yw = vector(f16tof32(ubo_load_30 >> 16)); const uint scalar_offset_41 = ((offset + 16u)) / 4; - uint4 ubo_load_33 = buffer[scalar_offset_41 / 4]; + uint4 ubo_load_33 = ub[scalar_offset_41 / 4]; uint2 ubo_load_32 = ((scalar_offset_41 & 2) ? ubo_load_33.zw : ubo_load_33.xy); vector ubo_load_32_xz = vector(f16tof32(ubo_load_32 & 0xFFFF)); vector ubo_load_32_yw = vector(f16tof32(ubo_load_32 >> 16)); return matrix(vector(ubo_load_28_xz[0], ubo_load_28_yw[0], ubo_load_28_xz[1], ubo_load_28_yw[1]), vector(ubo_load_30_xz[0], ubo_load_30_yw[0], ubo_load_30_xz[1], ubo_load_30_yw[1]), vector(ubo_load_32_xz[0], ubo_load_32_yw[0], ubo_load_32_xz[1], ubo_load_32_yw[1])); } -matrix tint_symbol_33(uint4 buffer[400], uint offset) { +matrix ub_load_31(uint offset) { const uint scalar_offset_42 = ((offset + 0u)) / 4; - uint ubo_load_34 = buffer[scalar_offset_42 / 4][scalar_offset_42 % 4]; + uint ubo_load_34 = ub[scalar_offset_42 / 4][scalar_offset_42 % 4]; const uint scalar_offset_43 = ((offset + 4u)) / 4; - uint ubo_load_35 = buffer[scalar_offset_43 / 4][scalar_offset_43 % 4]; + uint ubo_load_35 = ub[scalar_offset_43 / 4][scalar_offset_43 % 4]; const uint scalar_offset_44 = ((offset + 8u)) / 4; - uint ubo_load_36 = buffer[scalar_offset_44 / 4][scalar_offset_44 % 4]; + uint ubo_load_36 = ub[scalar_offset_44 / 4][scalar_offset_44 % 4]; const uint scalar_offset_45 = ((offset + 12u)) / 4; - uint ubo_load_37 = buffer[scalar_offset_45 / 4][scalar_offset_45 % 4]; + uint ubo_load_37 = ub[scalar_offset_45 / 4][scalar_offset_45 % 4]; return matrix(vector(float16_t(f16tof32(ubo_load_34 & 0xFFFF)), float16_t(f16tof32(ubo_load_34 >> 16))), vector(float16_t(f16tof32(ubo_load_35 & 0xFFFF)), float16_t(f16tof32(ubo_load_35 >> 16))), vector(float16_t(f16tof32(ubo_load_36 & 0xFFFF)), float16_t(f16tof32(ubo_load_36 >> 16))), vector(float16_t(f16tof32(ubo_load_37 & 0xFFFF)), float16_t(f16tof32(ubo_load_37 >> 16)))); } -matrix tint_symbol_34(uint4 buffer[400], uint offset) { +matrix ub_load_32(uint offset) { const uint scalar_offset_46 = ((offset + 0u)) / 4; - uint4 ubo_load_39 = buffer[scalar_offset_46 / 4]; + uint4 ubo_load_39 = ub[scalar_offset_46 / 4]; uint2 ubo_load_38 = ((scalar_offset_46 & 2) ? ubo_load_39.zw : ubo_load_39.xy); vector ubo_load_38_xz = vector(f16tof32(ubo_load_38 & 0xFFFF)); float16_t ubo_load_38_y = f16tof32(ubo_load_38[0] >> 16); const uint scalar_offset_47 = ((offset + 8u)) / 4; - uint4 ubo_load_41 = buffer[scalar_offset_47 / 4]; + uint4 ubo_load_41 = ub[scalar_offset_47 / 4]; uint2 ubo_load_40 = ((scalar_offset_47 & 2) ? ubo_load_41.zw : ubo_load_41.xy); vector ubo_load_40_xz = vector(f16tof32(ubo_load_40 & 0xFFFF)); float16_t ubo_load_40_y = f16tof32(ubo_load_40[0] >> 16); const uint scalar_offset_48 = ((offset + 16u)) / 4; - uint4 ubo_load_43 = buffer[scalar_offset_48 / 4]; + uint4 ubo_load_43 = ub[scalar_offset_48 / 4]; uint2 ubo_load_42 = ((scalar_offset_48 & 2) ? ubo_load_43.zw : ubo_load_43.xy); vector ubo_load_42_xz = vector(f16tof32(ubo_load_42 & 0xFFFF)); float16_t ubo_load_42_y = f16tof32(ubo_load_42[0] >> 16); const uint scalar_offset_49 = ((offset + 24u)) / 4; - uint4 ubo_load_45 = buffer[scalar_offset_49 / 4]; + uint4 ubo_load_45 = ub[scalar_offset_49 / 4]; uint2 ubo_load_44 = ((scalar_offset_49 & 2) ? ubo_load_45.zw : ubo_load_45.xy); vector ubo_load_44_xz = vector(f16tof32(ubo_load_44 & 0xFFFF)); float16_t ubo_load_44_y = f16tof32(ubo_load_44[0] >> 16); return matrix(vector(ubo_load_38_xz[0], ubo_load_38_y, ubo_load_38_xz[1]), vector(ubo_load_40_xz[0], ubo_load_40_y, ubo_load_40_xz[1]), vector(ubo_load_42_xz[0], ubo_load_42_y, ubo_load_42_xz[1]), vector(ubo_load_44_xz[0], ubo_load_44_y, ubo_load_44_xz[1])); } -matrix tint_symbol_35(uint4 buffer[400], uint offset) { +matrix ub_load_33(uint offset) { const uint scalar_offset_50 = ((offset + 0u)) / 4; - uint4 ubo_load_47 = buffer[scalar_offset_50 / 4]; + uint4 ubo_load_47 = ub[scalar_offset_50 / 4]; uint2 ubo_load_46 = ((scalar_offset_50 & 2) ? ubo_load_47.zw : ubo_load_47.xy); vector ubo_load_46_xz = vector(f16tof32(ubo_load_46 & 0xFFFF)); vector ubo_load_46_yw = vector(f16tof32(ubo_load_46 >> 16)); const uint scalar_offset_51 = ((offset + 8u)) / 4; - uint4 ubo_load_49 = buffer[scalar_offset_51 / 4]; + uint4 ubo_load_49 = ub[scalar_offset_51 / 4]; uint2 ubo_load_48 = ((scalar_offset_51 & 2) ? ubo_load_49.zw : ubo_load_49.xy); vector ubo_load_48_xz = vector(f16tof32(ubo_load_48 & 0xFFFF)); vector ubo_load_48_yw = vector(f16tof32(ubo_load_48 >> 16)); const uint scalar_offset_52 = ((offset + 16u)) / 4; - uint4 ubo_load_51 = buffer[scalar_offset_52 / 4]; + uint4 ubo_load_51 = ub[scalar_offset_52 / 4]; uint2 ubo_load_50 = ((scalar_offset_52 & 2) ? ubo_load_51.zw : ubo_load_51.xy); vector ubo_load_50_xz = vector(f16tof32(ubo_load_50 & 0xFFFF)); vector ubo_load_50_yw = vector(f16tof32(ubo_load_50 >> 16)); const uint scalar_offset_53 = ((offset + 24u)) / 4; - uint4 ubo_load_53 = buffer[scalar_offset_53 / 4]; + uint4 ubo_load_53 = ub[scalar_offset_53 / 4]; uint2 ubo_load_52 = ((scalar_offset_53 & 2) ? ubo_load_53.zw : ubo_load_53.xy); vector ubo_load_52_xz = vector(f16tof32(ubo_load_52 & 0xFFFF)); vector ubo_load_52_yw = vector(f16tof32(ubo_load_52 >> 16)); return matrix(vector(ubo_load_46_xz[0], ubo_load_46_yw[0], ubo_load_46_xz[1], ubo_load_46_yw[1]), vector(ubo_load_48_xz[0], ubo_load_48_yw[0], ubo_load_48_xz[1], ubo_load_48_yw[1]), vector(ubo_load_50_xz[0], ubo_load_50_yw[0], ubo_load_50_xz[1], ubo_load_50_yw[1]), vector(ubo_load_52_xz[0], ubo_load_52_yw[0], ubo_load_52_xz[1], ubo_load_52_yw[1])); } -typedef float3 tint_symbol_36_ret[2]; -tint_symbol_36_ret tint_symbol_36(uint4 buffer[400], uint offset) { +typedef float3 ub_load_34_ret[2]; +ub_load_34_ret ub_load_34(uint offset) { float3 arr_1[2] = (float3[2])0; { for(uint i = 0u; (i < 2u); i = (i + 1u)) { const uint scalar_offset_54 = ((offset + (i * 16u))) / 4; - arr_1[i] = asfloat(buffer[scalar_offset_54 / 4].xyz); + arr_1[i] = asfloat(ub[scalar_offset_54 / 4].xyz); } } return arr_1; } -typedef matrix tint_symbol_37_ret[2]; -tint_symbol_37_ret tint_symbol_37(uint4 buffer[400], uint offset) { +typedef matrix ub_load_35_ret[2]; +ub_load_35_ret ub_load_35(uint offset) { matrix arr_2[2] = (matrix[2])0; { for(uint i_1 = 0u; (i_1 < 2u); i_1 = (i_1 + 1u)) { - arr_2[i_1] = tint_symbol_33(buffer, (offset + (i_1 * 16u))); + arr_2[i_1] = ub_load_31((offset + (i_1 * 16u))); } } return arr_2; @@ -291,26 +291,26 @@ void main_inner(uint idx) { vector ubo_load_60_xz = vector(f16tof32(ubo_load_60 & 0xFFFF)); vector ubo_load_60_yw = vector(f16tof32(ubo_load_60 >> 16)); const vector vec4_f16 = vector(ubo_load_60_xz[0], ubo_load_60_yw[0], ubo_load_60_xz[1], ubo_load_60_yw[1]); - const float2x2 mat2x2_f32 = tint_symbol_18(ub, ((800u * idx) + 168u)); - const float2x3 mat2x3_f32 = tint_symbol_19(ub, ((800u * idx) + 192u)); - const float2x4 mat2x4_f32 = tint_symbol_20(ub, ((800u * idx) + 224u)); - const float3x2 mat3x2_f32 = tint_symbol_21(ub, ((800u * idx) + 256u)); - const float3x3 mat3x3_f32 = tint_symbol_22(ub, ((800u * idx) + 288u)); - const float3x4 mat3x4_f32 = tint_symbol_23(ub, ((800u * idx) + 336u)); - const float4x2 mat4x2_f32 = tint_symbol_24(ub, ((800u * idx) + 384u)); - const float4x3 mat4x3_f32 = tint_symbol_25(ub, ((800u * idx) + 416u)); - const float4x4 mat4x4_f32 = tint_symbol_26(ub, ((800u * idx) + 480u)); - const matrix mat2x2_f16 = tint_symbol_27(ub, ((800u * idx) + 544u)); - const matrix mat2x3_f16 = tint_symbol_28(ub, ((800u * idx) + 552u)); - const matrix mat2x4_f16 = tint_symbol_29(ub, ((800u * idx) + 568u)); - const matrix mat3x2_f16 = tint_symbol_30(ub, ((800u * idx) + 584u)); - const matrix mat3x3_f16 = tint_symbol_31(ub, ((800u * idx) + 600u)); - const matrix mat3x4_f16 = tint_symbol_32(ub, ((800u * idx) + 624u)); - const matrix mat4x2_f16 = tint_symbol_33(ub, ((800u * idx) + 648u)); - const matrix mat4x3_f16 = tint_symbol_34(ub, ((800u * idx) + 664u)); - const matrix mat4x4_f16 = tint_symbol_35(ub, ((800u * idx) + 696u)); - const float3 arr2_vec3_f32[2] = tint_symbol_36(ub, ((800u * idx) + 736u)); - const matrix arr2_mat4x2_f16[2] = tint_symbol_37(ub, ((800u * idx) + 768u)); + const float2x2 mat2x2_f32 = ub_load_16(((800u * idx) + 168u)); + const float2x3 mat2x3_f32 = ub_load_17(((800u * idx) + 192u)); + const float2x4 mat2x4_f32 = ub_load_18(((800u * idx) + 224u)); + const float3x2 mat3x2_f32 = ub_load_19(((800u * idx) + 256u)); + const float3x3 mat3x3_f32 = ub_load_20(((800u * idx) + 288u)); + const float3x4 mat3x4_f32 = ub_load_21(((800u * idx) + 336u)); + const float4x2 mat4x2_f32 = ub_load_22(((800u * idx) + 384u)); + const float4x3 mat4x3_f32 = ub_load_23(((800u * idx) + 416u)); + const float4x4 mat4x4_f32 = ub_load_24(((800u * idx) + 480u)); + const matrix mat2x2_f16 = ub_load_25(((800u * idx) + 544u)); + const matrix mat2x3_f16 = ub_load_26(((800u * idx) + 552u)); + const matrix mat2x4_f16 = ub_load_27(((800u * idx) + 568u)); + const matrix mat3x2_f16 = ub_load_28(((800u * idx) + 584u)); + const matrix mat3x3_f16 = ub_load_29(((800u * idx) + 600u)); + const matrix mat3x4_f16 = ub_load_30(((800u * idx) + 624u)); + const matrix mat4x2_f16 = ub_load_31(((800u * idx) + 648u)); + const matrix mat4x3_f16 = ub_load_32(((800u * idx) + 664u)); + const matrix mat4x4_f16 = ub_load_33(((800u * idx) + 696u)); + const float3 arr2_vec3_f32[2] = ub_load_34(((800u * idx) + 736u)); + const matrix arr2_mat4x2_f16[2] = ub_load_35(((800u * idx) + 768u)); } [numthreads(1, 1, 1)] diff --git a/test/tint/buffer/uniform/static_index/read.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/static_index/read.wgsl.expected.dxc.hlsl index 7a69526931..d4a78bb215 100644 --- a/test/tint/buffer/uniform/static_index/read.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/static_index/read.wgsl.expected.dxc.hlsl @@ -7,103 +7,103 @@ cbuffer cbuffer_ub : register(b0, space0) { uint4 ub[44]; }; -float2x2 tint_symbol_12(uint4 buffer[44], uint offset) { +float2x2 ub_load_12(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = ub[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = ub[scalar_offset_1 / 4]; return float2x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy))); } -float2x3 tint_symbol_13(uint4 buffer[44], uint offset) { +float2x3 ub_load_13(uint offset) { const uint scalar_offset_2 = ((offset + 0u)) / 4; const uint scalar_offset_3 = ((offset + 16u)) / 4; - return float2x3(asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz)); + return float2x3(asfloat(ub[scalar_offset_2 / 4].xyz), asfloat(ub[scalar_offset_3 / 4].xyz)); } -float2x4 tint_symbol_14(uint4 buffer[44], uint offset) { +float2x4 ub_load_14(uint offset) { const uint scalar_offset_4 = ((offset + 0u)) / 4; const uint scalar_offset_5 = ((offset + 16u)) / 4; - return float2x4(asfloat(buffer[scalar_offset_4 / 4]), asfloat(buffer[scalar_offset_5 / 4])); + return float2x4(asfloat(ub[scalar_offset_4 / 4]), asfloat(ub[scalar_offset_5 / 4])); } -float3x2 tint_symbol_15(uint4 buffer[44], uint offset) { +float3x2 ub_load_15(uint offset) { const uint scalar_offset_6 = ((offset + 0u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_6 / 4]; + uint4 ubo_load_2 = ub[scalar_offset_6 / 4]; const uint scalar_offset_7 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_7 / 4]; + uint4 ubo_load_3 = ub[scalar_offset_7 / 4]; const uint scalar_offset_8 = ((offset + 16u)) / 4; - uint4 ubo_load_4 = buffer[scalar_offset_8 / 4]; + uint4 ubo_load_4 = ub[scalar_offset_8 / 4]; return float3x2(asfloat(((scalar_offset_6 & 2) ? ubo_load_2.zw : ubo_load_2.xy)), asfloat(((scalar_offset_7 & 2) ? ubo_load_3.zw : ubo_load_3.xy)), asfloat(((scalar_offset_8 & 2) ? ubo_load_4.zw : ubo_load_4.xy))); } -float3x3 tint_symbol_16(uint4 buffer[44], uint offset) { +float3x3 ub_load_16(uint offset) { const uint scalar_offset_9 = ((offset + 0u)) / 4; const uint scalar_offset_10 = ((offset + 16u)) / 4; const uint scalar_offset_11 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset_9 / 4].xyz), asfloat(buffer[scalar_offset_10 / 4].xyz), asfloat(buffer[scalar_offset_11 / 4].xyz)); + return float3x3(asfloat(ub[scalar_offset_9 / 4].xyz), asfloat(ub[scalar_offset_10 / 4].xyz), asfloat(ub[scalar_offset_11 / 4].xyz)); } -float3x4 tint_symbol_17(uint4 buffer[44], uint offset) { +float3x4 ub_load_17(uint offset) { const uint scalar_offset_12 = ((offset + 0u)) / 4; const uint scalar_offset_13 = ((offset + 16u)) / 4; const uint scalar_offset_14 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset_12 / 4]), asfloat(buffer[scalar_offset_13 / 4]), asfloat(buffer[scalar_offset_14 / 4])); + return float3x4(asfloat(ub[scalar_offset_12 / 4]), asfloat(ub[scalar_offset_13 / 4]), asfloat(ub[scalar_offset_14 / 4])); } -float4x2 tint_symbol_18(uint4 buffer[44], uint offset) { +float4x2 ub_load_18(uint offset) { const uint scalar_offset_15 = ((offset + 0u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_15 / 4]; + uint4 ubo_load_5 = ub[scalar_offset_15 / 4]; const uint scalar_offset_16 = ((offset + 8u)) / 4; - uint4 ubo_load_6 = buffer[scalar_offset_16 / 4]; + uint4 ubo_load_6 = ub[scalar_offset_16 / 4]; const uint scalar_offset_17 = ((offset + 16u)) / 4; - uint4 ubo_load_7 = buffer[scalar_offset_17 / 4]; + uint4 ubo_load_7 = ub[scalar_offset_17 / 4]; const uint scalar_offset_18 = ((offset + 24u)) / 4; - uint4 ubo_load_8 = buffer[scalar_offset_18 / 4]; + uint4 ubo_load_8 = ub[scalar_offset_18 / 4]; return float4x2(asfloat(((scalar_offset_15 & 2) ? ubo_load_5.zw : ubo_load_5.xy)), asfloat(((scalar_offset_16 & 2) ? ubo_load_6.zw : ubo_load_6.xy)), asfloat(((scalar_offset_17 & 2) ? ubo_load_7.zw : ubo_load_7.xy)), asfloat(((scalar_offset_18 & 2) ? ubo_load_8.zw : ubo_load_8.xy))); } -float4x3 tint_symbol_19(uint4 buffer[44], uint offset) { +float4x3 ub_load_19(uint offset) { const uint scalar_offset_19 = ((offset + 0u)) / 4; const uint scalar_offset_20 = ((offset + 16u)) / 4; const uint scalar_offset_21 = ((offset + 32u)) / 4; const uint scalar_offset_22 = ((offset + 48u)) / 4; - return float4x3(asfloat(buffer[scalar_offset_19 / 4].xyz), asfloat(buffer[scalar_offset_20 / 4].xyz), asfloat(buffer[scalar_offset_21 / 4].xyz), asfloat(buffer[scalar_offset_22 / 4].xyz)); + return float4x3(asfloat(ub[scalar_offset_19 / 4].xyz), asfloat(ub[scalar_offset_20 / 4].xyz), asfloat(ub[scalar_offset_21 / 4].xyz), asfloat(ub[scalar_offset_22 / 4].xyz)); } -float4x4 tint_symbol_20(uint4 buffer[44], uint offset) { +float4x4 ub_load_20(uint offset) { const uint scalar_offset_23 = ((offset + 0u)) / 4; const uint scalar_offset_24 = ((offset + 16u)) / 4; const uint scalar_offset_25 = ((offset + 32u)) / 4; const uint scalar_offset_26 = ((offset + 48u)) / 4; - return float4x4(asfloat(buffer[scalar_offset_23 / 4]), asfloat(buffer[scalar_offset_24 / 4]), asfloat(buffer[scalar_offset_25 / 4]), asfloat(buffer[scalar_offset_26 / 4])); + return float4x4(asfloat(ub[scalar_offset_23 / 4]), asfloat(ub[scalar_offset_24 / 4]), asfloat(ub[scalar_offset_25 / 4]), asfloat(ub[scalar_offset_26 / 4])); } -typedef float3 tint_symbol_21_ret[2]; -tint_symbol_21_ret tint_symbol_21(uint4 buffer[44], uint offset) { +typedef float3 ub_load_21_ret[2]; +ub_load_21_ret ub_load_21(uint offset) { float3 arr[2] = (float3[2])0; { for(uint i = 0u; (i < 2u); i = (i + 1u)) { const uint scalar_offset_27 = ((offset + (i * 16u))) / 4; - arr[i] = asfloat(buffer[scalar_offset_27 / 4].xyz); + arr[i] = asfloat(ub[scalar_offset_27 / 4].xyz); } } return arr; } -Inner tint_symbol_22(uint4 buffer[44], uint offset) { +Inner ub_load_22(uint offset) { const uint scalar_offset_28 = ((offset + 0u)) / 4; const uint scalar_offset_29 = ((offset + 16u)) / 4; - const Inner tint_symbol_24 = {asint(buffer[scalar_offset_28 / 4][scalar_offset_28 % 4]), asfloat(buffer[scalar_offset_29 / 4][scalar_offset_29 % 4])}; - return tint_symbol_24; + const Inner tint_symbol = {asint(ub[scalar_offset_28 / 4][scalar_offset_28 % 4]), asfloat(ub[scalar_offset_29 / 4][scalar_offset_29 % 4])}; + return tint_symbol; } -typedef Inner tint_symbol_23_ret[4]; -tint_symbol_23_ret tint_symbol_23(uint4 buffer[44], uint offset) { +typedef Inner ub_load_23_ret[4]; +ub_load_23_ret ub_load_23(uint offset) { Inner arr_1[4] = (Inner[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr_1[i_1] = tint_symbol_22(buffer, (offset + (i_1 * 32u))); + arr_1[i_1] = ub_load_22((offset + (i_1 * 32u))); } } return arr_1; @@ -123,17 +123,17 @@ void main() { const float4 vec4_f32 = asfloat(ub[6]); const int4 vec4_i32 = asint(ub[7]); const uint4 vec4_u32 = ub[8]; - const float2x2 mat2x2_f32 = tint_symbol_12(ub, 144u); - const float2x3 mat2x3_f32 = tint_symbol_13(ub, 160u); - const float2x4 mat2x4_f32 = tint_symbol_14(ub, 192u); - const float3x2 mat3x2_f32 = tint_symbol_15(ub, 224u); - const float3x3 mat3x3_f32 = tint_symbol_16(ub, 256u); - const float3x4 mat3x4_f32 = tint_symbol_17(ub, 304u); - const float4x2 mat4x2_f32 = tint_symbol_18(ub, 352u); - const float4x3 mat4x3_f32 = tint_symbol_19(ub, 384u); - const float4x4 mat4x4_f32 = tint_symbol_20(ub, 448u); - const float3 arr2_vec3_f32[2] = tint_symbol_21(ub, 512u); - const Inner struct_inner = tint_symbol_22(ub, 544u); - const Inner array_struct_inner[4] = tint_symbol_23(ub, 576u); + const float2x2 mat2x2_f32 = ub_load_12(144u); + const float2x3 mat2x3_f32 = ub_load_13(160u); + const float2x4 mat2x4_f32 = ub_load_14(192u); + const float3x2 mat3x2_f32 = ub_load_15(224u); + const float3x3 mat3x3_f32 = ub_load_16(256u); + const float3x4 mat3x4_f32 = ub_load_17(304u); + const float4x2 mat4x2_f32 = ub_load_18(352u); + const float4x3 mat4x3_f32 = ub_load_19(384u); + const float4x4 mat4x4_f32 = ub_load_20(448u); + const float3 arr2_vec3_f32[2] = ub_load_21(512u); + const Inner struct_inner = ub_load_22(544u); + const Inner array_struct_inner[4] = ub_load_23(576u); return; } diff --git a/test/tint/buffer/uniform/static_index/read.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/static_index/read.wgsl.expected.fxc.hlsl index 7a69526931..d4a78bb215 100644 --- a/test/tint/buffer/uniform/static_index/read.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/static_index/read.wgsl.expected.fxc.hlsl @@ -7,103 +7,103 @@ cbuffer cbuffer_ub : register(b0, space0) { uint4 ub[44]; }; -float2x2 tint_symbol_12(uint4 buffer[44], uint offset) { +float2x2 ub_load_12(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = ub[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = ub[scalar_offset_1 / 4]; return float2x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy))); } -float2x3 tint_symbol_13(uint4 buffer[44], uint offset) { +float2x3 ub_load_13(uint offset) { const uint scalar_offset_2 = ((offset + 0u)) / 4; const uint scalar_offset_3 = ((offset + 16u)) / 4; - return float2x3(asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz)); + return float2x3(asfloat(ub[scalar_offset_2 / 4].xyz), asfloat(ub[scalar_offset_3 / 4].xyz)); } -float2x4 tint_symbol_14(uint4 buffer[44], uint offset) { +float2x4 ub_load_14(uint offset) { const uint scalar_offset_4 = ((offset + 0u)) / 4; const uint scalar_offset_5 = ((offset + 16u)) / 4; - return float2x4(asfloat(buffer[scalar_offset_4 / 4]), asfloat(buffer[scalar_offset_5 / 4])); + return float2x4(asfloat(ub[scalar_offset_4 / 4]), asfloat(ub[scalar_offset_5 / 4])); } -float3x2 tint_symbol_15(uint4 buffer[44], uint offset) { +float3x2 ub_load_15(uint offset) { const uint scalar_offset_6 = ((offset + 0u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_6 / 4]; + uint4 ubo_load_2 = ub[scalar_offset_6 / 4]; const uint scalar_offset_7 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_7 / 4]; + uint4 ubo_load_3 = ub[scalar_offset_7 / 4]; const uint scalar_offset_8 = ((offset + 16u)) / 4; - uint4 ubo_load_4 = buffer[scalar_offset_8 / 4]; + uint4 ubo_load_4 = ub[scalar_offset_8 / 4]; return float3x2(asfloat(((scalar_offset_6 & 2) ? ubo_load_2.zw : ubo_load_2.xy)), asfloat(((scalar_offset_7 & 2) ? ubo_load_3.zw : ubo_load_3.xy)), asfloat(((scalar_offset_8 & 2) ? ubo_load_4.zw : ubo_load_4.xy))); } -float3x3 tint_symbol_16(uint4 buffer[44], uint offset) { +float3x3 ub_load_16(uint offset) { const uint scalar_offset_9 = ((offset + 0u)) / 4; const uint scalar_offset_10 = ((offset + 16u)) / 4; const uint scalar_offset_11 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset_9 / 4].xyz), asfloat(buffer[scalar_offset_10 / 4].xyz), asfloat(buffer[scalar_offset_11 / 4].xyz)); + return float3x3(asfloat(ub[scalar_offset_9 / 4].xyz), asfloat(ub[scalar_offset_10 / 4].xyz), asfloat(ub[scalar_offset_11 / 4].xyz)); } -float3x4 tint_symbol_17(uint4 buffer[44], uint offset) { +float3x4 ub_load_17(uint offset) { const uint scalar_offset_12 = ((offset + 0u)) / 4; const uint scalar_offset_13 = ((offset + 16u)) / 4; const uint scalar_offset_14 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset_12 / 4]), asfloat(buffer[scalar_offset_13 / 4]), asfloat(buffer[scalar_offset_14 / 4])); + return float3x4(asfloat(ub[scalar_offset_12 / 4]), asfloat(ub[scalar_offset_13 / 4]), asfloat(ub[scalar_offset_14 / 4])); } -float4x2 tint_symbol_18(uint4 buffer[44], uint offset) { +float4x2 ub_load_18(uint offset) { const uint scalar_offset_15 = ((offset + 0u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_15 / 4]; + uint4 ubo_load_5 = ub[scalar_offset_15 / 4]; const uint scalar_offset_16 = ((offset + 8u)) / 4; - uint4 ubo_load_6 = buffer[scalar_offset_16 / 4]; + uint4 ubo_load_6 = ub[scalar_offset_16 / 4]; const uint scalar_offset_17 = ((offset + 16u)) / 4; - uint4 ubo_load_7 = buffer[scalar_offset_17 / 4]; + uint4 ubo_load_7 = ub[scalar_offset_17 / 4]; const uint scalar_offset_18 = ((offset + 24u)) / 4; - uint4 ubo_load_8 = buffer[scalar_offset_18 / 4]; + uint4 ubo_load_8 = ub[scalar_offset_18 / 4]; return float4x2(asfloat(((scalar_offset_15 & 2) ? ubo_load_5.zw : ubo_load_5.xy)), asfloat(((scalar_offset_16 & 2) ? ubo_load_6.zw : ubo_load_6.xy)), asfloat(((scalar_offset_17 & 2) ? ubo_load_7.zw : ubo_load_7.xy)), asfloat(((scalar_offset_18 & 2) ? ubo_load_8.zw : ubo_load_8.xy))); } -float4x3 tint_symbol_19(uint4 buffer[44], uint offset) { +float4x3 ub_load_19(uint offset) { const uint scalar_offset_19 = ((offset + 0u)) / 4; const uint scalar_offset_20 = ((offset + 16u)) / 4; const uint scalar_offset_21 = ((offset + 32u)) / 4; const uint scalar_offset_22 = ((offset + 48u)) / 4; - return float4x3(asfloat(buffer[scalar_offset_19 / 4].xyz), asfloat(buffer[scalar_offset_20 / 4].xyz), asfloat(buffer[scalar_offset_21 / 4].xyz), asfloat(buffer[scalar_offset_22 / 4].xyz)); + return float4x3(asfloat(ub[scalar_offset_19 / 4].xyz), asfloat(ub[scalar_offset_20 / 4].xyz), asfloat(ub[scalar_offset_21 / 4].xyz), asfloat(ub[scalar_offset_22 / 4].xyz)); } -float4x4 tint_symbol_20(uint4 buffer[44], uint offset) { +float4x4 ub_load_20(uint offset) { const uint scalar_offset_23 = ((offset + 0u)) / 4; const uint scalar_offset_24 = ((offset + 16u)) / 4; const uint scalar_offset_25 = ((offset + 32u)) / 4; const uint scalar_offset_26 = ((offset + 48u)) / 4; - return float4x4(asfloat(buffer[scalar_offset_23 / 4]), asfloat(buffer[scalar_offset_24 / 4]), asfloat(buffer[scalar_offset_25 / 4]), asfloat(buffer[scalar_offset_26 / 4])); + return float4x4(asfloat(ub[scalar_offset_23 / 4]), asfloat(ub[scalar_offset_24 / 4]), asfloat(ub[scalar_offset_25 / 4]), asfloat(ub[scalar_offset_26 / 4])); } -typedef float3 tint_symbol_21_ret[2]; -tint_symbol_21_ret tint_symbol_21(uint4 buffer[44], uint offset) { +typedef float3 ub_load_21_ret[2]; +ub_load_21_ret ub_load_21(uint offset) { float3 arr[2] = (float3[2])0; { for(uint i = 0u; (i < 2u); i = (i + 1u)) { const uint scalar_offset_27 = ((offset + (i * 16u))) / 4; - arr[i] = asfloat(buffer[scalar_offset_27 / 4].xyz); + arr[i] = asfloat(ub[scalar_offset_27 / 4].xyz); } } return arr; } -Inner tint_symbol_22(uint4 buffer[44], uint offset) { +Inner ub_load_22(uint offset) { const uint scalar_offset_28 = ((offset + 0u)) / 4; const uint scalar_offset_29 = ((offset + 16u)) / 4; - const Inner tint_symbol_24 = {asint(buffer[scalar_offset_28 / 4][scalar_offset_28 % 4]), asfloat(buffer[scalar_offset_29 / 4][scalar_offset_29 % 4])}; - return tint_symbol_24; + const Inner tint_symbol = {asint(ub[scalar_offset_28 / 4][scalar_offset_28 % 4]), asfloat(ub[scalar_offset_29 / 4][scalar_offset_29 % 4])}; + return tint_symbol; } -typedef Inner tint_symbol_23_ret[4]; -tint_symbol_23_ret tint_symbol_23(uint4 buffer[44], uint offset) { +typedef Inner ub_load_23_ret[4]; +ub_load_23_ret ub_load_23(uint offset) { Inner arr_1[4] = (Inner[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr_1[i_1] = tint_symbol_22(buffer, (offset + (i_1 * 32u))); + arr_1[i_1] = ub_load_22((offset + (i_1 * 32u))); } } return arr_1; @@ -123,17 +123,17 @@ void main() { const float4 vec4_f32 = asfloat(ub[6]); const int4 vec4_i32 = asint(ub[7]); const uint4 vec4_u32 = ub[8]; - const float2x2 mat2x2_f32 = tint_symbol_12(ub, 144u); - const float2x3 mat2x3_f32 = tint_symbol_13(ub, 160u); - const float2x4 mat2x4_f32 = tint_symbol_14(ub, 192u); - const float3x2 mat3x2_f32 = tint_symbol_15(ub, 224u); - const float3x3 mat3x3_f32 = tint_symbol_16(ub, 256u); - const float3x4 mat3x4_f32 = tint_symbol_17(ub, 304u); - const float4x2 mat4x2_f32 = tint_symbol_18(ub, 352u); - const float4x3 mat4x3_f32 = tint_symbol_19(ub, 384u); - const float4x4 mat4x4_f32 = tint_symbol_20(ub, 448u); - const float3 arr2_vec3_f32[2] = tint_symbol_21(ub, 512u); - const Inner struct_inner = tint_symbol_22(ub, 544u); - const Inner array_struct_inner[4] = tint_symbol_23(ub, 576u); + const float2x2 mat2x2_f32 = ub_load_12(144u); + const float2x3 mat2x3_f32 = ub_load_13(160u); + const float2x4 mat2x4_f32 = ub_load_14(192u); + const float3x2 mat3x2_f32 = ub_load_15(224u); + const float3x3 mat3x3_f32 = ub_load_16(256u); + const float3x4 mat3x4_f32 = ub_load_17(304u); + const float4x2 mat4x2_f32 = ub_load_18(352u); + const float4x3 mat4x3_f32 = ub_load_19(384u); + const float4x4 mat4x4_f32 = ub_load_20(448u); + const float3 arr2_vec3_f32[2] = ub_load_21(512u); + const Inner struct_inner = ub_load_22(544u); + const Inner array_struct_inner[4] = ub_load_23(576u); return; } diff --git a/test/tint/buffer/uniform/static_index/read_f16.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/static_index/read_f16.wgsl.expected.dxc.hlsl index d0e6ba8d7f..be90b92fb7 100644 --- a/test/tint/buffer/uniform/static_index/read_f16.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/static_index/read_f16.wgsl.expected.dxc.hlsl @@ -8,260 +8,260 @@ cbuffer cbuffer_ub : register(b0, space0) { uint4 ub[55]; }; -float2x2 tint_symbol_16(uint4 buffer[55], uint offset) { +float2x2 ub_load_16(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = ub[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = ub[scalar_offset_1 / 4]; return float2x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy))); } -float2x3 tint_symbol_17(uint4 buffer[55], uint offset) { +float2x3 ub_load_17(uint offset) { const uint scalar_offset_2 = ((offset + 0u)) / 4; const uint scalar_offset_3 = ((offset + 16u)) / 4; - return float2x3(asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz)); + return float2x3(asfloat(ub[scalar_offset_2 / 4].xyz), asfloat(ub[scalar_offset_3 / 4].xyz)); } -float2x4 tint_symbol_18(uint4 buffer[55], uint offset) { +float2x4 ub_load_18(uint offset) { const uint scalar_offset_4 = ((offset + 0u)) / 4; const uint scalar_offset_5 = ((offset + 16u)) / 4; - return float2x4(asfloat(buffer[scalar_offset_4 / 4]), asfloat(buffer[scalar_offset_5 / 4])); + return float2x4(asfloat(ub[scalar_offset_4 / 4]), asfloat(ub[scalar_offset_5 / 4])); } -float3x2 tint_symbol_19(uint4 buffer[55], uint offset) { +float3x2 ub_load_19(uint offset) { const uint scalar_offset_6 = ((offset + 0u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_6 / 4]; + uint4 ubo_load_2 = ub[scalar_offset_6 / 4]; const uint scalar_offset_7 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_7 / 4]; + uint4 ubo_load_3 = ub[scalar_offset_7 / 4]; const uint scalar_offset_8 = ((offset + 16u)) / 4; - uint4 ubo_load_4 = buffer[scalar_offset_8 / 4]; + uint4 ubo_load_4 = ub[scalar_offset_8 / 4]; return float3x2(asfloat(((scalar_offset_6 & 2) ? ubo_load_2.zw : ubo_load_2.xy)), asfloat(((scalar_offset_7 & 2) ? ubo_load_3.zw : ubo_load_3.xy)), asfloat(((scalar_offset_8 & 2) ? ubo_load_4.zw : ubo_load_4.xy))); } -float3x3 tint_symbol_20(uint4 buffer[55], uint offset) { +float3x3 ub_load_20(uint offset) { const uint scalar_offset_9 = ((offset + 0u)) / 4; const uint scalar_offset_10 = ((offset + 16u)) / 4; const uint scalar_offset_11 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset_9 / 4].xyz), asfloat(buffer[scalar_offset_10 / 4].xyz), asfloat(buffer[scalar_offset_11 / 4].xyz)); + return float3x3(asfloat(ub[scalar_offset_9 / 4].xyz), asfloat(ub[scalar_offset_10 / 4].xyz), asfloat(ub[scalar_offset_11 / 4].xyz)); } -float3x4 tint_symbol_21(uint4 buffer[55], uint offset) { +float3x4 ub_load_21(uint offset) { const uint scalar_offset_12 = ((offset + 0u)) / 4; const uint scalar_offset_13 = ((offset + 16u)) / 4; const uint scalar_offset_14 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset_12 / 4]), asfloat(buffer[scalar_offset_13 / 4]), asfloat(buffer[scalar_offset_14 / 4])); + return float3x4(asfloat(ub[scalar_offset_12 / 4]), asfloat(ub[scalar_offset_13 / 4]), asfloat(ub[scalar_offset_14 / 4])); } -float4x2 tint_symbol_22(uint4 buffer[55], uint offset) { +float4x2 ub_load_22(uint offset) { const uint scalar_offset_15 = ((offset + 0u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_15 / 4]; + uint4 ubo_load_5 = ub[scalar_offset_15 / 4]; const uint scalar_offset_16 = ((offset + 8u)) / 4; - uint4 ubo_load_6 = buffer[scalar_offset_16 / 4]; + uint4 ubo_load_6 = ub[scalar_offset_16 / 4]; const uint scalar_offset_17 = ((offset + 16u)) / 4; - uint4 ubo_load_7 = buffer[scalar_offset_17 / 4]; + uint4 ubo_load_7 = ub[scalar_offset_17 / 4]; const uint scalar_offset_18 = ((offset + 24u)) / 4; - uint4 ubo_load_8 = buffer[scalar_offset_18 / 4]; + uint4 ubo_load_8 = ub[scalar_offset_18 / 4]; return float4x2(asfloat(((scalar_offset_15 & 2) ? ubo_load_5.zw : ubo_load_5.xy)), asfloat(((scalar_offset_16 & 2) ? ubo_load_6.zw : ubo_load_6.xy)), asfloat(((scalar_offset_17 & 2) ? ubo_load_7.zw : ubo_load_7.xy)), asfloat(((scalar_offset_18 & 2) ? ubo_load_8.zw : ubo_load_8.xy))); } -float4x3 tint_symbol_23(uint4 buffer[55], uint offset) { +float4x3 ub_load_23(uint offset) { const uint scalar_offset_19 = ((offset + 0u)) / 4; const uint scalar_offset_20 = ((offset + 16u)) / 4; const uint scalar_offset_21 = ((offset + 32u)) / 4; const uint scalar_offset_22 = ((offset + 48u)) / 4; - return float4x3(asfloat(buffer[scalar_offset_19 / 4].xyz), asfloat(buffer[scalar_offset_20 / 4].xyz), asfloat(buffer[scalar_offset_21 / 4].xyz), asfloat(buffer[scalar_offset_22 / 4].xyz)); + return float4x3(asfloat(ub[scalar_offset_19 / 4].xyz), asfloat(ub[scalar_offset_20 / 4].xyz), asfloat(ub[scalar_offset_21 / 4].xyz), asfloat(ub[scalar_offset_22 / 4].xyz)); } -float4x4 tint_symbol_24(uint4 buffer[55], uint offset) { +float4x4 ub_load_24(uint offset) { const uint scalar_offset_23 = ((offset + 0u)) / 4; const uint scalar_offset_24 = ((offset + 16u)) / 4; const uint scalar_offset_25 = ((offset + 32u)) / 4; const uint scalar_offset_26 = ((offset + 48u)) / 4; - return float4x4(asfloat(buffer[scalar_offset_23 / 4]), asfloat(buffer[scalar_offset_24 / 4]), asfloat(buffer[scalar_offset_25 / 4]), asfloat(buffer[scalar_offset_26 / 4])); + return float4x4(asfloat(ub[scalar_offset_23 / 4]), asfloat(ub[scalar_offset_24 / 4]), asfloat(ub[scalar_offset_25 / 4]), asfloat(ub[scalar_offset_26 / 4])); } -matrix tint_symbol_25(uint4 buffer[55], uint offset) { +matrix ub_load_25(uint offset) { const uint scalar_offset_27 = ((offset + 0u)) / 4; - uint ubo_load_9 = buffer[scalar_offset_27 / 4][scalar_offset_27 % 4]; + uint ubo_load_9 = ub[scalar_offset_27 / 4][scalar_offset_27 % 4]; const uint scalar_offset_28 = ((offset + 4u)) / 4; - uint ubo_load_10 = buffer[scalar_offset_28 / 4][scalar_offset_28 % 4]; + uint ubo_load_10 = ub[scalar_offset_28 / 4][scalar_offset_28 % 4]; return matrix(vector(float16_t(f16tof32(ubo_load_9 & 0xFFFF)), float16_t(f16tof32(ubo_load_9 >> 16))), vector(float16_t(f16tof32(ubo_load_10 & 0xFFFF)), float16_t(f16tof32(ubo_load_10 >> 16)))); } -matrix tint_symbol_26(uint4 buffer[55], uint offset) { +matrix ub_load_26(uint offset) { const uint scalar_offset_29 = ((offset + 0u)) / 4; - uint4 ubo_load_12 = buffer[scalar_offset_29 / 4]; + uint4 ubo_load_12 = ub[scalar_offset_29 / 4]; uint2 ubo_load_11 = ((scalar_offset_29 & 2) ? ubo_load_12.zw : ubo_load_12.xy); vector ubo_load_11_xz = vector(f16tof32(ubo_load_11 & 0xFFFF)); float16_t ubo_load_11_y = f16tof32(ubo_load_11[0] >> 16); const uint scalar_offset_30 = ((offset + 8u)) / 4; - uint4 ubo_load_14 = buffer[scalar_offset_30 / 4]; + uint4 ubo_load_14 = ub[scalar_offset_30 / 4]; uint2 ubo_load_13 = ((scalar_offset_30 & 2) ? ubo_load_14.zw : ubo_load_14.xy); vector ubo_load_13_xz = vector(f16tof32(ubo_load_13 & 0xFFFF)); float16_t ubo_load_13_y = f16tof32(ubo_load_13[0] >> 16); return matrix(vector(ubo_load_11_xz[0], ubo_load_11_y, ubo_load_11_xz[1]), vector(ubo_load_13_xz[0], ubo_load_13_y, ubo_load_13_xz[1])); } -matrix tint_symbol_27(uint4 buffer[55], uint offset) { +matrix ub_load_27(uint offset) { const uint scalar_offset_31 = ((offset + 0u)) / 4; - uint4 ubo_load_16 = buffer[scalar_offset_31 / 4]; + uint4 ubo_load_16 = ub[scalar_offset_31 / 4]; uint2 ubo_load_15 = ((scalar_offset_31 & 2) ? ubo_load_16.zw : ubo_load_16.xy); vector ubo_load_15_xz = vector(f16tof32(ubo_load_15 & 0xFFFF)); vector ubo_load_15_yw = vector(f16tof32(ubo_load_15 >> 16)); const uint scalar_offset_32 = ((offset + 8u)) / 4; - uint4 ubo_load_18 = buffer[scalar_offset_32 / 4]; + uint4 ubo_load_18 = ub[scalar_offset_32 / 4]; uint2 ubo_load_17 = ((scalar_offset_32 & 2) ? ubo_load_18.zw : ubo_load_18.xy); vector ubo_load_17_xz = vector(f16tof32(ubo_load_17 & 0xFFFF)); vector ubo_load_17_yw = vector(f16tof32(ubo_load_17 >> 16)); return matrix(vector(ubo_load_15_xz[0], ubo_load_15_yw[0], ubo_load_15_xz[1], ubo_load_15_yw[1]), vector(ubo_load_17_xz[0], ubo_load_17_yw[0], ubo_load_17_xz[1], ubo_load_17_yw[1])); } -matrix tint_symbol_28(uint4 buffer[55], uint offset) { +matrix ub_load_28(uint offset) { const uint scalar_offset_33 = ((offset + 0u)) / 4; - uint ubo_load_19 = buffer[scalar_offset_33 / 4][scalar_offset_33 % 4]; + uint ubo_load_19 = ub[scalar_offset_33 / 4][scalar_offset_33 % 4]; const uint scalar_offset_34 = ((offset + 4u)) / 4; - uint ubo_load_20 = buffer[scalar_offset_34 / 4][scalar_offset_34 % 4]; + uint ubo_load_20 = ub[scalar_offset_34 / 4][scalar_offset_34 % 4]; const uint scalar_offset_35 = ((offset + 8u)) / 4; - uint ubo_load_21 = buffer[scalar_offset_35 / 4][scalar_offset_35 % 4]; + uint ubo_load_21 = ub[scalar_offset_35 / 4][scalar_offset_35 % 4]; return matrix(vector(float16_t(f16tof32(ubo_load_19 & 0xFFFF)), float16_t(f16tof32(ubo_load_19 >> 16))), vector(float16_t(f16tof32(ubo_load_20 & 0xFFFF)), float16_t(f16tof32(ubo_load_20 >> 16))), vector(float16_t(f16tof32(ubo_load_21 & 0xFFFF)), float16_t(f16tof32(ubo_load_21 >> 16)))); } -matrix tint_symbol_29(uint4 buffer[55], uint offset) { +matrix ub_load_29(uint offset) { const uint scalar_offset_36 = ((offset + 0u)) / 4; - uint4 ubo_load_23 = buffer[scalar_offset_36 / 4]; + uint4 ubo_load_23 = ub[scalar_offset_36 / 4]; uint2 ubo_load_22 = ((scalar_offset_36 & 2) ? ubo_load_23.zw : ubo_load_23.xy); vector ubo_load_22_xz = vector(f16tof32(ubo_load_22 & 0xFFFF)); float16_t ubo_load_22_y = f16tof32(ubo_load_22[0] >> 16); const uint scalar_offset_37 = ((offset + 8u)) / 4; - uint4 ubo_load_25 = buffer[scalar_offset_37 / 4]; + uint4 ubo_load_25 = ub[scalar_offset_37 / 4]; uint2 ubo_load_24 = ((scalar_offset_37 & 2) ? ubo_load_25.zw : ubo_load_25.xy); vector ubo_load_24_xz = vector(f16tof32(ubo_load_24 & 0xFFFF)); float16_t ubo_load_24_y = f16tof32(ubo_load_24[0] >> 16); const uint scalar_offset_38 = ((offset + 16u)) / 4; - uint4 ubo_load_27 = buffer[scalar_offset_38 / 4]; + uint4 ubo_load_27 = ub[scalar_offset_38 / 4]; uint2 ubo_load_26 = ((scalar_offset_38 & 2) ? ubo_load_27.zw : ubo_load_27.xy); vector ubo_load_26_xz = vector(f16tof32(ubo_load_26 & 0xFFFF)); float16_t ubo_load_26_y = f16tof32(ubo_load_26[0] >> 16); return matrix(vector(ubo_load_22_xz[0], ubo_load_22_y, ubo_load_22_xz[1]), vector(ubo_load_24_xz[0], ubo_load_24_y, ubo_load_24_xz[1]), vector(ubo_load_26_xz[0], ubo_load_26_y, ubo_load_26_xz[1])); } -matrix tint_symbol_30(uint4 buffer[55], uint offset) { +matrix ub_load_30(uint offset) { const uint scalar_offset_39 = ((offset + 0u)) / 4; - uint4 ubo_load_29 = buffer[scalar_offset_39 / 4]; + uint4 ubo_load_29 = ub[scalar_offset_39 / 4]; uint2 ubo_load_28 = ((scalar_offset_39 & 2) ? ubo_load_29.zw : ubo_load_29.xy); vector ubo_load_28_xz = vector(f16tof32(ubo_load_28 & 0xFFFF)); vector ubo_load_28_yw = vector(f16tof32(ubo_load_28 >> 16)); const uint scalar_offset_40 = ((offset + 8u)) / 4; - uint4 ubo_load_31 = buffer[scalar_offset_40 / 4]; + uint4 ubo_load_31 = ub[scalar_offset_40 / 4]; uint2 ubo_load_30 = ((scalar_offset_40 & 2) ? ubo_load_31.zw : ubo_load_31.xy); vector ubo_load_30_xz = vector(f16tof32(ubo_load_30 & 0xFFFF)); vector ubo_load_30_yw = vector(f16tof32(ubo_load_30 >> 16)); const uint scalar_offset_41 = ((offset + 16u)) / 4; - uint4 ubo_load_33 = buffer[scalar_offset_41 / 4]; + uint4 ubo_load_33 = ub[scalar_offset_41 / 4]; uint2 ubo_load_32 = ((scalar_offset_41 & 2) ? ubo_load_33.zw : ubo_load_33.xy); vector ubo_load_32_xz = vector(f16tof32(ubo_load_32 & 0xFFFF)); vector ubo_load_32_yw = vector(f16tof32(ubo_load_32 >> 16)); return matrix(vector(ubo_load_28_xz[0], ubo_load_28_yw[0], ubo_load_28_xz[1], ubo_load_28_yw[1]), vector(ubo_load_30_xz[0], ubo_load_30_yw[0], ubo_load_30_xz[1], ubo_load_30_yw[1]), vector(ubo_load_32_xz[0], ubo_load_32_yw[0], ubo_load_32_xz[1], ubo_load_32_yw[1])); } -matrix tint_symbol_31(uint4 buffer[55], uint offset) { +matrix ub_load_31(uint offset) { const uint scalar_offset_42 = ((offset + 0u)) / 4; - uint ubo_load_34 = buffer[scalar_offset_42 / 4][scalar_offset_42 % 4]; + uint ubo_load_34 = ub[scalar_offset_42 / 4][scalar_offset_42 % 4]; const uint scalar_offset_43 = ((offset + 4u)) / 4; - uint ubo_load_35 = buffer[scalar_offset_43 / 4][scalar_offset_43 % 4]; + uint ubo_load_35 = ub[scalar_offset_43 / 4][scalar_offset_43 % 4]; const uint scalar_offset_44 = ((offset + 8u)) / 4; - uint ubo_load_36 = buffer[scalar_offset_44 / 4][scalar_offset_44 % 4]; + uint ubo_load_36 = ub[scalar_offset_44 / 4][scalar_offset_44 % 4]; const uint scalar_offset_45 = ((offset + 12u)) / 4; - uint ubo_load_37 = buffer[scalar_offset_45 / 4][scalar_offset_45 % 4]; + uint ubo_load_37 = ub[scalar_offset_45 / 4][scalar_offset_45 % 4]; return matrix(vector(float16_t(f16tof32(ubo_load_34 & 0xFFFF)), float16_t(f16tof32(ubo_load_34 >> 16))), vector(float16_t(f16tof32(ubo_load_35 & 0xFFFF)), float16_t(f16tof32(ubo_load_35 >> 16))), vector(float16_t(f16tof32(ubo_load_36 & 0xFFFF)), float16_t(f16tof32(ubo_load_36 >> 16))), vector(float16_t(f16tof32(ubo_load_37 & 0xFFFF)), float16_t(f16tof32(ubo_load_37 >> 16)))); } -matrix tint_symbol_32(uint4 buffer[55], uint offset) { +matrix ub_load_32(uint offset) { const uint scalar_offset_46 = ((offset + 0u)) / 4; - uint4 ubo_load_39 = buffer[scalar_offset_46 / 4]; + uint4 ubo_load_39 = ub[scalar_offset_46 / 4]; uint2 ubo_load_38 = ((scalar_offset_46 & 2) ? ubo_load_39.zw : ubo_load_39.xy); vector ubo_load_38_xz = vector(f16tof32(ubo_load_38 & 0xFFFF)); float16_t ubo_load_38_y = f16tof32(ubo_load_38[0] >> 16); const uint scalar_offset_47 = ((offset + 8u)) / 4; - uint4 ubo_load_41 = buffer[scalar_offset_47 / 4]; + uint4 ubo_load_41 = ub[scalar_offset_47 / 4]; uint2 ubo_load_40 = ((scalar_offset_47 & 2) ? ubo_load_41.zw : ubo_load_41.xy); vector ubo_load_40_xz = vector(f16tof32(ubo_load_40 & 0xFFFF)); float16_t ubo_load_40_y = f16tof32(ubo_load_40[0] >> 16); const uint scalar_offset_48 = ((offset + 16u)) / 4; - uint4 ubo_load_43 = buffer[scalar_offset_48 / 4]; + uint4 ubo_load_43 = ub[scalar_offset_48 / 4]; uint2 ubo_load_42 = ((scalar_offset_48 & 2) ? ubo_load_43.zw : ubo_load_43.xy); vector ubo_load_42_xz = vector(f16tof32(ubo_load_42 & 0xFFFF)); float16_t ubo_load_42_y = f16tof32(ubo_load_42[0] >> 16); const uint scalar_offset_49 = ((offset + 24u)) / 4; - uint4 ubo_load_45 = buffer[scalar_offset_49 / 4]; + uint4 ubo_load_45 = ub[scalar_offset_49 / 4]; uint2 ubo_load_44 = ((scalar_offset_49 & 2) ? ubo_load_45.zw : ubo_load_45.xy); vector ubo_load_44_xz = vector(f16tof32(ubo_load_44 & 0xFFFF)); float16_t ubo_load_44_y = f16tof32(ubo_load_44[0] >> 16); return matrix(vector(ubo_load_38_xz[0], ubo_load_38_y, ubo_load_38_xz[1]), vector(ubo_load_40_xz[0], ubo_load_40_y, ubo_load_40_xz[1]), vector(ubo_load_42_xz[0], ubo_load_42_y, ubo_load_42_xz[1]), vector(ubo_load_44_xz[0], ubo_load_44_y, ubo_load_44_xz[1])); } -matrix tint_symbol_33(uint4 buffer[55], uint offset) { +matrix ub_load_33(uint offset) { const uint scalar_offset_50 = ((offset + 0u)) / 4; - uint4 ubo_load_47 = buffer[scalar_offset_50 / 4]; + uint4 ubo_load_47 = ub[scalar_offset_50 / 4]; uint2 ubo_load_46 = ((scalar_offset_50 & 2) ? ubo_load_47.zw : ubo_load_47.xy); vector ubo_load_46_xz = vector(f16tof32(ubo_load_46 & 0xFFFF)); vector ubo_load_46_yw = vector(f16tof32(ubo_load_46 >> 16)); const uint scalar_offset_51 = ((offset + 8u)) / 4; - uint4 ubo_load_49 = buffer[scalar_offset_51 / 4]; + uint4 ubo_load_49 = ub[scalar_offset_51 / 4]; uint2 ubo_load_48 = ((scalar_offset_51 & 2) ? ubo_load_49.zw : ubo_load_49.xy); vector ubo_load_48_xz = vector(f16tof32(ubo_load_48 & 0xFFFF)); vector ubo_load_48_yw = vector(f16tof32(ubo_load_48 >> 16)); const uint scalar_offset_52 = ((offset + 16u)) / 4; - uint4 ubo_load_51 = buffer[scalar_offset_52 / 4]; + uint4 ubo_load_51 = ub[scalar_offset_52 / 4]; uint2 ubo_load_50 = ((scalar_offset_52 & 2) ? ubo_load_51.zw : ubo_load_51.xy); vector ubo_load_50_xz = vector(f16tof32(ubo_load_50 & 0xFFFF)); vector ubo_load_50_yw = vector(f16tof32(ubo_load_50 >> 16)); const uint scalar_offset_53 = ((offset + 24u)) / 4; - uint4 ubo_load_53 = buffer[scalar_offset_53 / 4]; + uint4 ubo_load_53 = ub[scalar_offset_53 / 4]; uint2 ubo_load_52 = ((scalar_offset_53 & 2) ? ubo_load_53.zw : ubo_load_53.xy); vector ubo_load_52_xz = vector(f16tof32(ubo_load_52 & 0xFFFF)); vector ubo_load_52_yw = vector(f16tof32(ubo_load_52 >> 16)); return matrix(vector(ubo_load_46_xz[0], ubo_load_46_yw[0], ubo_load_46_xz[1], ubo_load_46_yw[1]), vector(ubo_load_48_xz[0], ubo_load_48_yw[0], ubo_load_48_xz[1], ubo_load_48_yw[1]), vector(ubo_load_50_xz[0], ubo_load_50_yw[0], ubo_load_50_xz[1], ubo_load_50_yw[1]), vector(ubo_load_52_xz[0], ubo_load_52_yw[0], ubo_load_52_xz[1], ubo_load_52_yw[1])); } -typedef float3 tint_symbol_34_ret[2]; -tint_symbol_34_ret tint_symbol_34(uint4 buffer[55], uint offset) { +typedef float3 ub_load_34_ret[2]; +ub_load_34_ret ub_load_34(uint offset) { float3 arr[2] = (float3[2])0; { for(uint i = 0u; (i < 2u); i = (i + 1u)) { const uint scalar_offset_54 = ((offset + (i * 16u))) / 4; - arr[i] = asfloat(buffer[scalar_offset_54 / 4].xyz); + arr[i] = asfloat(ub[scalar_offset_54 / 4].xyz); } } return arr; } -typedef matrix tint_symbol_35_ret[2]; -tint_symbol_35_ret tint_symbol_35(uint4 buffer[55], uint offset) { +typedef matrix ub_load_35_ret[2]; +ub_load_35_ret ub_load_35(uint offset) { matrix arr_1[2] = (matrix[2])0; { for(uint i_1 = 0u; (i_1 < 2u); i_1 = (i_1 + 1u)) { - arr_1[i_1] = tint_symbol_31(buffer, (offset + (i_1 * 16u))); + arr_1[i_1] = ub_load_31((offset + (i_1 * 16u))); } } return arr_1; } -Inner tint_symbol_36(uint4 buffer[55], uint offset) { +Inner ub_load_36(uint offset) { const uint scalar_offset_55 = ((offset + 0u)) / 4; const uint scalar_offset_56 = ((offset + 4u)) / 4; const uint scalar_offset_bytes = ((offset + 8u)); const uint scalar_offset_index = scalar_offset_bytes / 4; - const Inner tint_symbol_38 = {asint(buffer[scalar_offset_55 / 4][scalar_offset_55 % 4]), asfloat(buffer[scalar_offset_56 / 4][scalar_offset_56 % 4]), float16_t(f16tof32(((buffer[scalar_offset_index / 4][scalar_offset_index % 4] >> (scalar_offset_bytes % 4 == 0 ? 0 : 16)) & 0xFFFF)))}; - return tint_symbol_38; + const Inner tint_symbol = {asint(ub[scalar_offset_55 / 4][scalar_offset_55 % 4]), asfloat(ub[scalar_offset_56 / 4][scalar_offset_56 % 4]), float16_t(f16tof32(((ub[scalar_offset_index / 4][scalar_offset_index % 4] >> (scalar_offset_bytes % 4 == 0 ? 0 : 16)) & 0xFFFF)))}; + return tint_symbol; } -typedef Inner tint_symbol_37_ret[4]; -tint_symbol_37_ret tint_symbol_37(uint4 buffer[55], uint offset) { +typedef Inner ub_load_37_ret[4]; +ub_load_37_ret ub_load_37(uint offset) { Inner arr_2[4] = (Inner[4])0; { for(uint i_2 = 0u; (i_2 < 4u); i_2 = (i_2 + 1u)) { - arr_2[i_2] = tint_symbol_36(buffer, (offset + (i_2 * 16u))); + arr_2[i_2] = ub_load_36((offset + (i_2 * 16u))); } } return arr_2; @@ -292,27 +292,27 @@ void main() { vector ubo_load_56_xz = vector(f16tof32(ubo_load_56 & 0xFFFF)); vector ubo_load_56_yw = vector(f16tof32(ubo_load_56 >> 16)); const vector vec4_f16 = vector(ubo_load_56_xz[0], ubo_load_56_yw[0], ubo_load_56_xz[1], ubo_load_56_yw[1]); - const float2x2 mat2x2_f32 = tint_symbol_16(ub, 168u); - const float2x3 mat2x3_f32 = tint_symbol_17(ub, 192u); - const float2x4 mat2x4_f32 = tint_symbol_18(ub, 224u); - const float3x2 mat3x2_f32 = tint_symbol_19(ub, 256u); - const float3x3 mat3x3_f32 = tint_symbol_20(ub, 288u); - const float3x4 mat3x4_f32 = tint_symbol_21(ub, 336u); - const float4x2 mat4x2_f32 = tint_symbol_22(ub, 384u); - const float4x3 mat4x3_f32 = tint_symbol_23(ub, 416u); - const float4x4 mat4x4_f32 = tint_symbol_24(ub, 480u); - const matrix mat2x2_f16 = tint_symbol_25(ub, 544u); - const matrix mat2x3_f16 = tint_symbol_26(ub, 552u); - const matrix mat2x4_f16 = tint_symbol_27(ub, 568u); - const matrix mat3x2_f16 = tint_symbol_28(ub, 584u); - const matrix mat3x3_f16 = tint_symbol_29(ub, 600u); - const matrix mat3x4_f16 = tint_symbol_30(ub, 624u); - const matrix mat4x2_f16 = tint_symbol_31(ub, 648u); - const matrix mat4x3_f16 = tint_symbol_32(ub, 664u); - const matrix mat4x4_f16 = tint_symbol_33(ub, 696u); - const float3 arr2_vec3_f32[2] = tint_symbol_34(ub, 736u); - const matrix arr2_mat4x2_f16[2] = tint_symbol_35(ub, 768u); - const Inner struct_inner = tint_symbol_36(ub, 800u); - const Inner array_struct_inner[4] = tint_symbol_37(ub, 816u); + const float2x2 mat2x2_f32 = ub_load_16(168u); + const float2x3 mat2x3_f32 = ub_load_17(192u); + const float2x4 mat2x4_f32 = ub_load_18(224u); + const float3x2 mat3x2_f32 = ub_load_19(256u); + const float3x3 mat3x3_f32 = ub_load_20(288u); + const float3x4 mat3x4_f32 = ub_load_21(336u); + const float4x2 mat4x2_f32 = ub_load_22(384u); + const float4x3 mat4x3_f32 = ub_load_23(416u); + const float4x4 mat4x4_f32 = ub_load_24(480u); + const matrix mat2x2_f16 = ub_load_25(544u); + const matrix mat2x3_f16 = ub_load_26(552u); + const matrix mat2x4_f16 = ub_load_27(568u); + const matrix mat3x2_f16 = ub_load_28(584u); + const matrix mat3x3_f16 = ub_load_29(600u); + const matrix mat3x4_f16 = ub_load_30(624u); + const matrix mat4x2_f16 = ub_load_31(648u); + const matrix mat4x3_f16 = ub_load_32(664u); + const matrix mat4x4_f16 = ub_load_33(696u); + const float3 arr2_vec3_f32[2] = ub_load_34(736u); + const matrix arr2_mat4x2_f16[2] = ub_load_35(768u); + const Inner struct_inner = ub_load_36(800u); + const Inner array_struct_inner[4] = ub_load_37(816u); return; } diff --git a/test/tint/buffer/uniform/std140/array/mat2x2_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat2x2_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl index 10f9f7c610..27a33b0221 100644 --- a/test/tint/buffer/uniform/std140/array/mat2x2_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat2x2_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl @@ -8,20 +8,20 @@ int i() { return counter; } -float2x2 tint_symbol_1(uint4 buffer[4], uint offset) { +float2x2 a_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = a[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = a[scalar_offset_1 / 4]; return float2x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy))); } -typedef float2x2 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[4], uint offset) { +typedef float2x2 a_load_ret[4]; +a_load_ret a_load(uint offset) { float2x2 arr[4] = (float2x2[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_1(buffer, (offset + (i_1 * 16u))); + arr[i_1] = a_load_1((offset + (i_1 * 16u))); } } return arr; @@ -31,8 +31,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[4], uint offset) { void f() { const int p_a_i_save = i(); const int p_a_i_i_save = i(); - const float2x2 l_a[4] = tint_symbol(a, 0u); - const float2x2 l_a_i = tint_symbol_1(a, (16u * uint(p_a_i_save))); + const float2x2 l_a[4] = a_load(0u); + const float2x2 l_a_i = a_load_1((16u * uint(p_a_i_save))); const uint scalar_offset_2 = (((16u * uint(p_a_i_save)) + (8u * uint(p_a_i_i_save)))) / 4; uint4 ubo_load_2 = a[scalar_offset_2 / 4]; const float2 l_a_i_i = asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy)); diff --git a/test/tint/buffer/uniform/std140/array/mat2x2_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/array/mat2x2_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl index 10f9f7c610..27a33b0221 100644 --- a/test/tint/buffer/uniform/std140/array/mat2x2_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat2x2_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl @@ -8,20 +8,20 @@ int i() { return counter; } -float2x2 tint_symbol_1(uint4 buffer[4], uint offset) { +float2x2 a_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = a[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = a[scalar_offset_1 / 4]; return float2x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy))); } -typedef float2x2 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[4], uint offset) { +typedef float2x2 a_load_ret[4]; +a_load_ret a_load(uint offset) { float2x2 arr[4] = (float2x2[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_1(buffer, (offset + (i_1 * 16u))); + arr[i_1] = a_load_1((offset + (i_1 * 16u))); } } return arr; @@ -31,8 +31,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[4], uint offset) { void f() { const int p_a_i_save = i(); const int p_a_i_i_save = i(); - const float2x2 l_a[4] = tint_symbol(a, 0u); - const float2x2 l_a_i = tint_symbol_1(a, (16u * uint(p_a_i_save))); + const float2x2 l_a[4] = a_load(0u); + const float2x2 l_a_i = a_load_1((16u * uint(p_a_i_save))); const uint scalar_offset_2 = (((16u * uint(p_a_i_save)) + (8u * uint(p_a_i_i_save)))) / 4; uint4 ubo_load_2 = a[scalar_offset_2 / 4]; const float2 l_a_i_i = asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy)); diff --git a/test/tint/buffer/uniform/std140/array/mat2x2_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat2x2_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl index c533ebae78..167a5f6150 100644 --- a/test/tint/buffer/uniform/std140/array/mat2x2_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat2x2_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl @@ -2,20 +2,20 @@ cbuffer cbuffer_a : register(b0, space0) { uint4 a[4]; }; -float2x2 tint_symbol_1(uint4 buffer[4], uint offset) { +float2x2 a_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = a[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = a[scalar_offset_1 / 4]; return float2x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy))); } -typedef float2x2 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[4], uint offset) { +typedef float2x2 a_load_ret[4]; +a_load_ret a_load(uint offset) { float2x2 arr[4] = (float2x2[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 16u))); + arr[i] = a_load_1((offset + (i * 16u))); } } return arr; @@ -23,8 +23,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[4], uint offset) { [numthreads(1, 1, 1)] void f() { - const float2x2 l_a[4] = tint_symbol(a, 0u); - const float2x2 l_a_i = tint_symbol_1(a, 32u); + const float2x2 l_a[4] = a_load(0u); + const float2x2 l_a_i = a_load_1(32u); const float2 l_a_i_i = asfloat(a[2].zw); return; } diff --git a/test/tint/buffer/uniform/std140/array/mat2x2_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/array/mat2x2_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl index c533ebae78..167a5f6150 100644 --- a/test/tint/buffer/uniform/std140/array/mat2x2_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat2x2_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl @@ -2,20 +2,20 @@ cbuffer cbuffer_a : register(b0, space0) { uint4 a[4]; }; -float2x2 tint_symbol_1(uint4 buffer[4], uint offset) { +float2x2 a_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = a[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = a[scalar_offset_1 / 4]; return float2x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy))); } -typedef float2x2 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[4], uint offset) { +typedef float2x2 a_load_ret[4]; +a_load_ret a_load(uint offset) { float2x2 arr[4] = (float2x2[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 16u))); + arr[i] = a_load_1((offset + (i * 16u))); } } return arr; @@ -23,8 +23,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[4], uint offset) { [numthreads(1, 1, 1)] void f() { - const float2x2 l_a[4] = tint_symbol(a, 0u); - const float2x2 l_a_i = tint_symbol_1(a, 32u); + const float2x2 l_a[4] = a_load(0u); + const float2x2 l_a_i = a_load_1(32u); const float2 l_a_i_i = asfloat(a[2].zw); return; } diff --git a/test/tint/buffer/uniform/std140/array/mat2x2_f32/to_builtin.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat2x2_f32/to_builtin.wgsl.expected.dxc.hlsl index e8f4937748..454c4dcf2e 100644 --- a/test/tint/buffer/uniform/std140/array/mat2x2_f32/to_builtin.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat2x2_f32/to_builtin.wgsl.expected.dxc.hlsl @@ -2,17 +2,17 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[4]; }; -float2x2 tint_symbol(uint4 buffer[4], uint offset) { +float2x2 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; return float2x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy))); } [numthreads(1, 1, 1)] void f() { - const float2x2 t = transpose(tint_symbol(u, 32u)); + const float2x2 t = transpose(u_load(32u)); const float l = length(asfloat(u[0].zw).yx); const float a = abs(asfloat(u[0].zw).yx.x); return; diff --git a/test/tint/buffer/uniform/std140/array/mat2x2_f32/to_builtin.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/array/mat2x2_f32/to_builtin.wgsl.expected.fxc.hlsl index e8f4937748..454c4dcf2e 100644 --- a/test/tint/buffer/uniform/std140/array/mat2x2_f32/to_builtin.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat2x2_f32/to_builtin.wgsl.expected.fxc.hlsl @@ -2,17 +2,17 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[4]; }; -float2x2 tint_symbol(uint4 buffer[4], uint offset) { +float2x2 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; return float2x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy))); } [numthreads(1, 1, 1)] void f() { - const float2x2 t = transpose(tint_symbol(u, 32u)); + const float2x2 t = transpose(u_load(32u)); const float l = length(asfloat(u[0].zw).yx); const float a = abs(asfloat(u[0].zw).yx.x); return; diff --git a/test/tint/buffer/uniform/std140/array/mat2x2_f32/to_fn.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat2x2_f32/to_fn.wgsl.expected.dxc.hlsl index 46e25b6449..22e2429874 100644 --- a/test/tint/buffer/uniform/std140/array/mat2x2_f32/to_fn.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat2x2_f32/to_fn.wgsl.expected.dxc.hlsl @@ -14,20 +14,20 @@ void c(float2 v) { void d(float f_1) { } -float2x2 tint_symbol_1(uint4 buffer[4], uint offset) { +float2x2 u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; return float2x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy))); } -typedef float2x2 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[4], uint offset) { +typedef float2x2 u_load_ret[4]; +u_load_ret u_load(uint offset) { float2x2 arr[4] = (float2x2[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 16u))); + arr[i] = u_load_1((offset + (i * 16u))); } } return arr; @@ -35,8 +35,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[4], uint offset) { [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); - b(tint_symbol_1(u, 16u)); + a(u_load(0u)); + b(u_load_1(16u)); c(asfloat(u[1].xy).yx); d(asfloat(u[1].xy).yx.x); return; diff --git a/test/tint/buffer/uniform/std140/array/mat2x2_f32/to_fn.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/array/mat2x2_f32/to_fn.wgsl.expected.fxc.hlsl index 46e25b6449..22e2429874 100644 --- a/test/tint/buffer/uniform/std140/array/mat2x2_f32/to_fn.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat2x2_f32/to_fn.wgsl.expected.fxc.hlsl @@ -14,20 +14,20 @@ void c(float2 v) { void d(float f_1) { } -float2x2 tint_symbol_1(uint4 buffer[4], uint offset) { +float2x2 u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; return float2x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy))); } -typedef float2x2 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[4], uint offset) { +typedef float2x2 u_load_ret[4]; +u_load_ret u_load(uint offset) { float2x2 arr[4] = (float2x2[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 16u))); + arr[i] = u_load_1((offset + (i * 16u))); } } return arr; @@ -35,8 +35,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[4], uint offset) { [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); - b(tint_symbol_1(u, 16u)); + a(u_load(0u)); + b(u_load_1(16u)); c(asfloat(u[1].xy).yx); d(asfloat(u[1].xy).yx.x); return; diff --git a/test/tint/buffer/uniform/std140/array/mat2x2_f32/to_private.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat2x2_f32/to_private.wgsl.expected.dxc.hlsl index 4595eb281a..a35a970383 100644 --- a/test/tint/buffer/uniform/std140/array/mat2x2_f32/to_private.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat2x2_f32/to_private.wgsl.expected.dxc.hlsl @@ -3,20 +3,20 @@ cbuffer cbuffer_u : register(b0, space0) { }; static float2x2 p[4] = (float2x2[4])0; -float2x2 tint_symbol_1(uint4 buffer[4], uint offset) { +float2x2 u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; return float2x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy))); } -typedef float2x2 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[4], uint offset) { +typedef float2x2 u_load_ret[4]; +u_load_ret u_load(uint offset) { float2x2 arr[4] = (float2x2[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 16u))); + arr[i] = u_load_1((offset + (i * 16u))); } } return arr; @@ -24,8 +24,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[4], uint offset) { [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); - p[1] = tint_symbol_1(u, 32u); + p = u_load(0u); + p[1] = u_load_1(32u); p[1][0] = asfloat(u[0].zw).yx; p[1][0].x = asfloat(u[0].z); return; diff --git a/test/tint/buffer/uniform/std140/array/mat2x2_f32/to_private.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/array/mat2x2_f32/to_private.wgsl.expected.fxc.hlsl index 4595eb281a..a35a970383 100644 --- a/test/tint/buffer/uniform/std140/array/mat2x2_f32/to_private.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat2x2_f32/to_private.wgsl.expected.fxc.hlsl @@ -3,20 +3,20 @@ cbuffer cbuffer_u : register(b0, space0) { }; static float2x2 p[4] = (float2x2[4])0; -float2x2 tint_symbol_1(uint4 buffer[4], uint offset) { +float2x2 u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; return float2x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy))); } -typedef float2x2 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[4], uint offset) { +typedef float2x2 u_load_ret[4]; +u_load_ret u_load(uint offset) { float2x2 arr[4] = (float2x2[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 16u))); + arr[i] = u_load_1((offset + (i * 16u))); } } return arr; @@ -24,8 +24,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[4], uint offset) { [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); - p[1] = tint_symbol_1(u, 32u); + p = u_load(0u); + p[1] = u_load_1(32u); p[1][0] = asfloat(u[0].zw).yx; p[1][0].x = asfloat(u[0].z); return; diff --git a/test/tint/buffer/uniform/std140/array/mat2x2_f32/to_storage.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat2x2_f32/to_storage.wgsl.expected.dxc.hlsl index 280d978dbc..ff1c64e862 100644 --- a/test/tint/buffer/uniform/std140/array/mat2x2_f32/to_storage.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat2x2_f32/to_storage.wgsl.expected.dxc.hlsl @@ -3,34 +3,34 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol_1(RWByteAddressBuffer buffer, uint offset, float2x2 value) { - buffer.Store2((offset + 0u), asuint(value[0u])); - buffer.Store2((offset + 8u), asuint(value[1u])); +void s_store_1(uint offset, float2x2 value) { + s.Store2((offset + 0u), asuint(value[0u])); + s.Store2((offset + 8u), asuint(value[1u])); } -void tint_symbol(RWByteAddressBuffer buffer, uint offset, float2x2 value[4]) { +void s_store(uint offset, float2x2 value[4]) { float2x2 array_1[4] = value; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - tint_symbol_1(buffer, (offset + (i * 16u)), array_1[i]); + s_store_1((offset + (i * 16u)), array_1[i]); } } } -float2x2 tint_symbol_4(uint4 buffer[4], uint offset) { +float2x2 u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; return float2x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy))); } -typedef float2x2 tint_symbol_3_ret[4]; -tint_symbol_3_ret tint_symbol_3(uint4 buffer[4], uint offset) { +typedef float2x2 u_load_ret[4]; +u_load_ret u_load(uint offset) { float2x2 arr[4] = (float2x2[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_4(buffer, (offset + (i_1 * 16u))); + arr[i_1] = u_load_1((offset + (i_1 * 16u))); } } return arr; @@ -38,8 +38,8 @@ tint_symbol_3_ret tint_symbol_3(uint4 buffer[4], uint offset) { [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_3(u, 0u)); - tint_symbol_1(s, 16u, tint_symbol_4(u, 32u)); + s_store(0u, u_load(0u)); + s_store_1(16u, u_load_1(32u)); s.Store2(16u, asuint(asfloat(u[0].zw).yx)); s.Store(16u, asuint(asfloat(u[0].z))); return; diff --git a/test/tint/buffer/uniform/std140/array/mat2x2_f32/to_storage.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/array/mat2x2_f32/to_storage.wgsl.expected.fxc.hlsl index 280d978dbc..ff1c64e862 100644 --- a/test/tint/buffer/uniform/std140/array/mat2x2_f32/to_storage.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat2x2_f32/to_storage.wgsl.expected.fxc.hlsl @@ -3,34 +3,34 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol_1(RWByteAddressBuffer buffer, uint offset, float2x2 value) { - buffer.Store2((offset + 0u), asuint(value[0u])); - buffer.Store2((offset + 8u), asuint(value[1u])); +void s_store_1(uint offset, float2x2 value) { + s.Store2((offset + 0u), asuint(value[0u])); + s.Store2((offset + 8u), asuint(value[1u])); } -void tint_symbol(RWByteAddressBuffer buffer, uint offset, float2x2 value[4]) { +void s_store(uint offset, float2x2 value[4]) { float2x2 array_1[4] = value; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - tint_symbol_1(buffer, (offset + (i * 16u)), array_1[i]); + s_store_1((offset + (i * 16u)), array_1[i]); } } } -float2x2 tint_symbol_4(uint4 buffer[4], uint offset) { +float2x2 u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; return float2x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy))); } -typedef float2x2 tint_symbol_3_ret[4]; -tint_symbol_3_ret tint_symbol_3(uint4 buffer[4], uint offset) { +typedef float2x2 u_load_ret[4]; +u_load_ret u_load(uint offset) { float2x2 arr[4] = (float2x2[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_4(buffer, (offset + (i_1 * 16u))); + arr[i_1] = u_load_1((offset + (i_1 * 16u))); } } return arr; @@ -38,8 +38,8 @@ tint_symbol_3_ret tint_symbol_3(uint4 buffer[4], uint offset) { [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_3(u, 0u)); - tint_symbol_1(s, 16u, tint_symbol_4(u, 32u)); + s_store(0u, u_load(0u)); + s_store_1(16u, u_load_1(32u)); s.Store2(16u, asuint(asfloat(u[0].zw).yx)); s.Store(16u, asuint(asfloat(u[0].z))); return; diff --git a/test/tint/buffer/uniform/std140/array/mat2x2_f32/to_workgroup.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat2x2_f32/to_workgroup.wgsl.expected.dxc.hlsl index 29d1ba28cb..e000768287 100644 --- a/test/tint/buffer/uniform/std140/array/mat2x2_f32/to_workgroup.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat2x2_f32/to_workgroup.wgsl.expected.dxc.hlsl @@ -7,20 +7,20 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -float2x2 tint_symbol_3(uint4 buffer[4], uint offset) { +float2x2 u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; return float2x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy))); } -typedef float2x2 tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[4], uint offset) { +typedef float2x2 u_load_ret[4]; +u_load_ret u_load(uint offset) { float2x2 arr[4] = (float2x2[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_3(buffer, (offset + (i_1 * 16u))); + arr[i_1] = u_load_1((offset + (i_1 * 16u))); } } return arr; @@ -34,8 +34,8 @@ void f_inner(uint local_invocation_index) { } } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); - w[1] = tint_symbol_3(u, 32u); + w = u_load(0u); + w[1] = u_load_1(32u); w[1][0] = asfloat(u[0].zw).yx; w[1][0].x = asfloat(u[0].z); } diff --git a/test/tint/buffer/uniform/std140/array/mat2x2_f32/to_workgroup.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/array/mat2x2_f32/to_workgroup.wgsl.expected.fxc.hlsl index 29d1ba28cb..e000768287 100644 --- a/test/tint/buffer/uniform/std140/array/mat2x2_f32/to_workgroup.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat2x2_f32/to_workgroup.wgsl.expected.fxc.hlsl @@ -7,20 +7,20 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -float2x2 tint_symbol_3(uint4 buffer[4], uint offset) { +float2x2 u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; return float2x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy))); } -typedef float2x2 tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[4], uint offset) { +typedef float2x2 u_load_ret[4]; +u_load_ret u_load(uint offset) { float2x2 arr[4] = (float2x2[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_3(buffer, (offset + (i_1 * 16u))); + arr[i_1] = u_load_1((offset + (i_1 * 16u))); } } return arr; @@ -34,8 +34,8 @@ void f_inner(uint local_invocation_index) { } } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); - w[1] = tint_symbol_3(u, 32u); + w = u_load(0u); + w[1] = u_load_1(32u); w[1][0] = asfloat(u[0].zw).yx; w[1][0].x = asfloat(u[0].z); } diff --git a/test/tint/buffer/uniform/std140/array/mat2x3_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat2x3_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl index 43a8682df0..9f294b33cc 100644 --- a/test/tint/buffer/uniform/std140/array/mat2x3_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat2x3_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl @@ -8,26 +8,26 @@ int i() { return counter; } -matrix tint_symbol_1(uint4 buffer[4], uint offset) { +matrix a_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = a[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = a[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); return matrix(vector(ubo_load_xz[0], ubo_load_y, ubo_load_xz[1]), vector(ubo_load_2_xz[0], ubo_load_2_y, ubo_load_2_xz[1])); } -typedef matrix tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[4], uint offset) { +typedef matrix a_load_ret[4]; +a_load_ret a_load(uint offset) { matrix arr[4] = (matrix[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_1(buffer, (offset + (i_1 * 16u))); + arr[i_1] = a_load_1((offset + (i_1 * 16u))); } } return arr; @@ -37,8 +37,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[4], uint offset) { void f() { const int p_a_i_save = i(); const int p_a_i_i_save = i(); - const matrix l_a[4] = tint_symbol(a, 0u); - const matrix l_a_i = tint_symbol_1(a, (16u * uint(p_a_i_save))); + const matrix l_a[4] = a_load(0u); + const matrix l_a_i = a_load_1((16u * uint(p_a_i_save))); const uint scalar_offset_2 = (((16u * uint(p_a_i_save)) + (8u * uint(p_a_i_i_save)))) / 4; uint4 ubo_load_5 = a[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); diff --git a/test/tint/buffer/uniform/std140/array/mat2x3_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat2x3_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl index 6a66652c46..da13a52d53 100644 --- a/test/tint/buffer/uniform/std140/array/mat2x3_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat2x3_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl @@ -2,26 +2,26 @@ cbuffer cbuffer_a : register(b0, space0) { uint4 a[4]; }; -matrix tint_symbol_1(uint4 buffer[4], uint offset) { +matrix a_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = a[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = a[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); return matrix(vector(ubo_load_xz[0], ubo_load_y, ubo_load_xz[1]), vector(ubo_load_2_xz[0], ubo_load_2_y, ubo_load_2_xz[1])); } -typedef matrix tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[4], uint offset) { +typedef matrix a_load_ret[4]; +a_load_ret a_load(uint offset) { matrix arr[4] = (matrix[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 16u))); + arr[i] = a_load_1((offset + (i * 16u))); } } return arr; @@ -29,8 +29,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[4], uint offset) { [numthreads(1, 1, 1)] void f() { - const matrix l_a[4] = tint_symbol(a, 0u); - const matrix l_a_i = tint_symbol_1(a, 32u); + const matrix l_a[4] = a_load(0u); + const matrix l_a_i = a_load_1(32u); uint2 ubo_load_4 = a[2].zw; vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); float16_t ubo_load_4_y = f16tof32(ubo_load_4[0] >> 16); diff --git a/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_builtin.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_builtin.wgsl.expected.dxc.hlsl index 277e378c83..3f7c98b4f6 100644 --- a/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_builtin.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_builtin.wgsl.expected.dxc.hlsl @@ -2,14 +2,14 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[4]; }; -matrix tint_symbol(uint4 buffer[4], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); @@ -18,7 +18,7 @@ matrix tint_symbol(uint4 buffer[4], uint offset) { [numthreads(1, 1, 1)] void f() { - const matrix t = transpose(tint_symbol(u, 32u)); + const matrix t = transpose(u_load(32u)); uint2 ubo_load_4 = u[0].zw; vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); float16_t ubo_load_4_y = f16tof32(ubo_load_4[0] >> 16); diff --git a/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_fn.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_fn.wgsl.expected.dxc.hlsl index 19bfcc6dde..65a0d293d6 100644 --- a/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_fn.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_fn.wgsl.expected.dxc.hlsl @@ -14,26 +14,26 @@ void c(vector v) { void d(float16_t f_1) { } -matrix tint_symbol_1(uint4 buffer[4], uint offset) { +matrix u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); return matrix(vector(ubo_load_xz[0], ubo_load_y, ubo_load_xz[1]), vector(ubo_load_2_xz[0], ubo_load_2_y, ubo_load_2_xz[1])); } -typedef matrix tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[4], uint offset) { +typedef matrix u_load_ret[4]; +u_load_ret u_load(uint offset) { matrix arr[4] = (matrix[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 16u))); + arr[i] = u_load_1((offset + (i * 16u))); } } return arr; @@ -41,8 +41,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[4], uint offset) { [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); - b(tint_symbol_1(u, 16u)); + a(u_load(0u)); + b(u_load_1(16u)); uint2 ubo_load_4 = u[1].xy; vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); float16_t ubo_load_4_y = f16tof32(ubo_load_4[0] >> 16); diff --git a/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_private.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_private.wgsl.expected.dxc.hlsl index 9fbd2992a0..7282cf22d4 100644 --- a/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_private.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_private.wgsl.expected.dxc.hlsl @@ -3,26 +3,26 @@ cbuffer cbuffer_u : register(b0, space0) { }; static matrix p[4] = (matrix[4])0; -matrix tint_symbol_1(uint4 buffer[4], uint offset) { +matrix u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); return matrix(vector(ubo_load_xz[0], ubo_load_y, ubo_load_xz[1]), vector(ubo_load_2_xz[0], ubo_load_2_y, ubo_load_2_xz[1])); } -typedef matrix tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[4], uint offset) { +typedef matrix u_load_ret[4]; +u_load_ret u_load(uint offset) { matrix arr[4] = (matrix[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 16u))); + arr[i] = u_load_1((offset + (i * 16u))); } } return arr; @@ -30,8 +30,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[4], uint offset) { [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); - p[1] = tint_symbol_1(u, 32u); + p = u_load(0u); + p[1] = u_load_1(32u); uint2 ubo_load_4 = u[0].zw; vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); float16_t ubo_load_4_y = f16tof32(ubo_load_4[0] >> 16); diff --git a/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_storage.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_storage.wgsl.expected.dxc.hlsl index b40659430e..995da33691 100644 --- a/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_storage.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_storage.wgsl.expected.dxc.hlsl @@ -3,40 +3,40 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol_1(RWByteAddressBuffer buffer, uint offset, matrix value) { - buffer.Store >((offset + 0u), value[0u]); - buffer.Store >((offset + 8u), value[1u]); +void s_store_1(uint offset, matrix value) { + s.Store >((offset + 0u), value[0u]); + s.Store >((offset + 8u), value[1u]); } -void tint_symbol(RWByteAddressBuffer buffer, uint offset, matrix value[4]) { +void s_store(uint offset, matrix value[4]) { matrix array_1[4] = value; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - tint_symbol_1(buffer, (offset + (i * 16u)), array_1[i]); + s_store_1((offset + (i * 16u)), array_1[i]); } } } -matrix tint_symbol_4(uint4 buffer[4], uint offset) { +matrix u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); return matrix(vector(ubo_load_xz[0], ubo_load_y, ubo_load_xz[1]), vector(ubo_load_2_xz[0], ubo_load_2_y, ubo_load_2_xz[1])); } -typedef matrix tint_symbol_3_ret[4]; -tint_symbol_3_ret tint_symbol_3(uint4 buffer[4], uint offset) { +typedef matrix u_load_ret[4]; +u_load_ret u_load(uint offset) { matrix arr[4] = (matrix[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_4(buffer, (offset + (i_1 * 16u))); + arr[i_1] = u_load_1((offset + (i_1 * 16u))); } } return arr; @@ -44,8 +44,8 @@ tint_symbol_3_ret tint_symbol_3(uint4 buffer[4], uint offset) { [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_3(u, 0u)); - tint_symbol_1(s, 16u, tint_symbol_4(u, 32u)); + s_store(0u, u_load(0u)); + s_store_1(16u, u_load_1(32u)); uint2 ubo_load_4 = u[0].zw; vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); float16_t ubo_load_4_y = f16tof32(ubo_load_4[0] >> 16); diff --git a/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_workgroup.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_workgroup.wgsl.expected.dxc.hlsl index 4f956e9a20..9a0e71a35d 100644 --- a/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_workgroup.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat2x3_f16/to_workgroup.wgsl.expected.dxc.hlsl @@ -7,26 +7,26 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -matrix tint_symbol_3(uint4 buffer[4], uint offset) { +matrix u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); return matrix(vector(ubo_load_xz[0], ubo_load_y, ubo_load_xz[1]), vector(ubo_load_2_xz[0], ubo_load_2_y, ubo_load_2_xz[1])); } -typedef matrix tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[4], uint offset) { +typedef matrix u_load_ret[4]; +u_load_ret u_load(uint offset) { matrix arr[4] = (matrix[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_3(buffer, (offset + (i_1 * 16u))); + arr[i_1] = u_load_1((offset + (i_1 * 16u))); } } return arr; @@ -40,8 +40,8 @@ void f_inner(uint local_invocation_index) { } } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); - w[1] = tint_symbol_3(u, 32u); + w = u_load(0u); + w[1] = u_load_1(32u); uint2 ubo_load_4 = u[0].zw; vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); float16_t ubo_load_4_y = f16tof32(ubo_load_4[0] >> 16); diff --git a/test/tint/buffer/uniform/std140/array/mat2x3_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat2x3_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl index 0533b18513..379c6062b3 100644 --- a/test/tint/buffer/uniform/std140/array/mat2x3_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat2x3_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl @@ -8,18 +8,18 @@ int i() { return counter; } -float2x3 tint_symbol_1(uint4 buffer[8], uint offset) { +float2x3 a_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz)); + return float2x3(asfloat(a[scalar_offset / 4].xyz), asfloat(a[scalar_offset_1 / 4].xyz)); } -typedef float2x3 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[8], uint offset) { +typedef float2x3 a_load_ret[4]; +a_load_ret a_load(uint offset) { float2x3 arr[4] = (float2x3[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_1(buffer, (offset + (i_1 * 32u))); + arr[i_1] = a_load_1((offset + (i_1 * 32u))); } } return arr; @@ -29,8 +29,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[8], uint offset) { void f() { const int p_a_i_save = i(); const int p_a_i_i_save = i(); - const float2x3 l_a[4] = tint_symbol(a, 0u); - const float2x3 l_a_i = tint_symbol_1(a, (32u * uint(p_a_i_save))); + const float2x3 l_a[4] = a_load(0u); + const float2x3 l_a_i = a_load_1((32u * uint(p_a_i_save))); const uint scalar_offset_2 = (((32u * uint(p_a_i_save)) + (16u * uint(p_a_i_i_save)))) / 4; const float3 l_a_i_i = asfloat(a[scalar_offset_2 / 4].xyz); return; diff --git a/test/tint/buffer/uniform/std140/array/mat2x3_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/array/mat2x3_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl index 0533b18513..379c6062b3 100644 --- a/test/tint/buffer/uniform/std140/array/mat2x3_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat2x3_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl @@ -8,18 +8,18 @@ int i() { return counter; } -float2x3 tint_symbol_1(uint4 buffer[8], uint offset) { +float2x3 a_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz)); + return float2x3(asfloat(a[scalar_offset / 4].xyz), asfloat(a[scalar_offset_1 / 4].xyz)); } -typedef float2x3 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[8], uint offset) { +typedef float2x3 a_load_ret[4]; +a_load_ret a_load(uint offset) { float2x3 arr[4] = (float2x3[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_1(buffer, (offset + (i_1 * 32u))); + arr[i_1] = a_load_1((offset + (i_1 * 32u))); } } return arr; @@ -29,8 +29,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[8], uint offset) { void f() { const int p_a_i_save = i(); const int p_a_i_i_save = i(); - const float2x3 l_a[4] = tint_symbol(a, 0u); - const float2x3 l_a_i = tint_symbol_1(a, (32u * uint(p_a_i_save))); + const float2x3 l_a[4] = a_load(0u); + const float2x3 l_a_i = a_load_1((32u * uint(p_a_i_save))); const uint scalar_offset_2 = (((32u * uint(p_a_i_save)) + (16u * uint(p_a_i_i_save)))) / 4; const float3 l_a_i_i = asfloat(a[scalar_offset_2 / 4].xyz); return; diff --git a/test/tint/buffer/uniform/std140/array/mat2x3_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat2x3_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl index a6dcbe4736..d6387275f9 100644 --- a/test/tint/buffer/uniform/std140/array/mat2x3_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat2x3_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl @@ -2,18 +2,18 @@ cbuffer cbuffer_a : register(b0, space0) { uint4 a[8]; }; -float2x3 tint_symbol_1(uint4 buffer[8], uint offset) { +float2x3 a_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz)); + return float2x3(asfloat(a[scalar_offset / 4].xyz), asfloat(a[scalar_offset_1 / 4].xyz)); } -typedef float2x3 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[8], uint offset) { +typedef float2x3 a_load_ret[4]; +a_load_ret a_load(uint offset) { float2x3 arr[4] = (float2x3[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 32u))); + arr[i] = a_load_1((offset + (i * 32u))); } } return arr; @@ -21,8 +21,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[8], uint offset) { [numthreads(1, 1, 1)] void f() { - const float2x3 l_a[4] = tint_symbol(a, 0u); - const float2x3 l_a_i = tint_symbol_1(a, 64u); + const float2x3 l_a[4] = a_load(0u); + const float2x3 l_a_i = a_load_1(64u); const float3 l_a_i_i = asfloat(a[5].xyz); return; } diff --git a/test/tint/buffer/uniform/std140/array/mat2x3_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/array/mat2x3_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl index a6dcbe4736..d6387275f9 100644 --- a/test/tint/buffer/uniform/std140/array/mat2x3_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat2x3_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl @@ -2,18 +2,18 @@ cbuffer cbuffer_a : register(b0, space0) { uint4 a[8]; }; -float2x3 tint_symbol_1(uint4 buffer[8], uint offset) { +float2x3 a_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz)); + return float2x3(asfloat(a[scalar_offset / 4].xyz), asfloat(a[scalar_offset_1 / 4].xyz)); } -typedef float2x3 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[8], uint offset) { +typedef float2x3 a_load_ret[4]; +a_load_ret a_load(uint offset) { float2x3 arr[4] = (float2x3[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 32u))); + arr[i] = a_load_1((offset + (i * 32u))); } } return arr; @@ -21,8 +21,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[8], uint offset) { [numthreads(1, 1, 1)] void f() { - const float2x3 l_a[4] = tint_symbol(a, 0u); - const float2x3 l_a_i = tint_symbol_1(a, 64u); + const float2x3 l_a[4] = a_load(0u); + const float2x3 l_a_i = a_load_1(64u); const float3 l_a_i_i = asfloat(a[5].xyz); return; } diff --git a/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_builtin.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_builtin.wgsl.expected.dxc.hlsl index 3ba88affde..80263fecba 100644 --- a/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_builtin.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_builtin.wgsl.expected.dxc.hlsl @@ -2,15 +2,15 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[8]; }; -float2x3 tint_symbol(uint4 buffer[8], uint offset) { +float2x3 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz)); + return float2x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz)); } [numthreads(1, 1, 1)] void f() { - const float3x2 t = transpose(tint_symbol(u, 64u)); + const float3x2 t = transpose(u_load(64u)); const float l = length(asfloat(u[1].xyz).zxy); const float a = abs(asfloat(u[1].xyz).zxy.x); return; diff --git a/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_builtin.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_builtin.wgsl.expected.fxc.hlsl index 3ba88affde..80263fecba 100644 --- a/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_builtin.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_builtin.wgsl.expected.fxc.hlsl @@ -2,15 +2,15 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[8]; }; -float2x3 tint_symbol(uint4 buffer[8], uint offset) { +float2x3 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz)); + return float2x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz)); } [numthreads(1, 1, 1)] void f() { - const float3x2 t = transpose(tint_symbol(u, 64u)); + const float3x2 t = transpose(u_load(64u)); const float l = length(asfloat(u[1].xyz).zxy); const float a = abs(asfloat(u[1].xyz).zxy.x); return; diff --git a/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_fn.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_fn.wgsl.expected.dxc.hlsl index 9c293d72aa..87ee40585b 100644 --- a/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_fn.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_fn.wgsl.expected.dxc.hlsl @@ -14,18 +14,18 @@ void c(float3 v) { void d(float f_1) { } -float2x3 tint_symbol_1(uint4 buffer[8], uint offset) { +float2x3 u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz)); + return float2x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz)); } -typedef float2x3 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[8], uint offset) { +typedef float2x3 u_load_ret[4]; +u_load_ret u_load(uint offset) { float2x3 arr[4] = (float2x3[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 32u))); + arr[i] = u_load_1((offset + (i * 32u))); } } return arr; @@ -33,8 +33,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[8], uint offset) { [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); - b(tint_symbol_1(u, 32u)); + a(u_load(0u)); + b(u_load_1(32u)); c(asfloat(u[2].xyz).zxy); d(asfloat(u[2].xyz).zxy.x); return; diff --git a/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_fn.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_fn.wgsl.expected.fxc.hlsl index 9c293d72aa..87ee40585b 100644 --- a/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_fn.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_fn.wgsl.expected.fxc.hlsl @@ -14,18 +14,18 @@ void c(float3 v) { void d(float f_1) { } -float2x3 tint_symbol_1(uint4 buffer[8], uint offset) { +float2x3 u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz)); + return float2x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz)); } -typedef float2x3 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[8], uint offset) { +typedef float2x3 u_load_ret[4]; +u_load_ret u_load(uint offset) { float2x3 arr[4] = (float2x3[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 32u))); + arr[i] = u_load_1((offset + (i * 32u))); } } return arr; @@ -33,8 +33,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[8], uint offset) { [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); - b(tint_symbol_1(u, 32u)); + a(u_load(0u)); + b(u_load_1(32u)); c(asfloat(u[2].xyz).zxy); d(asfloat(u[2].xyz).zxy.x); return; diff --git a/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_private.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_private.wgsl.expected.dxc.hlsl index 5f9d5070da..296b739f04 100644 --- a/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_private.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_private.wgsl.expected.dxc.hlsl @@ -3,18 +3,18 @@ cbuffer cbuffer_u : register(b0, space0) { }; static float2x3 p[4] = (float2x3[4])0; -float2x3 tint_symbol_1(uint4 buffer[8], uint offset) { +float2x3 u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz)); + return float2x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz)); } -typedef float2x3 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[8], uint offset) { +typedef float2x3 u_load_ret[4]; +u_load_ret u_load(uint offset) { float2x3 arr[4] = (float2x3[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 32u))); + arr[i] = u_load_1((offset + (i * 32u))); } } return arr; @@ -22,8 +22,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[8], uint offset) { [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); - p[1] = tint_symbol_1(u, 64u); + p = u_load(0u); + p[1] = u_load_1(64u); p[1][0] = asfloat(u[1].xyz).zxy; p[1][0].x = asfloat(u[1].x); return; diff --git a/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_private.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_private.wgsl.expected.fxc.hlsl index 5f9d5070da..296b739f04 100644 --- a/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_private.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_private.wgsl.expected.fxc.hlsl @@ -3,18 +3,18 @@ cbuffer cbuffer_u : register(b0, space0) { }; static float2x3 p[4] = (float2x3[4])0; -float2x3 tint_symbol_1(uint4 buffer[8], uint offset) { +float2x3 u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz)); + return float2x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz)); } -typedef float2x3 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[8], uint offset) { +typedef float2x3 u_load_ret[4]; +u_load_ret u_load(uint offset) { float2x3 arr[4] = (float2x3[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 32u))); + arr[i] = u_load_1((offset + (i * 32u))); } } return arr; @@ -22,8 +22,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[8], uint offset) { [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); - p[1] = tint_symbol_1(u, 64u); + p = u_load(0u); + p[1] = u_load_1(64u); p[1][0] = asfloat(u[1].xyz).zxy; p[1][0].x = asfloat(u[1].x); return; diff --git a/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_storage.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_storage.wgsl.expected.dxc.hlsl index 93021a5d2c..fb02fff523 100644 --- a/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_storage.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_storage.wgsl.expected.dxc.hlsl @@ -3,32 +3,32 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol_1(RWByteAddressBuffer buffer, uint offset, float2x3 value) { - buffer.Store3((offset + 0u), asuint(value[0u])); - buffer.Store3((offset + 16u), asuint(value[1u])); +void s_store_1(uint offset, float2x3 value) { + s.Store3((offset + 0u), asuint(value[0u])); + s.Store3((offset + 16u), asuint(value[1u])); } -void tint_symbol(RWByteAddressBuffer buffer, uint offset, float2x3 value[4]) { +void s_store(uint offset, float2x3 value[4]) { float2x3 array_1[4] = value; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - tint_symbol_1(buffer, (offset + (i * 32u)), array_1[i]); + s_store_1((offset + (i * 32u)), array_1[i]); } } } -float2x3 tint_symbol_4(uint4 buffer[8], uint offset) { +float2x3 u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz)); + return float2x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz)); } -typedef float2x3 tint_symbol_3_ret[4]; -tint_symbol_3_ret tint_symbol_3(uint4 buffer[8], uint offset) { +typedef float2x3 u_load_ret[4]; +u_load_ret u_load(uint offset) { float2x3 arr[4] = (float2x3[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_4(buffer, (offset + (i_1 * 32u))); + arr[i_1] = u_load_1((offset + (i_1 * 32u))); } } return arr; @@ -36,8 +36,8 @@ tint_symbol_3_ret tint_symbol_3(uint4 buffer[8], uint offset) { [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_3(u, 0u)); - tint_symbol_1(s, 32u, tint_symbol_4(u, 64u)); + s_store(0u, u_load(0u)); + s_store_1(32u, u_load_1(64u)); s.Store3(32u, asuint(asfloat(u[1].xyz).zxy)); s.Store(32u, asuint(asfloat(u[1].x))); return; diff --git a/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_storage.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_storage.wgsl.expected.fxc.hlsl index 93021a5d2c..fb02fff523 100644 --- a/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_storage.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_storage.wgsl.expected.fxc.hlsl @@ -3,32 +3,32 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol_1(RWByteAddressBuffer buffer, uint offset, float2x3 value) { - buffer.Store3((offset + 0u), asuint(value[0u])); - buffer.Store3((offset + 16u), asuint(value[1u])); +void s_store_1(uint offset, float2x3 value) { + s.Store3((offset + 0u), asuint(value[0u])); + s.Store3((offset + 16u), asuint(value[1u])); } -void tint_symbol(RWByteAddressBuffer buffer, uint offset, float2x3 value[4]) { +void s_store(uint offset, float2x3 value[4]) { float2x3 array_1[4] = value; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - tint_symbol_1(buffer, (offset + (i * 32u)), array_1[i]); + s_store_1((offset + (i * 32u)), array_1[i]); } } } -float2x3 tint_symbol_4(uint4 buffer[8], uint offset) { +float2x3 u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz)); + return float2x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz)); } -typedef float2x3 tint_symbol_3_ret[4]; -tint_symbol_3_ret tint_symbol_3(uint4 buffer[8], uint offset) { +typedef float2x3 u_load_ret[4]; +u_load_ret u_load(uint offset) { float2x3 arr[4] = (float2x3[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_4(buffer, (offset + (i_1 * 32u))); + arr[i_1] = u_load_1((offset + (i_1 * 32u))); } } return arr; @@ -36,8 +36,8 @@ tint_symbol_3_ret tint_symbol_3(uint4 buffer[8], uint offset) { [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_3(u, 0u)); - tint_symbol_1(s, 32u, tint_symbol_4(u, 64u)); + s_store(0u, u_load(0u)); + s_store_1(32u, u_load_1(64u)); s.Store3(32u, asuint(asfloat(u[1].xyz).zxy)); s.Store(32u, asuint(asfloat(u[1].x))); return; diff --git a/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_workgroup.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_workgroup.wgsl.expected.dxc.hlsl index 0b13b882f3..aa69e961aa 100644 --- a/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_workgroup.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_workgroup.wgsl.expected.dxc.hlsl @@ -7,18 +7,18 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -float2x3 tint_symbol_3(uint4 buffer[8], uint offset) { +float2x3 u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz)); + return float2x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz)); } -typedef float2x3 tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[8], uint offset) { +typedef float2x3 u_load_ret[4]; +u_load_ret u_load(uint offset) { float2x3 arr[4] = (float2x3[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_3(buffer, (offset + (i_1 * 32u))); + arr[i_1] = u_load_1((offset + (i_1 * 32u))); } } return arr; @@ -32,8 +32,8 @@ void f_inner(uint local_invocation_index) { } } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); - w[1] = tint_symbol_3(u, 64u); + w = u_load(0u); + w[1] = u_load_1(64u); w[1][0] = asfloat(u[1].xyz).zxy; w[1][0].x = asfloat(u[1].x); } diff --git a/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_workgroup.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_workgroup.wgsl.expected.fxc.hlsl index 0b13b882f3..aa69e961aa 100644 --- a/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_workgroup.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat2x3_f32/to_workgroup.wgsl.expected.fxc.hlsl @@ -7,18 +7,18 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -float2x3 tint_symbol_3(uint4 buffer[8], uint offset) { +float2x3 u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz)); + return float2x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz)); } -typedef float2x3 tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[8], uint offset) { +typedef float2x3 u_load_ret[4]; +u_load_ret u_load(uint offset) { float2x3 arr[4] = (float2x3[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_3(buffer, (offset + (i_1 * 32u))); + arr[i_1] = u_load_1((offset + (i_1 * 32u))); } } return arr; @@ -32,8 +32,8 @@ void f_inner(uint local_invocation_index) { } } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); - w[1] = tint_symbol_3(u, 64u); + w = u_load(0u); + w[1] = u_load_1(64u); w[1][0] = asfloat(u[1].xyz).zxy; w[1][0].x = asfloat(u[1].x); } diff --git a/test/tint/buffer/uniform/std140/array/mat2x4_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat2x4_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl index fe063566d5..28bccc7795 100644 --- a/test/tint/buffer/uniform/std140/array/mat2x4_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat2x4_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl @@ -8,26 +8,26 @@ int i() { return counter; } -matrix tint_symbol_1(uint4 buffer[4], uint offset) { +matrix a_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = a[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = a[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); vector ubo_load_2_yw = vector(f16tof32(ubo_load_2 >> 16)); return matrix(vector(ubo_load_xz[0], ubo_load_yw[0], ubo_load_xz[1], ubo_load_yw[1]), vector(ubo_load_2_xz[0], ubo_load_2_yw[0], ubo_load_2_xz[1], ubo_load_2_yw[1])); } -typedef matrix tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[4], uint offset) { +typedef matrix a_load_ret[4]; +a_load_ret a_load(uint offset) { matrix arr[4] = (matrix[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_1(buffer, (offset + (i_1 * 16u))); + arr[i_1] = a_load_1((offset + (i_1 * 16u))); } } return arr; @@ -37,8 +37,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[4], uint offset) { void f() { const int p_a_i_save = i(); const int p_a_i_i_save = i(); - const matrix l_a[4] = tint_symbol(a, 0u); - const matrix l_a_i = tint_symbol_1(a, (16u * uint(p_a_i_save))); + const matrix l_a[4] = a_load(0u); + const matrix l_a_i = a_load_1((16u * uint(p_a_i_save))); const uint scalar_offset_2 = (((16u * uint(p_a_i_save)) + (8u * uint(p_a_i_i_save)))) / 4; uint4 ubo_load_5 = a[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); diff --git a/test/tint/buffer/uniform/std140/array/mat2x4_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat2x4_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl index 3632bead97..37d8cdd63b 100644 --- a/test/tint/buffer/uniform/std140/array/mat2x4_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat2x4_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl @@ -2,26 +2,26 @@ cbuffer cbuffer_a : register(b0, space0) { uint4 a[4]; }; -matrix tint_symbol_1(uint4 buffer[4], uint offset) { +matrix a_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = a[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = a[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); vector ubo_load_2_yw = vector(f16tof32(ubo_load_2 >> 16)); return matrix(vector(ubo_load_xz[0], ubo_load_yw[0], ubo_load_xz[1], ubo_load_yw[1]), vector(ubo_load_2_xz[0], ubo_load_2_yw[0], ubo_load_2_xz[1], ubo_load_2_yw[1])); } -typedef matrix tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[4], uint offset) { +typedef matrix a_load_ret[4]; +a_load_ret a_load(uint offset) { matrix arr[4] = (matrix[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 16u))); + arr[i] = a_load_1((offset + (i * 16u))); } } return arr; @@ -29,8 +29,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[4], uint offset) { [numthreads(1, 1, 1)] void f() { - const matrix l_a[4] = tint_symbol(a, 0u); - const matrix l_a_i = tint_symbol_1(a, 32u); + const matrix l_a[4] = a_load(0u); + const matrix l_a_i = a_load_1(32u); uint2 ubo_load_4 = a[2].zw; vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); vector ubo_load_4_yw = vector(f16tof32(ubo_load_4 >> 16)); diff --git a/test/tint/buffer/uniform/std140/array/mat2x4_f16/to_builtin.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat2x4_f16/to_builtin.wgsl.expected.dxc.hlsl index b6a103e73f..7b85111a90 100644 --- a/test/tint/buffer/uniform/std140/array/mat2x4_f16/to_builtin.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat2x4_f16/to_builtin.wgsl.expected.dxc.hlsl @@ -2,14 +2,14 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[4]; }; -matrix tint_symbol(uint4 buffer[4], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); vector ubo_load_2_yw = vector(f16tof32(ubo_load_2 >> 16)); @@ -18,7 +18,7 @@ matrix tint_symbol(uint4 buffer[4], uint offset) { [numthreads(1, 1, 1)] void f() { - const matrix t = transpose(tint_symbol(u, 32u)); + const matrix t = transpose(u_load(32u)); uint2 ubo_load_4 = u[0].zw; vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); vector ubo_load_4_yw = vector(f16tof32(ubo_load_4 >> 16)); diff --git a/test/tint/buffer/uniform/std140/array/mat2x4_f16/to_fn.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat2x4_f16/to_fn.wgsl.expected.dxc.hlsl index f249b86a5c..e3bbebaa12 100644 --- a/test/tint/buffer/uniform/std140/array/mat2x4_f16/to_fn.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat2x4_f16/to_fn.wgsl.expected.dxc.hlsl @@ -14,26 +14,26 @@ void c(vector v) { void d(float16_t f_1) { } -matrix tint_symbol_1(uint4 buffer[4], uint offset) { +matrix u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); vector ubo_load_2_yw = vector(f16tof32(ubo_load_2 >> 16)); return matrix(vector(ubo_load_xz[0], ubo_load_yw[0], ubo_load_xz[1], ubo_load_yw[1]), vector(ubo_load_2_xz[0], ubo_load_2_yw[0], ubo_load_2_xz[1], ubo_load_2_yw[1])); } -typedef matrix tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[4], uint offset) { +typedef matrix u_load_ret[4]; +u_load_ret u_load(uint offset) { matrix arr[4] = (matrix[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 16u))); + arr[i] = u_load_1((offset + (i * 16u))); } } return arr; @@ -41,8 +41,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[4], uint offset) { [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); - b(tint_symbol_1(u, 16u)); + a(u_load(0u)); + b(u_load_1(16u)); uint2 ubo_load_4 = u[1].xy; vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); vector ubo_load_4_yw = vector(f16tof32(ubo_load_4 >> 16)); diff --git a/test/tint/buffer/uniform/std140/array/mat2x4_f16/to_private.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat2x4_f16/to_private.wgsl.expected.dxc.hlsl index 245b619579..2dbdd05534 100644 --- a/test/tint/buffer/uniform/std140/array/mat2x4_f16/to_private.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat2x4_f16/to_private.wgsl.expected.dxc.hlsl @@ -3,26 +3,26 @@ cbuffer cbuffer_u : register(b0, space0) { }; static matrix p[4] = (matrix[4])0; -matrix tint_symbol_1(uint4 buffer[4], uint offset) { +matrix u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); vector ubo_load_2_yw = vector(f16tof32(ubo_load_2 >> 16)); return matrix(vector(ubo_load_xz[0], ubo_load_yw[0], ubo_load_xz[1], ubo_load_yw[1]), vector(ubo_load_2_xz[0], ubo_load_2_yw[0], ubo_load_2_xz[1], ubo_load_2_yw[1])); } -typedef matrix tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[4], uint offset) { +typedef matrix u_load_ret[4]; +u_load_ret u_load(uint offset) { matrix arr[4] = (matrix[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 16u))); + arr[i] = u_load_1((offset + (i * 16u))); } } return arr; @@ -30,8 +30,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[4], uint offset) { [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); - p[1] = tint_symbol_1(u, 32u); + p = u_load(0u); + p[1] = u_load_1(32u); uint2 ubo_load_4 = u[0].zw; vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); vector ubo_load_4_yw = vector(f16tof32(ubo_load_4 >> 16)); diff --git a/test/tint/buffer/uniform/std140/array/mat2x4_f16/to_storage.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat2x4_f16/to_storage.wgsl.expected.dxc.hlsl index 28c564e519..33f7c703f0 100644 --- a/test/tint/buffer/uniform/std140/array/mat2x4_f16/to_storage.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat2x4_f16/to_storage.wgsl.expected.dxc.hlsl @@ -3,40 +3,40 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol_1(RWByteAddressBuffer buffer, uint offset, matrix value) { - buffer.Store >((offset + 0u), value[0u]); - buffer.Store >((offset + 8u), value[1u]); +void s_store_1(uint offset, matrix value) { + s.Store >((offset + 0u), value[0u]); + s.Store >((offset + 8u), value[1u]); } -void tint_symbol(RWByteAddressBuffer buffer, uint offset, matrix value[4]) { +void s_store(uint offset, matrix value[4]) { matrix array_1[4] = value; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - tint_symbol_1(buffer, (offset + (i * 16u)), array_1[i]); + s_store_1((offset + (i * 16u)), array_1[i]); } } } -matrix tint_symbol_4(uint4 buffer[4], uint offset) { +matrix u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); vector ubo_load_2_yw = vector(f16tof32(ubo_load_2 >> 16)); return matrix(vector(ubo_load_xz[0], ubo_load_yw[0], ubo_load_xz[1], ubo_load_yw[1]), vector(ubo_load_2_xz[0], ubo_load_2_yw[0], ubo_load_2_xz[1], ubo_load_2_yw[1])); } -typedef matrix tint_symbol_3_ret[4]; -tint_symbol_3_ret tint_symbol_3(uint4 buffer[4], uint offset) { +typedef matrix u_load_ret[4]; +u_load_ret u_load(uint offset) { matrix arr[4] = (matrix[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_4(buffer, (offset + (i_1 * 16u))); + arr[i_1] = u_load_1((offset + (i_1 * 16u))); } } return arr; @@ -44,8 +44,8 @@ tint_symbol_3_ret tint_symbol_3(uint4 buffer[4], uint offset) { [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_3(u, 0u)); - tint_symbol_1(s, 16u, tint_symbol_4(u, 32u)); + s_store(0u, u_load(0u)); + s_store_1(16u, u_load_1(32u)); uint2 ubo_load_4 = u[0].zw; vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); vector ubo_load_4_yw = vector(f16tof32(ubo_load_4 >> 16)); diff --git a/test/tint/buffer/uniform/std140/array/mat2x4_f16/to_workgroup.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat2x4_f16/to_workgroup.wgsl.expected.dxc.hlsl index 2efdd388f1..888645bc8a 100644 --- a/test/tint/buffer/uniform/std140/array/mat2x4_f16/to_workgroup.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat2x4_f16/to_workgroup.wgsl.expected.dxc.hlsl @@ -7,26 +7,26 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -matrix tint_symbol_3(uint4 buffer[4], uint offset) { +matrix u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); vector ubo_load_2_yw = vector(f16tof32(ubo_load_2 >> 16)); return matrix(vector(ubo_load_xz[0], ubo_load_yw[0], ubo_load_xz[1], ubo_load_yw[1]), vector(ubo_load_2_xz[0], ubo_load_2_yw[0], ubo_load_2_xz[1], ubo_load_2_yw[1])); } -typedef matrix tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[4], uint offset) { +typedef matrix u_load_ret[4]; +u_load_ret u_load(uint offset) { matrix arr[4] = (matrix[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_3(buffer, (offset + (i_1 * 16u))); + arr[i_1] = u_load_1((offset + (i_1 * 16u))); } } return arr; @@ -40,8 +40,8 @@ void f_inner(uint local_invocation_index) { } } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); - w[1] = tint_symbol_3(u, 32u); + w = u_load(0u); + w[1] = u_load_1(32u); uint2 ubo_load_4 = u[0].zw; vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); vector ubo_load_4_yw = vector(f16tof32(ubo_load_4 >> 16)); diff --git a/test/tint/buffer/uniform/std140/array/mat2x4_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat2x4_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl index 2f907f8f8a..c8636d8c5e 100644 --- a/test/tint/buffer/uniform/std140/array/mat2x4_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat2x4_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl @@ -8,18 +8,18 @@ int i() { return counter; } -float2x4 tint_symbol_1(uint4 buffer[8], uint offset) { +float2x4 a_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4])); + return float2x4(asfloat(a[scalar_offset / 4]), asfloat(a[scalar_offset_1 / 4])); } -typedef float2x4 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[8], uint offset) { +typedef float2x4 a_load_ret[4]; +a_load_ret a_load(uint offset) { float2x4 arr[4] = (float2x4[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_1(buffer, (offset + (i_1 * 32u))); + arr[i_1] = a_load_1((offset + (i_1 * 32u))); } } return arr; @@ -29,8 +29,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[8], uint offset) { void f() { const int p_a_i_save = i(); const int p_a_i_i_save = i(); - const float2x4 l_a[4] = tint_symbol(a, 0u); - const float2x4 l_a_i = tint_symbol_1(a, (32u * uint(p_a_i_save))); + const float2x4 l_a[4] = a_load(0u); + const float2x4 l_a_i = a_load_1((32u * uint(p_a_i_save))); const uint scalar_offset_2 = (((32u * uint(p_a_i_save)) + (16u * uint(p_a_i_i_save)))) / 4; const float4 l_a_i_i = asfloat(a[scalar_offset_2 / 4]); return; diff --git a/test/tint/buffer/uniform/std140/array/mat2x4_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/array/mat2x4_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl index 2f907f8f8a..c8636d8c5e 100644 --- a/test/tint/buffer/uniform/std140/array/mat2x4_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat2x4_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl @@ -8,18 +8,18 @@ int i() { return counter; } -float2x4 tint_symbol_1(uint4 buffer[8], uint offset) { +float2x4 a_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4])); + return float2x4(asfloat(a[scalar_offset / 4]), asfloat(a[scalar_offset_1 / 4])); } -typedef float2x4 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[8], uint offset) { +typedef float2x4 a_load_ret[4]; +a_load_ret a_load(uint offset) { float2x4 arr[4] = (float2x4[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_1(buffer, (offset + (i_1 * 32u))); + arr[i_1] = a_load_1((offset + (i_1 * 32u))); } } return arr; @@ -29,8 +29,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[8], uint offset) { void f() { const int p_a_i_save = i(); const int p_a_i_i_save = i(); - const float2x4 l_a[4] = tint_symbol(a, 0u); - const float2x4 l_a_i = tint_symbol_1(a, (32u * uint(p_a_i_save))); + const float2x4 l_a[4] = a_load(0u); + const float2x4 l_a_i = a_load_1((32u * uint(p_a_i_save))); const uint scalar_offset_2 = (((32u * uint(p_a_i_save)) + (16u * uint(p_a_i_i_save)))) / 4; const float4 l_a_i_i = asfloat(a[scalar_offset_2 / 4]); return; diff --git a/test/tint/buffer/uniform/std140/array/mat2x4_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat2x4_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl index 89fd887054..f8d3475c31 100644 --- a/test/tint/buffer/uniform/std140/array/mat2x4_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat2x4_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl @@ -2,18 +2,18 @@ cbuffer cbuffer_a : register(b0, space0) { uint4 a[8]; }; -float2x4 tint_symbol_1(uint4 buffer[8], uint offset) { +float2x4 a_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4])); + return float2x4(asfloat(a[scalar_offset / 4]), asfloat(a[scalar_offset_1 / 4])); } -typedef float2x4 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[8], uint offset) { +typedef float2x4 a_load_ret[4]; +a_load_ret a_load(uint offset) { float2x4 arr[4] = (float2x4[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 32u))); + arr[i] = a_load_1((offset + (i * 32u))); } } return arr; @@ -21,8 +21,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[8], uint offset) { [numthreads(1, 1, 1)] void f() { - const float2x4 l_a[4] = tint_symbol(a, 0u); - const float2x4 l_a_i = tint_symbol_1(a, 64u); + const float2x4 l_a[4] = a_load(0u); + const float2x4 l_a_i = a_load_1(64u); const float4 l_a_i_i = asfloat(a[5]); return; } diff --git a/test/tint/buffer/uniform/std140/array/mat2x4_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/array/mat2x4_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl index 89fd887054..f8d3475c31 100644 --- a/test/tint/buffer/uniform/std140/array/mat2x4_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat2x4_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl @@ -2,18 +2,18 @@ cbuffer cbuffer_a : register(b0, space0) { uint4 a[8]; }; -float2x4 tint_symbol_1(uint4 buffer[8], uint offset) { +float2x4 a_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4])); + return float2x4(asfloat(a[scalar_offset / 4]), asfloat(a[scalar_offset_1 / 4])); } -typedef float2x4 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[8], uint offset) { +typedef float2x4 a_load_ret[4]; +a_load_ret a_load(uint offset) { float2x4 arr[4] = (float2x4[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 32u))); + arr[i] = a_load_1((offset + (i * 32u))); } } return arr; @@ -21,8 +21,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[8], uint offset) { [numthreads(1, 1, 1)] void f() { - const float2x4 l_a[4] = tint_symbol(a, 0u); - const float2x4 l_a_i = tint_symbol_1(a, 64u); + const float2x4 l_a[4] = a_load(0u); + const float2x4 l_a_i = a_load_1(64u); const float4 l_a_i_i = asfloat(a[5]); return; } diff --git a/test/tint/buffer/uniform/std140/array/mat2x4_f32/to_builtin.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat2x4_f32/to_builtin.wgsl.expected.dxc.hlsl index e5ed9375ca..7ffe200645 100644 --- a/test/tint/buffer/uniform/std140/array/mat2x4_f32/to_builtin.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat2x4_f32/to_builtin.wgsl.expected.dxc.hlsl @@ -2,15 +2,15 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[8]; }; -float2x4 tint_symbol(uint4 buffer[8], uint offset) { +float2x4 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4])); + return float2x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4])); } [numthreads(1, 1, 1)] void f() { - const float4x2 t = transpose(tint_symbol(u, 64u)); + const float4x2 t = transpose(u_load(64u)); const float l = length(asfloat(u[1]).ywxz); const float a = abs(asfloat(u[1]).ywxz.x); return; diff --git a/test/tint/buffer/uniform/std140/array/mat2x4_f32/to_builtin.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/array/mat2x4_f32/to_builtin.wgsl.expected.fxc.hlsl index e5ed9375ca..7ffe200645 100644 --- a/test/tint/buffer/uniform/std140/array/mat2x4_f32/to_builtin.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat2x4_f32/to_builtin.wgsl.expected.fxc.hlsl @@ -2,15 +2,15 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[8]; }; -float2x4 tint_symbol(uint4 buffer[8], uint offset) { +float2x4 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4])); + return float2x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4])); } [numthreads(1, 1, 1)] void f() { - const float4x2 t = transpose(tint_symbol(u, 64u)); + const float4x2 t = transpose(u_load(64u)); const float l = length(asfloat(u[1]).ywxz); const float a = abs(asfloat(u[1]).ywxz.x); return; diff --git a/test/tint/buffer/uniform/std140/array/mat2x4_f32/to_fn.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat2x4_f32/to_fn.wgsl.expected.dxc.hlsl index ea9471ab63..3d5d72d315 100644 --- a/test/tint/buffer/uniform/std140/array/mat2x4_f32/to_fn.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat2x4_f32/to_fn.wgsl.expected.dxc.hlsl @@ -14,18 +14,18 @@ void c(float4 v) { void d(float f_1) { } -float2x4 tint_symbol_1(uint4 buffer[8], uint offset) { +float2x4 u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4])); + return float2x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4])); } -typedef float2x4 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[8], uint offset) { +typedef float2x4 u_load_ret[4]; +u_load_ret u_load(uint offset) { float2x4 arr[4] = (float2x4[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 32u))); + arr[i] = u_load_1((offset + (i * 32u))); } } return arr; @@ -33,8 +33,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[8], uint offset) { [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); - b(tint_symbol_1(u, 32u)); + a(u_load(0u)); + b(u_load_1(32u)); c(asfloat(u[2]).ywxz); d(asfloat(u[2]).ywxz.x); return; diff --git a/test/tint/buffer/uniform/std140/array/mat2x4_f32/to_fn.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/array/mat2x4_f32/to_fn.wgsl.expected.fxc.hlsl index ea9471ab63..3d5d72d315 100644 --- a/test/tint/buffer/uniform/std140/array/mat2x4_f32/to_fn.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat2x4_f32/to_fn.wgsl.expected.fxc.hlsl @@ -14,18 +14,18 @@ void c(float4 v) { void d(float f_1) { } -float2x4 tint_symbol_1(uint4 buffer[8], uint offset) { +float2x4 u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4])); + return float2x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4])); } -typedef float2x4 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[8], uint offset) { +typedef float2x4 u_load_ret[4]; +u_load_ret u_load(uint offset) { float2x4 arr[4] = (float2x4[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 32u))); + arr[i] = u_load_1((offset + (i * 32u))); } } return arr; @@ -33,8 +33,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[8], uint offset) { [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); - b(tint_symbol_1(u, 32u)); + a(u_load(0u)); + b(u_load_1(32u)); c(asfloat(u[2]).ywxz); d(asfloat(u[2]).ywxz.x); return; diff --git a/test/tint/buffer/uniform/std140/array/mat2x4_f32/to_private.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat2x4_f32/to_private.wgsl.expected.dxc.hlsl index ba81ce8c42..88ec239530 100644 --- a/test/tint/buffer/uniform/std140/array/mat2x4_f32/to_private.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat2x4_f32/to_private.wgsl.expected.dxc.hlsl @@ -3,18 +3,18 @@ cbuffer cbuffer_u : register(b0, space0) { }; static float2x4 p[4] = (float2x4[4])0; -float2x4 tint_symbol_1(uint4 buffer[8], uint offset) { +float2x4 u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4])); + return float2x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4])); } -typedef float2x4 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[8], uint offset) { +typedef float2x4 u_load_ret[4]; +u_load_ret u_load(uint offset) { float2x4 arr[4] = (float2x4[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 32u))); + arr[i] = u_load_1((offset + (i * 32u))); } } return arr; @@ -22,8 +22,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[8], uint offset) { [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); - p[1] = tint_symbol_1(u, 64u); + p = u_load(0u); + p[1] = u_load_1(64u); p[1][0] = asfloat(u[1]).ywxz; p[1][0].x = asfloat(u[1].x); return; diff --git a/test/tint/buffer/uniform/std140/array/mat2x4_f32/to_private.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/array/mat2x4_f32/to_private.wgsl.expected.fxc.hlsl index ba81ce8c42..88ec239530 100644 --- a/test/tint/buffer/uniform/std140/array/mat2x4_f32/to_private.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat2x4_f32/to_private.wgsl.expected.fxc.hlsl @@ -3,18 +3,18 @@ cbuffer cbuffer_u : register(b0, space0) { }; static float2x4 p[4] = (float2x4[4])0; -float2x4 tint_symbol_1(uint4 buffer[8], uint offset) { +float2x4 u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4])); + return float2x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4])); } -typedef float2x4 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[8], uint offset) { +typedef float2x4 u_load_ret[4]; +u_load_ret u_load(uint offset) { float2x4 arr[4] = (float2x4[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 32u))); + arr[i] = u_load_1((offset + (i * 32u))); } } return arr; @@ -22,8 +22,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[8], uint offset) { [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); - p[1] = tint_symbol_1(u, 64u); + p = u_load(0u); + p[1] = u_load_1(64u); p[1][0] = asfloat(u[1]).ywxz; p[1][0].x = asfloat(u[1].x); return; diff --git a/test/tint/buffer/uniform/std140/array/mat2x4_f32/to_storage.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat2x4_f32/to_storage.wgsl.expected.dxc.hlsl index 5b44d2d99b..b12251b753 100644 --- a/test/tint/buffer/uniform/std140/array/mat2x4_f32/to_storage.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat2x4_f32/to_storage.wgsl.expected.dxc.hlsl @@ -3,32 +3,32 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol_1(RWByteAddressBuffer buffer, uint offset, float2x4 value) { - buffer.Store4((offset + 0u), asuint(value[0u])); - buffer.Store4((offset + 16u), asuint(value[1u])); +void s_store_1(uint offset, float2x4 value) { + s.Store4((offset + 0u), asuint(value[0u])); + s.Store4((offset + 16u), asuint(value[1u])); } -void tint_symbol(RWByteAddressBuffer buffer, uint offset, float2x4 value[4]) { +void s_store(uint offset, float2x4 value[4]) { float2x4 array_1[4] = value; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - tint_symbol_1(buffer, (offset + (i * 32u)), array_1[i]); + s_store_1((offset + (i * 32u)), array_1[i]); } } } -float2x4 tint_symbol_4(uint4 buffer[8], uint offset) { +float2x4 u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4])); + return float2x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4])); } -typedef float2x4 tint_symbol_3_ret[4]; -tint_symbol_3_ret tint_symbol_3(uint4 buffer[8], uint offset) { +typedef float2x4 u_load_ret[4]; +u_load_ret u_load(uint offset) { float2x4 arr[4] = (float2x4[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_4(buffer, (offset + (i_1 * 32u))); + arr[i_1] = u_load_1((offset + (i_1 * 32u))); } } return arr; @@ -36,8 +36,8 @@ tint_symbol_3_ret tint_symbol_3(uint4 buffer[8], uint offset) { [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_3(u, 0u)); - tint_symbol_1(s, 32u, tint_symbol_4(u, 64u)); + s_store(0u, u_load(0u)); + s_store_1(32u, u_load_1(64u)); s.Store4(32u, asuint(asfloat(u[1]).ywxz)); s.Store(32u, asuint(asfloat(u[1].x))); return; diff --git a/test/tint/buffer/uniform/std140/array/mat2x4_f32/to_storage.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/array/mat2x4_f32/to_storage.wgsl.expected.fxc.hlsl index 5b44d2d99b..b12251b753 100644 --- a/test/tint/buffer/uniform/std140/array/mat2x4_f32/to_storage.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat2x4_f32/to_storage.wgsl.expected.fxc.hlsl @@ -3,32 +3,32 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol_1(RWByteAddressBuffer buffer, uint offset, float2x4 value) { - buffer.Store4((offset + 0u), asuint(value[0u])); - buffer.Store4((offset + 16u), asuint(value[1u])); +void s_store_1(uint offset, float2x4 value) { + s.Store4((offset + 0u), asuint(value[0u])); + s.Store4((offset + 16u), asuint(value[1u])); } -void tint_symbol(RWByteAddressBuffer buffer, uint offset, float2x4 value[4]) { +void s_store(uint offset, float2x4 value[4]) { float2x4 array_1[4] = value; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - tint_symbol_1(buffer, (offset + (i * 32u)), array_1[i]); + s_store_1((offset + (i * 32u)), array_1[i]); } } } -float2x4 tint_symbol_4(uint4 buffer[8], uint offset) { +float2x4 u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4])); + return float2x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4])); } -typedef float2x4 tint_symbol_3_ret[4]; -tint_symbol_3_ret tint_symbol_3(uint4 buffer[8], uint offset) { +typedef float2x4 u_load_ret[4]; +u_load_ret u_load(uint offset) { float2x4 arr[4] = (float2x4[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_4(buffer, (offset + (i_1 * 32u))); + arr[i_1] = u_load_1((offset + (i_1 * 32u))); } } return arr; @@ -36,8 +36,8 @@ tint_symbol_3_ret tint_symbol_3(uint4 buffer[8], uint offset) { [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_3(u, 0u)); - tint_symbol_1(s, 32u, tint_symbol_4(u, 64u)); + s_store(0u, u_load(0u)); + s_store_1(32u, u_load_1(64u)); s.Store4(32u, asuint(asfloat(u[1]).ywxz)); s.Store(32u, asuint(asfloat(u[1].x))); return; diff --git a/test/tint/buffer/uniform/std140/array/mat2x4_f32/to_workgroup.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat2x4_f32/to_workgroup.wgsl.expected.dxc.hlsl index 963cbf80c9..26b249f60b 100644 --- a/test/tint/buffer/uniform/std140/array/mat2x4_f32/to_workgroup.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat2x4_f32/to_workgroup.wgsl.expected.dxc.hlsl @@ -7,18 +7,18 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -float2x4 tint_symbol_3(uint4 buffer[8], uint offset) { +float2x4 u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4])); + return float2x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4])); } -typedef float2x4 tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[8], uint offset) { +typedef float2x4 u_load_ret[4]; +u_load_ret u_load(uint offset) { float2x4 arr[4] = (float2x4[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_3(buffer, (offset + (i_1 * 32u))); + arr[i_1] = u_load_1((offset + (i_1 * 32u))); } } return arr; @@ -32,8 +32,8 @@ void f_inner(uint local_invocation_index) { } } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); - w[1] = tint_symbol_3(u, 64u); + w = u_load(0u); + w[1] = u_load_1(64u); w[1][0] = asfloat(u[1]).ywxz; w[1][0].x = asfloat(u[1].x); } diff --git a/test/tint/buffer/uniform/std140/array/mat2x4_f32/to_workgroup.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/array/mat2x4_f32/to_workgroup.wgsl.expected.fxc.hlsl index 963cbf80c9..26b249f60b 100644 --- a/test/tint/buffer/uniform/std140/array/mat2x4_f32/to_workgroup.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat2x4_f32/to_workgroup.wgsl.expected.fxc.hlsl @@ -7,18 +7,18 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -float2x4 tint_symbol_3(uint4 buffer[8], uint offset) { +float2x4 u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4])); + return float2x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4])); } -typedef float2x4 tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[8], uint offset) { +typedef float2x4 u_load_ret[4]; +u_load_ret u_load(uint offset) { float2x4 arr[4] = (float2x4[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_3(buffer, (offset + (i_1 * 32u))); + arr[i_1] = u_load_1((offset + (i_1 * 32u))); } } return arr; @@ -32,8 +32,8 @@ void f_inner(uint local_invocation_index) { } } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); - w[1] = tint_symbol_3(u, 64u); + w = u_load(0u); + w[1] = u_load_1(64u); w[1][0] = asfloat(u[1]).ywxz; w[1][0].x = asfloat(u[1].x); } diff --git a/test/tint/buffer/uniform/std140/array/mat3x3_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat3x3_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl index ec7bba0689..79aed43dfc 100644 --- a/test/tint/buffer/uniform/std140/array/mat3x3_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat3x3_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl @@ -8,19 +8,19 @@ int i() { return counter; } -float3x3 tint_symbol_1(uint4 buffer[12], uint offset) { +float3x3 a_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz)); + return float3x3(asfloat(a[scalar_offset / 4].xyz), asfloat(a[scalar_offset_1 / 4].xyz), asfloat(a[scalar_offset_2 / 4].xyz)); } -typedef float3x3 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[12], uint offset) { +typedef float3x3 a_load_ret[4]; +a_load_ret a_load(uint offset) { float3x3 arr[4] = (float3x3[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_1(buffer, (offset + (i_1 * 48u))); + arr[i_1] = a_load_1((offset + (i_1 * 48u))); } } return arr; @@ -30,8 +30,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[12], uint offset) { void f() { const int p_a_i_save = i(); const int p_a_i_i_save = i(); - const float3x3 l_a[4] = tint_symbol(a, 0u); - const float3x3 l_a_i = tint_symbol_1(a, (48u * uint(p_a_i_save))); + const float3x3 l_a[4] = a_load(0u); + const float3x3 l_a_i = a_load_1((48u * uint(p_a_i_save))); const uint scalar_offset_3 = (((48u * uint(p_a_i_save)) + (16u * uint(p_a_i_i_save)))) / 4; const float3 l_a_i_i = asfloat(a[scalar_offset_3 / 4].xyz); return; diff --git a/test/tint/buffer/uniform/std140/array/mat3x3_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/array/mat3x3_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl index ec7bba0689..79aed43dfc 100644 --- a/test/tint/buffer/uniform/std140/array/mat3x3_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat3x3_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl @@ -8,19 +8,19 @@ int i() { return counter; } -float3x3 tint_symbol_1(uint4 buffer[12], uint offset) { +float3x3 a_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz)); + return float3x3(asfloat(a[scalar_offset / 4].xyz), asfloat(a[scalar_offset_1 / 4].xyz), asfloat(a[scalar_offset_2 / 4].xyz)); } -typedef float3x3 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[12], uint offset) { +typedef float3x3 a_load_ret[4]; +a_load_ret a_load(uint offset) { float3x3 arr[4] = (float3x3[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_1(buffer, (offset + (i_1 * 48u))); + arr[i_1] = a_load_1((offset + (i_1 * 48u))); } } return arr; @@ -30,8 +30,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[12], uint offset) { void f() { const int p_a_i_save = i(); const int p_a_i_i_save = i(); - const float3x3 l_a[4] = tint_symbol(a, 0u); - const float3x3 l_a_i = tint_symbol_1(a, (48u * uint(p_a_i_save))); + const float3x3 l_a[4] = a_load(0u); + const float3x3 l_a_i = a_load_1((48u * uint(p_a_i_save))); const uint scalar_offset_3 = (((48u * uint(p_a_i_save)) + (16u * uint(p_a_i_i_save)))) / 4; const float3 l_a_i_i = asfloat(a[scalar_offset_3 / 4].xyz); return; diff --git a/test/tint/buffer/uniform/std140/array/mat3x3_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat3x3_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl index ac8182a547..428ba4f2d0 100644 --- a/test/tint/buffer/uniform/std140/array/mat3x3_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat3x3_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl @@ -2,19 +2,19 @@ cbuffer cbuffer_a : register(b0, space0) { uint4 a[12]; }; -float3x3 tint_symbol_1(uint4 buffer[12], uint offset) { +float3x3 a_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz)); + return float3x3(asfloat(a[scalar_offset / 4].xyz), asfloat(a[scalar_offset_1 / 4].xyz), asfloat(a[scalar_offset_2 / 4].xyz)); } -typedef float3x3 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[12], uint offset) { +typedef float3x3 a_load_ret[4]; +a_load_ret a_load(uint offset) { float3x3 arr[4] = (float3x3[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 48u))); + arr[i] = a_load_1((offset + (i * 48u))); } } return arr; @@ -22,8 +22,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[12], uint offset) { [numthreads(1, 1, 1)] void f() { - const float3x3 l_a[4] = tint_symbol(a, 0u); - const float3x3 l_a_i = tint_symbol_1(a, 96u); + const float3x3 l_a[4] = a_load(0u); + const float3x3 l_a_i = a_load_1(96u); const float3 l_a_i_i = asfloat(a[7].xyz); return; } diff --git a/test/tint/buffer/uniform/std140/array/mat3x3_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/array/mat3x3_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl index ac8182a547..428ba4f2d0 100644 --- a/test/tint/buffer/uniform/std140/array/mat3x3_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat3x3_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl @@ -2,19 +2,19 @@ cbuffer cbuffer_a : register(b0, space0) { uint4 a[12]; }; -float3x3 tint_symbol_1(uint4 buffer[12], uint offset) { +float3x3 a_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz)); + return float3x3(asfloat(a[scalar_offset / 4].xyz), asfloat(a[scalar_offset_1 / 4].xyz), asfloat(a[scalar_offset_2 / 4].xyz)); } -typedef float3x3 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[12], uint offset) { +typedef float3x3 a_load_ret[4]; +a_load_ret a_load(uint offset) { float3x3 arr[4] = (float3x3[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 48u))); + arr[i] = a_load_1((offset + (i * 48u))); } } return arr; @@ -22,8 +22,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[12], uint offset) { [numthreads(1, 1, 1)] void f() { - const float3x3 l_a[4] = tint_symbol(a, 0u); - const float3x3 l_a_i = tint_symbol_1(a, 96u); + const float3x3 l_a[4] = a_load(0u); + const float3x3 l_a_i = a_load_1(96u); const float3 l_a_i_i = asfloat(a[7].xyz); return; } diff --git a/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_builtin.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_builtin.wgsl.expected.dxc.hlsl index 6bf5247553..5ac2bb692e 100644 --- a/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_builtin.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_builtin.wgsl.expected.dxc.hlsl @@ -2,16 +2,16 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[12]; }; -float3x3 tint_symbol(uint4 buffer[12], uint offset) { +float3x3 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz)); + return float3x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz)); } [numthreads(1, 1, 1)] void f() { - const float3x3 t = transpose(tint_symbol(u, 96u)); + const float3x3 t = transpose(u_load(96u)); const float l = length(asfloat(u[1].xyz).zxy); const float a = abs(asfloat(u[1].xyz).zxy.x); return; diff --git a/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_builtin.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_builtin.wgsl.expected.fxc.hlsl index 6bf5247553..5ac2bb692e 100644 --- a/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_builtin.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_builtin.wgsl.expected.fxc.hlsl @@ -2,16 +2,16 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[12]; }; -float3x3 tint_symbol(uint4 buffer[12], uint offset) { +float3x3 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz)); + return float3x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz)); } [numthreads(1, 1, 1)] void f() { - const float3x3 t = transpose(tint_symbol(u, 96u)); + const float3x3 t = transpose(u_load(96u)); const float l = length(asfloat(u[1].xyz).zxy); const float a = abs(asfloat(u[1].xyz).zxy.x); return; diff --git a/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_fn.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_fn.wgsl.expected.dxc.hlsl index 3251692d0c..505cd5e4d9 100644 --- a/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_fn.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_fn.wgsl.expected.dxc.hlsl @@ -14,19 +14,19 @@ void c(float3 v) { void d(float f_1) { } -float3x3 tint_symbol_1(uint4 buffer[12], uint offset) { +float3x3 u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz)); + return float3x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz)); } -typedef float3x3 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[12], uint offset) { +typedef float3x3 u_load_ret[4]; +u_load_ret u_load(uint offset) { float3x3 arr[4] = (float3x3[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 48u))); + arr[i] = u_load_1((offset + (i * 48u))); } } return arr; @@ -34,8 +34,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[12], uint offset) { [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); - b(tint_symbol_1(u, 48u)); + a(u_load(0u)); + b(u_load_1(48u)); c(asfloat(u[3].xyz).zxy); d(asfloat(u[3].xyz).zxy.x); return; diff --git a/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_fn.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_fn.wgsl.expected.fxc.hlsl index 3251692d0c..505cd5e4d9 100644 --- a/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_fn.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_fn.wgsl.expected.fxc.hlsl @@ -14,19 +14,19 @@ void c(float3 v) { void d(float f_1) { } -float3x3 tint_symbol_1(uint4 buffer[12], uint offset) { +float3x3 u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz)); + return float3x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz)); } -typedef float3x3 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[12], uint offset) { +typedef float3x3 u_load_ret[4]; +u_load_ret u_load(uint offset) { float3x3 arr[4] = (float3x3[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 48u))); + arr[i] = u_load_1((offset + (i * 48u))); } } return arr; @@ -34,8 +34,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[12], uint offset) { [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); - b(tint_symbol_1(u, 48u)); + a(u_load(0u)); + b(u_load_1(48u)); c(asfloat(u[3].xyz).zxy); d(asfloat(u[3].xyz).zxy.x); return; diff --git a/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_private.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_private.wgsl.expected.dxc.hlsl index 4bf04e7673..b717990988 100644 --- a/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_private.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_private.wgsl.expected.dxc.hlsl @@ -3,19 +3,19 @@ cbuffer cbuffer_u : register(b0, space0) { }; static float3x3 p[4] = (float3x3[4])0; -float3x3 tint_symbol_1(uint4 buffer[12], uint offset) { +float3x3 u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz)); + return float3x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz)); } -typedef float3x3 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[12], uint offset) { +typedef float3x3 u_load_ret[4]; +u_load_ret u_load(uint offset) { float3x3 arr[4] = (float3x3[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 48u))); + arr[i] = u_load_1((offset + (i * 48u))); } } return arr; @@ -23,8 +23,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[12], uint offset) { [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); - p[1] = tint_symbol_1(u, 96u); + p = u_load(0u); + p[1] = u_load_1(96u); p[1][0] = asfloat(u[1].xyz).zxy; p[1][0].x = asfloat(u[1].x); return; diff --git a/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_private.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_private.wgsl.expected.fxc.hlsl index 4bf04e7673..b717990988 100644 --- a/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_private.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_private.wgsl.expected.fxc.hlsl @@ -3,19 +3,19 @@ cbuffer cbuffer_u : register(b0, space0) { }; static float3x3 p[4] = (float3x3[4])0; -float3x3 tint_symbol_1(uint4 buffer[12], uint offset) { +float3x3 u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz)); + return float3x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz)); } -typedef float3x3 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[12], uint offset) { +typedef float3x3 u_load_ret[4]; +u_load_ret u_load(uint offset) { float3x3 arr[4] = (float3x3[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 48u))); + arr[i] = u_load_1((offset + (i * 48u))); } } return arr; @@ -23,8 +23,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[12], uint offset) { [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); - p[1] = tint_symbol_1(u, 96u); + p = u_load(0u); + p[1] = u_load_1(96u); p[1][0] = asfloat(u[1].xyz).zxy; p[1][0].x = asfloat(u[1].x); return; diff --git a/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_storage.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_storage.wgsl.expected.dxc.hlsl index 563ec2e0ec..da597a8cdc 100644 --- a/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_storage.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_storage.wgsl.expected.dxc.hlsl @@ -3,34 +3,34 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol_1(RWByteAddressBuffer buffer, uint offset, float3x3 value) { - buffer.Store3((offset + 0u), asuint(value[0u])); - buffer.Store3((offset + 16u), asuint(value[1u])); - buffer.Store3((offset + 32u), asuint(value[2u])); +void s_store_1(uint offset, float3x3 value) { + s.Store3((offset + 0u), asuint(value[0u])); + s.Store3((offset + 16u), asuint(value[1u])); + s.Store3((offset + 32u), asuint(value[2u])); } -void tint_symbol(RWByteAddressBuffer buffer, uint offset, float3x3 value[4]) { +void s_store(uint offset, float3x3 value[4]) { float3x3 array_1[4] = value; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - tint_symbol_1(buffer, (offset + (i * 48u)), array_1[i]); + s_store_1((offset + (i * 48u)), array_1[i]); } } } -float3x3 tint_symbol_4(uint4 buffer[12], uint offset) { +float3x3 u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz)); + return float3x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz)); } -typedef float3x3 tint_symbol_3_ret[4]; -tint_symbol_3_ret tint_symbol_3(uint4 buffer[12], uint offset) { +typedef float3x3 u_load_ret[4]; +u_load_ret u_load(uint offset) { float3x3 arr[4] = (float3x3[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_4(buffer, (offset + (i_1 * 48u))); + arr[i_1] = u_load_1((offset + (i_1 * 48u))); } } return arr; @@ -38,8 +38,8 @@ tint_symbol_3_ret tint_symbol_3(uint4 buffer[12], uint offset) { [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_3(u, 0u)); - tint_symbol_1(s, 48u, tint_symbol_4(u, 96u)); + s_store(0u, u_load(0u)); + s_store_1(48u, u_load_1(96u)); s.Store3(48u, asuint(asfloat(u[1].xyz).zxy)); s.Store(48u, asuint(asfloat(u[1].x))); return; diff --git a/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_storage.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_storage.wgsl.expected.fxc.hlsl index 563ec2e0ec..da597a8cdc 100644 --- a/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_storage.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_storage.wgsl.expected.fxc.hlsl @@ -3,34 +3,34 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol_1(RWByteAddressBuffer buffer, uint offset, float3x3 value) { - buffer.Store3((offset + 0u), asuint(value[0u])); - buffer.Store3((offset + 16u), asuint(value[1u])); - buffer.Store3((offset + 32u), asuint(value[2u])); +void s_store_1(uint offset, float3x3 value) { + s.Store3((offset + 0u), asuint(value[0u])); + s.Store3((offset + 16u), asuint(value[1u])); + s.Store3((offset + 32u), asuint(value[2u])); } -void tint_symbol(RWByteAddressBuffer buffer, uint offset, float3x3 value[4]) { +void s_store(uint offset, float3x3 value[4]) { float3x3 array_1[4] = value; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - tint_symbol_1(buffer, (offset + (i * 48u)), array_1[i]); + s_store_1((offset + (i * 48u)), array_1[i]); } } } -float3x3 tint_symbol_4(uint4 buffer[12], uint offset) { +float3x3 u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz)); + return float3x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz)); } -typedef float3x3 tint_symbol_3_ret[4]; -tint_symbol_3_ret tint_symbol_3(uint4 buffer[12], uint offset) { +typedef float3x3 u_load_ret[4]; +u_load_ret u_load(uint offset) { float3x3 arr[4] = (float3x3[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_4(buffer, (offset + (i_1 * 48u))); + arr[i_1] = u_load_1((offset + (i_1 * 48u))); } } return arr; @@ -38,8 +38,8 @@ tint_symbol_3_ret tint_symbol_3(uint4 buffer[12], uint offset) { [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_3(u, 0u)); - tint_symbol_1(s, 48u, tint_symbol_4(u, 96u)); + s_store(0u, u_load(0u)); + s_store_1(48u, u_load_1(96u)); s.Store3(48u, asuint(asfloat(u[1].xyz).zxy)); s.Store(48u, asuint(asfloat(u[1].x))); return; diff --git a/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_workgroup.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_workgroup.wgsl.expected.dxc.hlsl index 1751886316..2845665dcb 100644 --- a/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_workgroup.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_workgroup.wgsl.expected.dxc.hlsl @@ -7,19 +7,19 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -float3x3 tint_symbol_3(uint4 buffer[12], uint offset) { +float3x3 u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz)); + return float3x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz)); } -typedef float3x3 tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[12], uint offset) { +typedef float3x3 u_load_ret[4]; +u_load_ret u_load(uint offset) { float3x3 arr[4] = (float3x3[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_3(buffer, (offset + (i_1 * 48u))); + arr[i_1] = u_load_1((offset + (i_1 * 48u))); } } return arr; @@ -33,8 +33,8 @@ void f_inner(uint local_invocation_index) { } } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); - w[1] = tint_symbol_3(u, 96u); + w = u_load(0u); + w[1] = u_load_1(96u); w[1][0] = asfloat(u[1].xyz).zxy; w[1][0].x = asfloat(u[1].x); } diff --git a/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_workgroup.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_workgroup.wgsl.expected.fxc.hlsl index 1751886316..2845665dcb 100644 --- a/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_workgroup.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat3x3_f32/to_workgroup.wgsl.expected.fxc.hlsl @@ -7,19 +7,19 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -float3x3 tint_symbol_3(uint4 buffer[12], uint offset) { +float3x3 u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz)); + return float3x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz)); } -typedef float3x3 tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[12], uint offset) { +typedef float3x3 u_load_ret[4]; +u_load_ret u_load(uint offset) { float3x3 arr[4] = (float3x3[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_3(buffer, (offset + (i_1 * 48u))); + arr[i_1] = u_load_1((offset + (i_1 * 48u))); } } return arr; @@ -33,8 +33,8 @@ void f_inner(uint local_invocation_index) { } } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); - w[1] = tint_symbol_3(u, 96u); + w = u_load(0u); + w[1] = u_load_1(96u); w[1][0] = asfloat(u[1].xyz).zxy; w[1][0].x = asfloat(u[1].x); } diff --git a/test/tint/buffer/uniform/std140/array/mat3x4_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat3x4_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl index 89cb90f6ce..a3b59fabf6 100644 --- a/test/tint/buffer/uniform/std140/array/mat3x4_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat3x4_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl @@ -8,19 +8,19 @@ int i() { return counter; } -float3x4 tint_symbol_1(uint4 buffer[12], uint offset) { +float3x4 a_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); + return float3x4(asfloat(a[scalar_offset / 4]), asfloat(a[scalar_offset_1 / 4]), asfloat(a[scalar_offset_2 / 4])); } -typedef float3x4 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[12], uint offset) { +typedef float3x4 a_load_ret[4]; +a_load_ret a_load(uint offset) { float3x4 arr[4] = (float3x4[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_1(buffer, (offset + (i_1 * 48u))); + arr[i_1] = a_load_1((offset + (i_1 * 48u))); } } return arr; @@ -30,8 +30,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[12], uint offset) { void f() { const int p_a_i_save = i(); const int p_a_i_i_save = i(); - const float3x4 l_a[4] = tint_symbol(a, 0u); - const float3x4 l_a_i = tint_symbol_1(a, (48u * uint(p_a_i_save))); + const float3x4 l_a[4] = a_load(0u); + const float3x4 l_a_i = a_load_1((48u * uint(p_a_i_save))); const uint scalar_offset_3 = (((48u * uint(p_a_i_save)) + (16u * uint(p_a_i_i_save)))) / 4; const float4 l_a_i_i = asfloat(a[scalar_offset_3 / 4]); return; diff --git a/test/tint/buffer/uniform/std140/array/mat3x4_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/array/mat3x4_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl index 89cb90f6ce..a3b59fabf6 100644 --- a/test/tint/buffer/uniform/std140/array/mat3x4_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat3x4_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl @@ -8,19 +8,19 @@ int i() { return counter; } -float3x4 tint_symbol_1(uint4 buffer[12], uint offset) { +float3x4 a_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); + return float3x4(asfloat(a[scalar_offset / 4]), asfloat(a[scalar_offset_1 / 4]), asfloat(a[scalar_offset_2 / 4])); } -typedef float3x4 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[12], uint offset) { +typedef float3x4 a_load_ret[4]; +a_load_ret a_load(uint offset) { float3x4 arr[4] = (float3x4[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_1(buffer, (offset + (i_1 * 48u))); + arr[i_1] = a_load_1((offset + (i_1 * 48u))); } } return arr; @@ -30,8 +30,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[12], uint offset) { void f() { const int p_a_i_save = i(); const int p_a_i_i_save = i(); - const float3x4 l_a[4] = tint_symbol(a, 0u); - const float3x4 l_a_i = tint_symbol_1(a, (48u * uint(p_a_i_save))); + const float3x4 l_a[4] = a_load(0u); + const float3x4 l_a_i = a_load_1((48u * uint(p_a_i_save))); const uint scalar_offset_3 = (((48u * uint(p_a_i_save)) + (16u * uint(p_a_i_i_save)))) / 4; const float4 l_a_i_i = asfloat(a[scalar_offset_3 / 4]); return; diff --git a/test/tint/buffer/uniform/std140/array/mat3x4_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat3x4_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl index ebb5252007..1a0a032fd2 100644 --- a/test/tint/buffer/uniform/std140/array/mat3x4_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat3x4_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl @@ -2,19 +2,19 @@ cbuffer cbuffer_a : register(b0, space0) { uint4 a[12]; }; -float3x4 tint_symbol_1(uint4 buffer[12], uint offset) { +float3x4 a_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); + return float3x4(asfloat(a[scalar_offset / 4]), asfloat(a[scalar_offset_1 / 4]), asfloat(a[scalar_offset_2 / 4])); } -typedef float3x4 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[12], uint offset) { +typedef float3x4 a_load_ret[4]; +a_load_ret a_load(uint offset) { float3x4 arr[4] = (float3x4[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 48u))); + arr[i] = a_load_1((offset + (i * 48u))); } } return arr; @@ -22,8 +22,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[12], uint offset) { [numthreads(1, 1, 1)] void f() { - const float3x4 l_a[4] = tint_symbol(a, 0u); - const float3x4 l_a_i = tint_symbol_1(a, 96u); + const float3x4 l_a[4] = a_load(0u); + const float3x4 l_a_i = a_load_1(96u); const float4 l_a_i_i = asfloat(a[7]); return; } diff --git a/test/tint/buffer/uniform/std140/array/mat3x4_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/array/mat3x4_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl index ebb5252007..1a0a032fd2 100644 --- a/test/tint/buffer/uniform/std140/array/mat3x4_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat3x4_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl @@ -2,19 +2,19 @@ cbuffer cbuffer_a : register(b0, space0) { uint4 a[12]; }; -float3x4 tint_symbol_1(uint4 buffer[12], uint offset) { +float3x4 a_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); + return float3x4(asfloat(a[scalar_offset / 4]), asfloat(a[scalar_offset_1 / 4]), asfloat(a[scalar_offset_2 / 4])); } -typedef float3x4 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[12], uint offset) { +typedef float3x4 a_load_ret[4]; +a_load_ret a_load(uint offset) { float3x4 arr[4] = (float3x4[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 48u))); + arr[i] = a_load_1((offset + (i * 48u))); } } return arr; @@ -22,8 +22,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[12], uint offset) { [numthreads(1, 1, 1)] void f() { - const float3x4 l_a[4] = tint_symbol(a, 0u); - const float3x4 l_a_i = tint_symbol_1(a, 96u); + const float3x4 l_a[4] = a_load(0u); + const float3x4 l_a_i = a_load_1(96u); const float4 l_a_i_i = asfloat(a[7]); return; } diff --git a/test/tint/buffer/uniform/std140/array/mat3x4_f32/to_builtin.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat3x4_f32/to_builtin.wgsl.expected.dxc.hlsl index e9ab804c58..79024c9ab3 100644 --- a/test/tint/buffer/uniform/std140/array/mat3x4_f32/to_builtin.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat3x4_f32/to_builtin.wgsl.expected.dxc.hlsl @@ -2,16 +2,16 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[12]; }; -float3x4 tint_symbol(uint4 buffer[12], uint offset) { +float3x4 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); + return float3x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4]), asfloat(u[scalar_offset_2 / 4])); } [numthreads(1, 1, 1)] void f() { - const float4x3 t = transpose(tint_symbol(u, 96u)); + const float4x3 t = transpose(u_load(96u)); const float l = length(asfloat(u[1]).ywxz); const float a = abs(asfloat(u[1]).ywxz.x); return; diff --git a/test/tint/buffer/uniform/std140/array/mat3x4_f32/to_builtin.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/array/mat3x4_f32/to_builtin.wgsl.expected.fxc.hlsl index e9ab804c58..79024c9ab3 100644 --- a/test/tint/buffer/uniform/std140/array/mat3x4_f32/to_builtin.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat3x4_f32/to_builtin.wgsl.expected.fxc.hlsl @@ -2,16 +2,16 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[12]; }; -float3x4 tint_symbol(uint4 buffer[12], uint offset) { +float3x4 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); + return float3x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4]), asfloat(u[scalar_offset_2 / 4])); } [numthreads(1, 1, 1)] void f() { - const float4x3 t = transpose(tint_symbol(u, 96u)); + const float4x3 t = transpose(u_load(96u)); const float l = length(asfloat(u[1]).ywxz); const float a = abs(asfloat(u[1]).ywxz.x); return; diff --git a/test/tint/buffer/uniform/std140/array/mat3x4_f32/to_fn.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat3x4_f32/to_fn.wgsl.expected.dxc.hlsl index a16dec763d..f0e3f34293 100644 --- a/test/tint/buffer/uniform/std140/array/mat3x4_f32/to_fn.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat3x4_f32/to_fn.wgsl.expected.dxc.hlsl @@ -14,19 +14,19 @@ void c(float4 v) { void d(float f_1) { } -float3x4 tint_symbol_1(uint4 buffer[12], uint offset) { +float3x4 u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); + return float3x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4]), asfloat(u[scalar_offset_2 / 4])); } -typedef float3x4 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[12], uint offset) { +typedef float3x4 u_load_ret[4]; +u_load_ret u_load(uint offset) { float3x4 arr[4] = (float3x4[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 48u))); + arr[i] = u_load_1((offset + (i * 48u))); } } return arr; @@ -34,8 +34,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[12], uint offset) { [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); - b(tint_symbol_1(u, 48u)); + a(u_load(0u)); + b(u_load_1(48u)); c(asfloat(u[3]).ywxz); d(asfloat(u[3]).ywxz.x); return; diff --git a/test/tint/buffer/uniform/std140/array/mat3x4_f32/to_fn.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/array/mat3x4_f32/to_fn.wgsl.expected.fxc.hlsl index a16dec763d..f0e3f34293 100644 --- a/test/tint/buffer/uniform/std140/array/mat3x4_f32/to_fn.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat3x4_f32/to_fn.wgsl.expected.fxc.hlsl @@ -14,19 +14,19 @@ void c(float4 v) { void d(float f_1) { } -float3x4 tint_symbol_1(uint4 buffer[12], uint offset) { +float3x4 u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); + return float3x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4]), asfloat(u[scalar_offset_2 / 4])); } -typedef float3x4 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[12], uint offset) { +typedef float3x4 u_load_ret[4]; +u_load_ret u_load(uint offset) { float3x4 arr[4] = (float3x4[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 48u))); + arr[i] = u_load_1((offset + (i * 48u))); } } return arr; @@ -34,8 +34,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[12], uint offset) { [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); - b(tint_symbol_1(u, 48u)); + a(u_load(0u)); + b(u_load_1(48u)); c(asfloat(u[3]).ywxz); d(asfloat(u[3]).ywxz.x); return; diff --git a/test/tint/buffer/uniform/std140/array/mat3x4_f32/to_private.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat3x4_f32/to_private.wgsl.expected.dxc.hlsl index b708074efe..3eb8b4ffac 100644 --- a/test/tint/buffer/uniform/std140/array/mat3x4_f32/to_private.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat3x4_f32/to_private.wgsl.expected.dxc.hlsl @@ -3,19 +3,19 @@ cbuffer cbuffer_u : register(b0, space0) { }; static float3x4 p[4] = (float3x4[4])0; -float3x4 tint_symbol_1(uint4 buffer[12], uint offset) { +float3x4 u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); + return float3x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4]), asfloat(u[scalar_offset_2 / 4])); } -typedef float3x4 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[12], uint offset) { +typedef float3x4 u_load_ret[4]; +u_load_ret u_load(uint offset) { float3x4 arr[4] = (float3x4[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 48u))); + arr[i] = u_load_1((offset + (i * 48u))); } } return arr; @@ -23,8 +23,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[12], uint offset) { [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); - p[1] = tint_symbol_1(u, 96u); + p = u_load(0u); + p[1] = u_load_1(96u); p[1][0] = asfloat(u[1]).ywxz; p[1][0].x = asfloat(u[1].x); return; diff --git a/test/tint/buffer/uniform/std140/array/mat3x4_f32/to_private.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/array/mat3x4_f32/to_private.wgsl.expected.fxc.hlsl index b708074efe..3eb8b4ffac 100644 --- a/test/tint/buffer/uniform/std140/array/mat3x4_f32/to_private.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat3x4_f32/to_private.wgsl.expected.fxc.hlsl @@ -3,19 +3,19 @@ cbuffer cbuffer_u : register(b0, space0) { }; static float3x4 p[4] = (float3x4[4])0; -float3x4 tint_symbol_1(uint4 buffer[12], uint offset) { +float3x4 u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); + return float3x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4]), asfloat(u[scalar_offset_2 / 4])); } -typedef float3x4 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[12], uint offset) { +typedef float3x4 u_load_ret[4]; +u_load_ret u_load(uint offset) { float3x4 arr[4] = (float3x4[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 48u))); + arr[i] = u_load_1((offset + (i * 48u))); } } return arr; @@ -23,8 +23,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[12], uint offset) { [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); - p[1] = tint_symbol_1(u, 96u); + p = u_load(0u); + p[1] = u_load_1(96u); p[1][0] = asfloat(u[1]).ywxz; p[1][0].x = asfloat(u[1].x); return; diff --git a/test/tint/buffer/uniform/std140/array/mat3x4_f32/to_storage.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat3x4_f32/to_storage.wgsl.expected.dxc.hlsl index b6ecb13051..f1ed40f048 100644 --- a/test/tint/buffer/uniform/std140/array/mat3x4_f32/to_storage.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat3x4_f32/to_storage.wgsl.expected.dxc.hlsl @@ -3,34 +3,34 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol_1(RWByteAddressBuffer buffer, uint offset, float3x4 value) { - buffer.Store4((offset + 0u), asuint(value[0u])); - buffer.Store4((offset + 16u), asuint(value[1u])); - buffer.Store4((offset + 32u), asuint(value[2u])); +void s_store_1(uint offset, float3x4 value) { + s.Store4((offset + 0u), asuint(value[0u])); + s.Store4((offset + 16u), asuint(value[1u])); + s.Store4((offset + 32u), asuint(value[2u])); } -void tint_symbol(RWByteAddressBuffer buffer, uint offset, float3x4 value[4]) { +void s_store(uint offset, float3x4 value[4]) { float3x4 array_1[4] = value; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - tint_symbol_1(buffer, (offset + (i * 48u)), array_1[i]); + s_store_1((offset + (i * 48u)), array_1[i]); } } } -float3x4 tint_symbol_4(uint4 buffer[12], uint offset) { +float3x4 u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); + return float3x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4]), asfloat(u[scalar_offset_2 / 4])); } -typedef float3x4 tint_symbol_3_ret[4]; -tint_symbol_3_ret tint_symbol_3(uint4 buffer[12], uint offset) { +typedef float3x4 u_load_ret[4]; +u_load_ret u_load(uint offset) { float3x4 arr[4] = (float3x4[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_4(buffer, (offset + (i_1 * 48u))); + arr[i_1] = u_load_1((offset + (i_1 * 48u))); } } return arr; @@ -38,8 +38,8 @@ tint_symbol_3_ret tint_symbol_3(uint4 buffer[12], uint offset) { [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_3(u, 0u)); - tint_symbol_1(s, 48u, tint_symbol_4(u, 96u)); + s_store(0u, u_load(0u)); + s_store_1(48u, u_load_1(96u)); s.Store4(48u, asuint(asfloat(u[1]).ywxz)); s.Store(48u, asuint(asfloat(u[1].x))); return; diff --git a/test/tint/buffer/uniform/std140/array/mat3x4_f32/to_storage.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/array/mat3x4_f32/to_storage.wgsl.expected.fxc.hlsl index b6ecb13051..f1ed40f048 100644 --- a/test/tint/buffer/uniform/std140/array/mat3x4_f32/to_storage.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat3x4_f32/to_storage.wgsl.expected.fxc.hlsl @@ -3,34 +3,34 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol_1(RWByteAddressBuffer buffer, uint offset, float3x4 value) { - buffer.Store4((offset + 0u), asuint(value[0u])); - buffer.Store4((offset + 16u), asuint(value[1u])); - buffer.Store4((offset + 32u), asuint(value[2u])); +void s_store_1(uint offset, float3x4 value) { + s.Store4((offset + 0u), asuint(value[0u])); + s.Store4((offset + 16u), asuint(value[1u])); + s.Store4((offset + 32u), asuint(value[2u])); } -void tint_symbol(RWByteAddressBuffer buffer, uint offset, float3x4 value[4]) { +void s_store(uint offset, float3x4 value[4]) { float3x4 array_1[4] = value; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - tint_symbol_1(buffer, (offset + (i * 48u)), array_1[i]); + s_store_1((offset + (i * 48u)), array_1[i]); } } } -float3x4 tint_symbol_4(uint4 buffer[12], uint offset) { +float3x4 u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); + return float3x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4]), asfloat(u[scalar_offset_2 / 4])); } -typedef float3x4 tint_symbol_3_ret[4]; -tint_symbol_3_ret tint_symbol_3(uint4 buffer[12], uint offset) { +typedef float3x4 u_load_ret[4]; +u_load_ret u_load(uint offset) { float3x4 arr[4] = (float3x4[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_4(buffer, (offset + (i_1 * 48u))); + arr[i_1] = u_load_1((offset + (i_1 * 48u))); } } return arr; @@ -38,8 +38,8 @@ tint_symbol_3_ret tint_symbol_3(uint4 buffer[12], uint offset) { [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_3(u, 0u)); - tint_symbol_1(s, 48u, tint_symbol_4(u, 96u)); + s_store(0u, u_load(0u)); + s_store_1(48u, u_load_1(96u)); s.Store4(48u, asuint(asfloat(u[1]).ywxz)); s.Store(48u, asuint(asfloat(u[1].x))); return; diff --git a/test/tint/buffer/uniform/std140/array/mat3x4_f32/to_workgroup.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat3x4_f32/to_workgroup.wgsl.expected.dxc.hlsl index b27032e4b7..4572abf29d 100644 --- a/test/tint/buffer/uniform/std140/array/mat3x4_f32/to_workgroup.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat3x4_f32/to_workgroup.wgsl.expected.dxc.hlsl @@ -7,19 +7,19 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -float3x4 tint_symbol_3(uint4 buffer[12], uint offset) { +float3x4 u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); + return float3x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4]), asfloat(u[scalar_offset_2 / 4])); } -typedef float3x4 tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[12], uint offset) { +typedef float3x4 u_load_ret[4]; +u_load_ret u_load(uint offset) { float3x4 arr[4] = (float3x4[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_3(buffer, (offset + (i_1 * 48u))); + arr[i_1] = u_load_1((offset + (i_1 * 48u))); } } return arr; @@ -33,8 +33,8 @@ void f_inner(uint local_invocation_index) { } } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); - w[1] = tint_symbol_3(u, 96u); + w = u_load(0u); + w[1] = u_load_1(96u); w[1][0] = asfloat(u[1]).ywxz; w[1][0].x = asfloat(u[1].x); } diff --git a/test/tint/buffer/uniform/std140/array/mat3x4_f32/to_workgroup.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/array/mat3x4_f32/to_workgroup.wgsl.expected.fxc.hlsl index b27032e4b7..4572abf29d 100644 --- a/test/tint/buffer/uniform/std140/array/mat3x4_f32/to_workgroup.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat3x4_f32/to_workgroup.wgsl.expected.fxc.hlsl @@ -7,19 +7,19 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -float3x4 tint_symbol_3(uint4 buffer[12], uint offset) { +float3x4 u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); + return float3x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4]), asfloat(u[scalar_offset_2 / 4])); } -typedef float3x4 tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[12], uint offset) { +typedef float3x4 u_load_ret[4]; +u_load_ret u_load(uint offset) { float3x4 arr[4] = (float3x4[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_3(buffer, (offset + (i_1 * 48u))); + arr[i_1] = u_load_1((offset + (i_1 * 48u))); } } return arr; @@ -33,8 +33,8 @@ void f_inner(uint local_invocation_index) { } } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); - w[1] = tint_symbol_3(u, 96u); + w = u_load(0u); + w[1] = u_load_1(96u); w[1][0] = asfloat(u[1]).ywxz; w[1][0].x = asfloat(u[1].x); } diff --git a/test/tint/buffer/uniform/std140/array/mat4x2_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat4x2_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl index c5d26b1ba2..abab0b3981 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x2_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat4x2_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl @@ -8,24 +8,24 @@ int i() { return counter; } -matrix tint_symbol_1(uint4 buffer[4], uint offset) { +matrix a_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint ubo_load = buffer[scalar_offset / 4][scalar_offset % 4]; + uint ubo_load = a[scalar_offset / 4][scalar_offset % 4]; const uint scalar_offset_1 = ((offset + 4u)) / 4; - uint ubo_load_1 = buffer[scalar_offset_1 / 4][scalar_offset_1 % 4]; + uint ubo_load_1 = a[scalar_offset_1 / 4][scalar_offset_1 % 4]; const uint scalar_offset_2 = ((offset + 8u)) / 4; - uint ubo_load_2 = buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]; + uint ubo_load_2 = a[scalar_offset_2 / 4][scalar_offset_2 % 4]; const uint scalar_offset_3 = ((offset + 12u)) / 4; - uint ubo_load_3 = buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]; + uint ubo_load_3 = a[scalar_offset_3 / 4][scalar_offset_3 % 4]; return matrix(vector(float16_t(f16tof32(ubo_load & 0xFFFF)), float16_t(f16tof32(ubo_load >> 16))), vector(float16_t(f16tof32(ubo_load_1 & 0xFFFF)), float16_t(f16tof32(ubo_load_1 >> 16))), vector(float16_t(f16tof32(ubo_load_2 & 0xFFFF)), float16_t(f16tof32(ubo_load_2 >> 16))), vector(float16_t(f16tof32(ubo_load_3 & 0xFFFF)), float16_t(f16tof32(ubo_load_3 >> 16)))); } -typedef matrix tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[4], uint offset) { +typedef matrix a_load_ret[4]; +a_load_ret a_load(uint offset) { matrix arr[4] = (matrix[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_1(buffer, (offset + (i_1 * 16u))); + arr[i_1] = a_load_1((offset + (i_1 * 16u))); } } return arr; @@ -35,8 +35,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[4], uint offset) { void f() { const int p_a_i_save = i(); const int p_a_i_i_save = i(); - const matrix l_a[4] = tint_symbol(a, 0u); - const matrix l_a_i = tint_symbol_1(a, (16u * uint(p_a_i_save))); + const matrix l_a[4] = a_load(0u); + const matrix l_a_i = a_load_1((16u * uint(p_a_i_save))); const uint scalar_offset_4 = (((16u * uint(p_a_i_save)) + (4u * uint(p_a_i_i_save)))) / 4; uint ubo_load_4 = a[scalar_offset_4 / 4][scalar_offset_4 % 4]; const vector l_a_i_i = vector(float16_t(f16tof32(ubo_load_4 & 0xFFFF)), float16_t(f16tof32(ubo_load_4 >> 16))); diff --git a/test/tint/buffer/uniform/std140/array/mat4x2_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat4x2_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl index 0ffe38cc37..7d328a5c33 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x2_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat4x2_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl @@ -2,24 +2,24 @@ cbuffer cbuffer_a : register(b0, space0) { uint4 a[4]; }; -matrix tint_symbol_1(uint4 buffer[4], uint offset) { +matrix a_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint ubo_load = buffer[scalar_offset / 4][scalar_offset % 4]; + uint ubo_load = a[scalar_offset / 4][scalar_offset % 4]; const uint scalar_offset_1 = ((offset + 4u)) / 4; - uint ubo_load_1 = buffer[scalar_offset_1 / 4][scalar_offset_1 % 4]; + uint ubo_load_1 = a[scalar_offset_1 / 4][scalar_offset_1 % 4]; const uint scalar_offset_2 = ((offset + 8u)) / 4; - uint ubo_load_2 = buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]; + uint ubo_load_2 = a[scalar_offset_2 / 4][scalar_offset_2 % 4]; const uint scalar_offset_3 = ((offset + 12u)) / 4; - uint ubo_load_3 = buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]; + uint ubo_load_3 = a[scalar_offset_3 / 4][scalar_offset_3 % 4]; return matrix(vector(float16_t(f16tof32(ubo_load & 0xFFFF)), float16_t(f16tof32(ubo_load >> 16))), vector(float16_t(f16tof32(ubo_load_1 & 0xFFFF)), float16_t(f16tof32(ubo_load_1 >> 16))), vector(float16_t(f16tof32(ubo_load_2 & 0xFFFF)), float16_t(f16tof32(ubo_load_2 >> 16))), vector(float16_t(f16tof32(ubo_load_3 & 0xFFFF)), float16_t(f16tof32(ubo_load_3 >> 16)))); } -typedef matrix tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[4], uint offset) { +typedef matrix a_load_ret[4]; +a_load_ret a_load(uint offset) { matrix arr[4] = (matrix[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 16u))); + arr[i] = a_load_1((offset + (i * 16u))); } } return arr; @@ -27,8 +27,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[4], uint offset) { [numthreads(1, 1, 1)] void f() { - const matrix l_a[4] = tint_symbol(a, 0u); - const matrix l_a_i = tint_symbol_1(a, 32u); + const matrix l_a[4] = a_load(0u); + const matrix l_a_i = a_load_1(32u); uint ubo_load_4 = a[2].y; const vector l_a_i_i = vector(float16_t(f16tof32(ubo_load_4 & 0xFFFF)), float16_t(f16tof32(ubo_load_4 >> 16))); return; diff --git a/test/tint/buffer/uniform/std140/array/mat4x2_f16/to_builtin.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat4x2_f16/to_builtin.wgsl.expected.dxc.hlsl index cddeb05d78..69578b7f56 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x2_f16/to_builtin.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat4x2_f16/to_builtin.wgsl.expected.dxc.hlsl @@ -2,21 +2,21 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[4]; }; -matrix tint_symbol(uint4 buffer[4], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint ubo_load = buffer[scalar_offset / 4][scalar_offset % 4]; + uint ubo_load = u[scalar_offset / 4][scalar_offset % 4]; const uint scalar_offset_1 = ((offset + 4u)) / 4; - uint ubo_load_1 = buffer[scalar_offset_1 / 4][scalar_offset_1 % 4]; + uint ubo_load_1 = u[scalar_offset_1 / 4][scalar_offset_1 % 4]; const uint scalar_offset_2 = ((offset + 8u)) / 4; - uint ubo_load_2 = buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]; + uint ubo_load_2 = u[scalar_offset_2 / 4][scalar_offset_2 % 4]; const uint scalar_offset_3 = ((offset + 12u)) / 4; - uint ubo_load_3 = buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]; + uint ubo_load_3 = u[scalar_offset_3 / 4][scalar_offset_3 % 4]; return matrix(vector(float16_t(f16tof32(ubo_load & 0xFFFF)), float16_t(f16tof32(ubo_load >> 16))), vector(float16_t(f16tof32(ubo_load_1 & 0xFFFF)), float16_t(f16tof32(ubo_load_1 >> 16))), vector(float16_t(f16tof32(ubo_load_2 & 0xFFFF)), float16_t(f16tof32(ubo_load_2 >> 16))), vector(float16_t(f16tof32(ubo_load_3 & 0xFFFF)), float16_t(f16tof32(ubo_load_3 >> 16)))); } [numthreads(1, 1, 1)] void f() { - const matrix t = transpose(tint_symbol(u, 32u)); + const matrix t = transpose(u_load(32u)); uint ubo_load_4 = u[0].y; const float16_t l = length(vector(float16_t(f16tof32(ubo_load_4 & 0xFFFF)), float16_t(f16tof32(ubo_load_4 >> 16))).yx); uint ubo_load_5 = u[0].y; diff --git a/test/tint/buffer/uniform/std140/array/mat4x2_f16/to_fn.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat4x2_f16/to_fn.wgsl.expected.dxc.hlsl index 3895e311ab..a1d7bb4e10 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x2_f16/to_fn.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat4x2_f16/to_fn.wgsl.expected.dxc.hlsl @@ -14,24 +14,24 @@ void c(vector v) { void d(float16_t f_1) { } -matrix tint_symbol_1(uint4 buffer[4], uint offset) { +matrix u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint ubo_load = buffer[scalar_offset / 4][scalar_offset % 4]; + uint ubo_load = u[scalar_offset / 4][scalar_offset % 4]; const uint scalar_offset_1 = ((offset + 4u)) / 4; - uint ubo_load_1 = buffer[scalar_offset_1 / 4][scalar_offset_1 % 4]; + uint ubo_load_1 = u[scalar_offset_1 / 4][scalar_offset_1 % 4]; const uint scalar_offset_2 = ((offset + 8u)) / 4; - uint ubo_load_2 = buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]; + uint ubo_load_2 = u[scalar_offset_2 / 4][scalar_offset_2 % 4]; const uint scalar_offset_3 = ((offset + 12u)) / 4; - uint ubo_load_3 = buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]; + uint ubo_load_3 = u[scalar_offset_3 / 4][scalar_offset_3 % 4]; return matrix(vector(float16_t(f16tof32(ubo_load & 0xFFFF)), float16_t(f16tof32(ubo_load >> 16))), vector(float16_t(f16tof32(ubo_load_1 & 0xFFFF)), float16_t(f16tof32(ubo_load_1 >> 16))), vector(float16_t(f16tof32(ubo_load_2 & 0xFFFF)), float16_t(f16tof32(ubo_load_2 >> 16))), vector(float16_t(f16tof32(ubo_load_3 & 0xFFFF)), float16_t(f16tof32(ubo_load_3 >> 16)))); } -typedef matrix tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[4], uint offset) { +typedef matrix u_load_ret[4]; +u_load_ret u_load(uint offset) { matrix arr[4] = (matrix[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 16u))); + arr[i] = u_load_1((offset + (i * 16u))); } } return arr; @@ -39,8 +39,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[4], uint offset) { [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); - b(tint_symbol_1(u, 16u)); + a(u_load(0u)); + b(u_load_1(16u)); uint ubo_load_4 = u[1].x; c(vector(float16_t(f16tof32(ubo_load_4 & 0xFFFF)), float16_t(f16tof32(ubo_load_4 >> 16))).yx); uint ubo_load_5 = u[1].x; diff --git a/test/tint/buffer/uniform/std140/array/mat4x2_f16/to_private.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat4x2_f16/to_private.wgsl.expected.dxc.hlsl index f9a1fc803c..d2752fb079 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x2_f16/to_private.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat4x2_f16/to_private.wgsl.expected.dxc.hlsl @@ -3,24 +3,24 @@ cbuffer cbuffer_u : register(b0, space0) { }; static matrix p[4] = (matrix[4])0; -matrix tint_symbol_1(uint4 buffer[4], uint offset) { +matrix u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint ubo_load = buffer[scalar_offset / 4][scalar_offset % 4]; + uint ubo_load = u[scalar_offset / 4][scalar_offset % 4]; const uint scalar_offset_1 = ((offset + 4u)) / 4; - uint ubo_load_1 = buffer[scalar_offset_1 / 4][scalar_offset_1 % 4]; + uint ubo_load_1 = u[scalar_offset_1 / 4][scalar_offset_1 % 4]; const uint scalar_offset_2 = ((offset + 8u)) / 4; - uint ubo_load_2 = buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]; + uint ubo_load_2 = u[scalar_offset_2 / 4][scalar_offset_2 % 4]; const uint scalar_offset_3 = ((offset + 12u)) / 4; - uint ubo_load_3 = buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]; + uint ubo_load_3 = u[scalar_offset_3 / 4][scalar_offset_3 % 4]; return matrix(vector(float16_t(f16tof32(ubo_load & 0xFFFF)), float16_t(f16tof32(ubo_load >> 16))), vector(float16_t(f16tof32(ubo_load_1 & 0xFFFF)), float16_t(f16tof32(ubo_load_1 >> 16))), vector(float16_t(f16tof32(ubo_load_2 & 0xFFFF)), float16_t(f16tof32(ubo_load_2 >> 16))), vector(float16_t(f16tof32(ubo_load_3 & 0xFFFF)), float16_t(f16tof32(ubo_load_3 >> 16)))); } -typedef matrix tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[4], uint offset) { +typedef matrix u_load_ret[4]; +u_load_ret u_load(uint offset) { matrix arr[4] = (matrix[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 16u))); + arr[i] = u_load_1((offset + (i * 16u))); } } return arr; @@ -28,8 +28,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[4], uint offset) { [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); - p[1] = tint_symbol_1(u, 32u); + p = u_load(0u); + p[1] = u_load_1(32u); uint ubo_load_4 = u[0].y; p[1][0] = vector(float16_t(f16tof32(ubo_load_4 & 0xFFFF)), float16_t(f16tof32(ubo_load_4 >> 16))).yx; p[1][0].x = float16_t(f16tof32(((u[0].y) & 0xFFFF))); diff --git a/test/tint/buffer/uniform/std140/array/mat4x2_f16/to_storage.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat4x2_f16/to_storage.wgsl.expected.dxc.hlsl index 45800241b2..dce8224513 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x2_f16/to_storage.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat4x2_f16/to_storage.wgsl.expected.dxc.hlsl @@ -3,40 +3,40 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol_1(RWByteAddressBuffer buffer, uint offset, matrix value) { - buffer.Store >((offset + 0u), value[0u]); - buffer.Store >((offset + 4u), value[1u]); - buffer.Store >((offset + 8u), value[2u]); - buffer.Store >((offset + 12u), value[3u]); +void s_store_1(uint offset, matrix value) { + s.Store >((offset + 0u), value[0u]); + s.Store >((offset + 4u), value[1u]); + s.Store >((offset + 8u), value[2u]); + s.Store >((offset + 12u), value[3u]); } -void tint_symbol(RWByteAddressBuffer buffer, uint offset, matrix value[4]) { +void s_store(uint offset, matrix value[4]) { matrix array_1[4] = value; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - tint_symbol_1(buffer, (offset + (i * 16u)), array_1[i]); + s_store_1((offset + (i * 16u)), array_1[i]); } } } -matrix tint_symbol_4(uint4 buffer[4], uint offset) { +matrix u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint ubo_load = buffer[scalar_offset / 4][scalar_offset % 4]; + uint ubo_load = u[scalar_offset / 4][scalar_offset % 4]; const uint scalar_offset_1 = ((offset + 4u)) / 4; - uint ubo_load_1 = buffer[scalar_offset_1 / 4][scalar_offset_1 % 4]; + uint ubo_load_1 = u[scalar_offset_1 / 4][scalar_offset_1 % 4]; const uint scalar_offset_2 = ((offset + 8u)) / 4; - uint ubo_load_2 = buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]; + uint ubo_load_2 = u[scalar_offset_2 / 4][scalar_offset_2 % 4]; const uint scalar_offset_3 = ((offset + 12u)) / 4; - uint ubo_load_3 = buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]; + uint ubo_load_3 = u[scalar_offset_3 / 4][scalar_offset_3 % 4]; return matrix(vector(float16_t(f16tof32(ubo_load & 0xFFFF)), float16_t(f16tof32(ubo_load >> 16))), vector(float16_t(f16tof32(ubo_load_1 & 0xFFFF)), float16_t(f16tof32(ubo_load_1 >> 16))), vector(float16_t(f16tof32(ubo_load_2 & 0xFFFF)), float16_t(f16tof32(ubo_load_2 >> 16))), vector(float16_t(f16tof32(ubo_load_3 & 0xFFFF)), float16_t(f16tof32(ubo_load_3 >> 16)))); } -typedef matrix tint_symbol_3_ret[4]; -tint_symbol_3_ret tint_symbol_3(uint4 buffer[4], uint offset) { +typedef matrix u_load_ret[4]; +u_load_ret u_load(uint offset) { matrix arr[4] = (matrix[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_4(buffer, (offset + (i_1 * 16u))); + arr[i_1] = u_load_1((offset + (i_1 * 16u))); } } return arr; @@ -44,8 +44,8 @@ tint_symbol_3_ret tint_symbol_3(uint4 buffer[4], uint offset) { [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_3(u, 0u)); - tint_symbol_1(s, 16u, tint_symbol_4(u, 32u)); + s_store(0u, u_load(0u)); + s_store_1(16u, u_load_1(32u)); uint ubo_load_4 = u[0].y; s.Store >(16u, vector(float16_t(f16tof32(ubo_load_4 & 0xFFFF)), float16_t(f16tof32(ubo_load_4 >> 16))).yx); s.Store(16u, float16_t(f16tof32(((u[0].y) & 0xFFFF)))); diff --git a/test/tint/buffer/uniform/std140/array/mat4x2_f16/to_workgroup.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat4x2_f16/to_workgroup.wgsl.expected.dxc.hlsl index f67e4318af..c4fc7be95a 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x2_f16/to_workgroup.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat4x2_f16/to_workgroup.wgsl.expected.dxc.hlsl @@ -7,24 +7,24 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -matrix tint_symbol_3(uint4 buffer[4], uint offset) { +matrix u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint ubo_load = buffer[scalar_offset / 4][scalar_offset % 4]; + uint ubo_load = u[scalar_offset / 4][scalar_offset % 4]; const uint scalar_offset_1 = ((offset + 4u)) / 4; - uint ubo_load_1 = buffer[scalar_offset_1 / 4][scalar_offset_1 % 4]; + uint ubo_load_1 = u[scalar_offset_1 / 4][scalar_offset_1 % 4]; const uint scalar_offset_2 = ((offset + 8u)) / 4; - uint ubo_load_2 = buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]; + uint ubo_load_2 = u[scalar_offset_2 / 4][scalar_offset_2 % 4]; const uint scalar_offset_3 = ((offset + 12u)) / 4; - uint ubo_load_3 = buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]; + uint ubo_load_3 = u[scalar_offset_3 / 4][scalar_offset_3 % 4]; return matrix(vector(float16_t(f16tof32(ubo_load & 0xFFFF)), float16_t(f16tof32(ubo_load >> 16))), vector(float16_t(f16tof32(ubo_load_1 & 0xFFFF)), float16_t(f16tof32(ubo_load_1 >> 16))), vector(float16_t(f16tof32(ubo_load_2 & 0xFFFF)), float16_t(f16tof32(ubo_load_2 >> 16))), vector(float16_t(f16tof32(ubo_load_3 & 0xFFFF)), float16_t(f16tof32(ubo_load_3 >> 16)))); } -typedef matrix tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[4], uint offset) { +typedef matrix u_load_ret[4]; +u_load_ret u_load(uint offset) { matrix arr[4] = (matrix[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_3(buffer, (offset + (i_1 * 16u))); + arr[i_1] = u_load_1((offset + (i_1 * 16u))); } } return arr; @@ -38,8 +38,8 @@ void f_inner(uint local_invocation_index) { } } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); - w[1] = tint_symbol_3(u, 32u); + w = u_load(0u); + w[1] = u_load_1(32u); uint ubo_load_4 = u[0].y; w[1][0] = vector(float16_t(f16tof32(ubo_load_4 & 0xFFFF)), float16_t(f16tof32(ubo_load_4 >> 16))).yx; w[1][0].x = float16_t(f16tof32(((u[0].y) & 0xFFFF))); diff --git a/test/tint/buffer/uniform/std140/array/mat4x2_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat4x2_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl index 2b7d52a41b..80052814be 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x2_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat4x2_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl @@ -8,24 +8,24 @@ int i() { return counter; } -float4x2 tint_symbol_1(uint4 buffer[8], uint offset) { +float4x2 a_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = a[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = a[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = a[scalar_offset_2 / 4]; const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_3 = a[scalar_offset_3 / 4]; return float4x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy)), asfloat(((scalar_offset_3 & 2) ? ubo_load_3.zw : ubo_load_3.xy))); } -typedef float4x2 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[8], uint offset) { +typedef float4x2 a_load_ret[4]; +a_load_ret a_load(uint offset) { float4x2 arr[4] = (float4x2[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_1(buffer, (offset + (i_1 * 32u))); + arr[i_1] = a_load_1((offset + (i_1 * 32u))); } } return arr; @@ -35,8 +35,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[8], uint offset) { void f() { const int p_a_i_save = i(); const int p_a_i_i_save = i(); - const float4x2 l_a[4] = tint_symbol(a, 0u); - const float4x2 l_a_i = tint_symbol_1(a, (32u * uint(p_a_i_save))); + const float4x2 l_a[4] = a_load(0u); + const float4x2 l_a_i = a_load_1((32u * uint(p_a_i_save))); const uint scalar_offset_4 = (((32u * uint(p_a_i_save)) + (8u * uint(p_a_i_i_save)))) / 4; uint4 ubo_load_4 = a[scalar_offset_4 / 4]; const float2 l_a_i_i = asfloat(((scalar_offset_4 & 2) ? ubo_load_4.zw : ubo_load_4.xy)); diff --git a/test/tint/buffer/uniform/std140/array/mat4x2_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/array/mat4x2_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl index 2b7d52a41b..80052814be 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x2_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat4x2_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl @@ -8,24 +8,24 @@ int i() { return counter; } -float4x2 tint_symbol_1(uint4 buffer[8], uint offset) { +float4x2 a_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = a[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = a[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = a[scalar_offset_2 / 4]; const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_3 = a[scalar_offset_3 / 4]; return float4x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy)), asfloat(((scalar_offset_3 & 2) ? ubo_load_3.zw : ubo_load_3.xy))); } -typedef float4x2 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[8], uint offset) { +typedef float4x2 a_load_ret[4]; +a_load_ret a_load(uint offset) { float4x2 arr[4] = (float4x2[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_1(buffer, (offset + (i_1 * 32u))); + arr[i_1] = a_load_1((offset + (i_1 * 32u))); } } return arr; @@ -35,8 +35,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[8], uint offset) { void f() { const int p_a_i_save = i(); const int p_a_i_i_save = i(); - const float4x2 l_a[4] = tint_symbol(a, 0u); - const float4x2 l_a_i = tint_symbol_1(a, (32u * uint(p_a_i_save))); + const float4x2 l_a[4] = a_load(0u); + const float4x2 l_a_i = a_load_1((32u * uint(p_a_i_save))); const uint scalar_offset_4 = (((32u * uint(p_a_i_save)) + (8u * uint(p_a_i_i_save)))) / 4; uint4 ubo_load_4 = a[scalar_offset_4 / 4]; const float2 l_a_i_i = asfloat(((scalar_offset_4 & 2) ? ubo_load_4.zw : ubo_load_4.xy)); diff --git a/test/tint/buffer/uniform/std140/array/mat4x2_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat4x2_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl index 8b8b235ce4..7c02f6cfdb 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x2_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat4x2_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl @@ -2,24 +2,24 @@ cbuffer cbuffer_a : register(b0, space0) { uint4 a[8]; }; -float4x2 tint_symbol_1(uint4 buffer[8], uint offset) { +float4x2 a_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = a[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = a[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = a[scalar_offset_2 / 4]; const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_3 = a[scalar_offset_3 / 4]; return float4x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy)), asfloat(((scalar_offset_3 & 2) ? ubo_load_3.zw : ubo_load_3.xy))); } -typedef float4x2 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[8], uint offset) { +typedef float4x2 a_load_ret[4]; +a_load_ret a_load(uint offset) { float4x2 arr[4] = (float4x2[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 32u))); + arr[i] = a_load_1((offset + (i * 32u))); } } return arr; @@ -27,8 +27,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[8], uint offset) { [numthreads(1, 1, 1)] void f() { - const float4x2 l_a[4] = tint_symbol(a, 0u); - const float4x2 l_a_i = tint_symbol_1(a, 64u); + const float4x2 l_a[4] = a_load(0u); + const float4x2 l_a_i = a_load_1(64u); const float2 l_a_i_i = asfloat(a[4].zw); return; } diff --git a/test/tint/buffer/uniform/std140/array/mat4x2_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/array/mat4x2_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl index 8b8b235ce4..7c02f6cfdb 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x2_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat4x2_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl @@ -2,24 +2,24 @@ cbuffer cbuffer_a : register(b0, space0) { uint4 a[8]; }; -float4x2 tint_symbol_1(uint4 buffer[8], uint offset) { +float4x2 a_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = a[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = a[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = a[scalar_offset_2 / 4]; const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_3 = a[scalar_offset_3 / 4]; return float4x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy)), asfloat(((scalar_offset_3 & 2) ? ubo_load_3.zw : ubo_load_3.xy))); } -typedef float4x2 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[8], uint offset) { +typedef float4x2 a_load_ret[4]; +a_load_ret a_load(uint offset) { float4x2 arr[4] = (float4x2[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 32u))); + arr[i] = a_load_1((offset + (i * 32u))); } } return arr; @@ -27,8 +27,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[8], uint offset) { [numthreads(1, 1, 1)] void f() { - const float4x2 l_a[4] = tint_symbol(a, 0u); - const float4x2 l_a_i = tint_symbol_1(a, 64u); + const float4x2 l_a[4] = a_load(0u); + const float4x2 l_a_i = a_load_1(64u); const float2 l_a_i_i = asfloat(a[4].zw); return; } diff --git a/test/tint/buffer/uniform/std140/array/mat4x2_f32/to_builtin.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat4x2_f32/to_builtin.wgsl.expected.dxc.hlsl index 2e395ab6d3..c16ba4f58c 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x2_f32/to_builtin.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat4x2_f32/to_builtin.wgsl.expected.dxc.hlsl @@ -2,21 +2,21 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[8]; }; -float4x2 tint_symbol(uint4 buffer[8], uint offset) { +float4x2 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = u[scalar_offset_2 / 4]; const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_3 = u[scalar_offset_3 / 4]; return float4x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy)), asfloat(((scalar_offset_3 & 2) ? ubo_load_3.zw : ubo_load_3.xy))); } [numthreads(1, 1, 1)] void f() { - const float2x4 t = transpose(tint_symbol(u, 64u)); + const float2x4 t = transpose(u_load(64u)); const float l = length(asfloat(u[0].zw).yx); const float a = abs(asfloat(u[0].zw).yx.x); return; diff --git a/test/tint/buffer/uniform/std140/array/mat4x2_f32/to_builtin.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/array/mat4x2_f32/to_builtin.wgsl.expected.fxc.hlsl index 2e395ab6d3..c16ba4f58c 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x2_f32/to_builtin.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat4x2_f32/to_builtin.wgsl.expected.fxc.hlsl @@ -2,21 +2,21 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[8]; }; -float4x2 tint_symbol(uint4 buffer[8], uint offset) { +float4x2 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = u[scalar_offset_2 / 4]; const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_3 = u[scalar_offset_3 / 4]; return float4x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy)), asfloat(((scalar_offset_3 & 2) ? ubo_load_3.zw : ubo_load_3.xy))); } [numthreads(1, 1, 1)] void f() { - const float2x4 t = transpose(tint_symbol(u, 64u)); + const float2x4 t = transpose(u_load(64u)); const float l = length(asfloat(u[0].zw).yx); const float a = abs(asfloat(u[0].zw).yx.x); return; diff --git a/test/tint/buffer/uniform/std140/array/mat4x2_f32/to_fn.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat4x2_f32/to_fn.wgsl.expected.dxc.hlsl index a0eba53b79..fbd8de95e2 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x2_f32/to_fn.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat4x2_f32/to_fn.wgsl.expected.dxc.hlsl @@ -14,24 +14,24 @@ void c(float2 v) { void d(float f_1) { } -float4x2 tint_symbol_1(uint4 buffer[8], uint offset) { +float4x2 u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = u[scalar_offset_2 / 4]; const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_3 = u[scalar_offset_3 / 4]; return float4x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy)), asfloat(((scalar_offset_3 & 2) ? ubo_load_3.zw : ubo_load_3.xy))); } -typedef float4x2 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[8], uint offset) { +typedef float4x2 u_load_ret[4]; +u_load_ret u_load(uint offset) { float4x2 arr[4] = (float4x2[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 32u))); + arr[i] = u_load_1((offset + (i * 32u))); } } return arr; @@ -39,8 +39,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[8], uint offset) { [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); - b(tint_symbol_1(u, 32u)); + a(u_load(0u)); + b(u_load_1(32u)); c(asfloat(u[2].xy).yx); d(asfloat(u[2].xy).yx.x); return; diff --git a/test/tint/buffer/uniform/std140/array/mat4x2_f32/to_fn.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/array/mat4x2_f32/to_fn.wgsl.expected.fxc.hlsl index a0eba53b79..fbd8de95e2 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x2_f32/to_fn.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat4x2_f32/to_fn.wgsl.expected.fxc.hlsl @@ -14,24 +14,24 @@ void c(float2 v) { void d(float f_1) { } -float4x2 tint_symbol_1(uint4 buffer[8], uint offset) { +float4x2 u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = u[scalar_offset_2 / 4]; const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_3 = u[scalar_offset_3 / 4]; return float4x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy)), asfloat(((scalar_offset_3 & 2) ? ubo_load_3.zw : ubo_load_3.xy))); } -typedef float4x2 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[8], uint offset) { +typedef float4x2 u_load_ret[4]; +u_load_ret u_load(uint offset) { float4x2 arr[4] = (float4x2[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 32u))); + arr[i] = u_load_1((offset + (i * 32u))); } } return arr; @@ -39,8 +39,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[8], uint offset) { [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); - b(tint_symbol_1(u, 32u)); + a(u_load(0u)); + b(u_load_1(32u)); c(asfloat(u[2].xy).yx); d(asfloat(u[2].xy).yx.x); return; diff --git a/test/tint/buffer/uniform/std140/array/mat4x2_f32/to_private.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat4x2_f32/to_private.wgsl.expected.dxc.hlsl index f33d735ddb..08b68895c7 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x2_f32/to_private.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat4x2_f32/to_private.wgsl.expected.dxc.hlsl @@ -3,24 +3,24 @@ cbuffer cbuffer_u : register(b0, space0) { }; static float4x2 p[4] = (float4x2[4])0; -float4x2 tint_symbol_1(uint4 buffer[8], uint offset) { +float4x2 u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = u[scalar_offset_2 / 4]; const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_3 = u[scalar_offset_3 / 4]; return float4x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy)), asfloat(((scalar_offset_3 & 2) ? ubo_load_3.zw : ubo_load_3.xy))); } -typedef float4x2 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[8], uint offset) { +typedef float4x2 u_load_ret[4]; +u_load_ret u_load(uint offset) { float4x2 arr[4] = (float4x2[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 32u))); + arr[i] = u_load_1((offset + (i * 32u))); } } return arr; @@ -28,8 +28,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[8], uint offset) { [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); - p[1] = tint_symbol_1(u, 64u); + p = u_load(0u); + p[1] = u_load_1(64u); p[1][0] = asfloat(u[0].zw).yx; p[1][0].x = asfloat(u[0].z); return; diff --git a/test/tint/buffer/uniform/std140/array/mat4x2_f32/to_private.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/array/mat4x2_f32/to_private.wgsl.expected.fxc.hlsl index f33d735ddb..08b68895c7 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x2_f32/to_private.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat4x2_f32/to_private.wgsl.expected.fxc.hlsl @@ -3,24 +3,24 @@ cbuffer cbuffer_u : register(b0, space0) { }; static float4x2 p[4] = (float4x2[4])0; -float4x2 tint_symbol_1(uint4 buffer[8], uint offset) { +float4x2 u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = u[scalar_offset_2 / 4]; const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_3 = u[scalar_offset_3 / 4]; return float4x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy)), asfloat(((scalar_offset_3 & 2) ? ubo_load_3.zw : ubo_load_3.xy))); } -typedef float4x2 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[8], uint offset) { +typedef float4x2 u_load_ret[4]; +u_load_ret u_load(uint offset) { float4x2 arr[4] = (float4x2[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 32u))); + arr[i] = u_load_1((offset + (i * 32u))); } } return arr; @@ -28,8 +28,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[8], uint offset) { [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); - p[1] = tint_symbol_1(u, 64u); + p = u_load(0u); + p[1] = u_load_1(64u); p[1][0] = asfloat(u[0].zw).yx; p[1][0].x = asfloat(u[0].z); return; diff --git a/test/tint/buffer/uniform/std140/array/mat4x2_f32/to_storage.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat4x2_f32/to_storage.wgsl.expected.dxc.hlsl index 22f1ffe707..4d9c46c171 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x2_f32/to_storage.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat4x2_f32/to_storage.wgsl.expected.dxc.hlsl @@ -3,40 +3,40 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol_1(RWByteAddressBuffer buffer, uint offset, float4x2 value) { - buffer.Store2((offset + 0u), asuint(value[0u])); - buffer.Store2((offset + 8u), asuint(value[1u])); - buffer.Store2((offset + 16u), asuint(value[2u])); - buffer.Store2((offset + 24u), asuint(value[3u])); +void s_store_1(uint offset, float4x2 value) { + s.Store2((offset + 0u), asuint(value[0u])); + s.Store2((offset + 8u), asuint(value[1u])); + s.Store2((offset + 16u), asuint(value[2u])); + s.Store2((offset + 24u), asuint(value[3u])); } -void tint_symbol(RWByteAddressBuffer buffer, uint offset, float4x2 value[4]) { +void s_store(uint offset, float4x2 value[4]) { float4x2 array_1[4] = value; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - tint_symbol_1(buffer, (offset + (i * 32u)), array_1[i]); + s_store_1((offset + (i * 32u)), array_1[i]); } } } -float4x2 tint_symbol_4(uint4 buffer[8], uint offset) { +float4x2 u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = u[scalar_offset_2 / 4]; const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_3 = u[scalar_offset_3 / 4]; return float4x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy)), asfloat(((scalar_offset_3 & 2) ? ubo_load_3.zw : ubo_load_3.xy))); } -typedef float4x2 tint_symbol_3_ret[4]; -tint_symbol_3_ret tint_symbol_3(uint4 buffer[8], uint offset) { +typedef float4x2 u_load_ret[4]; +u_load_ret u_load(uint offset) { float4x2 arr[4] = (float4x2[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_4(buffer, (offset + (i_1 * 32u))); + arr[i_1] = u_load_1((offset + (i_1 * 32u))); } } return arr; @@ -44,8 +44,8 @@ tint_symbol_3_ret tint_symbol_3(uint4 buffer[8], uint offset) { [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_3(u, 0u)); - tint_symbol_1(s, 32u, tint_symbol_4(u, 64u)); + s_store(0u, u_load(0u)); + s_store_1(32u, u_load_1(64u)); s.Store2(32u, asuint(asfloat(u[0].zw).yx)); s.Store(32u, asuint(asfloat(u[0].z))); return; diff --git a/test/tint/buffer/uniform/std140/array/mat4x2_f32/to_storage.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/array/mat4x2_f32/to_storage.wgsl.expected.fxc.hlsl index 22f1ffe707..4d9c46c171 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x2_f32/to_storage.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat4x2_f32/to_storage.wgsl.expected.fxc.hlsl @@ -3,40 +3,40 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol_1(RWByteAddressBuffer buffer, uint offset, float4x2 value) { - buffer.Store2((offset + 0u), asuint(value[0u])); - buffer.Store2((offset + 8u), asuint(value[1u])); - buffer.Store2((offset + 16u), asuint(value[2u])); - buffer.Store2((offset + 24u), asuint(value[3u])); +void s_store_1(uint offset, float4x2 value) { + s.Store2((offset + 0u), asuint(value[0u])); + s.Store2((offset + 8u), asuint(value[1u])); + s.Store2((offset + 16u), asuint(value[2u])); + s.Store2((offset + 24u), asuint(value[3u])); } -void tint_symbol(RWByteAddressBuffer buffer, uint offset, float4x2 value[4]) { +void s_store(uint offset, float4x2 value[4]) { float4x2 array_1[4] = value; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - tint_symbol_1(buffer, (offset + (i * 32u)), array_1[i]); + s_store_1((offset + (i * 32u)), array_1[i]); } } } -float4x2 tint_symbol_4(uint4 buffer[8], uint offset) { +float4x2 u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = u[scalar_offset_2 / 4]; const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_3 = u[scalar_offset_3 / 4]; return float4x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy)), asfloat(((scalar_offset_3 & 2) ? ubo_load_3.zw : ubo_load_3.xy))); } -typedef float4x2 tint_symbol_3_ret[4]; -tint_symbol_3_ret tint_symbol_3(uint4 buffer[8], uint offset) { +typedef float4x2 u_load_ret[4]; +u_load_ret u_load(uint offset) { float4x2 arr[4] = (float4x2[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_4(buffer, (offset + (i_1 * 32u))); + arr[i_1] = u_load_1((offset + (i_1 * 32u))); } } return arr; @@ -44,8 +44,8 @@ tint_symbol_3_ret tint_symbol_3(uint4 buffer[8], uint offset) { [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_3(u, 0u)); - tint_symbol_1(s, 32u, tint_symbol_4(u, 64u)); + s_store(0u, u_load(0u)); + s_store_1(32u, u_load_1(64u)); s.Store2(32u, asuint(asfloat(u[0].zw).yx)); s.Store(32u, asuint(asfloat(u[0].z))); return; diff --git a/test/tint/buffer/uniform/std140/array/mat4x2_f32/to_workgroup.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat4x2_f32/to_workgroup.wgsl.expected.dxc.hlsl index 0917dce482..dc406a1979 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x2_f32/to_workgroup.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat4x2_f32/to_workgroup.wgsl.expected.dxc.hlsl @@ -7,24 +7,24 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -float4x2 tint_symbol_3(uint4 buffer[8], uint offset) { +float4x2 u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = u[scalar_offset_2 / 4]; const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_3 = u[scalar_offset_3 / 4]; return float4x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy)), asfloat(((scalar_offset_3 & 2) ? ubo_load_3.zw : ubo_load_3.xy))); } -typedef float4x2 tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[8], uint offset) { +typedef float4x2 u_load_ret[4]; +u_load_ret u_load(uint offset) { float4x2 arr[4] = (float4x2[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_3(buffer, (offset + (i_1 * 32u))); + arr[i_1] = u_load_1((offset + (i_1 * 32u))); } } return arr; @@ -38,8 +38,8 @@ void f_inner(uint local_invocation_index) { } } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); - w[1] = tint_symbol_3(u, 64u); + w = u_load(0u); + w[1] = u_load_1(64u); w[1][0] = asfloat(u[0].zw).yx; w[1][0].x = asfloat(u[0].z); } diff --git a/test/tint/buffer/uniform/std140/array/mat4x2_f32/to_workgroup.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/array/mat4x2_f32/to_workgroup.wgsl.expected.fxc.hlsl index 0917dce482..dc406a1979 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x2_f32/to_workgroup.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat4x2_f32/to_workgroup.wgsl.expected.fxc.hlsl @@ -7,24 +7,24 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -float4x2 tint_symbol_3(uint4 buffer[8], uint offset) { +float4x2 u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = u[scalar_offset_2 / 4]; const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_3 = u[scalar_offset_3 / 4]; return float4x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy)), asfloat(((scalar_offset_3 & 2) ? ubo_load_3.zw : ubo_load_3.xy))); } -typedef float4x2 tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[8], uint offset) { +typedef float4x2 u_load_ret[4]; +u_load_ret u_load(uint offset) { float4x2 arr[4] = (float4x2[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_3(buffer, (offset + (i_1 * 32u))); + arr[i_1] = u_load_1((offset + (i_1 * 32u))); } } return arr; @@ -38,8 +38,8 @@ void f_inner(uint local_invocation_index) { } } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); - w[1] = tint_symbol_3(u, 64u); + w = u_load(0u); + w[1] = u_load_1(64u); w[1][0] = asfloat(u[0].zw).yx; w[1][0].x = asfloat(u[0].z); } diff --git a/test/tint/buffer/uniform/std140/array/mat4x3_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat4x3_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl index 87b7680a76..d09e012a1d 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x3_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat4x3_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl @@ -8,36 +8,36 @@ int i() { return counter; } -matrix tint_symbol_1(uint4 buffer[8], uint offset) { +matrix a_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = a[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = a[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = a[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); float16_t ubo_load_4_y = f16tof32(ubo_load_4[0] >> 16); const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_7 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_7 = a[scalar_offset_3 / 4]; uint2 ubo_load_6 = ((scalar_offset_3 & 2) ? ubo_load_7.zw : ubo_load_7.xy); vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); float16_t ubo_load_6_y = f16tof32(ubo_load_6[0] >> 16); return matrix(vector(ubo_load_xz[0], ubo_load_y, ubo_load_xz[1]), vector(ubo_load_2_xz[0], ubo_load_2_y, ubo_load_2_xz[1]), vector(ubo_load_4_xz[0], ubo_load_4_y, ubo_load_4_xz[1]), vector(ubo_load_6_xz[0], ubo_load_6_y, ubo_load_6_xz[1])); } -typedef matrix tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[8], uint offset) { +typedef matrix a_load_ret[4]; +a_load_ret a_load(uint offset) { matrix arr[4] = (matrix[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_1(buffer, (offset + (i_1 * 32u))); + arr[i_1] = a_load_1((offset + (i_1 * 32u))); } } return arr; @@ -47,8 +47,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[8], uint offset) { void f() { const int p_a_i_save = i(); const int p_a_i_i_save = i(); - const matrix l_a[4] = tint_symbol(a, 0u); - const matrix l_a_i = tint_symbol_1(a, (32u * uint(p_a_i_save))); + const matrix l_a[4] = a_load(0u); + const matrix l_a_i = a_load_1((32u * uint(p_a_i_save))); const uint scalar_offset_4 = (((32u * uint(p_a_i_save)) + (8u * uint(p_a_i_i_save)))) / 4; uint4 ubo_load_9 = a[scalar_offset_4 / 4]; uint2 ubo_load_8 = ((scalar_offset_4 & 2) ? ubo_load_9.zw : ubo_load_9.xy); diff --git a/test/tint/buffer/uniform/std140/array/mat4x3_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat4x3_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl index 53dc367a27..dbbeacea87 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x3_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat4x3_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl @@ -2,36 +2,36 @@ cbuffer cbuffer_a : register(b0, space0) { uint4 a[8]; }; -matrix tint_symbol_1(uint4 buffer[8], uint offset) { +matrix a_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = a[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = a[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = a[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); float16_t ubo_load_4_y = f16tof32(ubo_load_4[0] >> 16); const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_7 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_7 = a[scalar_offset_3 / 4]; uint2 ubo_load_6 = ((scalar_offset_3 & 2) ? ubo_load_7.zw : ubo_load_7.xy); vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); float16_t ubo_load_6_y = f16tof32(ubo_load_6[0] >> 16); return matrix(vector(ubo_load_xz[0], ubo_load_y, ubo_load_xz[1]), vector(ubo_load_2_xz[0], ubo_load_2_y, ubo_load_2_xz[1]), vector(ubo_load_4_xz[0], ubo_load_4_y, ubo_load_4_xz[1]), vector(ubo_load_6_xz[0], ubo_load_6_y, ubo_load_6_xz[1])); } -typedef matrix tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[8], uint offset) { +typedef matrix a_load_ret[4]; +a_load_ret a_load(uint offset) { matrix arr[4] = (matrix[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 32u))); + arr[i] = a_load_1((offset + (i * 32u))); } } return arr; @@ -39,8 +39,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[8], uint offset) { [numthreads(1, 1, 1)] void f() { - const matrix l_a[4] = tint_symbol(a, 0u); - const matrix l_a_i = tint_symbol_1(a, 64u); + const matrix l_a[4] = a_load(0u); + const matrix l_a_i = a_load_1(64u); uint2 ubo_load_8 = a[4].zw; vector ubo_load_8_xz = vector(f16tof32(ubo_load_8 & 0xFFFF)); float16_t ubo_load_8_y = f16tof32(ubo_load_8[0] >> 16); diff --git a/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_builtin.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_builtin.wgsl.expected.dxc.hlsl index fe691e9760..b3ba42f11a 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_builtin.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_builtin.wgsl.expected.dxc.hlsl @@ -2,24 +2,24 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[8]; }; -matrix tint_symbol(uint4 buffer[8], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = u[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); float16_t ubo_load_4_y = f16tof32(ubo_load_4[0] >> 16); const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_7 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_7 = u[scalar_offset_3 / 4]; uint2 ubo_load_6 = ((scalar_offset_3 & 2) ? ubo_load_7.zw : ubo_load_7.xy); vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); float16_t ubo_load_6_y = f16tof32(ubo_load_6[0] >> 16); @@ -28,7 +28,7 @@ matrix tint_symbol(uint4 buffer[8], uint offset) { [numthreads(1, 1, 1)] void f() { - const matrix t = transpose(tint_symbol(u, 64u)); + const matrix t = transpose(u_load(64u)); uint2 ubo_load_8 = u[0].zw; vector ubo_load_8_xz = vector(f16tof32(ubo_load_8 & 0xFFFF)); float16_t ubo_load_8_y = f16tof32(ubo_load_8[0] >> 16); diff --git a/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_fn.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_fn.wgsl.expected.dxc.hlsl index 2768c9971b..46e3546d2c 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_fn.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_fn.wgsl.expected.dxc.hlsl @@ -14,36 +14,36 @@ void c(vector v) { void d(float16_t f_1) { } -matrix tint_symbol_1(uint4 buffer[8], uint offset) { +matrix u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = u[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); float16_t ubo_load_4_y = f16tof32(ubo_load_4[0] >> 16); const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_7 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_7 = u[scalar_offset_3 / 4]; uint2 ubo_load_6 = ((scalar_offset_3 & 2) ? ubo_load_7.zw : ubo_load_7.xy); vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); float16_t ubo_load_6_y = f16tof32(ubo_load_6[0] >> 16); return matrix(vector(ubo_load_xz[0], ubo_load_y, ubo_load_xz[1]), vector(ubo_load_2_xz[0], ubo_load_2_y, ubo_load_2_xz[1]), vector(ubo_load_4_xz[0], ubo_load_4_y, ubo_load_4_xz[1]), vector(ubo_load_6_xz[0], ubo_load_6_y, ubo_load_6_xz[1])); } -typedef matrix tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[8], uint offset) { +typedef matrix u_load_ret[4]; +u_load_ret u_load(uint offset) { matrix arr[4] = (matrix[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 32u))); + arr[i] = u_load_1((offset + (i * 32u))); } } return arr; @@ -51,8 +51,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[8], uint offset) { [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); - b(tint_symbol_1(u, 32u)); + a(u_load(0u)); + b(u_load_1(32u)); uint2 ubo_load_8 = u[2].xy; vector ubo_load_8_xz = vector(f16tof32(ubo_load_8 & 0xFFFF)); float16_t ubo_load_8_y = f16tof32(ubo_load_8[0] >> 16); diff --git a/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_private.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_private.wgsl.expected.dxc.hlsl index 4b507021ee..5b7bb16535 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_private.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_private.wgsl.expected.dxc.hlsl @@ -3,36 +3,36 @@ cbuffer cbuffer_u : register(b0, space0) { }; static matrix p[4] = (matrix[4])0; -matrix tint_symbol_1(uint4 buffer[8], uint offset) { +matrix u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = u[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); float16_t ubo_load_4_y = f16tof32(ubo_load_4[0] >> 16); const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_7 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_7 = u[scalar_offset_3 / 4]; uint2 ubo_load_6 = ((scalar_offset_3 & 2) ? ubo_load_7.zw : ubo_load_7.xy); vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); float16_t ubo_load_6_y = f16tof32(ubo_load_6[0] >> 16); return matrix(vector(ubo_load_xz[0], ubo_load_y, ubo_load_xz[1]), vector(ubo_load_2_xz[0], ubo_load_2_y, ubo_load_2_xz[1]), vector(ubo_load_4_xz[0], ubo_load_4_y, ubo_load_4_xz[1]), vector(ubo_load_6_xz[0], ubo_load_6_y, ubo_load_6_xz[1])); } -typedef matrix tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[8], uint offset) { +typedef matrix u_load_ret[4]; +u_load_ret u_load(uint offset) { matrix arr[4] = (matrix[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 32u))); + arr[i] = u_load_1((offset + (i * 32u))); } } return arr; @@ -40,8 +40,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[8], uint offset) { [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); - p[1] = tint_symbol_1(u, 64u); + p = u_load(0u); + p[1] = u_load_1(64u); uint2 ubo_load_8 = u[0].zw; vector ubo_load_8_xz = vector(f16tof32(ubo_load_8 & 0xFFFF)); float16_t ubo_load_8_y = f16tof32(ubo_load_8[0] >> 16); diff --git a/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_storage.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_storage.wgsl.expected.dxc.hlsl index 8039a70956..8b8f883c0b 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_storage.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_storage.wgsl.expected.dxc.hlsl @@ -3,52 +3,52 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol_1(RWByteAddressBuffer buffer, uint offset, matrix value) { - buffer.Store >((offset + 0u), value[0u]); - buffer.Store >((offset + 8u), value[1u]); - buffer.Store >((offset + 16u), value[2u]); - buffer.Store >((offset + 24u), value[3u]); +void s_store_1(uint offset, matrix value) { + s.Store >((offset + 0u), value[0u]); + s.Store >((offset + 8u), value[1u]); + s.Store >((offset + 16u), value[2u]); + s.Store >((offset + 24u), value[3u]); } -void tint_symbol(RWByteAddressBuffer buffer, uint offset, matrix value[4]) { +void s_store(uint offset, matrix value[4]) { matrix array_1[4] = value; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - tint_symbol_1(buffer, (offset + (i * 32u)), array_1[i]); + s_store_1((offset + (i * 32u)), array_1[i]); } } } -matrix tint_symbol_4(uint4 buffer[8], uint offset) { +matrix u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = u[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); float16_t ubo_load_4_y = f16tof32(ubo_load_4[0] >> 16); const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_7 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_7 = u[scalar_offset_3 / 4]; uint2 ubo_load_6 = ((scalar_offset_3 & 2) ? ubo_load_7.zw : ubo_load_7.xy); vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); float16_t ubo_load_6_y = f16tof32(ubo_load_6[0] >> 16); return matrix(vector(ubo_load_xz[0], ubo_load_y, ubo_load_xz[1]), vector(ubo_load_2_xz[0], ubo_load_2_y, ubo_load_2_xz[1]), vector(ubo_load_4_xz[0], ubo_load_4_y, ubo_load_4_xz[1]), vector(ubo_load_6_xz[0], ubo_load_6_y, ubo_load_6_xz[1])); } -typedef matrix tint_symbol_3_ret[4]; -tint_symbol_3_ret tint_symbol_3(uint4 buffer[8], uint offset) { +typedef matrix u_load_ret[4]; +u_load_ret u_load(uint offset) { matrix arr[4] = (matrix[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_4(buffer, (offset + (i_1 * 32u))); + arr[i_1] = u_load_1((offset + (i_1 * 32u))); } } return arr; @@ -56,8 +56,8 @@ tint_symbol_3_ret tint_symbol_3(uint4 buffer[8], uint offset) { [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_3(u, 0u)); - tint_symbol_1(s, 32u, tint_symbol_4(u, 64u)); + s_store(0u, u_load(0u)); + s_store_1(32u, u_load_1(64u)); uint2 ubo_load_8 = u[0].zw; vector ubo_load_8_xz = vector(f16tof32(ubo_load_8 & 0xFFFF)); float16_t ubo_load_8_y = f16tof32(ubo_load_8[0] >> 16); diff --git a/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_workgroup.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_workgroup.wgsl.expected.dxc.hlsl index 6024dea99a..115d880ea5 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_workgroup.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat4x3_f16/to_workgroup.wgsl.expected.dxc.hlsl @@ -7,36 +7,36 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -matrix tint_symbol_3(uint4 buffer[8], uint offset) { +matrix u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = u[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); float16_t ubo_load_4_y = f16tof32(ubo_load_4[0] >> 16); const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_7 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_7 = u[scalar_offset_3 / 4]; uint2 ubo_load_6 = ((scalar_offset_3 & 2) ? ubo_load_7.zw : ubo_load_7.xy); vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); float16_t ubo_load_6_y = f16tof32(ubo_load_6[0] >> 16); return matrix(vector(ubo_load_xz[0], ubo_load_y, ubo_load_xz[1]), vector(ubo_load_2_xz[0], ubo_load_2_y, ubo_load_2_xz[1]), vector(ubo_load_4_xz[0], ubo_load_4_y, ubo_load_4_xz[1]), vector(ubo_load_6_xz[0], ubo_load_6_y, ubo_load_6_xz[1])); } -typedef matrix tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[8], uint offset) { +typedef matrix u_load_ret[4]; +u_load_ret u_load(uint offset) { matrix arr[4] = (matrix[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_3(buffer, (offset + (i_1 * 32u))); + arr[i_1] = u_load_1((offset + (i_1 * 32u))); } } return arr; @@ -50,8 +50,8 @@ void f_inner(uint local_invocation_index) { } } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); - w[1] = tint_symbol_3(u, 64u); + w = u_load(0u); + w[1] = u_load_1(64u); uint2 ubo_load_8 = u[0].zw; vector ubo_load_8_xz = vector(f16tof32(ubo_load_8 & 0xFFFF)); float16_t ubo_load_8_y = f16tof32(ubo_load_8[0] >> 16); diff --git a/test/tint/buffer/uniform/std140/array/mat4x3_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat4x3_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl index 0d9daa8247..ae93236834 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x3_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat4x3_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl @@ -8,20 +8,20 @@ int i() { return counter; } -float4x3 tint_symbol_1(uint4 buffer[16], uint offset) { +float4x3 a_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz)); + return float4x3(asfloat(a[scalar_offset / 4].xyz), asfloat(a[scalar_offset_1 / 4].xyz), asfloat(a[scalar_offset_2 / 4].xyz), asfloat(a[scalar_offset_3 / 4].xyz)); } -typedef float4x3 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[16], uint offset) { +typedef float4x3 a_load_ret[4]; +a_load_ret a_load(uint offset) { float4x3 arr[4] = (float4x3[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_1(buffer, (offset + (i_1 * 64u))); + arr[i_1] = a_load_1((offset + (i_1 * 64u))); } } return arr; @@ -31,8 +31,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[16], uint offset) { void f() { const int p_a_i_save = i(); const int p_a_i_i_save = i(); - const float4x3 l_a[4] = tint_symbol(a, 0u); - const float4x3 l_a_i = tint_symbol_1(a, (64u * uint(p_a_i_save))); + const float4x3 l_a[4] = a_load(0u); + const float4x3 l_a_i = a_load_1((64u * uint(p_a_i_save))); const uint scalar_offset_4 = (((64u * uint(p_a_i_save)) + (16u * uint(p_a_i_i_save)))) / 4; const float3 l_a_i_i = asfloat(a[scalar_offset_4 / 4].xyz); return; diff --git a/test/tint/buffer/uniform/std140/array/mat4x3_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/array/mat4x3_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl index 0d9daa8247..ae93236834 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x3_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat4x3_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl @@ -8,20 +8,20 @@ int i() { return counter; } -float4x3 tint_symbol_1(uint4 buffer[16], uint offset) { +float4x3 a_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz)); + return float4x3(asfloat(a[scalar_offset / 4].xyz), asfloat(a[scalar_offset_1 / 4].xyz), asfloat(a[scalar_offset_2 / 4].xyz), asfloat(a[scalar_offset_3 / 4].xyz)); } -typedef float4x3 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[16], uint offset) { +typedef float4x3 a_load_ret[4]; +a_load_ret a_load(uint offset) { float4x3 arr[4] = (float4x3[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_1(buffer, (offset + (i_1 * 64u))); + arr[i_1] = a_load_1((offset + (i_1 * 64u))); } } return arr; @@ -31,8 +31,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[16], uint offset) { void f() { const int p_a_i_save = i(); const int p_a_i_i_save = i(); - const float4x3 l_a[4] = tint_symbol(a, 0u); - const float4x3 l_a_i = tint_symbol_1(a, (64u * uint(p_a_i_save))); + const float4x3 l_a[4] = a_load(0u); + const float4x3 l_a_i = a_load_1((64u * uint(p_a_i_save))); const uint scalar_offset_4 = (((64u * uint(p_a_i_save)) + (16u * uint(p_a_i_i_save)))) / 4; const float3 l_a_i_i = asfloat(a[scalar_offset_4 / 4].xyz); return; diff --git a/test/tint/buffer/uniform/std140/array/mat4x3_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat4x3_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl index 7b865c6ed6..a870d116af 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x3_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat4x3_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl @@ -2,20 +2,20 @@ cbuffer cbuffer_a : register(b0, space0) { uint4 a[16]; }; -float4x3 tint_symbol_1(uint4 buffer[16], uint offset) { +float4x3 a_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz)); + return float4x3(asfloat(a[scalar_offset / 4].xyz), asfloat(a[scalar_offset_1 / 4].xyz), asfloat(a[scalar_offset_2 / 4].xyz), asfloat(a[scalar_offset_3 / 4].xyz)); } -typedef float4x3 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[16], uint offset) { +typedef float4x3 a_load_ret[4]; +a_load_ret a_load(uint offset) { float4x3 arr[4] = (float4x3[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 64u))); + arr[i] = a_load_1((offset + (i * 64u))); } } return arr; @@ -23,8 +23,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[16], uint offset) { [numthreads(1, 1, 1)] void f() { - const float4x3 l_a[4] = tint_symbol(a, 0u); - const float4x3 l_a_i = tint_symbol_1(a, 128u); + const float4x3 l_a[4] = a_load(0u); + const float4x3 l_a_i = a_load_1(128u); const float3 l_a_i_i = asfloat(a[9].xyz); return; } diff --git a/test/tint/buffer/uniform/std140/array/mat4x3_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/array/mat4x3_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl index 7b865c6ed6..a870d116af 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x3_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat4x3_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl @@ -2,20 +2,20 @@ cbuffer cbuffer_a : register(b0, space0) { uint4 a[16]; }; -float4x3 tint_symbol_1(uint4 buffer[16], uint offset) { +float4x3 a_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz)); + return float4x3(asfloat(a[scalar_offset / 4].xyz), asfloat(a[scalar_offset_1 / 4].xyz), asfloat(a[scalar_offset_2 / 4].xyz), asfloat(a[scalar_offset_3 / 4].xyz)); } -typedef float4x3 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[16], uint offset) { +typedef float4x3 a_load_ret[4]; +a_load_ret a_load(uint offset) { float4x3 arr[4] = (float4x3[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 64u))); + arr[i] = a_load_1((offset + (i * 64u))); } } return arr; @@ -23,8 +23,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[16], uint offset) { [numthreads(1, 1, 1)] void f() { - const float4x3 l_a[4] = tint_symbol(a, 0u); - const float4x3 l_a_i = tint_symbol_1(a, 128u); + const float4x3 l_a[4] = a_load(0u); + const float4x3 l_a_i = a_load_1(128u); const float3 l_a_i_i = asfloat(a[9].xyz); return; } diff --git a/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_builtin.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_builtin.wgsl.expected.dxc.hlsl index f398365b1e..f888288694 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_builtin.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_builtin.wgsl.expected.dxc.hlsl @@ -2,17 +2,17 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[16]; }; -float4x3 tint_symbol(uint4 buffer[16], uint offset) { +float4x3 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz)); + return float4x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz), asfloat(u[scalar_offset_3 / 4].xyz)); } [numthreads(1, 1, 1)] void f() { - const float3x4 t = transpose(tint_symbol(u, 128u)); + const float3x4 t = transpose(u_load(128u)); const float l = length(asfloat(u[1].xyz).zxy); const float a = abs(asfloat(u[1].xyz).zxy.x); return; diff --git a/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_builtin.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_builtin.wgsl.expected.fxc.hlsl index f398365b1e..f888288694 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_builtin.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_builtin.wgsl.expected.fxc.hlsl @@ -2,17 +2,17 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[16]; }; -float4x3 tint_symbol(uint4 buffer[16], uint offset) { +float4x3 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz)); + return float4x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz), asfloat(u[scalar_offset_3 / 4].xyz)); } [numthreads(1, 1, 1)] void f() { - const float3x4 t = transpose(tint_symbol(u, 128u)); + const float3x4 t = transpose(u_load(128u)); const float l = length(asfloat(u[1].xyz).zxy); const float a = abs(asfloat(u[1].xyz).zxy.x); return; diff --git a/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_fn.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_fn.wgsl.expected.dxc.hlsl index c1ac4a6f15..74614d70e7 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_fn.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_fn.wgsl.expected.dxc.hlsl @@ -14,20 +14,20 @@ void c(float3 v) { void d(float f_1) { } -float4x3 tint_symbol_1(uint4 buffer[16], uint offset) { +float4x3 u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz)); + return float4x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz), asfloat(u[scalar_offset_3 / 4].xyz)); } -typedef float4x3 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[16], uint offset) { +typedef float4x3 u_load_ret[4]; +u_load_ret u_load(uint offset) { float4x3 arr[4] = (float4x3[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 64u))); + arr[i] = u_load_1((offset + (i * 64u))); } } return arr; @@ -35,8 +35,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[16], uint offset) { [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); - b(tint_symbol_1(u, 64u)); + a(u_load(0u)); + b(u_load_1(64u)); c(asfloat(u[4].xyz).zxy); d(asfloat(u[4].xyz).zxy.x); return; diff --git a/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_fn.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_fn.wgsl.expected.fxc.hlsl index c1ac4a6f15..74614d70e7 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_fn.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_fn.wgsl.expected.fxc.hlsl @@ -14,20 +14,20 @@ void c(float3 v) { void d(float f_1) { } -float4x3 tint_symbol_1(uint4 buffer[16], uint offset) { +float4x3 u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz)); + return float4x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz), asfloat(u[scalar_offset_3 / 4].xyz)); } -typedef float4x3 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[16], uint offset) { +typedef float4x3 u_load_ret[4]; +u_load_ret u_load(uint offset) { float4x3 arr[4] = (float4x3[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 64u))); + arr[i] = u_load_1((offset + (i * 64u))); } } return arr; @@ -35,8 +35,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[16], uint offset) { [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); - b(tint_symbol_1(u, 64u)); + a(u_load(0u)); + b(u_load_1(64u)); c(asfloat(u[4].xyz).zxy); d(asfloat(u[4].xyz).zxy.x); return; diff --git a/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_private.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_private.wgsl.expected.dxc.hlsl index 5236d8f6cd..45924d8f6a 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_private.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_private.wgsl.expected.dxc.hlsl @@ -3,20 +3,20 @@ cbuffer cbuffer_u : register(b0, space0) { }; static float4x3 p[4] = (float4x3[4])0; -float4x3 tint_symbol_1(uint4 buffer[16], uint offset) { +float4x3 u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz)); + return float4x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz), asfloat(u[scalar_offset_3 / 4].xyz)); } -typedef float4x3 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[16], uint offset) { +typedef float4x3 u_load_ret[4]; +u_load_ret u_load(uint offset) { float4x3 arr[4] = (float4x3[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 64u))); + arr[i] = u_load_1((offset + (i * 64u))); } } return arr; @@ -24,8 +24,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[16], uint offset) { [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); - p[1] = tint_symbol_1(u, 128u); + p = u_load(0u); + p[1] = u_load_1(128u); p[1][0] = asfloat(u[1].xyz).zxy; p[1][0].x = asfloat(u[1].x); return; diff --git a/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_private.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_private.wgsl.expected.fxc.hlsl index 5236d8f6cd..45924d8f6a 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_private.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_private.wgsl.expected.fxc.hlsl @@ -3,20 +3,20 @@ cbuffer cbuffer_u : register(b0, space0) { }; static float4x3 p[4] = (float4x3[4])0; -float4x3 tint_symbol_1(uint4 buffer[16], uint offset) { +float4x3 u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz)); + return float4x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz), asfloat(u[scalar_offset_3 / 4].xyz)); } -typedef float4x3 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[16], uint offset) { +typedef float4x3 u_load_ret[4]; +u_load_ret u_load(uint offset) { float4x3 arr[4] = (float4x3[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 64u))); + arr[i] = u_load_1((offset + (i * 64u))); } } return arr; @@ -24,8 +24,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[16], uint offset) { [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); - p[1] = tint_symbol_1(u, 128u); + p = u_load(0u); + p[1] = u_load_1(128u); p[1][0] = asfloat(u[1].xyz).zxy; p[1][0].x = asfloat(u[1].x); return; diff --git a/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_storage.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_storage.wgsl.expected.dxc.hlsl index 6d83315c41..a9a307562a 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_storage.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_storage.wgsl.expected.dxc.hlsl @@ -3,36 +3,36 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol_1(RWByteAddressBuffer buffer, uint offset, float4x3 value) { - buffer.Store3((offset + 0u), asuint(value[0u])); - buffer.Store3((offset + 16u), asuint(value[1u])); - buffer.Store3((offset + 32u), asuint(value[2u])); - buffer.Store3((offset + 48u), asuint(value[3u])); +void s_store_1(uint offset, float4x3 value) { + s.Store3((offset + 0u), asuint(value[0u])); + s.Store3((offset + 16u), asuint(value[1u])); + s.Store3((offset + 32u), asuint(value[2u])); + s.Store3((offset + 48u), asuint(value[3u])); } -void tint_symbol(RWByteAddressBuffer buffer, uint offset, float4x3 value[4]) { +void s_store(uint offset, float4x3 value[4]) { float4x3 array_1[4] = value; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - tint_symbol_1(buffer, (offset + (i * 64u)), array_1[i]); + s_store_1((offset + (i * 64u)), array_1[i]); } } } -float4x3 tint_symbol_4(uint4 buffer[16], uint offset) { +float4x3 u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz)); + return float4x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz), asfloat(u[scalar_offset_3 / 4].xyz)); } -typedef float4x3 tint_symbol_3_ret[4]; -tint_symbol_3_ret tint_symbol_3(uint4 buffer[16], uint offset) { +typedef float4x3 u_load_ret[4]; +u_load_ret u_load(uint offset) { float4x3 arr[4] = (float4x3[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_4(buffer, (offset + (i_1 * 64u))); + arr[i_1] = u_load_1((offset + (i_1 * 64u))); } } return arr; @@ -40,8 +40,8 @@ tint_symbol_3_ret tint_symbol_3(uint4 buffer[16], uint offset) { [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_3(u, 0u)); - tint_symbol_1(s, 64u, tint_symbol_4(u, 128u)); + s_store(0u, u_load(0u)); + s_store_1(64u, u_load_1(128u)); s.Store3(64u, asuint(asfloat(u[1].xyz).zxy)); s.Store(64u, asuint(asfloat(u[1].x))); return; diff --git a/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_storage.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_storage.wgsl.expected.fxc.hlsl index 6d83315c41..a9a307562a 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_storage.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_storage.wgsl.expected.fxc.hlsl @@ -3,36 +3,36 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol_1(RWByteAddressBuffer buffer, uint offset, float4x3 value) { - buffer.Store3((offset + 0u), asuint(value[0u])); - buffer.Store3((offset + 16u), asuint(value[1u])); - buffer.Store3((offset + 32u), asuint(value[2u])); - buffer.Store3((offset + 48u), asuint(value[3u])); +void s_store_1(uint offset, float4x3 value) { + s.Store3((offset + 0u), asuint(value[0u])); + s.Store3((offset + 16u), asuint(value[1u])); + s.Store3((offset + 32u), asuint(value[2u])); + s.Store3((offset + 48u), asuint(value[3u])); } -void tint_symbol(RWByteAddressBuffer buffer, uint offset, float4x3 value[4]) { +void s_store(uint offset, float4x3 value[4]) { float4x3 array_1[4] = value; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - tint_symbol_1(buffer, (offset + (i * 64u)), array_1[i]); + s_store_1((offset + (i * 64u)), array_1[i]); } } } -float4x3 tint_symbol_4(uint4 buffer[16], uint offset) { +float4x3 u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz)); + return float4x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz), asfloat(u[scalar_offset_3 / 4].xyz)); } -typedef float4x3 tint_symbol_3_ret[4]; -tint_symbol_3_ret tint_symbol_3(uint4 buffer[16], uint offset) { +typedef float4x3 u_load_ret[4]; +u_load_ret u_load(uint offset) { float4x3 arr[4] = (float4x3[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_4(buffer, (offset + (i_1 * 64u))); + arr[i_1] = u_load_1((offset + (i_1 * 64u))); } } return arr; @@ -40,8 +40,8 @@ tint_symbol_3_ret tint_symbol_3(uint4 buffer[16], uint offset) { [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_3(u, 0u)); - tint_symbol_1(s, 64u, tint_symbol_4(u, 128u)); + s_store(0u, u_load(0u)); + s_store_1(64u, u_load_1(128u)); s.Store3(64u, asuint(asfloat(u[1].xyz).zxy)); s.Store(64u, asuint(asfloat(u[1].x))); return; diff --git a/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_workgroup.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_workgroup.wgsl.expected.dxc.hlsl index 1c1745ad83..ce142b0e65 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_workgroup.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_workgroup.wgsl.expected.dxc.hlsl @@ -7,20 +7,20 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -float4x3 tint_symbol_3(uint4 buffer[16], uint offset) { +float4x3 u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz)); + return float4x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz), asfloat(u[scalar_offset_3 / 4].xyz)); } -typedef float4x3 tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[16], uint offset) { +typedef float4x3 u_load_ret[4]; +u_load_ret u_load(uint offset) { float4x3 arr[4] = (float4x3[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_3(buffer, (offset + (i_1 * 64u))); + arr[i_1] = u_load_1((offset + (i_1 * 64u))); } } return arr; @@ -34,8 +34,8 @@ void f_inner(uint local_invocation_index) { } } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); - w[1] = tint_symbol_3(u, 128u); + w = u_load(0u); + w[1] = u_load_1(128u); w[1][0] = asfloat(u[1].xyz).zxy; w[1][0].x = asfloat(u[1].x); } diff --git a/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_workgroup.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_workgroup.wgsl.expected.fxc.hlsl index 1c1745ad83..ce142b0e65 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_workgroup.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat4x3_f32/to_workgroup.wgsl.expected.fxc.hlsl @@ -7,20 +7,20 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -float4x3 tint_symbol_3(uint4 buffer[16], uint offset) { +float4x3 u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz)); + return float4x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz), asfloat(u[scalar_offset_3 / 4].xyz)); } -typedef float4x3 tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[16], uint offset) { +typedef float4x3 u_load_ret[4]; +u_load_ret u_load(uint offset) { float4x3 arr[4] = (float4x3[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_3(buffer, (offset + (i_1 * 64u))); + arr[i_1] = u_load_1((offset + (i_1 * 64u))); } } return arr; @@ -34,8 +34,8 @@ void f_inner(uint local_invocation_index) { } } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); - w[1] = tint_symbol_3(u, 128u); + w = u_load(0u); + w[1] = u_load_1(128u); w[1][0] = asfloat(u[1].xyz).zxy; w[1][0].x = asfloat(u[1].x); } diff --git a/test/tint/buffer/uniform/std140/array/mat4x4_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat4x4_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl index 59fae52843..a7ff9eca28 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x4_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat4x4_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl @@ -8,36 +8,36 @@ int i() { return counter; } -matrix tint_symbol_1(uint4 buffer[8], uint offset) { +matrix a_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = a[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = a[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); vector ubo_load_2_yw = vector(f16tof32(ubo_load_2 >> 16)); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = a[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); vector ubo_load_4_yw = vector(f16tof32(ubo_load_4 >> 16)); const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_7 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_7 = a[scalar_offset_3 / 4]; uint2 ubo_load_6 = ((scalar_offset_3 & 2) ? ubo_load_7.zw : ubo_load_7.xy); vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); vector ubo_load_6_yw = vector(f16tof32(ubo_load_6 >> 16)); return matrix(vector(ubo_load_xz[0], ubo_load_yw[0], ubo_load_xz[1], ubo_load_yw[1]), vector(ubo_load_2_xz[0], ubo_load_2_yw[0], ubo_load_2_xz[1], ubo_load_2_yw[1]), vector(ubo_load_4_xz[0], ubo_load_4_yw[0], ubo_load_4_xz[1], ubo_load_4_yw[1]), vector(ubo_load_6_xz[0], ubo_load_6_yw[0], ubo_load_6_xz[1], ubo_load_6_yw[1])); } -typedef matrix tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[8], uint offset) { +typedef matrix a_load_ret[4]; +a_load_ret a_load(uint offset) { matrix arr[4] = (matrix[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_1(buffer, (offset + (i_1 * 32u))); + arr[i_1] = a_load_1((offset + (i_1 * 32u))); } } return arr; @@ -47,8 +47,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[8], uint offset) { void f() { const int p_a_i_save = i(); const int p_a_i_i_save = i(); - const matrix l_a[4] = tint_symbol(a, 0u); - const matrix l_a_i = tint_symbol_1(a, (32u * uint(p_a_i_save))); + const matrix l_a[4] = a_load(0u); + const matrix l_a_i = a_load_1((32u * uint(p_a_i_save))); const uint scalar_offset_4 = (((32u * uint(p_a_i_save)) + (8u * uint(p_a_i_i_save)))) / 4; uint4 ubo_load_9 = a[scalar_offset_4 / 4]; uint2 ubo_load_8 = ((scalar_offset_4 & 2) ? ubo_load_9.zw : ubo_load_9.xy); diff --git a/test/tint/buffer/uniform/std140/array/mat4x4_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat4x4_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl index 0413807269..7798842442 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x4_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat4x4_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl @@ -2,36 +2,36 @@ cbuffer cbuffer_a : register(b0, space0) { uint4 a[8]; }; -matrix tint_symbol_1(uint4 buffer[8], uint offset) { +matrix a_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = a[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = a[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); vector ubo_load_2_yw = vector(f16tof32(ubo_load_2 >> 16)); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = a[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); vector ubo_load_4_yw = vector(f16tof32(ubo_load_4 >> 16)); const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_7 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_7 = a[scalar_offset_3 / 4]; uint2 ubo_load_6 = ((scalar_offset_3 & 2) ? ubo_load_7.zw : ubo_load_7.xy); vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); vector ubo_load_6_yw = vector(f16tof32(ubo_load_6 >> 16)); return matrix(vector(ubo_load_xz[0], ubo_load_yw[0], ubo_load_xz[1], ubo_load_yw[1]), vector(ubo_load_2_xz[0], ubo_load_2_yw[0], ubo_load_2_xz[1], ubo_load_2_yw[1]), vector(ubo_load_4_xz[0], ubo_load_4_yw[0], ubo_load_4_xz[1], ubo_load_4_yw[1]), vector(ubo_load_6_xz[0], ubo_load_6_yw[0], ubo_load_6_xz[1], ubo_load_6_yw[1])); } -typedef matrix tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[8], uint offset) { +typedef matrix a_load_ret[4]; +a_load_ret a_load(uint offset) { matrix arr[4] = (matrix[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 32u))); + arr[i] = a_load_1((offset + (i * 32u))); } } return arr; @@ -39,8 +39,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[8], uint offset) { [numthreads(1, 1, 1)] void f() { - const matrix l_a[4] = tint_symbol(a, 0u); - const matrix l_a_i = tint_symbol_1(a, 64u); + const matrix l_a[4] = a_load(0u); + const matrix l_a_i = a_load_1(64u); uint2 ubo_load_8 = a[4].zw; vector ubo_load_8_xz = vector(f16tof32(ubo_load_8 & 0xFFFF)); vector ubo_load_8_yw = vector(f16tof32(ubo_load_8 >> 16)); diff --git a/test/tint/buffer/uniform/std140/array/mat4x4_f16/to_builtin.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat4x4_f16/to_builtin.wgsl.expected.dxc.hlsl index 3db7f37b82..94f5ad187a 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x4_f16/to_builtin.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat4x4_f16/to_builtin.wgsl.expected.dxc.hlsl @@ -2,24 +2,24 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[8]; }; -matrix tint_symbol(uint4 buffer[8], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); vector ubo_load_2_yw = vector(f16tof32(ubo_load_2 >> 16)); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = u[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); vector ubo_load_4_yw = vector(f16tof32(ubo_load_4 >> 16)); const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_7 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_7 = u[scalar_offset_3 / 4]; uint2 ubo_load_6 = ((scalar_offset_3 & 2) ? ubo_load_7.zw : ubo_load_7.xy); vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); vector ubo_load_6_yw = vector(f16tof32(ubo_load_6 >> 16)); @@ -28,7 +28,7 @@ matrix tint_symbol(uint4 buffer[8], uint offset) { [numthreads(1, 1, 1)] void f() { - const matrix t = transpose(tint_symbol(u, 64u)); + const matrix t = transpose(u_load(64u)); uint2 ubo_load_8 = u[0].zw; vector ubo_load_8_xz = vector(f16tof32(ubo_load_8 & 0xFFFF)); vector ubo_load_8_yw = vector(f16tof32(ubo_load_8 >> 16)); diff --git a/test/tint/buffer/uniform/std140/array/mat4x4_f16/to_fn.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat4x4_f16/to_fn.wgsl.expected.dxc.hlsl index 99d280287e..fd3ef0b09c 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x4_f16/to_fn.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat4x4_f16/to_fn.wgsl.expected.dxc.hlsl @@ -14,36 +14,36 @@ void c(vector v) { void d(float16_t f_1) { } -matrix tint_symbol_1(uint4 buffer[8], uint offset) { +matrix u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); vector ubo_load_2_yw = vector(f16tof32(ubo_load_2 >> 16)); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = u[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); vector ubo_load_4_yw = vector(f16tof32(ubo_load_4 >> 16)); const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_7 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_7 = u[scalar_offset_3 / 4]; uint2 ubo_load_6 = ((scalar_offset_3 & 2) ? ubo_load_7.zw : ubo_load_7.xy); vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); vector ubo_load_6_yw = vector(f16tof32(ubo_load_6 >> 16)); return matrix(vector(ubo_load_xz[0], ubo_load_yw[0], ubo_load_xz[1], ubo_load_yw[1]), vector(ubo_load_2_xz[0], ubo_load_2_yw[0], ubo_load_2_xz[1], ubo_load_2_yw[1]), vector(ubo_load_4_xz[0], ubo_load_4_yw[0], ubo_load_4_xz[1], ubo_load_4_yw[1]), vector(ubo_load_6_xz[0], ubo_load_6_yw[0], ubo_load_6_xz[1], ubo_load_6_yw[1])); } -typedef matrix tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[8], uint offset) { +typedef matrix u_load_ret[4]; +u_load_ret u_load(uint offset) { matrix arr[4] = (matrix[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 32u))); + arr[i] = u_load_1((offset + (i * 32u))); } } return arr; @@ -51,8 +51,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[8], uint offset) { [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); - b(tint_symbol_1(u, 32u)); + a(u_load(0u)); + b(u_load_1(32u)); uint2 ubo_load_8 = u[2].xy; vector ubo_load_8_xz = vector(f16tof32(ubo_load_8 & 0xFFFF)); vector ubo_load_8_yw = vector(f16tof32(ubo_load_8 >> 16)); diff --git a/test/tint/buffer/uniform/std140/array/mat4x4_f16/to_private.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat4x4_f16/to_private.wgsl.expected.dxc.hlsl index d5fc3e35b0..ea68e0b50b 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x4_f16/to_private.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat4x4_f16/to_private.wgsl.expected.dxc.hlsl @@ -3,36 +3,36 @@ cbuffer cbuffer_u : register(b0, space0) { }; static matrix p[4] = (matrix[4])0; -matrix tint_symbol_1(uint4 buffer[8], uint offset) { +matrix u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); vector ubo_load_2_yw = vector(f16tof32(ubo_load_2 >> 16)); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = u[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); vector ubo_load_4_yw = vector(f16tof32(ubo_load_4 >> 16)); const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_7 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_7 = u[scalar_offset_3 / 4]; uint2 ubo_load_6 = ((scalar_offset_3 & 2) ? ubo_load_7.zw : ubo_load_7.xy); vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); vector ubo_load_6_yw = vector(f16tof32(ubo_load_6 >> 16)); return matrix(vector(ubo_load_xz[0], ubo_load_yw[0], ubo_load_xz[1], ubo_load_yw[1]), vector(ubo_load_2_xz[0], ubo_load_2_yw[0], ubo_load_2_xz[1], ubo_load_2_yw[1]), vector(ubo_load_4_xz[0], ubo_load_4_yw[0], ubo_load_4_xz[1], ubo_load_4_yw[1]), vector(ubo_load_6_xz[0], ubo_load_6_yw[0], ubo_load_6_xz[1], ubo_load_6_yw[1])); } -typedef matrix tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[8], uint offset) { +typedef matrix u_load_ret[4]; +u_load_ret u_load(uint offset) { matrix arr[4] = (matrix[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 32u))); + arr[i] = u_load_1((offset + (i * 32u))); } } return arr; @@ -40,8 +40,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[8], uint offset) { [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); - p[1] = tint_symbol_1(u, 64u); + p = u_load(0u); + p[1] = u_load_1(64u); uint2 ubo_load_8 = u[0].zw; vector ubo_load_8_xz = vector(f16tof32(ubo_load_8 & 0xFFFF)); vector ubo_load_8_yw = vector(f16tof32(ubo_load_8 >> 16)); diff --git a/test/tint/buffer/uniform/std140/array/mat4x4_f16/to_storage.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat4x4_f16/to_storage.wgsl.expected.dxc.hlsl index 9e8d1ecf2c..453390c92c 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x4_f16/to_storage.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat4x4_f16/to_storage.wgsl.expected.dxc.hlsl @@ -3,52 +3,52 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol_1(RWByteAddressBuffer buffer, uint offset, matrix value) { - buffer.Store >((offset + 0u), value[0u]); - buffer.Store >((offset + 8u), value[1u]); - buffer.Store >((offset + 16u), value[2u]); - buffer.Store >((offset + 24u), value[3u]); +void s_store_1(uint offset, matrix value) { + s.Store >((offset + 0u), value[0u]); + s.Store >((offset + 8u), value[1u]); + s.Store >((offset + 16u), value[2u]); + s.Store >((offset + 24u), value[3u]); } -void tint_symbol(RWByteAddressBuffer buffer, uint offset, matrix value[4]) { +void s_store(uint offset, matrix value[4]) { matrix array_1[4] = value; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - tint_symbol_1(buffer, (offset + (i * 32u)), array_1[i]); + s_store_1((offset + (i * 32u)), array_1[i]); } } } -matrix tint_symbol_4(uint4 buffer[8], uint offset) { +matrix u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); vector ubo_load_2_yw = vector(f16tof32(ubo_load_2 >> 16)); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = u[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); vector ubo_load_4_yw = vector(f16tof32(ubo_load_4 >> 16)); const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_7 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_7 = u[scalar_offset_3 / 4]; uint2 ubo_load_6 = ((scalar_offset_3 & 2) ? ubo_load_7.zw : ubo_load_7.xy); vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); vector ubo_load_6_yw = vector(f16tof32(ubo_load_6 >> 16)); return matrix(vector(ubo_load_xz[0], ubo_load_yw[0], ubo_load_xz[1], ubo_load_yw[1]), vector(ubo_load_2_xz[0], ubo_load_2_yw[0], ubo_load_2_xz[1], ubo_load_2_yw[1]), vector(ubo_load_4_xz[0], ubo_load_4_yw[0], ubo_load_4_xz[1], ubo_load_4_yw[1]), vector(ubo_load_6_xz[0], ubo_load_6_yw[0], ubo_load_6_xz[1], ubo_load_6_yw[1])); } -typedef matrix tint_symbol_3_ret[4]; -tint_symbol_3_ret tint_symbol_3(uint4 buffer[8], uint offset) { +typedef matrix u_load_ret[4]; +u_load_ret u_load(uint offset) { matrix arr[4] = (matrix[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_4(buffer, (offset + (i_1 * 32u))); + arr[i_1] = u_load_1((offset + (i_1 * 32u))); } } return arr; @@ -56,8 +56,8 @@ tint_symbol_3_ret tint_symbol_3(uint4 buffer[8], uint offset) { [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_3(u, 0u)); - tint_symbol_1(s, 32u, tint_symbol_4(u, 64u)); + s_store(0u, u_load(0u)); + s_store_1(32u, u_load_1(64u)); uint2 ubo_load_8 = u[0].zw; vector ubo_load_8_xz = vector(f16tof32(ubo_load_8 & 0xFFFF)); vector ubo_load_8_yw = vector(f16tof32(ubo_load_8 >> 16)); diff --git a/test/tint/buffer/uniform/std140/array/mat4x4_f16/to_workgroup.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat4x4_f16/to_workgroup.wgsl.expected.dxc.hlsl index 94db3c46aa..6c2142d599 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x4_f16/to_workgroup.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat4x4_f16/to_workgroup.wgsl.expected.dxc.hlsl @@ -7,36 +7,36 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -matrix tint_symbol_3(uint4 buffer[8], uint offset) { +matrix u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); vector ubo_load_2_yw = vector(f16tof32(ubo_load_2 >> 16)); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = u[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); vector ubo_load_4_yw = vector(f16tof32(ubo_load_4 >> 16)); const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_7 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_7 = u[scalar_offset_3 / 4]; uint2 ubo_load_6 = ((scalar_offset_3 & 2) ? ubo_load_7.zw : ubo_load_7.xy); vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); vector ubo_load_6_yw = vector(f16tof32(ubo_load_6 >> 16)); return matrix(vector(ubo_load_xz[0], ubo_load_yw[0], ubo_load_xz[1], ubo_load_yw[1]), vector(ubo_load_2_xz[0], ubo_load_2_yw[0], ubo_load_2_xz[1], ubo_load_2_yw[1]), vector(ubo_load_4_xz[0], ubo_load_4_yw[0], ubo_load_4_xz[1], ubo_load_4_yw[1]), vector(ubo_load_6_xz[0], ubo_load_6_yw[0], ubo_load_6_xz[1], ubo_load_6_yw[1])); } -typedef matrix tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[8], uint offset) { +typedef matrix u_load_ret[4]; +u_load_ret u_load(uint offset) { matrix arr[4] = (matrix[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_3(buffer, (offset + (i_1 * 32u))); + arr[i_1] = u_load_1((offset + (i_1 * 32u))); } } return arr; @@ -50,8 +50,8 @@ void f_inner(uint local_invocation_index) { } } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); - w[1] = tint_symbol_3(u, 64u); + w = u_load(0u); + w[1] = u_load_1(64u); uint2 ubo_load_8 = u[0].zw; vector ubo_load_8_xz = vector(f16tof32(ubo_load_8 & 0xFFFF)); vector ubo_load_8_yw = vector(f16tof32(ubo_load_8 >> 16)); diff --git a/test/tint/buffer/uniform/std140/array/mat4x4_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat4x4_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl index cfb9ecf07c..5543cec6a5 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x4_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat4x4_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl @@ -8,20 +8,20 @@ int i() { return counter; } -float4x4 tint_symbol_1(uint4 buffer[16], uint offset) { +float4x4 a_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]), asfloat(buffer[scalar_offset_3 / 4])); + return float4x4(asfloat(a[scalar_offset / 4]), asfloat(a[scalar_offset_1 / 4]), asfloat(a[scalar_offset_2 / 4]), asfloat(a[scalar_offset_3 / 4])); } -typedef float4x4 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[16], uint offset) { +typedef float4x4 a_load_ret[4]; +a_load_ret a_load(uint offset) { float4x4 arr[4] = (float4x4[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_1(buffer, (offset + (i_1 * 64u))); + arr[i_1] = a_load_1((offset + (i_1 * 64u))); } } return arr; @@ -31,8 +31,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[16], uint offset) { void f() { const int p_a_i_save = i(); const int p_a_i_i_save = i(); - const float4x4 l_a[4] = tint_symbol(a, 0u); - const float4x4 l_a_i = tint_symbol_1(a, (64u * uint(p_a_i_save))); + const float4x4 l_a[4] = a_load(0u); + const float4x4 l_a_i = a_load_1((64u * uint(p_a_i_save))); const uint scalar_offset_4 = (((64u * uint(p_a_i_save)) + (16u * uint(p_a_i_i_save)))) / 4; const float4 l_a_i_i = asfloat(a[scalar_offset_4 / 4]); return; diff --git a/test/tint/buffer/uniform/std140/array/mat4x4_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/array/mat4x4_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl index cfb9ecf07c..5543cec6a5 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x4_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat4x4_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl @@ -8,20 +8,20 @@ int i() { return counter; } -float4x4 tint_symbol_1(uint4 buffer[16], uint offset) { +float4x4 a_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]), asfloat(buffer[scalar_offset_3 / 4])); + return float4x4(asfloat(a[scalar_offset / 4]), asfloat(a[scalar_offset_1 / 4]), asfloat(a[scalar_offset_2 / 4]), asfloat(a[scalar_offset_3 / 4])); } -typedef float4x4 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[16], uint offset) { +typedef float4x4 a_load_ret[4]; +a_load_ret a_load(uint offset) { float4x4 arr[4] = (float4x4[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_1(buffer, (offset + (i_1 * 64u))); + arr[i_1] = a_load_1((offset + (i_1 * 64u))); } } return arr; @@ -31,8 +31,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[16], uint offset) { void f() { const int p_a_i_save = i(); const int p_a_i_i_save = i(); - const float4x4 l_a[4] = tint_symbol(a, 0u); - const float4x4 l_a_i = tint_symbol_1(a, (64u * uint(p_a_i_save))); + const float4x4 l_a[4] = a_load(0u); + const float4x4 l_a_i = a_load_1((64u * uint(p_a_i_save))); const uint scalar_offset_4 = (((64u * uint(p_a_i_save)) + (16u * uint(p_a_i_i_save)))) / 4; const float4 l_a_i_i = asfloat(a[scalar_offset_4 / 4]); return; diff --git a/test/tint/buffer/uniform/std140/array/mat4x4_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat4x4_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl index ac24f0453d..2873c7e3d1 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x4_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat4x4_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl @@ -2,20 +2,20 @@ cbuffer cbuffer_a : register(b0, space0) { uint4 a[16]; }; -float4x4 tint_symbol_1(uint4 buffer[16], uint offset) { +float4x4 a_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]), asfloat(buffer[scalar_offset_3 / 4])); + return float4x4(asfloat(a[scalar_offset / 4]), asfloat(a[scalar_offset_1 / 4]), asfloat(a[scalar_offset_2 / 4]), asfloat(a[scalar_offset_3 / 4])); } -typedef float4x4 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[16], uint offset) { +typedef float4x4 a_load_ret[4]; +a_load_ret a_load(uint offset) { float4x4 arr[4] = (float4x4[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 64u))); + arr[i] = a_load_1((offset + (i * 64u))); } } return arr; @@ -23,8 +23,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[16], uint offset) { [numthreads(1, 1, 1)] void f() { - const float4x4 l_a[4] = tint_symbol(a, 0u); - const float4x4 l_a_i = tint_symbol_1(a, 128u); + const float4x4 l_a[4] = a_load(0u); + const float4x4 l_a_i = a_load_1(128u); const float4 l_a_i_i = asfloat(a[9]); return; } diff --git a/test/tint/buffer/uniform/std140/array/mat4x4_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/array/mat4x4_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl index ac24f0453d..2873c7e3d1 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x4_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat4x4_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl @@ -2,20 +2,20 @@ cbuffer cbuffer_a : register(b0, space0) { uint4 a[16]; }; -float4x4 tint_symbol_1(uint4 buffer[16], uint offset) { +float4x4 a_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]), asfloat(buffer[scalar_offset_3 / 4])); + return float4x4(asfloat(a[scalar_offset / 4]), asfloat(a[scalar_offset_1 / 4]), asfloat(a[scalar_offset_2 / 4]), asfloat(a[scalar_offset_3 / 4])); } -typedef float4x4 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[16], uint offset) { +typedef float4x4 a_load_ret[4]; +a_load_ret a_load(uint offset) { float4x4 arr[4] = (float4x4[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 64u))); + arr[i] = a_load_1((offset + (i * 64u))); } } return arr; @@ -23,8 +23,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[16], uint offset) { [numthreads(1, 1, 1)] void f() { - const float4x4 l_a[4] = tint_symbol(a, 0u); - const float4x4 l_a_i = tint_symbol_1(a, 128u); + const float4x4 l_a[4] = a_load(0u); + const float4x4 l_a_i = a_load_1(128u); const float4 l_a_i_i = asfloat(a[9]); return; } diff --git a/test/tint/buffer/uniform/std140/array/mat4x4_f32/to_builtin.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat4x4_f32/to_builtin.wgsl.expected.dxc.hlsl index bb637b6e7a..a0c4736f14 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x4_f32/to_builtin.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat4x4_f32/to_builtin.wgsl.expected.dxc.hlsl @@ -2,17 +2,17 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[16]; }; -float4x4 tint_symbol(uint4 buffer[16], uint offset) { +float4x4 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]), asfloat(buffer[scalar_offset_3 / 4])); + return float4x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4]), asfloat(u[scalar_offset_2 / 4]), asfloat(u[scalar_offset_3 / 4])); } [numthreads(1, 1, 1)] void f() { - const float4x4 t = transpose(tint_symbol(u, 128u)); + const float4x4 t = transpose(u_load(128u)); const float l = length(asfloat(u[1]).ywxz); const float a = abs(asfloat(u[1]).ywxz.x); return; diff --git a/test/tint/buffer/uniform/std140/array/mat4x4_f32/to_builtin.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/array/mat4x4_f32/to_builtin.wgsl.expected.fxc.hlsl index bb637b6e7a..a0c4736f14 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x4_f32/to_builtin.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat4x4_f32/to_builtin.wgsl.expected.fxc.hlsl @@ -2,17 +2,17 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[16]; }; -float4x4 tint_symbol(uint4 buffer[16], uint offset) { +float4x4 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]), asfloat(buffer[scalar_offset_3 / 4])); + return float4x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4]), asfloat(u[scalar_offset_2 / 4]), asfloat(u[scalar_offset_3 / 4])); } [numthreads(1, 1, 1)] void f() { - const float4x4 t = transpose(tint_symbol(u, 128u)); + const float4x4 t = transpose(u_load(128u)); const float l = length(asfloat(u[1]).ywxz); const float a = abs(asfloat(u[1]).ywxz.x); return; diff --git a/test/tint/buffer/uniform/std140/array/mat4x4_f32/to_fn.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat4x4_f32/to_fn.wgsl.expected.dxc.hlsl index c6389d9ebf..40c53b3ad9 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x4_f32/to_fn.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat4x4_f32/to_fn.wgsl.expected.dxc.hlsl @@ -14,20 +14,20 @@ void c(float4 v) { void d(float f_1) { } -float4x4 tint_symbol_1(uint4 buffer[16], uint offset) { +float4x4 u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]), asfloat(buffer[scalar_offset_3 / 4])); + return float4x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4]), asfloat(u[scalar_offset_2 / 4]), asfloat(u[scalar_offset_3 / 4])); } -typedef float4x4 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[16], uint offset) { +typedef float4x4 u_load_ret[4]; +u_load_ret u_load(uint offset) { float4x4 arr[4] = (float4x4[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 64u))); + arr[i] = u_load_1((offset + (i * 64u))); } } return arr; @@ -35,8 +35,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[16], uint offset) { [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); - b(tint_symbol_1(u, 64u)); + a(u_load(0u)); + b(u_load_1(64u)); c(asfloat(u[4]).ywxz); d(asfloat(u[4]).ywxz.x); return; diff --git a/test/tint/buffer/uniform/std140/array/mat4x4_f32/to_fn.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/array/mat4x4_f32/to_fn.wgsl.expected.fxc.hlsl index c6389d9ebf..40c53b3ad9 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x4_f32/to_fn.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat4x4_f32/to_fn.wgsl.expected.fxc.hlsl @@ -14,20 +14,20 @@ void c(float4 v) { void d(float f_1) { } -float4x4 tint_symbol_1(uint4 buffer[16], uint offset) { +float4x4 u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]), asfloat(buffer[scalar_offset_3 / 4])); + return float4x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4]), asfloat(u[scalar_offset_2 / 4]), asfloat(u[scalar_offset_3 / 4])); } -typedef float4x4 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[16], uint offset) { +typedef float4x4 u_load_ret[4]; +u_load_ret u_load(uint offset) { float4x4 arr[4] = (float4x4[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 64u))); + arr[i] = u_load_1((offset + (i * 64u))); } } return arr; @@ -35,8 +35,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[16], uint offset) { [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); - b(tint_symbol_1(u, 64u)); + a(u_load(0u)); + b(u_load_1(64u)); c(asfloat(u[4]).ywxz); d(asfloat(u[4]).ywxz.x); return; diff --git a/test/tint/buffer/uniform/std140/array/mat4x4_f32/to_private.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat4x4_f32/to_private.wgsl.expected.dxc.hlsl index faaf6bb23e..2d73f21a3f 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x4_f32/to_private.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat4x4_f32/to_private.wgsl.expected.dxc.hlsl @@ -3,20 +3,20 @@ cbuffer cbuffer_u : register(b0, space0) { }; static float4x4 p[4] = (float4x4[4])0; -float4x4 tint_symbol_1(uint4 buffer[16], uint offset) { +float4x4 u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]), asfloat(buffer[scalar_offset_3 / 4])); + return float4x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4]), asfloat(u[scalar_offset_2 / 4]), asfloat(u[scalar_offset_3 / 4])); } -typedef float4x4 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[16], uint offset) { +typedef float4x4 u_load_ret[4]; +u_load_ret u_load(uint offset) { float4x4 arr[4] = (float4x4[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 64u))); + arr[i] = u_load_1((offset + (i * 64u))); } } return arr; @@ -24,8 +24,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[16], uint offset) { [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); - p[1] = tint_symbol_1(u, 128u); + p = u_load(0u); + p[1] = u_load_1(128u); p[1][0] = asfloat(u[1]).ywxz; p[1][0].x = asfloat(u[1].x); return; diff --git a/test/tint/buffer/uniform/std140/array/mat4x4_f32/to_private.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/array/mat4x4_f32/to_private.wgsl.expected.fxc.hlsl index faaf6bb23e..2d73f21a3f 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x4_f32/to_private.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat4x4_f32/to_private.wgsl.expected.fxc.hlsl @@ -3,20 +3,20 @@ cbuffer cbuffer_u : register(b0, space0) { }; static float4x4 p[4] = (float4x4[4])0; -float4x4 tint_symbol_1(uint4 buffer[16], uint offset) { +float4x4 u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]), asfloat(buffer[scalar_offset_3 / 4])); + return float4x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4]), asfloat(u[scalar_offset_2 / 4]), asfloat(u[scalar_offset_3 / 4])); } -typedef float4x4 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[16], uint offset) { +typedef float4x4 u_load_ret[4]; +u_load_ret u_load(uint offset) { float4x4 arr[4] = (float4x4[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 64u))); + arr[i] = u_load_1((offset + (i * 64u))); } } return arr; @@ -24,8 +24,8 @@ tint_symbol_ret tint_symbol(uint4 buffer[16], uint offset) { [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); - p[1] = tint_symbol_1(u, 128u); + p = u_load(0u); + p[1] = u_load_1(128u); p[1][0] = asfloat(u[1]).ywxz; p[1][0].x = asfloat(u[1].x); return; diff --git a/test/tint/buffer/uniform/std140/array/mat4x4_f32/to_storage.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat4x4_f32/to_storage.wgsl.expected.dxc.hlsl index fce48272e7..b1685e1255 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x4_f32/to_storage.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat4x4_f32/to_storage.wgsl.expected.dxc.hlsl @@ -3,36 +3,36 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol_1(RWByteAddressBuffer buffer, uint offset, float4x4 value) { - buffer.Store4((offset + 0u), asuint(value[0u])); - buffer.Store4((offset + 16u), asuint(value[1u])); - buffer.Store4((offset + 32u), asuint(value[2u])); - buffer.Store4((offset + 48u), asuint(value[3u])); +void s_store_1(uint offset, float4x4 value) { + s.Store4((offset + 0u), asuint(value[0u])); + s.Store4((offset + 16u), asuint(value[1u])); + s.Store4((offset + 32u), asuint(value[2u])); + s.Store4((offset + 48u), asuint(value[3u])); } -void tint_symbol(RWByteAddressBuffer buffer, uint offset, float4x4 value[4]) { +void s_store(uint offset, float4x4 value[4]) { float4x4 array_1[4] = value; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - tint_symbol_1(buffer, (offset + (i * 64u)), array_1[i]); + s_store_1((offset + (i * 64u)), array_1[i]); } } } -float4x4 tint_symbol_4(uint4 buffer[16], uint offset) { +float4x4 u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]), asfloat(buffer[scalar_offset_3 / 4])); + return float4x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4]), asfloat(u[scalar_offset_2 / 4]), asfloat(u[scalar_offset_3 / 4])); } -typedef float4x4 tint_symbol_3_ret[4]; -tint_symbol_3_ret tint_symbol_3(uint4 buffer[16], uint offset) { +typedef float4x4 u_load_ret[4]; +u_load_ret u_load(uint offset) { float4x4 arr[4] = (float4x4[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_4(buffer, (offset + (i_1 * 64u))); + arr[i_1] = u_load_1((offset + (i_1 * 64u))); } } return arr; @@ -40,8 +40,8 @@ tint_symbol_3_ret tint_symbol_3(uint4 buffer[16], uint offset) { [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_3(u, 0u)); - tint_symbol_1(s, 64u, tint_symbol_4(u, 128u)); + s_store(0u, u_load(0u)); + s_store_1(64u, u_load_1(128u)); s.Store4(64u, asuint(asfloat(u[1]).ywxz)); s.Store(64u, asuint(asfloat(u[1].x))); return; diff --git a/test/tint/buffer/uniform/std140/array/mat4x4_f32/to_storage.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/array/mat4x4_f32/to_storage.wgsl.expected.fxc.hlsl index fce48272e7..b1685e1255 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x4_f32/to_storage.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat4x4_f32/to_storage.wgsl.expected.fxc.hlsl @@ -3,36 +3,36 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol_1(RWByteAddressBuffer buffer, uint offset, float4x4 value) { - buffer.Store4((offset + 0u), asuint(value[0u])); - buffer.Store4((offset + 16u), asuint(value[1u])); - buffer.Store4((offset + 32u), asuint(value[2u])); - buffer.Store4((offset + 48u), asuint(value[3u])); +void s_store_1(uint offset, float4x4 value) { + s.Store4((offset + 0u), asuint(value[0u])); + s.Store4((offset + 16u), asuint(value[1u])); + s.Store4((offset + 32u), asuint(value[2u])); + s.Store4((offset + 48u), asuint(value[3u])); } -void tint_symbol(RWByteAddressBuffer buffer, uint offset, float4x4 value[4]) { +void s_store(uint offset, float4x4 value[4]) { float4x4 array_1[4] = value; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - tint_symbol_1(buffer, (offset + (i * 64u)), array_1[i]); + s_store_1((offset + (i * 64u)), array_1[i]); } } } -float4x4 tint_symbol_4(uint4 buffer[16], uint offset) { +float4x4 u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]), asfloat(buffer[scalar_offset_3 / 4])); + return float4x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4]), asfloat(u[scalar_offset_2 / 4]), asfloat(u[scalar_offset_3 / 4])); } -typedef float4x4 tint_symbol_3_ret[4]; -tint_symbol_3_ret tint_symbol_3(uint4 buffer[16], uint offset) { +typedef float4x4 u_load_ret[4]; +u_load_ret u_load(uint offset) { float4x4 arr[4] = (float4x4[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_4(buffer, (offset + (i_1 * 64u))); + arr[i_1] = u_load_1((offset + (i_1 * 64u))); } } return arr; @@ -40,8 +40,8 @@ tint_symbol_3_ret tint_symbol_3(uint4 buffer[16], uint offset) { [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_3(u, 0u)); - tint_symbol_1(s, 64u, tint_symbol_4(u, 128u)); + s_store(0u, u_load(0u)); + s_store_1(64u, u_load_1(128u)); s.Store4(64u, asuint(asfloat(u[1]).ywxz)); s.Store(64u, asuint(asfloat(u[1].x))); return; diff --git a/test/tint/buffer/uniform/std140/array/mat4x4_f32/to_workgroup.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/array/mat4x4_f32/to_workgroup.wgsl.expected.dxc.hlsl index 312730ee42..6a62ead5c9 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x4_f32/to_workgroup.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat4x4_f32/to_workgroup.wgsl.expected.dxc.hlsl @@ -7,20 +7,20 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -float4x4 tint_symbol_3(uint4 buffer[16], uint offset) { +float4x4 u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]), asfloat(buffer[scalar_offset_3 / 4])); + return float4x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4]), asfloat(u[scalar_offset_2 / 4]), asfloat(u[scalar_offset_3 / 4])); } -typedef float4x4 tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[16], uint offset) { +typedef float4x4 u_load_ret[4]; +u_load_ret u_load(uint offset) { float4x4 arr[4] = (float4x4[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_3(buffer, (offset + (i_1 * 64u))); + arr[i_1] = u_load_1((offset + (i_1 * 64u))); } } return arr; @@ -34,8 +34,8 @@ void f_inner(uint local_invocation_index) { } } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); - w[1] = tint_symbol_3(u, 128u); + w = u_load(0u); + w[1] = u_load_1(128u); w[1][0] = asfloat(u[1]).ywxz; w[1][0].x = asfloat(u[1].x); } diff --git a/test/tint/buffer/uniform/std140/array/mat4x4_f32/to_workgroup.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/array/mat4x4_f32/to_workgroup.wgsl.expected.fxc.hlsl index 312730ee42..6a62ead5c9 100644 --- a/test/tint/buffer/uniform/std140/array/mat4x4_f32/to_workgroup.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/array/mat4x4_f32/to_workgroup.wgsl.expected.fxc.hlsl @@ -7,20 +7,20 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -float4x4 tint_symbol_3(uint4 buffer[16], uint offset) { +float4x4 u_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]), asfloat(buffer[scalar_offset_3 / 4])); + return float4x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4]), asfloat(u[scalar_offset_2 / 4]), asfloat(u[scalar_offset_3 / 4])); } -typedef float4x4 tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[16], uint offset) { +typedef float4x4 u_load_ret[4]; +u_load_ret u_load(uint offset) { float4x4 arr[4] = (float4x4[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_3(buffer, (offset + (i_1 * 64u))); + arr[i_1] = u_load_1((offset + (i_1 * 64u))); } } return arr; @@ -34,8 +34,8 @@ void f_inner(uint local_invocation_index) { } } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); - w[1] = tint_symbol_3(u, 128u); + w = u_load(0u); + w[1] = u_load_1(128u); w[1][0] = asfloat(u[1]).ywxz; w[1][0].x = asfloat(u[1].x); } diff --git a/test/tint/buffer/uniform/std140/struct/mat2x2_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat2x2_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl index 6fdfa270e3..11720b4d7e 100644 --- a/test/tint/buffer/uniform/std140/struct/mat2x2_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat2x2_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl @@ -15,41 +15,41 @@ int i() { return counter; } -matrix tint_symbol_8(uint4 buffer[64], uint offset) { +matrix a_load_4(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint ubo_load = buffer[scalar_offset / 4][scalar_offset % 4]; + uint ubo_load = a[scalar_offset / 4][scalar_offset % 4]; const uint scalar_offset_1 = ((offset + 4u)) / 4; - uint ubo_load_1 = buffer[scalar_offset_1 / 4][scalar_offset_1 % 4]; + uint ubo_load_1 = a[scalar_offset_1 / 4][scalar_offset_1 % 4]; return matrix(vector(float16_t(f16tof32(ubo_load & 0xFFFF)), float16_t(f16tof32(ubo_load >> 16))), vector(float16_t(f16tof32(ubo_load_1 & 0xFFFF)), float16_t(f16tof32(ubo_load_1 >> 16)))); } -Inner tint_symbol_7(uint4 buffer[64], uint offset) { - const Inner tint_symbol_11 = {tint_symbol_8(buffer, (offset + 0u))}; - return tint_symbol_11; +Inner a_load_3(uint offset) { + const Inner tint_symbol_4 = {a_load_4((offset + 0u))}; + return tint_symbol_4; } -typedef Inner tint_symbol_6_ret[4]; -tint_symbol_6_ret tint_symbol_6(uint4 buffer[64], uint offset) { +typedef Inner a_load_2_ret[4]; +a_load_2_ret a_load_2(uint offset) { Inner arr[4] = (Inner[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_7(buffer, (offset + (i_1 * 64u))); + arr[i_1] = a_load_3((offset + (i_1 * 64u))); } } return arr; } -Outer tint_symbol_5(uint4 buffer[64], uint offset) { - const Outer tint_symbol_12 = {tint_symbol_6(buffer, (offset + 0u))}; - return tint_symbol_12; +Outer a_load_1(uint offset) { + const Outer tint_symbol_5 = {a_load_2((offset + 0u))}; + return tint_symbol_5; } -typedef Outer tint_symbol_4_ret[4]; -tint_symbol_4_ret tint_symbol_4(uint4 buffer[64], uint offset) { +typedef Outer a_load_ret[4]; +a_load_ret a_load(uint offset) { Outer arr_1[4] = (Outer[4])0; { for(uint i_2 = 0u; (i_2 < 4u); i_2 = (i_2 + 1u)) { - arr_1[i_2] = tint_symbol_5(buffer, (offset + (i_2 * 256u))); + arr_1[i_2] = a_load_1((offset + (i_2 * 256u))); } } return arr_1; @@ -60,11 +60,11 @@ void f() { const int p_a_i_save = i(); const int p_a_i_a_i_save = i(); const int p_a_i_a_i_m_i_save = i(); - const Outer l_a[4] = tint_symbol_4(a, 0u); - const Outer l_a_i = tint_symbol_5(a, (256u * uint(p_a_i_save))); - const Inner l_a_i_a[4] = tint_symbol_6(a, (256u * uint(p_a_i_save))); - const Inner l_a_i_a_i = tint_symbol_7(a, ((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); - const matrix l_a_i_a_i_m = tint_symbol_8(a, ((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); + const Outer l_a[4] = a_load(0u); + const Outer l_a_i = a_load_1((256u * uint(p_a_i_save))); + const Inner l_a_i_a[4] = a_load_2((256u * uint(p_a_i_save))); + const Inner l_a_i_a_i = a_load_3(((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); + const matrix l_a_i_a_i_m = a_load_4(((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); const uint scalar_offset_2 = ((((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save))) + (4u * uint(p_a_i_a_i_m_i_save)))) / 4; uint ubo_load_2 = a[scalar_offset_2 / 4][scalar_offset_2 % 4]; const vector l_a_i_a_i_m_i = vector(float16_t(f16tof32(ubo_load_2 & 0xFFFF)), float16_t(f16tof32(ubo_load_2 >> 16))); diff --git a/test/tint/buffer/uniform/std140/struct/mat2x2_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat2x2_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl index fa6940dfb1..9bf3935064 100644 --- a/test/tint/buffer/uniform/std140/struct/mat2x2_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat2x2_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl @@ -9,41 +9,41 @@ cbuffer cbuffer_a : register(b0, space0) { uint4 a[64]; }; -matrix tint_symbol_4(uint4 buffer[64], uint offset) { +matrix a_load_4(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint ubo_load = buffer[scalar_offset / 4][scalar_offset % 4]; + uint ubo_load = a[scalar_offset / 4][scalar_offset % 4]; const uint scalar_offset_1 = ((offset + 4u)) / 4; - uint ubo_load_1 = buffer[scalar_offset_1 / 4][scalar_offset_1 % 4]; + uint ubo_load_1 = a[scalar_offset_1 / 4][scalar_offset_1 % 4]; return matrix(vector(float16_t(f16tof32(ubo_load & 0xFFFF)), float16_t(f16tof32(ubo_load >> 16))), vector(float16_t(f16tof32(ubo_load_1 & 0xFFFF)), float16_t(f16tof32(ubo_load_1 >> 16)))); } -Inner tint_symbol_3(uint4 buffer[64], uint offset) { - const Inner tint_symbol_7 = {tint_symbol_4(buffer, (offset + 0u))}; - return tint_symbol_7; +Inner a_load_3(uint offset) { + const Inner tint_symbol = {a_load_4((offset + 0u))}; + return tint_symbol; } -typedef Inner tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[64], uint offset) { +typedef Inner a_load_2_ret[4]; +a_load_2_ret a_load_2(uint offset) { Inner arr[4] = (Inner[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_3(buffer, (offset + (i * 64u))); + arr[i] = a_load_3((offset + (i * 64u))); } } return arr; } -Outer tint_symbol_1(uint4 buffer[64], uint offset) { - const Outer tint_symbol_8 = {tint_symbol_2(buffer, (offset + 0u))}; - return tint_symbol_8; +Outer a_load_1(uint offset) { + const Outer tint_symbol_1 = {a_load_2((offset + 0u))}; + return tint_symbol_1; } -typedef Outer tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[64], uint offset) { +typedef Outer a_load_ret[4]; +a_load_ret a_load(uint offset) { Outer arr_1[4] = (Outer[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr_1[i_1] = tint_symbol_1(buffer, (offset + (i_1 * 256u))); + arr_1[i_1] = a_load_1((offset + (i_1 * 256u))); } } return arr_1; @@ -51,11 +51,11 @@ tint_symbol_ret tint_symbol(uint4 buffer[64], uint offset) { [numthreads(1, 1, 1)] void f() { - const Outer l_a[4] = tint_symbol(a, 0u); - const Outer l_a_3 = tint_symbol_1(a, 768u); - const Inner l_a_3_a[4] = tint_symbol_2(a, 768u); - const Inner l_a_3_a_2 = tint_symbol_3(a, 896u); - const matrix l_a_3_a_2_m = tint_symbol_4(a, 896u); + const Outer l_a[4] = a_load(0u); + const Outer l_a_3 = a_load_1(768u); + const Inner l_a_3_a[4] = a_load_2(768u); + const Inner l_a_3_a_2 = a_load_3(896u); + const matrix l_a_3_a_2_m = a_load_4(896u); uint ubo_load_2 = a[56].y; const vector l_a_3_a_2_m_1 = vector(float16_t(f16tof32(ubo_load_2 & 0xFFFF)), float16_t(f16tof32(ubo_load_2 >> 16))); const float16_t l_a_3_a_2_m_1_0 = float16_t(f16tof32(((a[56].y) & 0xFFFF))); diff --git a/test/tint/buffer/uniform/std140/struct/mat2x2_f16/to_builtin.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat2x2_f16/to_builtin.wgsl.expected.dxc.hlsl index bb82c5d2a1..3035627043 100644 --- a/test/tint/buffer/uniform/std140/struct/mat2x2_f16/to_builtin.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat2x2_f16/to_builtin.wgsl.expected.dxc.hlsl @@ -2,17 +2,17 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[32]; }; -matrix tint_symbol(uint4 buffer[32], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint ubo_load = buffer[scalar_offset / 4][scalar_offset % 4]; + uint ubo_load = u[scalar_offset / 4][scalar_offset % 4]; const uint scalar_offset_1 = ((offset + 4u)) / 4; - uint ubo_load_1 = buffer[scalar_offset_1 / 4][scalar_offset_1 % 4]; + uint ubo_load_1 = u[scalar_offset_1 / 4][scalar_offset_1 % 4]; return matrix(vector(float16_t(f16tof32(ubo_load & 0xFFFF)), float16_t(f16tof32(ubo_load >> 16))), vector(float16_t(f16tof32(ubo_load_1 & 0xFFFF)), float16_t(f16tof32(ubo_load_1 >> 16)))); } [numthreads(1, 1, 1)] void f() { - const matrix t = transpose(tint_symbol(u, 260u)); + const matrix t = transpose(u_load(260u)); uint ubo_load_2 = u[0].z; const float16_t l = length(vector(float16_t(f16tof32(ubo_load_2 & 0xFFFF)), float16_t(f16tof32(ubo_load_2 >> 16))).yx); uint ubo_load_3 = u[0].z; diff --git a/test/tint/buffer/uniform/std140/struct/mat2x2_f16/to_fn.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat2x2_f16/to_fn.wgsl.expected.dxc.hlsl index 03670a0904..ed52fa7470 100644 --- a/test/tint/buffer/uniform/std140/struct/mat2x2_f16/to_fn.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat2x2_f16/to_fn.wgsl.expected.dxc.hlsl @@ -23,27 +23,27 @@ void d(vector v) { void e(float16_t f_1) { } -matrix tint_symbol_3(uint4 buffer[32], uint offset) { +matrix u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint ubo_load = buffer[scalar_offset / 4][scalar_offset % 4]; + uint ubo_load = u[scalar_offset / 4][scalar_offset % 4]; const uint scalar_offset_1 = ((offset + 4u)) / 4; - uint ubo_load_1 = buffer[scalar_offset_1 / 4][scalar_offset_1 % 4]; + uint ubo_load_1 = u[scalar_offset_1 / 4][scalar_offset_1 % 4]; return matrix(vector(float16_t(f16tof32(ubo_load & 0xFFFF)), float16_t(f16tof32(ubo_load >> 16))), vector(float16_t(f16tof32(ubo_load_1 & 0xFFFF)), float16_t(f16tof32(ubo_load_1 >> 16)))); } -S tint_symbol_1(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_2 = ((offset + 0u)) / 4; const uint scalar_offset_3 = ((offset + 64u)) / 4; - const S tint_symbol_5 = {asint(buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]), tint_symbol_3(buffer, (offset + 4u)), asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4])}; - return tint_symbol_5; + const S tint_symbol = {asint(u[scalar_offset_2 / 4][scalar_offset_2 % 4]), u_load_3((offset + 4u)), asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4])}; + return tint_symbol; } -typedef S tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 128u))); + arr[i] = u_load_1((offset + (i * 128u))); } } return arr; @@ -51,9 +51,9 @@ tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); - b(tint_symbol_1(u, 256u)); - c(tint_symbol_3(u, 260u)); + a(u_load(0u)); + b(u_load_1(256u)); + c(u_load_3(260u)); uint ubo_load_2 = u[0].z; d(vector(float16_t(f16tof32(ubo_load_2 & 0xFFFF)), float16_t(f16tof32(ubo_load_2 >> 16))).yx); uint ubo_load_3 = u[0].z; diff --git a/test/tint/buffer/uniform/std140/struct/mat2x2_f16/to_private.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat2x2_f16/to_private.wgsl.expected.dxc.hlsl index 5ff5a75113..2afb4e2552 100644 --- a/test/tint/buffer/uniform/std140/struct/mat2x2_f16/to_private.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat2x2_f16/to_private.wgsl.expected.dxc.hlsl @@ -9,27 +9,27 @@ cbuffer cbuffer_u : register(b0, space0) { }; static S p[4] = (S[4])0; -matrix tint_symbol_3(uint4 buffer[32], uint offset) { +matrix u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint ubo_load = buffer[scalar_offset / 4][scalar_offset % 4]; + uint ubo_load = u[scalar_offset / 4][scalar_offset % 4]; const uint scalar_offset_1 = ((offset + 4u)) / 4; - uint ubo_load_1 = buffer[scalar_offset_1 / 4][scalar_offset_1 % 4]; + uint ubo_load_1 = u[scalar_offset_1 / 4][scalar_offset_1 % 4]; return matrix(vector(float16_t(f16tof32(ubo_load & 0xFFFF)), float16_t(f16tof32(ubo_load >> 16))), vector(float16_t(f16tof32(ubo_load_1 & 0xFFFF)), float16_t(f16tof32(ubo_load_1 >> 16)))); } -S tint_symbol_1(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_2 = ((offset + 0u)) / 4; const uint scalar_offset_3 = ((offset + 64u)) / 4; - const S tint_symbol_5 = {asint(buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]), tint_symbol_3(buffer, (offset + 4u)), asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4])}; - return tint_symbol_5; + const S tint_symbol = {asint(u[scalar_offset_2 / 4][scalar_offset_2 % 4]), u_load_3((offset + 4u)), asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4])}; + return tint_symbol; } -typedef S tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 128u))); + arr[i] = u_load_1((offset + (i * 128u))); } } return arr; @@ -37,9 +37,9 @@ tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); - p[1] = tint_symbol_1(u, 256u); - p[3].m = tint_symbol_3(u, 260u); + p = u_load(0u); + p[1] = u_load_1(256u); + p[3].m = u_load_3(260u); uint ubo_load_2 = u[0].z; p[1].m[0] = vector(float16_t(f16tof32(ubo_load_2 & 0xFFFF)), float16_t(f16tof32(ubo_load_2 >> 16))).yx; return; diff --git a/test/tint/buffer/uniform/std140/struct/mat2x2_f16/to_storage.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat2x2_f16/to_storage.wgsl.expected.dxc.hlsl index c2951f1842..05f1e2f0a8 100644 --- a/test/tint/buffer/uniform/std140/struct/mat2x2_f16/to_storage.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat2x2_f16/to_storage.wgsl.expected.dxc.hlsl @@ -9,47 +9,47 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol_3(RWByteAddressBuffer buffer, uint offset, matrix value) { - buffer.Store >((offset + 0u), value[0u]); - buffer.Store >((offset + 4u), value[1u]); +void s_store_3(uint offset, matrix value) { + s.Store >((offset + 0u), value[0u]); + s.Store >((offset + 4u), value[1u]); } -void tint_symbol_1(RWByteAddressBuffer buffer, uint offset, S value) { - buffer.Store((offset + 0u), asuint(value.before)); - tint_symbol_3(buffer, (offset + 4u), value.m); - buffer.Store((offset + 64u), asuint(value.after)); +void s_store_1(uint offset, S value) { + s.Store((offset + 0u), asuint(value.before)); + s_store_3((offset + 4u), value.m); + s.Store((offset + 64u), asuint(value.after)); } -void tint_symbol(RWByteAddressBuffer buffer, uint offset, S value[4]) { +void s_store(uint offset, S value[4]) { S array_1[4] = value; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - tint_symbol_1(buffer, (offset + (i * 128u)), array_1[i]); + s_store_1((offset + (i * 128u)), array_1[i]); } } } -matrix tint_symbol_8(uint4 buffer[32], uint offset) { +matrix u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint ubo_load = buffer[scalar_offset / 4][scalar_offset % 4]; + uint ubo_load = u[scalar_offset / 4][scalar_offset % 4]; const uint scalar_offset_1 = ((offset + 4u)) / 4; - uint ubo_load_1 = buffer[scalar_offset_1 / 4][scalar_offset_1 % 4]; + uint ubo_load_1 = u[scalar_offset_1 / 4][scalar_offset_1 % 4]; return matrix(vector(float16_t(f16tof32(ubo_load & 0xFFFF)), float16_t(f16tof32(ubo_load >> 16))), vector(float16_t(f16tof32(ubo_load_1 & 0xFFFF)), float16_t(f16tof32(ubo_load_1 >> 16)))); } -S tint_symbol_6(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_2 = ((offset + 0u)) / 4; const uint scalar_offset_3 = ((offset + 64u)) / 4; - const S tint_symbol_10 = {asint(buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]), tint_symbol_8(buffer, (offset + 4u)), asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4])}; - return tint_symbol_10; + const S tint_symbol = {asint(u[scalar_offset_2 / 4][scalar_offset_2 % 4]), u_load_3((offset + 4u)), asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4])}; + return tint_symbol; } -typedef S tint_symbol_5_ret[4]; -tint_symbol_5_ret tint_symbol_5(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_6(buffer, (offset + (i_1 * 128u))); + arr[i_1] = u_load_1((offset + (i_1 * 128u))); } } return arr; @@ -57,9 +57,9 @@ tint_symbol_5_ret tint_symbol_5(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_5(u, 0u)); - tint_symbol_1(s, 128u, tint_symbol_6(u, 256u)); - tint_symbol_3(s, 388u, tint_symbol_8(u, 260u)); + s_store(0u, u_load(0u)); + s_store_1(128u, u_load_1(256u)); + s_store_3(388u, u_load_3(260u)); uint ubo_load_2 = u[0].z; s.Store >(132u, vector(float16_t(f16tof32(ubo_load_2 & 0xFFFF)), float16_t(f16tof32(ubo_load_2 >> 16))).yx); return; diff --git a/test/tint/buffer/uniform/std140/struct/mat2x2_f16/to_workgroup.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat2x2_f16/to_workgroup.wgsl.expected.dxc.hlsl index 15c8322512..44af793e38 100644 --- a/test/tint/buffer/uniform/std140/struct/mat2x2_f16/to_workgroup.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat2x2_f16/to_workgroup.wgsl.expected.dxc.hlsl @@ -13,27 +13,27 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -matrix tint_symbol_5(uint4 buffer[32], uint offset) { +matrix u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint ubo_load = buffer[scalar_offset / 4][scalar_offset % 4]; + uint ubo_load = u[scalar_offset / 4][scalar_offset % 4]; const uint scalar_offset_1 = ((offset + 4u)) / 4; - uint ubo_load_1 = buffer[scalar_offset_1 / 4][scalar_offset_1 % 4]; + uint ubo_load_1 = u[scalar_offset_1 / 4][scalar_offset_1 % 4]; return matrix(vector(float16_t(f16tof32(ubo_load & 0xFFFF)), float16_t(f16tof32(ubo_load >> 16))), vector(float16_t(f16tof32(ubo_load_1 & 0xFFFF)), float16_t(f16tof32(ubo_load_1 >> 16)))); } -S tint_symbol_3(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_2 = ((offset + 0u)) / 4; const uint scalar_offset_3 = ((offset + 64u)) / 4; - const S tint_symbol_8 = {asint(buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]), tint_symbol_5(buffer, (offset + 4u)), asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4])}; - return tint_symbol_8; + const S tint_symbol_3 = {asint(u[scalar_offset_2 / 4][scalar_offset_2 % 4]), u_load_3((offset + 4u)), asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4])}; + return tint_symbol_3; } -typedef S tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_3(buffer, (offset + (i_1 * 128u))); + arr[i_1] = u_load_1((offset + (i_1 * 128u))); } } return arr; @@ -43,14 +43,14 @@ void f_inner(uint local_invocation_index) { { for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) { const uint i = idx; - const S tint_symbol_7 = (S)0; - w[i] = tint_symbol_7; + const S tint_symbol_2 = (S)0; + w[i] = tint_symbol_2; } } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); - w[1] = tint_symbol_3(u, 256u); - w[3].m = tint_symbol_5(u, 260u); + w = u_load(0u); + w[1] = u_load_1(256u); + w[3].m = u_load_3(260u); uint ubo_load_2 = u[0].z; w[1].m[0] = vector(float16_t(f16tof32(ubo_load_2 & 0xFFFF)), float16_t(f16tof32(ubo_load_2 >> 16))).yx; } diff --git a/test/tint/buffer/uniform/std140/struct/mat2x2_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat2x2_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl index e08f4d5278..c20e4a76e6 100644 --- a/test/tint/buffer/uniform/std140/struct/mat2x2_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat2x2_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl @@ -15,41 +15,41 @@ int i() { return counter; } -float2x2 tint_symbol_8(uint4 buffer[64], uint offset) { +float2x2 a_load_4(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = a[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = a[scalar_offset_1 / 4]; return float2x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy))); } -Inner tint_symbol_7(uint4 buffer[64], uint offset) { - const Inner tint_symbol_11 = {tint_symbol_8(buffer, (offset + 0u))}; - return tint_symbol_11; +Inner a_load_3(uint offset) { + const Inner tint_symbol_4 = {a_load_4((offset + 0u))}; + return tint_symbol_4; } -typedef Inner tint_symbol_6_ret[4]; -tint_symbol_6_ret tint_symbol_6(uint4 buffer[64], uint offset) { +typedef Inner a_load_2_ret[4]; +a_load_2_ret a_load_2(uint offset) { Inner arr[4] = (Inner[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_7(buffer, (offset + (i_1 * 64u))); + arr[i_1] = a_load_3((offset + (i_1 * 64u))); } } return arr; } -Outer tint_symbol_5(uint4 buffer[64], uint offset) { - const Outer tint_symbol_12 = {tint_symbol_6(buffer, (offset + 0u))}; - return tint_symbol_12; +Outer a_load_1(uint offset) { + const Outer tint_symbol_5 = {a_load_2((offset + 0u))}; + return tint_symbol_5; } -typedef Outer tint_symbol_4_ret[4]; -tint_symbol_4_ret tint_symbol_4(uint4 buffer[64], uint offset) { +typedef Outer a_load_ret[4]; +a_load_ret a_load(uint offset) { Outer arr_1[4] = (Outer[4])0; { for(uint i_2 = 0u; (i_2 < 4u); i_2 = (i_2 + 1u)) { - arr_1[i_2] = tint_symbol_5(buffer, (offset + (i_2 * 256u))); + arr_1[i_2] = a_load_1((offset + (i_2 * 256u))); } } return arr_1; @@ -60,11 +60,11 @@ void f() { const int p_a_i_save = i(); const int p_a_i_a_i_save = i(); const int p_a_i_a_i_m_i_save = i(); - const Outer l_a[4] = tint_symbol_4(a, 0u); - const Outer l_a_i = tint_symbol_5(a, (256u * uint(p_a_i_save))); - const Inner l_a_i_a[4] = tint_symbol_6(a, (256u * uint(p_a_i_save))); - const Inner l_a_i_a_i = tint_symbol_7(a, ((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); - const float2x2 l_a_i_a_i_m = tint_symbol_8(a, ((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); + const Outer l_a[4] = a_load(0u); + const Outer l_a_i = a_load_1((256u * uint(p_a_i_save))); + const Inner l_a_i_a[4] = a_load_2((256u * uint(p_a_i_save))); + const Inner l_a_i_a_i = a_load_3(((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); + const float2x2 l_a_i_a_i_m = a_load_4(((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); const uint scalar_offset_2 = ((((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save))) + (8u * uint(p_a_i_a_i_m_i_save)))) / 4; uint4 ubo_load_2 = a[scalar_offset_2 / 4]; const float2 l_a_i_a_i_m_i = asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy)); diff --git a/test/tint/buffer/uniform/std140/struct/mat2x2_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat2x2_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl index e08f4d5278..c20e4a76e6 100644 --- a/test/tint/buffer/uniform/std140/struct/mat2x2_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat2x2_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl @@ -15,41 +15,41 @@ int i() { return counter; } -float2x2 tint_symbol_8(uint4 buffer[64], uint offset) { +float2x2 a_load_4(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = a[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = a[scalar_offset_1 / 4]; return float2x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy))); } -Inner tint_symbol_7(uint4 buffer[64], uint offset) { - const Inner tint_symbol_11 = {tint_symbol_8(buffer, (offset + 0u))}; - return tint_symbol_11; +Inner a_load_3(uint offset) { + const Inner tint_symbol_4 = {a_load_4((offset + 0u))}; + return tint_symbol_4; } -typedef Inner tint_symbol_6_ret[4]; -tint_symbol_6_ret tint_symbol_6(uint4 buffer[64], uint offset) { +typedef Inner a_load_2_ret[4]; +a_load_2_ret a_load_2(uint offset) { Inner arr[4] = (Inner[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_7(buffer, (offset + (i_1 * 64u))); + arr[i_1] = a_load_3((offset + (i_1 * 64u))); } } return arr; } -Outer tint_symbol_5(uint4 buffer[64], uint offset) { - const Outer tint_symbol_12 = {tint_symbol_6(buffer, (offset + 0u))}; - return tint_symbol_12; +Outer a_load_1(uint offset) { + const Outer tint_symbol_5 = {a_load_2((offset + 0u))}; + return tint_symbol_5; } -typedef Outer tint_symbol_4_ret[4]; -tint_symbol_4_ret tint_symbol_4(uint4 buffer[64], uint offset) { +typedef Outer a_load_ret[4]; +a_load_ret a_load(uint offset) { Outer arr_1[4] = (Outer[4])0; { for(uint i_2 = 0u; (i_2 < 4u); i_2 = (i_2 + 1u)) { - arr_1[i_2] = tint_symbol_5(buffer, (offset + (i_2 * 256u))); + arr_1[i_2] = a_load_1((offset + (i_2 * 256u))); } } return arr_1; @@ -60,11 +60,11 @@ void f() { const int p_a_i_save = i(); const int p_a_i_a_i_save = i(); const int p_a_i_a_i_m_i_save = i(); - const Outer l_a[4] = tint_symbol_4(a, 0u); - const Outer l_a_i = tint_symbol_5(a, (256u * uint(p_a_i_save))); - const Inner l_a_i_a[4] = tint_symbol_6(a, (256u * uint(p_a_i_save))); - const Inner l_a_i_a_i = tint_symbol_7(a, ((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); - const float2x2 l_a_i_a_i_m = tint_symbol_8(a, ((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); + const Outer l_a[4] = a_load(0u); + const Outer l_a_i = a_load_1((256u * uint(p_a_i_save))); + const Inner l_a_i_a[4] = a_load_2((256u * uint(p_a_i_save))); + const Inner l_a_i_a_i = a_load_3(((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); + const float2x2 l_a_i_a_i_m = a_load_4(((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); const uint scalar_offset_2 = ((((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save))) + (8u * uint(p_a_i_a_i_m_i_save)))) / 4; uint4 ubo_load_2 = a[scalar_offset_2 / 4]; const float2 l_a_i_a_i_m_i = asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy)); diff --git a/test/tint/buffer/uniform/std140/struct/mat2x2_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat2x2_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl index e732e8365b..4a66459e0d 100644 --- a/test/tint/buffer/uniform/std140/struct/mat2x2_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat2x2_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl @@ -9,41 +9,41 @@ cbuffer cbuffer_a : register(b0, space0) { uint4 a[64]; }; -float2x2 tint_symbol_4(uint4 buffer[64], uint offset) { +float2x2 a_load_4(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = a[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = a[scalar_offset_1 / 4]; return float2x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy))); } -Inner tint_symbol_3(uint4 buffer[64], uint offset) { - const Inner tint_symbol_7 = {tint_symbol_4(buffer, (offset + 0u))}; - return tint_symbol_7; +Inner a_load_3(uint offset) { + const Inner tint_symbol = {a_load_4((offset + 0u))}; + return tint_symbol; } -typedef Inner tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[64], uint offset) { +typedef Inner a_load_2_ret[4]; +a_load_2_ret a_load_2(uint offset) { Inner arr[4] = (Inner[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_3(buffer, (offset + (i * 64u))); + arr[i] = a_load_3((offset + (i * 64u))); } } return arr; } -Outer tint_symbol_1(uint4 buffer[64], uint offset) { - const Outer tint_symbol_8 = {tint_symbol_2(buffer, (offset + 0u))}; - return tint_symbol_8; +Outer a_load_1(uint offset) { + const Outer tint_symbol_1 = {a_load_2((offset + 0u))}; + return tint_symbol_1; } -typedef Outer tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[64], uint offset) { +typedef Outer a_load_ret[4]; +a_load_ret a_load(uint offset) { Outer arr_1[4] = (Outer[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr_1[i_1] = tint_symbol_1(buffer, (offset + (i_1 * 256u))); + arr_1[i_1] = a_load_1((offset + (i_1 * 256u))); } } return arr_1; @@ -51,11 +51,11 @@ tint_symbol_ret tint_symbol(uint4 buffer[64], uint offset) { [numthreads(1, 1, 1)] void f() { - const Outer l_a[4] = tint_symbol(a, 0u); - const Outer l_a_3 = tint_symbol_1(a, 768u); - const Inner l_a_3_a[4] = tint_symbol_2(a, 768u); - const Inner l_a_3_a_2 = tint_symbol_3(a, 896u); - const float2x2 l_a_3_a_2_m = tint_symbol_4(a, 896u); + const Outer l_a[4] = a_load(0u); + const Outer l_a_3 = a_load_1(768u); + const Inner l_a_3_a[4] = a_load_2(768u); + const Inner l_a_3_a_2 = a_load_3(896u); + const float2x2 l_a_3_a_2_m = a_load_4(896u); const float2 l_a_3_a_2_m_1 = asfloat(a[56].zw); const float l_a_3_a_2_m_1_0 = asfloat(a[56].z); return; diff --git a/test/tint/buffer/uniform/std140/struct/mat2x2_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat2x2_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl index e732e8365b..4a66459e0d 100644 --- a/test/tint/buffer/uniform/std140/struct/mat2x2_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat2x2_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl @@ -9,41 +9,41 @@ cbuffer cbuffer_a : register(b0, space0) { uint4 a[64]; }; -float2x2 tint_symbol_4(uint4 buffer[64], uint offset) { +float2x2 a_load_4(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = a[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = a[scalar_offset_1 / 4]; return float2x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy))); } -Inner tint_symbol_3(uint4 buffer[64], uint offset) { - const Inner tint_symbol_7 = {tint_symbol_4(buffer, (offset + 0u))}; - return tint_symbol_7; +Inner a_load_3(uint offset) { + const Inner tint_symbol = {a_load_4((offset + 0u))}; + return tint_symbol; } -typedef Inner tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[64], uint offset) { +typedef Inner a_load_2_ret[4]; +a_load_2_ret a_load_2(uint offset) { Inner arr[4] = (Inner[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_3(buffer, (offset + (i * 64u))); + arr[i] = a_load_3((offset + (i * 64u))); } } return arr; } -Outer tint_symbol_1(uint4 buffer[64], uint offset) { - const Outer tint_symbol_8 = {tint_symbol_2(buffer, (offset + 0u))}; - return tint_symbol_8; +Outer a_load_1(uint offset) { + const Outer tint_symbol_1 = {a_load_2((offset + 0u))}; + return tint_symbol_1; } -typedef Outer tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[64], uint offset) { +typedef Outer a_load_ret[4]; +a_load_ret a_load(uint offset) { Outer arr_1[4] = (Outer[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr_1[i_1] = tint_symbol_1(buffer, (offset + (i_1 * 256u))); + arr_1[i_1] = a_load_1((offset + (i_1 * 256u))); } } return arr_1; @@ -51,11 +51,11 @@ tint_symbol_ret tint_symbol(uint4 buffer[64], uint offset) { [numthreads(1, 1, 1)] void f() { - const Outer l_a[4] = tint_symbol(a, 0u); - const Outer l_a_3 = tint_symbol_1(a, 768u); - const Inner l_a_3_a[4] = tint_symbol_2(a, 768u); - const Inner l_a_3_a_2 = tint_symbol_3(a, 896u); - const float2x2 l_a_3_a_2_m = tint_symbol_4(a, 896u); + const Outer l_a[4] = a_load(0u); + const Outer l_a_3 = a_load_1(768u); + const Inner l_a_3_a[4] = a_load_2(768u); + const Inner l_a_3_a_2 = a_load_3(896u); + const float2x2 l_a_3_a_2_m = a_load_4(896u); const float2 l_a_3_a_2_m_1 = asfloat(a[56].zw); const float l_a_3_a_2_m_1_0 = asfloat(a[56].z); return; diff --git a/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_builtin.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_builtin.wgsl.expected.dxc.hlsl index a6813b0972..8a0a271f9c 100644 --- a/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_builtin.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_builtin.wgsl.expected.dxc.hlsl @@ -2,17 +2,17 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[32]; }; -float2x2 tint_symbol(uint4 buffer[32], uint offset) { +float2x2 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; return float2x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy))); } [numthreads(1, 1, 1)] void f() { - const float2x2 t = transpose(tint_symbol(u, 264u)); + const float2x2 t = transpose(u_load(264u)); const float l = length(asfloat(u[1].xy).yx); const float a = abs(asfloat(u[1].xy).yx.x); return; diff --git a/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_builtin.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_builtin.wgsl.expected.fxc.hlsl index a6813b0972..8a0a271f9c 100644 --- a/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_builtin.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_builtin.wgsl.expected.fxc.hlsl @@ -2,17 +2,17 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[32]; }; -float2x2 tint_symbol(uint4 buffer[32], uint offset) { +float2x2 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; return float2x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy))); } [numthreads(1, 1, 1)] void f() { - const float2x2 t = transpose(tint_symbol(u, 264u)); + const float2x2 t = transpose(u_load(264u)); const float l = length(asfloat(u[1].xy).yx); const float a = abs(asfloat(u[1].xy).yx.x); return; diff --git a/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_fn.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_fn.wgsl.expected.dxc.hlsl index e8f7c79256..c5f6fd4c5a 100644 --- a/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_fn.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_fn.wgsl.expected.dxc.hlsl @@ -23,27 +23,27 @@ void d(float2 v) { void e(float f_1) { } -float2x2 tint_symbol_3(uint4 buffer[32], uint offset) { +float2x2 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; return float2x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy))); } -S tint_symbol_1(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_2 = ((offset + 0u)) / 4; const uint scalar_offset_3 = ((offset + 64u)) / 4; - const S tint_symbol_5 = {asint(buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]), tint_symbol_3(buffer, (offset + 8u)), asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4])}; - return tint_symbol_5; + const S tint_symbol = {asint(u[scalar_offset_2 / 4][scalar_offset_2 % 4]), u_load_3((offset + 8u)), asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4])}; + return tint_symbol; } -typedef S tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 128u))); + arr[i] = u_load_1((offset + (i * 128u))); } } return arr; @@ -51,9 +51,9 @@ tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); - b(tint_symbol_1(u, 256u)); - c(tint_symbol_3(u, 264u)); + a(u_load(0u)); + b(u_load_1(256u)); + c(u_load_3(264u)); d(asfloat(u[1].xy).yx); e(asfloat(u[1].xy).yx.x); return; diff --git a/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_fn.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_fn.wgsl.expected.fxc.hlsl index e8f7c79256..c5f6fd4c5a 100644 --- a/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_fn.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_fn.wgsl.expected.fxc.hlsl @@ -23,27 +23,27 @@ void d(float2 v) { void e(float f_1) { } -float2x2 tint_symbol_3(uint4 buffer[32], uint offset) { +float2x2 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; return float2x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy))); } -S tint_symbol_1(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_2 = ((offset + 0u)) / 4; const uint scalar_offset_3 = ((offset + 64u)) / 4; - const S tint_symbol_5 = {asint(buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]), tint_symbol_3(buffer, (offset + 8u)), asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4])}; - return tint_symbol_5; + const S tint_symbol = {asint(u[scalar_offset_2 / 4][scalar_offset_2 % 4]), u_load_3((offset + 8u)), asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4])}; + return tint_symbol; } -typedef S tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 128u))); + arr[i] = u_load_1((offset + (i * 128u))); } } return arr; @@ -51,9 +51,9 @@ tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); - b(tint_symbol_1(u, 256u)); - c(tint_symbol_3(u, 264u)); + a(u_load(0u)); + b(u_load_1(256u)); + c(u_load_3(264u)); d(asfloat(u[1].xy).yx); e(asfloat(u[1].xy).yx.x); return; diff --git a/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_private.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_private.wgsl.expected.dxc.hlsl index be509ec478..f36adfe2bd 100644 --- a/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_private.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_private.wgsl.expected.dxc.hlsl @@ -9,27 +9,27 @@ cbuffer cbuffer_u : register(b0, space0) { }; static S p[4] = (S[4])0; -float2x2 tint_symbol_3(uint4 buffer[32], uint offset) { +float2x2 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; return float2x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy))); } -S tint_symbol_1(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_2 = ((offset + 0u)) / 4; const uint scalar_offset_3 = ((offset + 64u)) / 4; - const S tint_symbol_5 = {asint(buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]), tint_symbol_3(buffer, (offset + 8u)), asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4])}; - return tint_symbol_5; + const S tint_symbol = {asint(u[scalar_offset_2 / 4][scalar_offset_2 % 4]), u_load_3((offset + 8u)), asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4])}; + return tint_symbol; } -typedef S tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 128u))); + arr[i] = u_load_1((offset + (i * 128u))); } } return arr; @@ -37,9 +37,9 @@ tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); - p[1] = tint_symbol_1(u, 256u); - p[3].m = tint_symbol_3(u, 264u); + p = u_load(0u); + p[1] = u_load_1(256u); + p[3].m = u_load_3(264u); p[1].m[0] = asfloat(u[1].xy).yx; return; } diff --git a/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_private.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_private.wgsl.expected.fxc.hlsl index be509ec478..f36adfe2bd 100644 --- a/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_private.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_private.wgsl.expected.fxc.hlsl @@ -9,27 +9,27 @@ cbuffer cbuffer_u : register(b0, space0) { }; static S p[4] = (S[4])0; -float2x2 tint_symbol_3(uint4 buffer[32], uint offset) { +float2x2 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; return float2x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy))); } -S tint_symbol_1(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_2 = ((offset + 0u)) / 4; const uint scalar_offset_3 = ((offset + 64u)) / 4; - const S tint_symbol_5 = {asint(buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]), tint_symbol_3(buffer, (offset + 8u)), asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4])}; - return tint_symbol_5; + const S tint_symbol = {asint(u[scalar_offset_2 / 4][scalar_offset_2 % 4]), u_load_3((offset + 8u)), asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4])}; + return tint_symbol; } -typedef S tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 128u))); + arr[i] = u_load_1((offset + (i * 128u))); } } return arr; @@ -37,9 +37,9 @@ tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); - p[1] = tint_symbol_1(u, 256u); - p[3].m = tint_symbol_3(u, 264u); + p = u_load(0u); + p[1] = u_load_1(256u); + p[3].m = u_load_3(264u); p[1].m[0] = asfloat(u[1].xy).yx; return; } diff --git a/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_storage.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_storage.wgsl.expected.dxc.hlsl index de4e9791ec..d088b6aefc 100644 --- a/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_storage.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_storage.wgsl.expected.dxc.hlsl @@ -9,47 +9,47 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol_3(RWByteAddressBuffer buffer, uint offset, float2x2 value) { - buffer.Store2((offset + 0u), asuint(value[0u])); - buffer.Store2((offset + 8u), asuint(value[1u])); +void s_store_3(uint offset, float2x2 value) { + s.Store2((offset + 0u), asuint(value[0u])); + s.Store2((offset + 8u), asuint(value[1u])); } -void tint_symbol_1(RWByteAddressBuffer buffer, uint offset, S value) { - buffer.Store((offset + 0u), asuint(value.before)); - tint_symbol_3(buffer, (offset + 8u), value.m); - buffer.Store((offset + 64u), asuint(value.after)); +void s_store_1(uint offset, S value) { + s.Store((offset + 0u), asuint(value.before)); + s_store_3((offset + 8u), value.m); + s.Store((offset + 64u), asuint(value.after)); } -void tint_symbol(RWByteAddressBuffer buffer, uint offset, S value[4]) { +void s_store(uint offset, S value[4]) { S array_1[4] = value; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - tint_symbol_1(buffer, (offset + (i * 128u)), array_1[i]); + s_store_1((offset + (i * 128u)), array_1[i]); } } } -float2x2 tint_symbol_8(uint4 buffer[32], uint offset) { +float2x2 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; return float2x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy))); } -S tint_symbol_6(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_2 = ((offset + 0u)) / 4; const uint scalar_offset_3 = ((offset + 64u)) / 4; - const S tint_symbol_10 = {asint(buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]), tint_symbol_8(buffer, (offset + 8u)), asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4])}; - return tint_symbol_10; + const S tint_symbol = {asint(u[scalar_offset_2 / 4][scalar_offset_2 % 4]), u_load_3((offset + 8u)), asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4])}; + return tint_symbol; } -typedef S tint_symbol_5_ret[4]; -tint_symbol_5_ret tint_symbol_5(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_6(buffer, (offset + (i_1 * 128u))); + arr[i_1] = u_load_1((offset + (i_1 * 128u))); } } return arr; @@ -57,9 +57,9 @@ tint_symbol_5_ret tint_symbol_5(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_5(u, 0u)); - tint_symbol_1(s, 128u, tint_symbol_6(u, 256u)); - tint_symbol_3(s, 392u, tint_symbol_8(u, 264u)); + s_store(0u, u_load(0u)); + s_store_1(128u, u_load_1(256u)); + s_store_3(392u, u_load_3(264u)); s.Store2(136u, asuint(asfloat(u[1].xy).yx)); return; } diff --git a/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_storage.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_storage.wgsl.expected.fxc.hlsl index de4e9791ec..d088b6aefc 100644 --- a/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_storage.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_storage.wgsl.expected.fxc.hlsl @@ -9,47 +9,47 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol_3(RWByteAddressBuffer buffer, uint offset, float2x2 value) { - buffer.Store2((offset + 0u), asuint(value[0u])); - buffer.Store2((offset + 8u), asuint(value[1u])); +void s_store_3(uint offset, float2x2 value) { + s.Store2((offset + 0u), asuint(value[0u])); + s.Store2((offset + 8u), asuint(value[1u])); } -void tint_symbol_1(RWByteAddressBuffer buffer, uint offset, S value) { - buffer.Store((offset + 0u), asuint(value.before)); - tint_symbol_3(buffer, (offset + 8u), value.m); - buffer.Store((offset + 64u), asuint(value.after)); +void s_store_1(uint offset, S value) { + s.Store((offset + 0u), asuint(value.before)); + s_store_3((offset + 8u), value.m); + s.Store((offset + 64u), asuint(value.after)); } -void tint_symbol(RWByteAddressBuffer buffer, uint offset, S value[4]) { +void s_store(uint offset, S value[4]) { S array_1[4] = value; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - tint_symbol_1(buffer, (offset + (i * 128u)), array_1[i]); + s_store_1((offset + (i * 128u)), array_1[i]); } } } -float2x2 tint_symbol_8(uint4 buffer[32], uint offset) { +float2x2 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; return float2x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy))); } -S tint_symbol_6(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_2 = ((offset + 0u)) / 4; const uint scalar_offset_3 = ((offset + 64u)) / 4; - const S tint_symbol_10 = {asint(buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]), tint_symbol_8(buffer, (offset + 8u)), asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4])}; - return tint_symbol_10; + const S tint_symbol = {asint(u[scalar_offset_2 / 4][scalar_offset_2 % 4]), u_load_3((offset + 8u)), asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4])}; + return tint_symbol; } -typedef S tint_symbol_5_ret[4]; -tint_symbol_5_ret tint_symbol_5(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_6(buffer, (offset + (i_1 * 128u))); + arr[i_1] = u_load_1((offset + (i_1 * 128u))); } } return arr; @@ -57,9 +57,9 @@ tint_symbol_5_ret tint_symbol_5(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_5(u, 0u)); - tint_symbol_1(s, 128u, tint_symbol_6(u, 256u)); - tint_symbol_3(s, 392u, tint_symbol_8(u, 264u)); + s_store(0u, u_load(0u)); + s_store_1(128u, u_load_1(256u)); + s_store_3(392u, u_load_3(264u)); s.Store2(136u, asuint(asfloat(u[1].xy).yx)); return; } diff --git a/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_workgroup.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_workgroup.wgsl.expected.dxc.hlsl index c0c70b35d6..16e1a76cab 100644 --- a/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_workgroup.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_workgroup.wgsl.expected.dxc.hlsl @@ -13,27 +13,27 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -float2x2 tint_symbol_5(uint4 buffer[32], uint offset) { +float2x2 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; return float2x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy))); } -S tint_symbol_3(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_2 = ((offset + 0u)) / 4; const uint scalar_offset_3 = ((offset + 64u)) / 4; - const S tint_symbol_8 = {asint(buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]), tint_symbol_5(buffer, (offset + 8u)), asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4])}; - return tint_symbol_8; + const S tint_symbol_3 = {asint(u[scalar_offset_2 / 4][scalar_offset_2 % 4]), u_load_3((offset + 8u)), asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4])}; + return tint_symbol_3; } -typedef S tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_3(buffer, (offset + (i_1 * 128u))); + arr[i_1] = u_load_1((offset + (i_1 * 128u))); } } return arr; @@ -43,14 +43,14 @@ void f_inner(uint local_invocation_index) { { for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) { const uint i = idx; - const S tint_symbol_7 = (S)0; - w[i] = tint_symbol_7; + const S tint_symbol_2 = (S)0; + w[i] = tint_symbol_2; } } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); - w[1] = tint_symbol_3(u, 256u); - w[3].m = tint_symbol_5(u, 264u); + w = u_load(0u); + w[1] = u_load_1(256u); + w[3].m = u_load_3(264u); w[1].m[0] = asfloat(u[1].xy).yx; } diff --git a/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_workgroup.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_workgroup.wgsl.expected.fxc.hlsl index c0c70b35d6..16e1a76cab 100644 --- a/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_workgroup.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat2x2_f32/to_workgroup.wgsl.expected.fxc.hlsl @@ -13,27 +13,27 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -float2x2 tint_symbol_5(uint4 buffer[32], uint offset) { +float2x2 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; return float2x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy))); } -S tint_symbol_3(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_2 = ((offset + 0u)) / 4; const uint scalar_offset_3 = ((offset + 64u)) / 4; - const S tint_symbol_8 = {asint(buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]), tint_symbol_5(buffer, (offset + 8u)), asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4])}; - return tint_symbol_8; + const S tint_symbol_3 = {asint(u[scalar_offset_2 / 4][scalar_offset_2 % 4]), u_load_3((offset + 8u)), asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4])}; + return tint_symbol_3; } -typedef S tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_3(buffer, (offset + (i_1 * 128u))); + arr[i_1] = u_load_1((offset + (i_1 * 128u))); } } return arr; @@ -43,14 +43,14 @@ void f_inner(uint local_invocation_index) { { for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) { const uint i = idx; - const S tint_symbol_7 = (S)0; - w[i] = tint_symbol_7; + const S tint_symbol_2 = (S)0; + w[i] = tint_symbol_2; } } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); - w[1] = tint_symbol_3(u, 256u); - w[3].m = tint_symbol_5(u, 264u); + w = u_load(0u); + w[1] = u_load_1(256u); + w[3].m = u_load_3(264u); w[1].m[0] = asfloat(u[1].xy).yx; } diff --git a/test/tint/buffer/uniform/std140/struct/mat2x3_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat2x3_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl index 63633dce2d..e4d8e56f37 100644 --- a/test/tint/buffer/uniform/std140/struct/mat2x3_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat2x3_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl @@ -15,47 +15,47 @@ int i() { return counter; } -matrix tint_symbol_8(uint4 buffer[64], uint offset) { +matrix a_load_4(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = a[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = a[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); return matrix(vector(ubo_load_xz[0], ubo_load_y, ubo_load_xz[1]), vector(ubo_load_2_xz[0], ubo_load_2_y, ubo_load_2_xz[1])); } -Inner tint_symbol_7(uint4 buffer[64], uint offset) { - const Inner tint_symbol_11 = {tint_symbol_8(buffer, (offset + 0u))}; - return tint_symbol_11; +Inner a_load_3(uint offset) { + const Inner tint_symbol_4 = {a_load_4((offset + 0u))}; + return tint_symbol_4; } -typedef Inner tint_symbol_6_ret[4]; -tint_symbol_6_ret tint_symbol_6(uint4 buffer[64], uint offset) { +typedef Inner a_load_2_ret[4]; +a_load_2_ret a_load_2(uint offset) { Inner arr[4] = (Inner[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_7(buffer, (offset + (i_1 * 64u))); + arr[i_1] = a_load_3((offset + (i_1 * 64u))); } } return arr; } -Outer tint_symbol_5(uint4 buffer[64], uint offset) { - const Outer tint_symbol_12 = {tint_symbol_6(buffer, (offset + 0u))}; - return tint_symbol_12; +Outer a_load_1(uint offset) { + const Outer tint_symbol_5 = {a_load_2((offset + 0u))}; + return tint_symbol_5; } -typedef Outer tint_symbol_4_ret[4]; -tint_symbol_4_ret tint_symbol_4(uint4 buffer[64], uint offset) { +typedef Outer a_load_ret[4]; +a_load_ret a_load(uint offset) { Outer arr_1[4] = (Outer[4])0; { for(uint i_2 = 0u; (i_2 < 4u); i_2 = (i_2 + 1u)) { - arr_1[i_2] = tint_symbol_5(buffer, (offset + (i_2 * 256u))); + arr_1[i_2] = a_load_1((offset + (i_2 * 256u))); } } return arr_1; @@ -66,11 +66,11 @@ void f() { const int p_a_i_save = i(); const int p_a_i_a_i_save = i(); const int p_a_i_a_i_m_i_save = i(); - const Outer l_a[4] = tint_symbol_4(a, 0u); - const Outer l_a_i = tint_symbol_5(a, (256u * uint(p_a_i_save))); - const Inner l_a_i_a[4] = tint_symbol_6(a, (256u * uint(p_a_i_save))); - const Inner l_a_i_a_i = tint_symbol_7(a, ((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); - const matrix l_a_i_a_i_m = tint_symbol_8(a, ((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); + const Outer l_a[4] = a_load(0u); + const Outer l_a_i = a_load_1((256u * uint(p_a_i_save))); + const Inner l_a_i_a[4] = a_load_2((256u * uint(p_a_i_save))); + const Inner l_a_i_a_i = a_load_3(((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); + const matrix l_a_i_a_i_m = a_load_4(((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); const uint scalar_offset_2 = ((((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save))) + (8u * uint(p_a_i_a_i_m_i_save)))) / 4; uint4 ubo_load_5 = a[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); diff --git a/test/tint/buffer/uniform/std140/struct/mat2x3_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat2x3_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl index eca3eed886..703862f467 100644 --- a/test/tint/buffer/uniform/std140/struct/mat2x3_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat2x3_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl @@ -9,47 +9,47 @@ cbuffer cbuffer_a : register(b0, space0) { uint4 a[64]; }; -matrix tint_symbol_4(uint4 buffer[64], uint offset) { +matrix a_load_4(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = a[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = a[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); return matrix(vector(ubo_load_xz[0], ubo_load_y, ubo_load_xz[1]), vector(ubo_load_2_xz[0], ubo_load_2_y, ubo_load_2_xz[1])); } -Inner tint_symbol_3(uint4 buffer[64], uint offset) { - const Inner tint_symbol_7 = {tint_symbol_4(buffer, (offset + 0u))}; - return tint_symbol_7; +Inner a_load_3(uint offset) { + const Inner tint_symbol = {a_load_4((offset + 0u))}; + return tint_symbol; } -typedef Inner tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[64], uint offset) { +typedef Inner a_load_2_ret[4]; +a_load_2_ret a_load_2(uint offset) { Inner arr[4] = (Inner[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_3(buffer, (offset + (i * 64u))); + arr[i] = a_load_3((offset + (i * 64u))); } } return arr; } -Outer tint_symbol_1(uint4 buffer[64], uint offset) { - const Outer tint_symbol_8 = {tint_symbol_2(buffer, (offset + 0u))}; - return tint_symbol_8; +Outer a_load_1(uint offset) { + const Outer tint_symbol_1 = {a_load_2((offset + 0u))}; + return tint_symbol_1; } -typedef Outer tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[64], uint offset) { +typedef Outer a_load_ret[4]; +a_load_ret a_load(uint offset) { Outer arr_1[4] = (Outer[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr_1[i_1] = tint_symbol_1(buffer, (offset + (i_1 * 256u))); + arr_1[i_1] = a_load_1((offset + (i_1 * 256u))); } } return arr_1; @@ -57,11 +57,11 @@ tint_symbol_ret tint_symbol(uint4 buffer[64], uint offset) { [numthreads(1, 1, 1)] void f() { - const Outer l_a[4] = tint_symbol(a, 0u); - const Outer l_a_3 = tint_symbol_1(a, 768u); - const Inner l_a_3_a[4] = tint_symbol_2(a, 768u); - const Inner l_a_3_a_2 = tint_symbol_3(a, 896u); - const matrix l_a_3_a_2_m = tint_symbol_4(a, 896u); + const Outer l_a[4] = a_load(0u); + const Outer l_a_3 = a_load_1(768u); + const Inner l_a_3_a[4] = a_load_2(768u); + const Inner l_a_3_a_2 = a_load_3(896u); + const matrix l_a_3_a_2_m = a_load_4(896u); uint2 ubo_load_4 = a[56].zw; vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); float16_t ubo_load_4_y = f16tof32(ubo_load_4[0] >> 16); diff --git a/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_builtin.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_builtin.wgsl.expected.dxc.hlsl index fbcd74ffc9..735d0bb2c4 100644 --- a/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_builtin.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_builtin.wgsl.expected.dxc.hlsl @@ -2,14 +2,14 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[32]; }; -matrix tint_symbol(uint4 buffer[32], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); @@ -18,7 +18,7 @@ matrix tint_symbol(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - const matrix t = transpose(tint_symbol(u, 264u)); + const matrix t = transpose(u_load(264u)); uint2 ubo_load_4 = u[1].xy; vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); float16_t ubo_load_4_y = f16tof32(ubo_load_4[0] >> 16); diff --git a/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_fn.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_fn.wgsl.expected.dxc.hlsl index 0e799ce694..753c0b5346 100644 --- a/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_fn.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_fn.wgsl.expected.dxc.hlsl @@ -23,33 +23,33 @@ void d(vector v) { void e(float16_t f_1) { } -matrix tint_symbol_3(uint4 buffer[32], uint offset) { +matrix u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); return matrix(vector(ubo_load_xz[0], ubo_load_y, ubo_load_xz[1]), vector(ubo_load_2_xz[0], ubo_load_2_y, ubo_load_2_xz[1])); } -S tint_symbol_1(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_2 = ((offset + 0u)) / 4; const uint scalar_offset_3 = ((offset + 64u)) / 4; - const S tint_symbol_5 = {asint(buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]), tint_symbol_3(buffer, (offset + 8u)), asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4])}; - return tint_symbol_5; + const S tint_symbol = {asint(u[scalar_offset_2 / 4][scalar_offset_2 % 4]), u_load_3((offset + 8u)), asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4])}; + return tint_symbol; } -typedef S tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 128u))); + arr[i] = u_load_1((offset + (i * 128u))); } } return arr; @@ -57,9 +57,9 @@ tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); - b(tint_symbol_1(u, 256u)); - c(tint_symbol_3(u, 264u)); + a(u_load(0u)); + b(u_load_1(256u)); + c(u_load_3(264u)); uint2 ubo_load_4 = u[1].xy; vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); float16_t ubo_load_4_y = f16tof32(ubo_load_4[0] >> 16); diff --git a/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_private.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_private.wgsl.expected.dxc.hlsl index 918efe0473..42e3393062 100644 --- a/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_private.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_private.wgsl.expected.dxc.hlsl @@ -9,33 +9,33 @@ cbuffer cbuffer_u : register(b0, space0) { }; static S p[4] = (S[4])0; -matrix tint_symbol_3(uint4 buffer[32], uint offset) { +matrix u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); return matrix(vector(ubo_load_xz[0], ubo_load_y, ubo_load_xz[1]), vector(ubo_load_2_xz[0], ubo_load_2_y, ubo_load_2_xz[1])); } -S tint_symbol_1(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_2 = ((offset + 0u)) / 4; const uint scalar_offset_3 = ((offset + 64u)) / 4; - const S tint_symbol_5 = {asint(buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]), tint_symbol_3(buffer, (offset + 8u)), asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4])}; - return tint_symbol_5; + const S tint_symbol = {asint(u[scalar_offset_2 / 4][scalar_offset_2 % 4]), u_load_3((offset + 8u)), asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4])}; + return tint_symbol; } -typedef S tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 128u))); + arr[i] = u_load_1((offset + (i * 128u))); } } return arr; @@ -43,9 +43,9 @@ tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); - p[1] = tint_symbol_1(u, 256u); - p[3].m = tint_symbol_3(u, 264u); + p = u_load(0u); + p[1] = u_load_1(256u); + p[3].m = u_load_3(264u); uint2 ubo_load_4 = u[1].xy; vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); float16_t ubo_load_4_y = f16tof32(ubo_load_4[0] >> 16); diff --git a/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_storage.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_storage.wgsl.expected.dxc.hlsl index 6f680d2cf8..353fff7089 100644 --- a/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_storage.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_storage.wgsl.expected.dxc.hlsl @@ -9,53 +9,53 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol_3(RWByteAddressBuffer buffer, uint offset, matrix value) { - buffer.Store >((offset + 0u), value[0u]); - buffer.Store >((offset + 8u), value[1u]); +void s_store_3(uint offset, matrix value) { + s.Store >((offset + 0u), value[0u]); + s.Store >((offset + 8u), value[1u]); } -void tint_symbol_1(RWByteAddressBuffer buffer, uint offset, S value) { - buffer.Store((offset + 0u), asuint(value.before)); - tint_symbol_3(buffer, (offset + 8u), value.m); - buffer.Store((offset + 64u), asuint(value.after)); +void s_store_1(uint offset, S value) { + s.Store((offset + 0u), asuint(value.before)); + s_store_3((offset + 8u), value.m); + s.Store((offset + 64u), asuint(value.after)); } -void tint_symbol(RWByteAddressBuffer buffer, uint offset, S value[4]) { +void s_store(uint offset, S value[4]) { S array_1[4] = value; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - tint_symbol_1(buffer, (offset + (i * 128u)), array_1[i]); + s_store_1((offset + (i * 128u)), array_1[i]); } } } -matrix tint_symbol_8(uint4 buffer[32], uint offset) { +matrix u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); return matrix(vector(ubo_load_xz[0], ubo_load_y, ubo_load_xz[1]), vector(ubo_load_2_xz[0], ubo_load_2_y, ubo_load_2_xz[1])); } -S tint_symbol_6(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_2 = ((offset + 0u)) / 4; const uint scalar_offset_3 = ((offset + 64u)) / 4; - const S tint_symbol_10 = {asint(buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]), tint_symbol_8(buffer, (offset + 8u)), asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4])}; - return tint_symbol_10; + const S tint_symbol = {asint(u[scalar_offset_2 / 4][scalar_offset_2 % 4]), u_load_3((offset + 8u)), asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4])}; + return tint_symbol; } -typedef S tint_symbol_5_ret[4]; -tint_symbol_5_ret tint_symbol_5(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_6(buffer, (offset + (i_1 * 128u))); + arr[i_1] = u_load_1((offset + (i_1 * 128u))); } } return arr; @@ -63,9 +63,9 @@ tint_symbol_5_ret tint_symbol_5(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_5(u, 0u)); - tint_symbol_1(s, 128u, tint_symbol_6(u, 256u)); - tint_symbol_3(s, 392u, tint_symbol_8(u, 264u)); + s_store(0u, u_load(0u)); + s_store_1(128u, u_load_1(256u)); + s_store_3(392u, u_load_3(264u)); uint2 ubo_load_4 = u[1].xy; vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); float16_t ubo_load_4_y = f16tof32(ubo_load_4[0] >> 16); diff --git a/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_workgroup.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_workgroup.wgsl.expected.dxc.hlsl index 3ddda98865..4c76afb0f7 100644 --- a/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_workgroup.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat2x3_f16/to_workgroup.wgsl.expected.dxc.hlsl @@ -13,33 +13,33 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -matrix tint_symbol_5(uint4 buffer[32], uint offset) { +matrix u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); return matrix(vector(ubo_load_xz[0], ubo_load_y, ubo_load_xz[1]), vector(ubo_load_2_xz[0], ubo_load_2_y, ubo_load_2_xz[1])); } -S tint_symbol_3(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_2 = ((offset + 0u)) / 4; const uint scalar_offset_3 = ((offset + 64u)) / 4; - const S tint_symbol_8 = {asint(buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]), tint_symbol_5(buffer, (offset + 8u)), asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4])}; - return tint_symbol_8; + const S tint_symbol_3 = {asint(u[scalar_offset_2 / 4][scalar_offset_2 % 4]), u_load_3((offset + 8u)), asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4])}; + return tint_symbol_3; } -typedef S tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_3(buffer, (offset + (i_1 * 128u))); + arr[i_1] = u_load_1((offset + (i_1 * 128u))); } } return arr; @@ -49,14 +49,14 @@ void f_inner(uint local_invocation_index) { { for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) { const uint i = idx; - const S tint_symbol_7 = (S)0; - w[i] = tint_symbol_7; + const S tint_symbol_2 = (S)0; + w[i] = tint_symbol_2; } } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); - w[1] = tint_symbol_3(u, 256u); - w[3].m = tint_symbol_5(u, 264u); + w = u_load(0u); + w[1] = u_load_1(256u); + w[3].m = u_load_3(264u); uint2 ubo_load_4 = u[1].xy; vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); float16_t ubo_load_4_y = f16tof32(ubo_load_4[0] >> 16); diff --git a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl index 553de51c6b..b19fb59d17 100644 --- a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl @@ -15,39 +15,39 @@ int i() { return counter; } -float2x3 tint_symbol_8(uint4 buffer[64], uint offset) { +float2x3 a_load_4(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz)); + return float2x3(asfloat(a[scalar_offset / 4].xyz), asfloat(a[scalar_offset_1 / 4].xyz)); } -Inner tint_symbol_7(uint4 buffer[64], uint offset) { - const Inner tint_symbol_11 = {tint_symbol_8(buffer, (offset + 0u))}; - return tint_symbol_11; +Inner a_load_3(uint offset) { + const Inner tint_symbol_4 = {a_load_4((offset + 0u))}; + return tint_symbol_4; } -typedef Inner tint_symbol_6_ret[4]; -tint_symbol_6_ret tint_symbol_6(uint4 buffer[64], uint offset) { +typedef Inner a_load_2_ret[4]; +a_load_2_ret a_load_2(uint offset) { Inner arr[4] = (Inner[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_7(buffer, (offset + (i_1 * 64u))); + arr[i_1] = a_load_3((offset + (i_1 * 64u))); } } return arr; } -Outer tint_symbol_5(uint4 buffer[64], uint offset) { - const Outer tint_symbol_12 = {tint_symbol_6(buffer, (offset + 0u))}; - return tint_symbol_12; +Outer a_load_1(uint offset) { + const Outer tint_symbol_5 = {a_load_2((offset + 0u))}; + return tint_symbol_5; } -typedef Outer tint_symbol_4_ret[4]; -tint_symbol_4_ret tint_symbol_4(uint4 buffer[64], uint offset) { +typedef Outer a_load_ret[4]; +a_load_ret a_load(uint offset) { Outer arr_1[4] = (Outer[4])0; { for(uint i_2 = 0u; (i_2 < 4u); i_2 = (i_2 + 1u)) { - arr_1[i_2] = tint_symbol_5(buffer, (offset + (i_2 * 256u))); + arr_1[i_2] = a_load_1((offset + (i_2 * 256u))); } } return arr_1; @@ -58,11 +58,11 @@ void f() { const int p_a_i_save = i(); const int p_a_i_a_i_save = i(); const int p_a_i_a_i_m_i_save = i(); - const Outer l_a[4] = tint_symbol_4(a, 0u); - const Outer l_a_i = tint_symbol_5(a, (256u * uint(p_a_i_save))); - const Inner l_a_i_a[4] = tint_symbol_6(a, (256u * uint(p_a_i_save))); - const Inner l_a_i_a_i = tint_symbol_7(a, ((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); - const float2x3 l_a_i_a_i_m = tint_symbol_8(a, ((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); + const Outer l_a[4] = a_load(0u); + const Outer l_a_i = a_load_1((256u * uint(p_a_i_save))); + const Inner l_a_i_a[4] = a_load_2((256u * uint(p_a_i_save))); + const Inner l_a_i_a_i = a_load_3(((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); + const float2x3 l_a_i_a_i_m = a_load_4(((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); const uint scalar_offset_2 = ((((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save))) + (16u * uint(p_a_i_a_i_m_i_save)))) / 4; const float3 l_a_i_a_i_m_i = asfloat(a[scalar_offset_2 / 4].xyz); const int tint_symbol = p_a_i_save; diff --git a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl index 553de51c6b..b19fb59d17 100644 --- a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl @@ -15,39 +15,39 @@ int i() { return counter; } -float2x3 tint_symbol_8(uint4 buffer[64], uint offset) { +float2x3 a_load_4(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz)); + return float2x3(asfloat(a[scalar_offset / 4].xyz), asfloat(a[scalar_offset_1 / 4].xyz)); } -Inner tint_symbol_7(uint4 buffer[64], uint offset) { - const Inner tint_symbol_11 = {tint_symbol_8(buffer, (offset + 0u))}; - return tint_symbol_11; +Inner a_load_3(uint offset) { + const Inner tint_symbol_4 = {a_load_4((offset + 0u))}; + return tint_symbol_4; } -typedef Inner tint_symbol_6_ret[4]; -tint_symbol_6_ret tint_symbol_6(uint4 buffer[64], uint offset) { +typedef Inner a_load_2_ret[4]; +a_load_2_ret a_load_2(uint offset) { Inner arr[4] = (Inner[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_7(buffer, (offset + (i_1 * 64u))); + arr[i_1] = a_load_3((offset + (i_1 * 64u))); } } return arr; } -Outer tint_symbol_5(uint4 buffer[64], uint offset) { - const Outer tint_symbol_12 = {tint_symbol_6(buffer, (offset + 0u))}; - return tint_symbol_12; +Outer a_load_1(uint offset) { + const Outer tint_symbol_5 = {a_load_2((offset + 0u))}; + return tint_symbol_5; } -typedef Outer tint_symbol_4_ret[4]; -tint_symbol_4_ret tint_symbol_4(uint4 buffer[64], uint offset) { +typedef Outer a_load_ret[4]; +a_load_ret a_load(uint offset) { Outer arr_1[4] = (Outer[4])0; { for(uint i_2 = 0u; (i_2 < 4u); i_2 = (i_2 + 1u)) { - arr_1[i_2] = tint_symbol_5(buffer, (offset + (i_2 * 256u))); + arr_1[i_2] = a_load_1((offset + (i_2 * 256u))); } } return arr_1; @@ -58,11 +58,11 @@ void f() { const int p_a_i_save = i(); const int p_a_i_a_i_save = i(); const int p_a_i_a_i_m_i_save = i(); - const Outer l_a[4] = tint_symbol_4(a, 0u); - const Outer l_a_i = tint_symbol_5(a, (256u * uint(p_a_i_save))); - const Inner l_a_i_a[4] = tint_symbol_6(a, (256u * uint(p_a_i_save))); - const Inner l_a_i_a_i = tint_symbol_7(a, ((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); - const float2x3 l_a_i_a_i_m = tint_symbol_8(a, ((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); + const Outer l_a[4] = a_load(0u); + const Outer l_a_i = a_load_1((256u * uint(p_a_i_save))); + const Inner l_a_i_a[4] = a_load_2((256u * uint(p_a_i_save))); + const Inner l_a_i_a_i = a_load_3(((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); + const float2x3 l_a_i_a_i_m = a_load_4(((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); const uint scalar_offset_2 = ((((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save))) + (16u * uint(p_a_i_a_i_m_i_save)))) / 4; const float3 l_a_i_a_i_m_i = asfloat(a[scalar_offset_2 / 4].xyz); const int tint_symbol = p_a_i_save; diff --git a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl index 2273b9f49d..7a61a4aa6d 100644 --- a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl @@ -9,39 +9,39 @@ cbuffer cbuffer_a : register(b0, space0) { uint4 a[64]; }; -float2x3 tint_symbol_4(uint4 buffer[64], uint offset) { +float2x3 a_load_4(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz)); + return float2x3(asfloat(a[scalar_offset / 4].xyz), asfloat(a[scalar_offset_1 / 4].xyz)); } -Inner tint_symbol_3(uint4 buffer[64], uint offset) { - const Inner tint_symbol_7 = {tint_symbol_4(buffer, (offset + 0u))}; - return tint_symbol_7; +Inner a_load_3(uint offset) { + const Inner tint_symbol = {a_load_4((offset + 0u))}; + return tint_symbol; } -typedef Inner tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[64], uint offset) { +typedef Inner a_load_2_ret[4]; +a_load_2_ret a_load_2(uint offset) { Inner arr[4] = (Inner[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_3(buffer, (offset + (i * 64u))); + arr[i] = a_load_3((offset + (i * 64u))); } } return arr; } -Outer tint_symbol_1(uint4 buffer[64], uint offset) { - const Outer tint_symbol_8 = {tint_symbol_2(buffer, (offset + 0u))}; - return tint_symbol_8; +Outer a_load_1(uint offset) { + const Outer tint_symbol_1 = {a_load_2((offset + 0u))}; + return tint_symbol_1; } -typedef Outer tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[64], uint offset) { +typedef Outer a_load_ret[4]; +a_load_ret a_load(uint offset) { Outer arr_1[4] = (Outer[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr_1[i_1] = tint_symbol_1(buffer, (offset + (i_1 * 256u))); + arr_1[i_1] = a_load_1((offset + (i_1 * 256u))); } } return arr_1; @@ -49,11 +49,11 @@ tint_symbol_ret tint_symbol(uint4 buffer[64], uint offset) { [numthreads(1, 1, 1)] void f() { - const Outer l_a[4] = tint_symbol(a, 0u); - const Outer l_a_3 = tint_symbol_1(a, 768u); - const Inner l_a_3_a[4] = tint_symbol_2(a, 768u); - const Inner l_a_3_a_2 = tint_symbol_3(a, 896u); - const float2x3 l_a_3_a_2_m = tint_symbol_4(a, 896u); + const Outer l_a[4] = a_load(0u); + const Outer l_a_3 = a_load_1(768u); + const Inner l_a_3_a[4] = a_load_2(768u); + const Inner l_a_3_a_2 = a_load_3(896u); + const float2x3 l_a_3_a_2_m = a_load_4(896u); const float3 l_a_3_a_2_m_1 = asfloat(a[57].xyz); const float l_a_3_a_2_m_1_0 = asfloat(a[57].x); return; diff --git a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl index 2273b9f49d..7a61a4aa6d 100644 --- a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl @@ -9,39 +9,39 @@ cbuffer cbuffer_a : register(b0, space0) { uint4 a[64]; }; -float2x3 tint_symbol_4(uint4 buffer[64], uint offset) { +float2x3 a_load_4(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz)); + return float2x3(asfloat(a[scalar_offset / 4].xyz), asfloat(a[scalar_offset_1 / 4].xyz)); } -Inner tint_symbol_3(uint4 buffer[64], uint offset) { - const Inner tint_symbol_7 = {tint_symbol_4(buffer, (offset + 0u))}; - return tint_symbol_7; +Inner a_load_3(uint offset) { + const Inner tint_symbol = {a_load_4((offset + 0u))}; + return tint_symbol; } -typedef Inner tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[64], uint offset) { +typedef Inner a_load_2_ret[4]; +a_load_2_ret a_load_2(uint offset) { Inner arr[4] = (Inner[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_3(buffer, (offset + (i * 64u))); + arr[i] = a_load_3((offset + (i * 64u))); } } return arr; } -Outer tint_symbol_1(uint4 buffer[64], uint offset) { - const Outer tint_symbol_8 = {tint_symbol_2(buffer, (offset + 0u))}; - return tint_symbol_8; +Outer a_load_1(uint offset) { + const Outer tint_symbol_1 = {a_load_2((offset + 0u))}; + return tint_symbol_1; } -typedef Outer tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[64], uint offset) { +typedef Outer a_load_ret[4]; +a_load_ret a_load(uint offset) { Outer arr_1[4] = (Outer[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr_1[i_1] = tint_symbol_1(buffer, (offset + (i_1 * 256u))); + arr_1[i_1] = a_load_1((offset + (i_1 * 256u))); } } return arr_1; @@ -49,11 +49,11 @@ tint_symbol_ret tint_symbol(uint4 buffer[64], uint offset) { [numthreads(1, 1, 1)] void f() { - const Outer l_a[4] = tint_symbol(a, 0u); - const Outer l_a_3 = tint_symbol_1(a, 768u); - const Inner l_a_3_a[4] = tint_symbol_2(a, 768u); - const Inner l_a_3_a_2 = tint_symbol_3(a, 896u); - const float2x3 l_a_3_a_2_m = tint_symbol_4(a, 896u); + const Outer l_a[4] = a_load(0u); + const Outer l_a_3 = a_load_1(768u); + const Inner l_a_3_a[4] = a_load_2(768u); + const Inner l_a_3_a_2 = a_load_3(896u); + const float2x3 l_a_3_a_2_m = a_load_4(896u); const float3 l_a_3_a_2_m_1 = asfloat(a[57].xyz); const float l_a_3_a_2_m_1_0 = asfloat(a[57].x); return; diff --git a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_builtin.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_builtin.wgsl.expected.dxc.hlsl index 158973f540..90c1782a06 100644 --- a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_builtin.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_builtin.wgsl.expected.dxc.hlsl @@ -2,15 +2,15 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[32]; }; -float2x3 tint_symbol(uint4 buffer[32], uint offset) { +float2x3 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz)); + return float2x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz)); } [numthreads(1, 1, 1)] void f() { - const float3x2 t = transpose(tint_symbol(u, 272u)); + const float3x2 t = transpose(u_load(272u)); const float l = length(asfloat(u[2].xyz).zxy); const float a = abs(asfloat(u[2].xyz).zxy.x); return; diff --git a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_builtin.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_builtin.wgsl.expected.fxc.hlsl index 158973f540..90c1782a06 100644 --- a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_builtin.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_builtin.wgsl.expected.fxc.hlsl @@ -2,15 +2,15 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[32]; }; -float2x3 tint_symbol(uint4 buffer[32], uint offset) { +float2x3 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz)); + return float2x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz)); } [numthreads(1, 1, 1)] void f() { - const float3x2 t = transpose(tint_symbol(u, 272u)); + const float3x2 t = transpose(u_load(272u)); const float l = length(asfloat(u[2].xyz).zxy); const float a = abs(asfloat(u[2].xyz).zxy.x); return; diff --git a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_fn.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_fn.wgsl.expected.dxc.hlsl index c48f8772a6..20d98b62df 100644 --- a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_fn.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_fn.wgsl.expected.dxc.hlsl @@ -23,25 +23,25 @@ void d(float3 v) { void e(float f_1) { } -float2x3 tint_symbol_3(uint4 buffer[32], uint offset) { +float2x3 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz)); + return float2x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz)); } -S tint_symbol_1(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_2 = ((offset + 0u)) / 4; const uint scalar_offset_3 = ((offset + 64u)) / 4; - const S tint_symbol_5 = {asint(buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]), tint_symbol_3(buffer, (offset + 16u)), asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4])}; - return tint_symbol_5; + const S tint_symbol = {asint(u[scalar_offset_2 / 4][scalar_offset_2 % 4]), u_load_3((offset + 16u)), asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4])}; + return tint_symbol; } -typedef S tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 128u))); + arr[i] = u_load_1((offset + (i * 128u))); } } return arr; @@ -49,9 +49,9 @@ tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); - b(tint_symbol_1(u, 256u)); - c(tint_symbol_3(u, 272u)); + a(u_load(0u)); + b(u_load_1(256u)); + c(u_load_3(272u)); d(asfloat(u[2].xyz).zxy); e(asfloat(u[2].xyz).zxy.x); return; diff --git a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_fn.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_fn.wgsl.expected.fxc.hlsl index c48f8772a6..20d98b62df 100644 --- a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_fn.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_fn.wgsl.expected.fxc.hlsl @@ -23,25 +23,25 @@ void d(float3 v) { void e(float f_1) { } -float2x3 tint_symbol_3(uint4 buffer[32], uint offset) { +float2x3 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz)); + return float2x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz)); } -S tint_symbol_1(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_2 = ((offset + 0u)) / 4; const uint scalar_offset_3 = ((offset + 64u)) / 4; - const S tint_symbol_5 = {asint(buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]), tint_symbol_3(buffer, (offset + 16u)), asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4])}; - return tint_symbol_5; + const S tint_symbol = {asint(u[scalar_offset_2 / 4][scalar_offset_2 % 4]), u_load_3((offset + 16u)), asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4])}; + return tint_symbol; } -typedef S tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 128u))); + arr[i] = u_load_1((offset + (i * 128u))); } } return arr; @@ -49,9 +49,9 @@ tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); - b(tint_symbol_1(u, 256u)); - c(tint_symbol_3(u, 272u)); + a(u_load(0u)); + b(u_load_1(256u)); + c(u_load_3(272u)); d(asfloat(u[2].xyz).zxy); e(asfloat(u[2].xyz).zxy.x); return; diff --git a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_private.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_private.wgsl.expected.dxc.hlsl index 08aa42f639..3b38250e05 100644 --- a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_private.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_private.wgsl.expected.dxc.hlsl @@ -9,25 +9,25 @@ cbuffer cbuffer_u : register(b0, space0) { }; static S p[4] = (S[4])0; -float2x3 tint_symbol_3(uint4 buffer[32], uint offset) { +float2x3 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz)); + return float2x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz)); } -S tint_symbol_1(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_2 = ((offset + 0u)) / 4; const uint scalar_offset_3 = ((offset + 64u)) / 4; - const S tint_symbol_5 = {asint(buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]), tint_symbol_3(buffer, (offset + 16u)), asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4])}; - return tint_symbol_5; + const S tint_symbol = {asint(u[scalar_offset_2 / 4][scalar_offset_2 % 4]), u_load_3((offset + 16u)), asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4])}; + return tint_symbol; } -typedef S tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 128u))); + arr[i] = u_load_1((offset + (i * 128u))); } } return arr; @@ -35,9 +35,9 @@ tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); - p[1] = tint_symbol_1(u, 256u); - p[3].m = tint_symbol_3(u, 272u); + p = u_load(0u); + p[1] = u_load_1(256u); + p[3].m = u_load_3(272u); p[1].m[0] = asfloat(u[2].xyz).zxy; return; } diff --git a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_private.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_private.wgsl.expected.fxc.hlsl index 08aa42f639..3b38250e05 100644 --- a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_private.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_private.wgsl.expected.fxc.hlsl @@ -9,25 +9,25 @@ cbuffer cbuffer_u : register(b0, space0) { }; static S p[4] = (S[4])0; -float2x3 tint_symbol_3(uint4 buffer[32], uint offset) { +float2x3 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz)); + return float2x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz)); } -S tint_symbol_1(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_2 = ((offset + 0u)) / 4; const uint scalar_offset_3 = ((offset + 64u)) / 4; - const S tint_symbol_5 = {asint(buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]), tint_symbol_3(buffer, (offset + 16u)), asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4])}; - return tint_symbol_5; + const S tint_symbol = {asint(u[scalar_offset_2 / 4][scalar_offset_2 % 4]), u_load_3((offset + 16u)), asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4])}; + return tint_symbol; } -typedef S tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 128u))); + arr[i] = u_load_1((offset + (i * 128u))); } } return arr; @@ -35,9 +35,9 @@ tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); - p[1] = tint_symbol_1(u, 256u); - p[3].m = tint_symbol_3(u, 272u); + p = u_load(0u); + p[1] = u_load_1(256u); + p[3].m = u_load_3(272u); p[1].m[0] = asfloat(u[2].xyz).zxy; return; } diff --git a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_storage.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_storage.wgsl.expected.dxc.hlsl index 257e965d0c..a89fd41800 100644 --- a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_storage.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_storage.wgsl.expected.dxc.hlsl @@ -9,45 +9,45 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol_3(RWByteAddressBuffer buffer, uint offset, float2x3 value) { - buffer.Store3((offset + 0u), asuint(value[0u])); - buffer.Store3((offset + 16u), asuint(value[1u])); +void s_store_3(uint offset, float2x3 value) { + s.Store3((offset + 0u), asuint(value[0u])); + s.Store3((offset + 16u), asuint(value[1u])); } -void tint_symbol_1(RWByteAddressBuffer buffer, uint offset, S value) { - buffer.Store((offset + 0u), asuint(value.before)); - tint_symbol_3(buffer, (offset + 16u), value.m); - buffer.Store((offset + 64u), asuint(value.after)); +void s_store_1(uint offset, S value) { + s.Store((offset + 0u), asuint(value.before)); + s_store_3((offset + 16u), value.m); + s.Store((offset + 64u), asuint(value.after)); } -void tint_symbol(RWByteAddressBuffer buffer, uint offset, S value[4]) { +void s_store(uint offset, S value[4]) { S array_1[4] = value; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - tint_symbol_1(buffer, (offset + (i * 128u)), array_1[i]); + s_store_1((offset + (i * 128u)), array_1[i]); } } } -float2x3 tint_symbol_8(uint4 buffer[32], uint offset) { +float2x3 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz)); + return float2x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz)); } -S tint_symbol_6(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_2 = ((offset + 0u)) / 4; const uint scalar_offset_3 = ((offset + 64u)) / 4; - const S tint_symbol_10 = {asint(buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]), tint_symbol_8(buffer, (offset + 16u)), asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4])}; - return tint_symbol_10; + const S tint_symbol = {asint(u[scalar_offset_2 / 4][scalar_offset_2 % 4]), u_load_3((offset + 16u)), asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4])}; + return tint_symbol; } -typedef S tint_symbol_5_ret[4]; -tint_symbol_5_ret tint_symbol_5(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_6(buffer, (offset + (i_1 * 128u))); + arr[i_1] = u_load_1((offset + (i_1 * 128u))); } } return arr; @@ -55,9 +55,9 @@ tint_symbol_5_ret tint_symbol_5(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_5(u, 0u)); - tint_symbol_1(s, 128u, tint_symbol_6(u, 256u)); - tint_symbol_3(s, 400u, tint_symbol_8(u, 272u)); + s_store(0u, u_load(0u)); + s_store_1(128u, u_load_1(256u)); + s_store_3(400u, u_load_3(272u)); s.Store3(144u, asuint(asfloat(u[2].xyz).zxy)); return; } diff --git a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_storage.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_storage.wgsl.expected.fxc.hlsl index 257e965d0c..a89fd41800 100644 --- a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_storage.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_storage.wgsl.expected.fxc.hlsl @@ -9,45 +9,45 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol_3(RWByteAddressBuffer buffer, uint offset, float2x3 value) { - buffer.Store3((offset + 0u), asuint(value[0u])); - buffer.Store3((offset + 16u), asuint(value[1u])); +void s_store_3(uint offset, float2x3 value) { + s.Store3((offset + 0u), asuint(value[0u])); + s.Store3((offset + 16u), asuint(value[1u])); } -void tint_symbol_1(RWByteAddressBuffer buffer, uint offset, S value) { - buffer.Store((offset + 0u), asuint(value.before)); - tint_symbol_3(buffer, (offset + 16u), value.m); - buffer.Store((offset + 64u), asuint(value.after)); +void s_store_1(uint offset, S value) { + s.Store((offset + 0u), asuint(value.before)); + s_store_3((offset + 16u), value.m); + s.Store((offset + 64u), asuint(value.after)); } -void tint_symbol(RWByteAddressBuffer buffer, uint offset, S value[4]) { +void s_store(uint offset, S value[4]) { S array_1[4] = value; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - tint_symbol_1(buffer, (offset + (i * 128u)), array_1[i]); + s_store_1((offset + (i * 128u)), array_1[i]); } } } -float2x3 tint_symbol_8(uint4 buffer[32], uint offset) { +float2x3 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz)); + return float2x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz)); } -S tint_symbol_6(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_2 = ((offset + 0u)) / 4; const uint scalar_offset_3 = ((offset + 64u)) / 4; - const S tint_symbol_10 = {asint(buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]), tint_symbol_8(buffer, (offset + 16u)), asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4])}; - return tint_symbol_10; + const S tint_symbol = {asint(u[scalar_offset_2 / 4][scalar_offset_2 % 4]), u_load_3((offset + 16u)), asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4])}; + return tint_symbol; } -typedef S tint_symbol_5_ret[4]; -tint_symbol_5_ret tint_symbol_5(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_6(buffer, (offset + (i_1 * 128u))); + arr[i_1] = u_load_1((offset + (i_1 * 128u))); } } return arr; @@ -55,9 +55,9 @@ tint_symbol_5_ret tint_symbol_5(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_5(u, 0u)); - tint_symbol_1(s, 128u, tint_symbol_6(u, 256u)); - tint_symbol_3(s, 400u, tint_symbol_8(u, 272u)); + s_store(0u, u_load(0u)); + s_store_1(128u, u_load_1(256u)); + s_store_3(400u, u_load_3(272u)); s.Store3(144u, asuint(asfloat(u[2].xyz).zxy)); return; } diff --git a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_workgroup.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_workgroup.wgsl.expected.dxc.hlsl index e2fb38a15f..f4ad94293f 100644 --- a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_workgroup.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_workgroup.wgsl.expected.dxc.hlsl @@ -13,25 +13,25 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -float2x3 tint_symbol_5(uint4 buffer[32], uint offset) { +float2x3 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz)); + return float2x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz)); } -S tint_symbol_3(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_2 = ((offset + 0u)) / 4; const uint scalar_offset_3 = ((offset + 64u)) / 4; - const S tint_symbol_8 = {asint(buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]), tint_symbol_5(buffer, (offset + 16u)), asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4])}; - return tint_symbol_8; + const S tint_symbol_3 = {asint(u[scalar_offset_2 / 4][scalar_offset_2 % 4]), u_load_3((offset + 16u)), asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4])}; + return tint_symbol_3; } -typedef S tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_3(buffer, (offset + (i_1 * 128u))); + arr[i_1] = u_load_1((offset + (i_1 * 128u))); } } return arr; @@ -41,14 +41,14 @@ void f_inner(uint local_invocation_index) { { for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) { const uint i = idx; - const S tint_symbol_7 = (S)0; - w[i] = tint_symbol_7; + const S tint_symbol_2 = (S)0; + w[i] = tint_symbol_2; } } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); - w[1] = tint_symbol_3(u, 256u); - w[3].m = tint_symbol_5(u, 272u); + w = u_load(0u); + w[1] = u_load_1(256u); + w[3].m = u_load_3(272u); w[1].m[0] = asfloat(u[2].xyz).zxy; } diff --git a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_workgroup.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_workgroup.wgsl.expected.fxc.hlsl index e2fb38a15f..f4ad94293f 100644 --- a/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_workgroup.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat2x3_f32/to_workgroup.wgsl.expected.fxc.hlsl @@ -13,25 +13,25 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -float2x3 tint_symbol_5(uint4 buffer[32], uint offset) { +float2x3 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz)); + return float2x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz)); } -S tint_symbol_3(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_2 = ((offset + 0u)) / 4; const uint scalar_offset_3 = ((offset + 64u)) / 4; - const S tint_symbol_8 = {asint(buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]), tint_symbol_5(buffer, (offset + 16u)), asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4])}; - return tint_symbol_8; + const S tint_symbol_3 = {asint(u[scalar_offset_2 / 4][scalar_offset_2 % 4]), u_load_3((offset + 16u)), asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4])}; + return tint_symbol_3; } -typedef S tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_3(buffer, (offset + (i_1 * 128u))); + arr[i_1] = u_load_1((offset + (i_1 * 128u))); } } return arr; @@ -41,14 +41,14 @@ void f_inner(uint local_invocation_index) { { for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) { const uint i = idx; - const S tint_symbol_7 = (S)0; - w[i] = tint_symbol_7; + const S tint_symbol_2 = (S)0; + w[i] = tint_symbol_2; } } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); - w[1] = tint_symbol_3(u, 256u); - w[3].m = tint_symbol_5(u, 272u); + w = u_load(0u); + w[1] = u_load_1(256u); + w[3].m = u_load_3(272u); w[1].m[0] = asfloat(u[2].xyz).zxy; } diff --git a/test/tint/buffer/uniform/std140/struct/mat2x4_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat2x4_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl index 2bad1034b5..0095460013 100644 --- a/test/tint/buffer/uniform/std140/struct/mat2x4_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat2x4_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl @@ -15,47 +15,47 @@ int i() { return counter; } -matrix tint_symbol_8(uint4 buffer[64], uint offset) { +matrix a_load_4(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = a[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = a[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); vector ubo_load_2_yw = vector(f16tof32(ubo_load_2 >> 16)); return matrix(vector(ubo_load_xz[0], ubo_load_yw[0], ubo_load_xz[1], ubo_load_yw[1]), vector(ubo_load_2_xz[0], ubo_load_2_yw[0], ubo_load_2_xz[1], ubo_load_2_yw[1])); } -Inner tint_symbol_7(uint4 buffer[64], uint offset) { - const Inner tint_symbol_11 = {tint_symbol_8(buffer, (offset + 0u))}; - return tint_symbol_11; +Inner a_load_3(uint offset) { + const Inner tint_symbol_4 = {a_load_4((offset + 0u))}; + return tint_symbol_4; } -typedef Inner tint_symbol_6_ret[4]; -tint_symbol_6_ret tint_symbol_6(uint4 buffer[64], uint offset) { +typedef Inner a_load_2_ret[4]; +a_load_2_ret a_load_2(uint offset) { Inner arr[4] = (Inner[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_7(buffer, (offset + (i_1 * 64u))); + arr[i_1] = a_load_3((offset + (i_1 * 64u))); } } return arr; } -Outer tint_symbol_5(uint4 buffer[64], uint offset) { - const Outer tint_symbol_12 = {tint_symbol_6(buffer, (offset + 0u))}; - return tint_symbol_12; +Outer a_load_1(uint offset) { + const Outer tint_symbol_5 = {a_load_2((offset + 0u))}; + return tint_symbol_5; } -typedef Outer tint_symbol_4_ret[4]; -tint_symbol_4_ret tint_symbol_4(uint4 buffer[64], uint offset) { +typedef Outer a_load_ret[4]; +a_load_ret a_load(uint offset) { Outer arr_1[4] = (Outer[4])0; { for(uint i_2 = 0u; (i_2 < 4u); i_2 = (i_2 + 1u)) { - arr_1[i_2] = tint_symbol_5(buffer, (offset + (i_2 * 256u))); + arr_1[i_2] = a_load_1((offset + (i_2 * 256u))); } } return arr_1; @@ -66,11 +66,11 @@ void f() { const int p_a_i_save = i(); const int p_a_i_a_i_save = i(); const int p_a_i_a_i_m_i_save = i(); - const Outer l_a[4] = tint_symbol_4(a, 0u); - const Outer l_a_i = tint_symbol_5(a, (256u * uint(p_a_i_save))); - const Inner l_a_i_a[4] = tint_symbol_6(a, (256u * uint(p_a_i_save))); - const Inner l_a_i_a_i = tint_symbol_7(a, ((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); - const matrix l_a_i_a_i_m = tint_symbol_8(a, ((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); + const Outer l_a[4] = a_load(0u); + const Outer l_a_i = a_load_1((256u * uint(p_a_i_save))); + const Inner l_a_i_a[4] = a_load_2((256u * uint(p_a_i_save))); + const Inner l_a_i_a_i = a_load_3(((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); + const matrix l_a_i_a_i_m = a_load_4(((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); const uint scalar_offset_2 = ((((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save))) + (8u * uint(p_a_i_a_i_m_i_save)))) / 4; uint4 ubo_load_5 = a[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); diff --git a/test/tint/buffer/uniform/std140/struct/mat2x4_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat2x4_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl index 03120f79f3..b310f83d50 100644 --- a/test/tint/buffer/uniform/std140/struct/mat2x4_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat2x4_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl @@ -9,47 +9,47 @@ cbuffer cbuffer_a : register(b0, space0) { uint4 a[64]; }; -matrix tint_symbol_4(uint4 buffer[64], uint offset) { +matrix a_load_4(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = a[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = a[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); vector ubo_load_2_yw = vector(f16tof32(ubo_load_2 >> 16)); return matrix(vector(ubo_load_xz[0], ubo_load_yw[0], ubo_load_xz[1], ubo_load_yw[1]), vector(ubo_load_2_xz[0], ubo_load_2_yw[0], ubo_load_2_xz[1], ubo_load_2_yw[1])); } -Inner tint_symbol_3(uint4 buffer[64], uint offset) { - const Inner tint_symbol_7 = {tint_symbol_4(buffer, (offset + 0u))}; - return tint_symbol_7; +Inner a_load_3(uint offset) { + const Inner tint_symbol = {a_load_4((offset + 0u))}; + return tint_symbol; } -typedef Inner tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[64], uint offset) { +typedef Inner a_load_2_ret[4]; +a_load_2_ret a_load_2(uint offset) { Inner arr[4] = (Inner[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_3(buffer, (offset + (i * 64u))); + arr[i] = a_load_3((offset + (i * 64u))); } } return arr; } -Outer tint_symbol_1(uint4 buffer[64], uint offset) { - const Outer tint_symbol_8 = {tint_symbol_2(buffer, (offset + 0u))}; - return tint_symbol_8; +Outer a_load_1(uint offset) { + const Outer tint_symbol_1 = {a_load_2((offset + 0u))}; + return tint_symbol_1; } -typedef Outer tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[64], uint offset) { +typedef Outer a_load_ret[4]; +a_load_ret a_load(uint offset) { Outer arr_1[4] = (Outer[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr_1[i_1] = tint_symbol_1(buffer, (offset + (i_1 * 256u))); + arr_1[i_1] = a_load_1((offset + (i_1 * 256u))); } } return arr_1; @@ -57,11 +57,11 @@ tint_symbol_ret tint_symbol(uint4 buffer[64], uint offset) { [numthreads(1, 1, 1)] void f() { - const Outer l_a[4] = tint_symbol(a, 0u); - const Outer l_a_3 = tint_symbol_1(a, 768u); - const Inner l_a_3_a[4] = tint_symbol_2(a, 768u); - const Inner l_a_3_a_2 = tint_symbol_3(a, 896u); - const matrix l_a_3_a_2_m = tint_symbol_4(a, 896u); + const Outer l_a[4] = a_load(0u); + const Outer l_a_3 = a_load_1(768u); + const Inner l_a_3_a[4] = a_load_2(768u); + const Inner l_a_3_a_2 = a_load_3(896u); + const matrix l_a_3_a_2_m = a_load_4(896u); uint2 ubo_load_4 = a[56].zw; vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); vector ubo_load_4_yw = vector(f16tof32(ubo_load_4 >> 16)); diff --git a/test/tint/buffer/uniform/std140/struct/mat2x4_f16/to_builtin.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat2x4_f16/to_builtin.wgsl.expected.dxc.hlsl index 2244be68bc..decda0c533 100644 --- a/test/tint/buffer/uniform/std140/struct/mat2x4_f16/to_builtin.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat2x4_f16/to_builtin.wgsl.expected.dxc.hlsl @@ -2,14 +2,14 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[32]; }; -matrix tint_symbol(uint4 buffer[32], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); vector ubo_load_2_yw = vector(f16tof32(ubo_load_2 >> 16)); @@ -18,7 +18,7 @@ matrix tint_symbol(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - const matrix t = transpose(tint_symbol(u, 264u)); + const matrix t = transpose(u_load(264u)); uint2 ubo_load_4 = u[1].xy; vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); vector ubo_load_4_yw = vector(f16tof32(ubo_load_4 >> 16)); diff --git a/test/tint/buffer/uniform/std140/struct/mat2x4_f16/to_fn.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat2x4_f16/to_fn.wgsl.expected.dxc.hlsl index 8c5270f3a3..3079e3127d 100644 --- a/test/tint/buffer/uniform/std140/struct/mat2x4_f16/to_fn.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat2x4_f16/to_fn.wgsl.expected.dxc.hlsl @@ -23,33 +23,33 @@ void d(vector v) { void e(float16_t f_1) { } -matrix tint_symbol_3(uint4 buffer[32], uint offset) { +matrix u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); vector ubo_load_2_yw = vector(f16tof32(ubo_load_2 >> 16)); return matrix(vector(ubo_load_xz[0], ubo_load_yw[0], ubo_load_xz[1], ubo_load_yw[1]), vector(ubo_load_2_xz[0], ubo_load_2_yw[0], ubo_load_2_xz[1], ubo_load_2_yw[1])); } -S tint_symbol_1(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_2 = ((offset + 0u)) / 4; const uint scalar_offset_3 = ((offset + 64u)) / 4; - const S tint_symbol_5 = {asint(buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]), tint_symbol_3(buffer, (offset + 8u)), asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4])}; - return tint_symbol_5; + const S tint_symbol = {asint(u[scalar_offset_2 / 4][scalar_offset_2 % 4]), u_load_3((offset + 8u)), asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4])}; + return tint_symbol; } -typedef S tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 128u))); + arr[i] = u_load_1((offset + (i * 128u))); } } return arr; @@ -57,9 +57,9 @@ tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); - b(tint_symbol_1(u, 256u)); - c(tint_symbol_3(u, 264u)); + a(u_load(0u)); + b(u_load_1(256u)); + c(u_load_3(264u)); uint2 ubo_load_4 = u[1].xy; vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); vector ubo_load_4_yw = vector(f16tof32(ubo_load_4 >> 16)); diff --git a/test/tint/buffer/uniform/std140/struct/mat2x4_f16/to_private.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat2x4_f16/to_private.wgsl.expected.dxc.hlsl index e1907c3269..ca7c7a2e90 100644 --- a/test/tint/buffer/uniform/std140/struct/mat2x4_f16/to_private.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat2x4_f16/to_private.wgsl.expected.dxc.hlsl @@ -9,33 +9,33 @@ cbuffer cbuffer_u : register(b0, space0) { }; static S p[4] = (S[4])0; -matrix tint_symbol_3(uint4 buffer[32], uint offset) { +matrix u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); vector ubo_load_2_yw = vector(f16tof32(ubo_load_2 >> 16)); return matrix(vector(ubo_load_xz[0], ubo_load_yw[0], ubo_load_xz[1], ubo_load_yw[1]), vector(ubo_load_2_xz[0], ubo_load_2_yw[0], ubo_load_2_xz[1], ubo_load_2_yw[1])); } -S tint_symbol_1(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_2 = ((offset + 0u)) / 4; const uint scalar_offset_3 = ((offset + 64u)) / 4; - const S tint_symbol_5 = {asint(buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]), tint_symbol_3(buffer, (offset + 8u)), asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4])}; - return tint_symbol_5; + const S tint_symbol = {asint(u[scalar_offset_2 / 4][scalar_offset_2 % 4]), u_load_3((offset + 8u)), asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4])}; + return tint_symbol; } -typedef S tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 128u))); + arr[i] = u_load_1((offset + (i * 128u))); } } return arr; @@ -43,9 +43,9 @@ tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); - p[1] = tint_symbol_1(u, 256u); - p[3].m = tint_symbol_3(u, 264u); + p = u_load(0u); + p[1] = u_load_1(256u); + p[3].m = u_load_3(264u); uint2 ubo_load_4 = u[1].xy; vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); vector ubo_load_4_yw = vector(f16tof32(ubo_load_4 >> 16)); diff --git a/test/tint/buffer/uniform/std140/struct/mat2x4_f16/to_storage.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat2x4_f16/to_storage.wgsl.expected.dxc.hlsl index daa5fd7f84..33c8e28746 100644 --- a/test/tint/buffer/uniform/std140/struct/mat2x4_f16/to_storage.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat2x4_f16/to_storage.wgsl.expected.dxc.hlsl @@ -9,53 +9,53 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol_3(RWByteAddressBuffer buffer, uint offset, matrix value) { - buffer.Store >((offset + 0u), value[0u]); - buffer.Store >((offset + 8u), value[1u]); +void s_store_3(uint offset, matrix value) { + s.Store >((offset + 0u), value[0u]); + s.Store >((offset + 8u), value[1u]); } -void tint_symbol_1(RWByteAddressBuffer buffer, uint offset, S value) { - buffer.Store((offset + 0u), asuint(value.before)); - tint_symbol_3(buffer, (offset + 8u), value.m); - buffer.Store((offset + 64u), asuint(value.after)); +void s_store_1(uint offset, S value) { + s.Store((offset + 0u), asuint(value.before)); + s_store_3((offset + 8u), value.m); + s.Store((offset + 64u), asuint(value.after)); } -void tint_symbol(RWByteAddressBuffer buffer, uint offset, S value[4]) { +void s_store(uint offset, S value[4]) { S array_1[4] = value; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - tint_symbol_1(buffer, (offset + (i * 128u)), array_1[i]); + s_store_1((offset + (i * 128u)), array_1[i]); } } } -matrix tint_symbol_8(uint4 buffer[32], uint offset) { +matrix u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); vector ubo_load_2_yw = vector(f16tof32(ubo_load_2 >> 16)); return matrix(vector(ubo_load_xz[0], ubo_load_yw[0], ubo_load_xz[1], ubo_load_yw[1]), vector(ubo_load_2_xz[0], ubo_load_2_yw[0], ubo_load_2_xz[1], ubo_load_2_yw[1])); } -S tint_symbol_6(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_2 = ((offset + 0u)) / 4; const uint scalar_offset_3 = ((offset + 64u)) / 4; - const S tint_symbol_10 = {asint(buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]), tint_symbol_8(buffer, (offset + 8u)), asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4])}; - return tint_symbol_10; + const S tint_symbol = {asint(u[scalar_offset_2 / 4][scalar_offset_2 % 4]), u_load_3((offset + 8u)), asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4])}; + return tint_symbol; } -typedef S tint_symbol_5_ret[4]; -tint_symbol_5_ret tint_symbol_5(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_6(buffer, (offset + (i_1 * 128u))); + arr[i_1] = u_load_1((offset + (i_1 * 128u))); } } return arr; @@ -63,9 +63,9 @@ tint_symbol_5_ret tint_symbol_5(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_5(u, 0u)); - tint_symbol_1(s, 128u, tint_symbol_6(u, 256u)); - tint_symbol_3(s, 392u, tint_symbol_8(u, 264u)); + s_store(0u, u_load(0u)); + s_store_1(128u, u_load_1(256u)); + s_store_3(392u, u_load_3(264u)); uint2 ubo_load_4 = u[1].xy; vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); vector ubo_load_4_yw = vector(f16tof32(ubo_load_4 >> 16)); diff --git a/test/tint/buffer/uniform/std140/struct/mat2x4_f16/to_workgroup.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat2x4_f16/to_workgroup.wgsl.expected.dxc.hlsl index e57c69b2ff..22c32b065e 100644 --- a/test/tint/buffer/uniform/std140/struct/mat2x4_f16/to_workgroup.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat2x4_f16/to_workgroup.wgsl.expected.dxc.hlsl @@ -13,33 +13,33 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -matrix tint_symbol_5(uint4 buffer[32], uint offset) { +matrix u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); vector ubo_load_2_yw = vector(f16tof32(ubo_load_2 >> 16)); return matrix(vector(ubo_load_xz[0], ubo_load_yw[0], ubo_load_xz[1], ubo_load_yw[1]), vector(ubo_load_2_xz[0], ubo_load_2_yw[0], ubo_load_2_xz[1], ubo_load_2_yw[1])); } -S tint_symbol_3(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_2 = ((offset + 0u)) / 4; const uint scalar_offset_3 = ((offset + 64u)) / 4; - const S tint_symbol_8 = {asint(buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]), tint_symbol_5(buffer, (offset + 8u)), asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4])}; - return tint_symbol_8; + const S tint_symbol_3 = {asint(u[scalar_offset_2 / 4][scalar_offset_2 % 4]), u_load_3((offset + 8u)), asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4])}; + return tint_symbol_3; } -typedef S tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_3(buffer, (offset + (i_1 * 128u))); + arr[i_1] = u_load_1((offset + (i_1 * 128u))); } } return arr; @@ -49,14 +49,14 @@ void f_inner(uint local_invocation_index) { { for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) { const uint i = idx; - const S tint_symbol_7 = (S)0; - w[i] = tint_symbol_7; + const S tint_symbol_2 = (S)0; + w[i] = tint_symbol_2; } } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); - w[1] = tint_symbol_3(u, 256u); - w[3].m = tint_symbol_5(u, 264u); + w = u_load(0u); + w[1] = u_load_1(256u); + w[3].m = u_load_3(264u); uint2 ubo_load_4 = u[1].xy; vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); vector ubo_load_4_yw = vector(f16tof32(ubo_load_4 >> 16)); diff --git a/test/tint/buffer/uniform/std140/struct/mat2x4_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat2x4_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl index 0d53f5dcb4..bd90fc43c9 100644 --- a/test/tint/buffer/uniform/std140/struct/mat2x4_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat2x4_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl @@ -15,39 +15,39 @@ int i() { return counter; } -float2x4 tint_symbol_8(uint4 buffer[64], uint offset) { +float2x4 a_load_4(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4])); + return float2x4(asfloat(a[scalar_offset / 4]), asfloat(a[scalar_offset_1 / 4])); } -Inner tint_symbol_7(uint4 buffer[64], uint offset) { - const Inner tint_symbol_11 = {tint_symbol_8(buffer, (offset + 0u))}; - return tint_symbol_11; +Inner a_load_3(uint offset) { + const Inner tint_symbol_4 = {a_load_4((offset + 0u))}; + return tint_symbol_4; } -typedef Inner tint_symbol_6_ret[4]; -tint_symbol_6_ret tint_symbol_6(uint4 buffer[64], uint offset) { +typedef Inner a_load_2_ret[4]; +a_load_2_ret a_load_2(uint offset) { Inner arr[4] = (Inner[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_7(buffer, (offset + (i_1 * 64u))); + arr[i_1] = a_load_3((offset + (i_1 * 64u))); } } return arr; } -Outer tint_symbol_5(uint4 buffer[64], uint offset) { - const Outer tint_symbol_12 = {tint_symbol_6(buffer, (offset + 0u))}; - return tint_symbol_12; +Outer a_load_1(uint offset) { + const Outer tint_symbol_5 = {a_load_2((offset + 0u))}; + return tint_symbol_5; } -typedef Outer tint_symbol_4_ret[4]; -tint_symbol_4_ret tint_symbol_4(uint4 buffer[64], uint offset) { +typedef Outer a_load_ret[4]; +a_load_ret a_load(uint offset) { Outer arr_1[4] = (Outer[4])0; { for(uint i_2 = 0u; (i_2 < 4u); i_2 = (i_2 + 1u)) { - arr_1[i_2] = tint_symbol_5(buffer, (offset + (i_2 * 256u))); + arr_1[i_2] = a_load_1((offset + (i_2 * 256u))); } } return arr_1; @@ -58,11 +58,11 @@ void f() { const int p_a_i_save = i(); const int p_a_i_a_i_save = i(); const int p_a_i_a_i_m_i_save = i(); - const Outer l_a[4] = tint_symbol_4(a, 0u); - const Outer l_a_i = tint_symbol_5(a, (256u * uint(p_a_i_save))); - const Inner l_a_i_a[4] = tint_symbol_6(a, (256u * uint(p_a_i_save))); - const Inner l_a_i_a_i = tint_symbol_7(a, ((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); - const float2x4 l_a_i_a_i_m = tint_symbol_8(a, ((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); + const Outer l_a[4] = a_load(0u); + const Outer l_a_i = a_load_1((256u * uint(p_a_i_save))); + const Inner l_a_i_a[4] = a_load_2((256u * uint(p_a_i_save))); + const Inner l_a_i_a_i = a_load_3(((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); + const float2x4 l_a_i_a_i_m = a_load_4(((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); const uint scalar_offset_2 = ((((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save))) + (16u * uint(p_a_i_a_i_m_i_save)))) / 4; const float4 l_a_i_a_i_m_i = asfloat(a[scalar_offset_2 / 4]); const int tint_symbol = p_a_i_save; diff --git a/test/tint/buffer/uniform/std140/struct/mat2x4_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat2x4_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl index 0d53f5dcb4..bd90fc43c9 100644 --- a/test/tint/buffer/uniform/std140/struct/mat2x4_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat2x4_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl @@ -15,39 +15,39 @@ int i() { return counter; } -float2x4 tint_symbol_8(uint4 buffer[64], uint offset) { +float2x4 a_load_4(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4])); + return float2x4(asfloat(a[scalar_offset / 4]), asfloat(a[scalar_offset_1 / 4])); } -Inner tint_symbol_7(uint4 buffer[64], uint offset) { - const Inner tint_symbol_11 = {tint_symbol_8(buffer, (offset + 0u))}; - return tint_symbol_11; +Inner a_load_3(uint offset) { + const Inner tint_symbol_4 = {a_load_4((offset + 0u))}; + return tint_symbol_4; } -typedef Inner tint_symbol_6_ret[4]; -tint_symbol_6_ret tint_symbol_6(uint4 buffer[64], uint offset) { +typedef Inner a_load_2_ret[4]; +a_load_2_ret a_load_2(uint offset) { Inner arr[4] = (Inner[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_7(buffer, (offset + (i_1 * 64u))); + arr[i_1] = a_load_3((offset + (i_1 * 64u))); } } return arr; } -Outer tint_symbol_5(uint4 buffer[64], uint offset) { - const Outer tint_symbol_12 = {tint_symbol_6(buffer, (offset + 0u))}; - return tint_symbol_12; +Outer a_load_1(uint offset) { + const Outer tint_symbol_5 = {a_load_2((offset + 0u))}; + return tint_symbol_5; } -typedef Outer tint_symbol_4_ret[4]; -tint_symbol_4_ret tint_symbol_4(uint4 buffer[64], uint offset) { +typedef Outer a_load_ret[4]; +a_load_ret a_load(uint offset) { Outer arr_1[4] = (Outer[4])0; { for(uint i_2 = 0u; (i_2 < 4u); i_2 = (i_2 + 1u)) { - arr_1[i_2] = tint_symbol_5(buffer, (offset + (i_2 * 256u))); + arr_1[i_2] = a_load_1((offset + (i_2 * 256u))); } } return arr_1; @@ -58,11 +58,11 @@ void f() { const int p_a_i_save = i(); const int p_a_i_a_i_save = i(); const int p_a_i_a_i_m_i_save = i(); - const Outer l_a[4] = tint_symbol_4(a, 0u); - const Outer l_a_i = tint_symbol_5(a, (256u * uint(p_a_i_save))); - const Inner l_a_i_a[4] = tint_symbol_6(a, (256u * uint(p_a_i_save))); - const Inner l_a_i_a_i = tint_symbol_7(a, ((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); - const float2x4 l_a_i_a_i_m = tint_symbol_8(a, ((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); + const Outer l_a[4] = a_load(0u); + const Outer l_a_i = a_load_1((256u * uint(p_a_i_save))); + const Inner l_a_i_a[4] = a_load_2((256u * uint(p_a_i_save))); + const Inner l_a_i_a_i = a_load_3(((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); + const float2x4 l_a_i_a_i_m = a_load_4(((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); const uint scalar_offset_2 = ((((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save))) + (16u * uint(p_a_i_a_i_m_i_save)))) / 4; const float4 l_a_i_a_i_m_i = asfloat(a[scalar_offset_2 / 4]); const int tint_symbol = p_a_i_save; diff --git a/test/tint/buffer/uniform/std140/struct/mat2x4_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat2x4_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl index 9b489d1ddd..ff16e40f81 100644 --- a/test/tint/buffer/uniform/std140/struct/mat2x4_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat2x4_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl @@ -9,39 +9,39 @@ cbuffer cbuffer_a : register(b0, space0) { uint4 a[64]; }; -float2x4 tint_symbol_4(uint4 buffer[64], uint offset) { +float2x4 a_load_4(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4])); + return float2x4(asfloat(a[scalar_offset / 4]), asfloat(a[scalar_offset_1 / 4])); } -Inner tint_symbol_3(uint4 buffer[64], uint offset) { - const Inner tint_symbol_7 = {tint_symbol_4(buffer, (offset + 0u))}; - return tint_symbol_7; +Inner a_load_3(uint offset) { + const Inner tint_symbol = {a_load_4((offset + 0u))}; + return tint_symbol; } -typedef Inner tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[64], uint offset) { +typedef Inner a_load_2_ret[4]; +a_load_2_ret a_load_2(uint offset) { Inner arr[4] = (Inner[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_3(buffer, (offset + (i * 64u))); + arr[i] = a_load_3((offset + (i * 64u))); } } return arr; } -Outer tint_symbol_1(uint4 buffer[64], uint offset) { - const Outer tint_symbol_8 = {tint_symbol_2(buffer, (offset + 0u))}; - return tint_symbol_8; +Outer a_load_1(uint offset) { + const Outer tint_symbol_1 = {a_load_2((offset + 0u))}; + return tint_symbol_1; } -typedef Outer tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[64], uint offset) { +typedef Outer a_load_ret[4]; +a_load_ret a_load(uint offset) { Outer arr_1[4] = (Outer[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr_1[i_1] = tint_symbol_1(buffer, (offset + (i_1 * 256u))); + arr_1[i_1] = a_load_1((offset + (i_1 * 256u))); } } return arr_1; @@ -49,11 +49,11 @@ tint_symbol_ret tint_symbol(uint4 buffer[64], uint offset) { [numthreads(1, 1, 1)] void f() { - const Outer l_a[4] = tint_symbol(a, 0u); - const Outer l_a_3 = tint_symbol_1(a, 768u); - const Inner l_a_3_a[4] = tint_symbol_2(a, 768u); - const Inner l_a_3_a_2 = tint_symbol_3(a, 896u); - const float2x4 l_a_3_a_2_m = tint_symbol_4(a, 896u); + const Outer l_a[4] = a_load(0u); + const Outer l_a_3 = a_load_1(768u); + const Inner l_a_3_a[4] = a_load_2(768u); + const Inner l_a_3_a_2 = a_load_3(896u); + const float2x4 l_a_3_a_2_m = a_load_4(896u); const float4 l_a_3_a_2_m_1 = asfloat(a[57]); const float l_a_3_a_2_m_1_0 = asfloat(a[57].x); return; diff --git a/test/tint/buffer/uniform/std140/struct/mat2x4_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat2x4_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl index 9b489d1ddd..ff16e40f81 100644 --- a/test/tint/buffer/uniform/std140/struct/mat2x4_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat2x4_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl @@ -9,39 +9,39 @@ cbuffer cbuffer_a : register(b0, space0) { uint4 a[64]; }; -float2x4 tint_symbol_4(uint4 buffer[64], uint offset) { +float2x4 a_load_4(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4])); + return float2x4(asfloat(a[scalar_offset / 4]), asfloat(a[scalar_offset_1 / 4])); } -Inner tint_symbol_3(uint4 buffer[64], uint offset) { - const Inner tint_symbol_7 = {tint_symbol_4(buffer, (offset + 0u))}; - return tint_symbol_7; +Inner a_load_3(uint offset) { + const Inner tint_symbol = {a_load_4((offset + 0u))}; + return tint_symbol; } -typedef Inner tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[64], uint offset) { +typedef Inner a_load_2_ret[4]; +a_load_2_ret a_load_2(uint offset) { Inner arr[4] = (Inner[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_3(buffer, (offset + (i * 64u))); + arr[i] = a_load_3((offset + (i * 64u))); } } return arr; } -Outer tint_symbol_1(uint4 buffer[64], uint offset) { - const Outer tint_symbol_8 = {tint_symbol_2(buffer, (offset + 0u))}; - return tint_symbol_8; +Outer a_load_1(uint offset) { + const Outer tint_symbol_1 = {a_load_2((offset + 0u))}; + return tint_symbol_1; } -typedef Outer tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[64], uint offset) { +typedef Outer a_load_ret[4]; +a_load_ret a_load(uint offset) { Outer arr_1[4] = (Outer[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr_1[i_1] = tint_symbol_1(buffer, (offset + (i_1 * 256u))); + arr_1[i_1] = a_load_1((offset + (i_1 * 256u))); } } return arr_1; @@ -49,11 +49,11 @@ tint_symbol_ret tint_symbol(uint4 buffer[64], uint offset) { [numthreads(1, 1, 1)] void f() { - const Outer l_a[4] = tint_symbol(a, 0u); - const Outer l_a_3 = tint_symbol_1(a, 768u); - const Inner l_a_3_a[4] = tint_symbol_2(a, 768u); - const Inner l_a_3_a_2 = tint_symbol_3(a, 896u); - const float2x4 l_a_3_a_2_m = tint_symbol_4(a, 896u); + const Outer l_a[4] = a_load(0u); + const Outer l_a_3 = a_load_1(768u); + const Inner l_a_3_a[4] = a_load_2(768u); + const Inner l_a_3_a_2 = a_load_3(896u); + const float2x4 l_a_3_a_2_m = a_load_4(896u); const float4 l_a_3_a_2_m_1 = asfloat(a[57]); const float l_a_3_a_2_m_1_0 = asfloat(a[57].x); return; diff --git a/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_builtin.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_builtin.wgsl.expected.dxc.hlsl index c7ea34135f..6393ebef72 100644 --- a/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_builtin.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_builtin.wgsl.expected.dxc.hlsl @@ -2,15 +2,15 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[32]; }; -float2x4 tint_symbol(uint4 buffer[32], uint offset) { +float2x4 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4])); + return float2x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4])); } [numthreads(1, 1, 1)] void f() { - const float4x2 t = transpose(tint_symbol(u, 272u)); + const float4x2 t = transpose(u_load(272u)); const float l = length(asfloat(u[2]).ywxz); const float a = abs(asfloat(u[2]).ywxz.x); return; diff --git a/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_builtin.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_builtin.wgsl.expected.fxc.hlsl index c7ea34135f..6393ebef72 100644 --- a/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_builtin.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_builtin.wgsl.expected.fxc.hlsl @@ -2,15 +2,15 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[32]; }; -float2x4 tint_symbol(uint4 buffer[32], uint offset) { +float2x4 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4])); + return float2x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4])); } [numthreads(1, 1, 1)] void f() { - const float4x2 t = transpose(tint_symbol(u, 272u)); + const float4x2 t = transpose(u_load(272u)); const float l = length(asfloat(u[2]).ywxz); const float a = abs(asfloat(u[2]).ywxz.x); return; diff --git a/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_fn.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_fn.wgsl.expected.dxc.hlsl index c3c69962af..18b3e71116 100644 --- a/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_fn.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_fn.wgsl.expected.dxc.hlsl @@ -23,25 +23,25 @@ void d(float4 v) { void e(float f_1) { } -float2x4 tint_symbol_3(uint4 buffer[32], uint offset) { +float2x4 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4])); + return float2x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4])); } -S tint_symbol_1(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_2 = ((offset + 0u)) / 4; const uint scalar_offset_3 = ((offset + 64u)) / 4; - const S tint_symbol_5 = {asint(buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]), tint_symbol_3(buffer, (offset + 16u)), asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4])}; - return tint_symbol_5; + const S tint_symbol = {asint(u[scalar_offset_2 / 4][scalar_offset_2 % 4]), u_load_3((offset + 16u)), asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4])}; + return tint_symbol; } -typedef S tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 128u))); + arr[i] = u_load_1((offset + (i * 128u))); } } return arr; @@ -49,9 +49,9 @@ tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); - b(tint_symbol_1(u, 256u)); - c(tint_symbol_3(u, 272u)); + a(u_load(0u)); + b(u_load_1(256u)); + c(u_load_3(272u)); d(asfloat(u[2]).ywxz); e(asfloat(u[2]).ywxz.x); return; diff --git a/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_fn.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_fn.wgsl.expected.fxc.hlsl index c3c69962af..18b3e71116 100644 --- a/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_fn.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_fn.wgsl.expected.fxc.hlsl @@ -23,25 +23,25 @@ void d(float4 v) { void e(float f_1) { } -float2x4 tint_symbol_3(uint4 buffer[32], uint offset) { +float2x4 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4])); + return float2x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4])); } -S tint_symbol_1(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_2 = ((offset + 0u)) / 4; const uint scalar_offset_3 = ((offset + 64u)) / 4; - const S tint_symbol_5 = {asint(buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]), tint_symbol_3(buffer, (offset + 16u)), asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4])}; - return tint_symbol_5; + const S tint_symbol = {asint(u[scalar_offset_2 / 4][scalar_offset_2 % 4]), u_load_3((offset + 16u)), asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4])}; + return tint_symbol; } -typedef S tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 128u))); + arr[i] = u_load_1((offset + (i * 128u))); } } return arr; @@ -49,9 +49,9 @@ tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); - b(tint_symbol_1(u, 256u)); - c(tint_symbol_3(u, 272u)); + a(u_load(0u)); + b(u_load_1(256u)); + c(u_load_3(272u)); d(asfloat(u[2]).ywxz); e(asfloat(u[2]).ywxz.x); return; diff --git a/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_private.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_private.wgsl.expected.dxc.hlsl index 55acd61cc2..e68fec1190 100644 --- a/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_private.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_private.wgsl.expected.dxc.hlsl @@ -9,25 +9,25 @@ cbuffer cbuffer_u : register(b0, space0) { }; static S p[4] = (S[4])0; -float2x4 tint_symbol_3(uint4 buffer[32], uint offset) { +float2x4 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4])); + return float2x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4])); } -S tint_symbol_1(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_2 = ((offset + 0u)) / 4; const uint scalar_offset_3 = ((offset + 64u)) / 4; - const S tint_symbol_5 = {asint(buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]), tint_symbol_3(buffer, (offset + 16u)), asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4])}; - return tint_symbol_5; + const S tint_symbol = {asint(u[scalar_offset_2 / 4][scalar_offset_2 % 4]), u_load_3((offset + 16u)), asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4])}; + return tint_symbol; } -typedef S tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 128u))); + arr[i] = u_load_1((offset + (i * 128u))); } } return arr; @@ -35,9 +35,9 @@ tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); - p[1] = tint_symbol_1(u, 256u); - p[3].m = tint_symbol_3(u, 272u); + p = u_load(0u); + p[1] = u_load_1(256u); + p[3].m = u_load_3(272u); p[1].m[0] = asfloat(u[2]).ywxz; return; } diff --git a/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_private.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_private.wgsl.expected.fxc.hlsl index 55acd61cc2..e68fec1190 100644 --- a/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_private.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_private.wgsl.expected.fxc.hlsl @@ -9,25 +9,25 @@ cbuffer cbuffer_u : register(b0, space0) { }; static S p[4] = (S[4])0; -float2x4 tint_symbol_3(uint4 buffer[32], uint offset) { +float2x4 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4])); + return float2x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4])); } -S tint_symbol_1(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_2 = ((offset + 0u)) / 4; const uint scalar_offset_3 = ((offset + 64u)) / 4; - const S tint_symbol_5 = {asint(buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]), tint_symbol_3(buffer, (offset + 16u)), asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4])}; - return tint_symbol_5; + const S tint_symbol = {asint(u[scalar_offset_2 / 4][scalar_offset_2 % 4]), u_load_3((offset + 16u)), asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4])}; + return tint_symbol; } -typedef S tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 128u))); + arr[i] = u_load_1((offset + (i * 128u))); } } return arr; @@ -35,9 +35,9 @@ tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); - p[1] = tint_symbol_1(u, 256u); - p[3].m = tint_symbol_3(u, 272u); + p = u_load(0u); + p[1] = u_load_1(256u); + p[3].m = u_load_3(272u); p[1].m[0] = asfloat(u[2]).ywxz; return; } diff --git a/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_storage.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_storage.wgsl.expected.dxc.hlsl index 425d179cf6..bd34bd7f69 100644 --- a/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_storage.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_storage.wgsl.expected.dxc.hlsl @@ -9,45 +9,45 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol_3(RWByteAddressBuffer buffer, uint offset, float2x4 value) { - buffer.Store4((offset + 0u), asuint(value[0u])); - buffer.Store4((offset + 16u), asuint(value[1u])); +void s_store_3(uint offset, float2x4 value) { + s.Store4((offset + 0u), asuint(value[0u])); + s.Store4((offset + 16u), asuint(value[1u])); } -void tint_symbol_1(RWByteAddressBuffer buffer, uint offset, S value) { - buffer.Store((offset + 0u), asuint(value.before)); - tint_symbol_3(buffer, (offset + 16u), value.m); - buffer.Store((offset + 64u), asuint(value.after)); +void s_store_1(uint offset, S value) { + s.Store((offset + 0u), asuint(value.before)); + s_store_3((offset + 16u), value.m); + s.Store((offset + 64u), asuint(value.after)); } -void tint_symbol(RWByteAddressBuffer buffer, uint offset, S value[4]) { +void s_store(uint offset, S value[4]) { S array_1[4] = value; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - tint_symbol_1(buffer, (offset + (i * 128u)), array_1[i]); + s_store_1((offset + (i * 128u)), array_1[i]); } } } -float2x4 tint_symbol_8(uint4 buffer[32], uint offset) { +float2x4 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4])); + return float2x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4])); } -S tint_symbol_6(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_2 = ((offset + 0u)) / 4; const uint scalar_offset_3 = ((offset + 64u)) / 4; - const S tint_symbol_10 = {asint(buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]), tint_symbol_8(buffer, (offset + 16u)), asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4])}; - return tint_symbol_10; + const S tint_symbol = {asint(u[scalar_offset_2 / 4][scalar_offset_2 % 4]), u_load_3((offset + 16u)), asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4])}; + return tint_symbol; } -typedef S tint_symbol_5_ret[4]; -tint_symbol_5_ret tint_symbol_5(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_6(buffer, (offset + (i_1 * 128u))); + arr[i_1] = u_load_1((offset + (i_1 * 128u))); } } return arr; @@ -55,9 +55,9 @@ tint_symbol_5_ret tint_symbol_5(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_5(u, 0u)); - tint_symbol_1(s, 128u, tint_symbol_6(u, 256u)); - tint_symbol_3(s, 400u, tint_symbol_8(u, 272u)); + s_store(0u, u_load(0u)); + s_store_1(128u, u_load_1(256u)); + s_store_3(400u, u_load_3(272u)); s.Store4(144u, asuint(asfloat(u[2]).ywxz)); return; } diff --git a/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_storage.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_storage.wgsl.expected.fxc.hlsl index 425d179cf6..bd34bd7f69 100644 --- a/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_storage.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_storage.wgsl.expected.fxc.hlsl @@ -9,45 +9,45 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol_3(RWByteAddressBuffer buffer, uint offset, float2x4 value) { - buffer.Store4((offset + 0u), asuint(value[0u])); - buffer.Store4((offset + 16u), asuint(value[1u])); +void s_store_3(uint offset, float2x4 value) { + s.Store4((offset + 0u), asuint(value[0u])); + s.Store4((offset + 16u), asuint(value[1u])); } -void tint_symbol_1(RWByteAddressBuffer buffer, uint offset, S value) { - buffer.Store((offset + 0u), asuint(value.before)); - tint_symbol_3(buffer, (offset + 16u), value.m); - buffer.Store((offset + 64u), asuint(value.after)); +void s_store_1(uint offset, S value) { + s.Store((offset + 0u), asuint(value.before)); + s_store_3((offset + 16u), value.m); + s.Store((offset + 64u), asuint(value.after)); } -void tint_symbol(RWByteAddressBuffer buffer, uint offset, S value[4]) { +void s_store(uint offset, S value[4]) { S array_1[4] = value; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - tint_symbol_1(buffer, (offset + (i * 128u)), array_1[i]); + s_store_1((offset + (i * 128u)), array_1[i]); } } } -float2x4 tint_symbol_8(uint4 buffer[32], uint offset) { +float2x4 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4])); + return float2x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4])); } -S tint_symbol_6(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_2 = ((offset + 0u)) / 4; const uint scalar_offset_3 = ((offset + 64u)) / 4; - const S tint_symbol_10 = {asint(buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]), tint_symbol_8(buffer, (offset + 16u)), asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4])}; - return tint_symbol_10; + const S tint_symbol = {asint(u[scalar_offset_2 / 4][scalar_offset_2 % 4]), u_load_3((offset + 16u)), asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4])}; + return tint_symbol; } -typedef S tint_symbol_5_ret[4]; -tint_symbol_5_ret tint_symbol_5(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_6(buffer, (offset + (i_1 * 128u))); + arr[i_1] = u_load_1((offset + (i_1 * 128u))); } } return arr; @@ -55,9 +55,9 @@ tint_symbol_5_ret tint_symbol_5(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_5(u, 0u)); - tint_symbol_1(s, 128u, tint_symbol_6(u, 256u)); - tint_symbol_3(s, 400u, tint_symbol_8(u, 272u)); + s_store(0u, u_load(0u)); + s_store_1(128u, u_load_1(256u)); + s_store_3(400u, u_load_3(272u)); s.Store4(144u, asuint(asfloat(u[2]).ywxz)); return; } diff --git a/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_workgroup.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_workgroup.wgsl.expected.dxc.hlsl index 9f23bf32d0..f453ee3e94 100644 --- a/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_workgroup.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_workgroup.wgsl.expected.dxc.hlsl @@ -13,25 +13,25 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -float2x4 tint_symbol_5(uint4 buffer[32], uint offset) { +float2x4 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4])); + return float2x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4])); } -S tint_symbol_3(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_2 = ((offset + 0u)) / 4; const uint scalar_offset_3 = ((offset + 64u)) / 4; - const S tint_symbol_8 = {asint(buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]), tint_symbol_5(buffer, (offset + 16u)), asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4])}; - return tint_symbol_8; + const S tint_symbol_3 = {asint(u[scalar_offset_2 / 4][scalar_offset_2 % 4]), u_load_3((offset + 16u)), asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4])}; + return tint_symbol_3; } -typedef S tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_3(buffer, (offset + (i_1 * 128u))); + arr[i_1] = u_load_1((offset + (i_1 * 128u))); } } return arr; @@ -41,14 +41,14 @@ void f_inner(uint local_invocation_index) { { for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) { const uint i = idx; - const S tint_symbol_7 = (S)0; - w[i] = tint_symbol_7; + const S tint_symbol_2 = (S)0; + w[i] = tint_symbol_2; } } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); - w[1] = tint_symbol_3(u, 256u); - w[3].m = tint_symbol_5(u, 272u); + w = u_load(0u); + w[1] = u_load_1(256u); + w[3].m = u_load_3(272u); w[1].m[0] = asfloat(u[2]).ywxz; } diff --git a/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_workgroup.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_workgroup.wgsl.expected.fxc.hlsl index 9f23bf32d0..f453ee3e94 100644 --- a/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_workgroup.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat2x4_f32/to_workgroup.wgsl.expected.fxc.hlsl @@ -13,25 +13,25 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -float2x4 tint_symbol_5(uint4 buffer[32], uint offset) { +float2x4 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4])); + return float2x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4])); } -S tint_symbol_3(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_2 = ((offset + 0u)) / 4; const uint scalar_offset_3 = ((offset + 64u)) / 4; - const S tint_symbol_8 = {asint(buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]), tint_symbol_5(buffer, (offset + 16u)), asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4])}; - return tint_symbol_8; + const S tint_symbol_3 = {asint(u[scalar_offset_2 / 4][scalar_offset_2 % 4]), u_load_3((offset + 16u)), asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4])}; + return tint_symbol_3; } -typedef S tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_3(buffer, (offset + (i_1 * 128u))); + arr[i_1] = u_load_1((offset + (i_1 * 128u))); } } return arr; @@ -41,14 +41,14 @@ void f_inner(uint local_invocation_index) { { for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) { const uint i = idx; - const S tint_symbol_7 = (S)0; - w[i] = tint_symbol_7; + const S tint_symbol_2 = (S)0; + w[i] = tint_symbol_2; } } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); - w[1] = tint_symbol_3(u, 256u); - w[3].m = tint_symbol_5(u, 272u); + w = u_load(0u); + w[1] = u_load_1(256u); + w[3].m = u_load_3(272u); w[1].m[0] = asfloat(u[2]).ywxz; } diff --git a/test/tint/buffer/uniform/std140/struct/mat3x2_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat3x2_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl index 33c5e7a34a..4be38a394b 100644 --- a/test/tint/buffer/uniform/std140/struct/mat3x2_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat3x2_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl @@ -15,43 +15,43 @@ int i() { return counter; } -matrix tint_symbol_8(uint4 buffer[64], uint offset) { +matrix a_load_4(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint ubo_load = buffer[scalar_offset / 4][scalar_offset % 4]; + uint ubo_load = a[scalar_offset / 4][scalar_offset % 4]; const uint scalar_offset_1 = ((offset + 4u)) / 4; - uint ubo_load_1 = buffer[scalar_offset_1 / 4][scalar_offset_1 % 4]; + uint ubo_load_1 = a[scalar_offset_1 / 4][scalar_offset_1 % 4]; const uint scalar_offset_2 = ((offset + 8u)) / 4; - uint ubo_load_2 = buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]; + uint ubo_load_2 = a[scalar_offset_2 / 4][scalar_offset_2 % 4]; return matrix(vector(float16_t(f16tof32(ubo_load & 0xFFFF)), float16_t(f16tof32(ubo_load >> 16))), vector(float16_t(f16tof32(ubo_load_1 & 0xFFFF)), float16_t(f16tof32(ubo_load_1 >> 16))), vector(float16_t(f16tof32(ubo_load_2 & 0xFFFF)), float16_t(f16tof32(ubo_load_2 >> 16)))); } -Inner tint_symbol_7(uint4 buffer[64], uint offset) { - const Inner tint_symbol_11 = {tint_symbol_8(buffer, (offset + 0u))}; - return tint_symbol_11; +Inner a_load_3(uint offset) { + const Inner tint_symbol_4 = {a_load_4((offset + 0u))}; + return tint_symbol_4; } -typedef Inner tint_symbol_6_ret[4]; -tint_symbol_6_ret tint_symbol_6(uint4 buffer[64], uint offset) { +typedef Inner a_load_2_ret[4]; +a_load_2_ret a_load_2(uint offset) { Inner arr[4] = (Inner[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_7(buffer, (offset + (i_1 * 64u))); + arr[i_1] = a_load_3((offset + (i_1 * 64u))); } } return arr; } -Outer tint_symbol_5(uint4 buffer[64], uint offset) { - const Outer tint_symbol_12 = {tint_symbol_6(buffer, (offset + 0u))}; - return tint_symbol_12; +Outer a_load_1(uint offset) { + const Outer tint_symbol_5 = {a_load_2((offset + 0u))}; + return tint_symbol_5; } -typedef Outer tint_symbol_4_ret[4]; -tint_symbol_4_ret tint_symbol_4(uint4 buffer[64], uint offset) { +typedef Outer a_load_ret[4]; +a_load_ret a_load(uint offset) { Outer arr_1[4] = (Outer[4])0; { for(uint i_2 = 0u; (i_2 < 4u); i_2 = (i_2 + 1u)) { - arr_1[i_2] = tint_symbol_5(buffer, (offset + (i_2 * 256u))); + arr_1[i_2] = a_load_1((offset + (i_2 * 256u))); } } return arr_1; @@ -62,11 +62,11 @@ void f() { const int p_a_i_save = i(); const int p_a_i_a_i_save = i(); const int p_a_i_a_i_m_i_save = i(); - const Outer l_a[4] = tint_symbol_4(a, 0u); - const Outer l_a_i = tint_symbol_5(a, (256u * uint(p_a_i_save))); - const Inner l_a_i_a[4] = tint_symbol_6(a, (256u * uint(p_a_i_save))); - const Inner l_a_i_a_i = tint_symbol_7(a, ((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); - const matrix l_a_i_a_i_m = tint_symbol_8(a, ((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); + const Outer l_a[4] = a_load(0u); + const Outer l_a_i = a_load_1((256u * uint(p_a_i_save))); + const Inner l_a_i_a[4] = a_load_2((256u * uint(p_a_i_save))); + const Inner l_a_i_a_i = a_load_3(((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); + const matrix l_a_i_a_i_m = a_load_4(((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); const uint scalar_offset_3 = ((((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save))) + (4u * uint(p_a_i_a_i_m_i_save)))) / 4; uint ubo_load_3 = a[scalar_offset_3 / 4][scalar_offset_3 % 4]; const vector l_a_i_a_i_m_i = vector(float16_t(f16tof32(ubo_load_3 & 0xFFFF)), float16_t(f16tof32(ubo_load_3 >> 16))); diff --git a/test/tint/buffer/uniform/std140/struct/mat3x2_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat3x2_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl index 551b5337e5..a9ec7c5d05 100644 --- a/test/tint/buffer/uniform/std140/struct/mat3x2_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat3x2_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl @@ -9,43 +9,43 @@ cbuffer cbuffer_a : register(b0, space0) { uint4 a[64]; }; -matrix tint_symbol_4(uint4 buffer[64], uint offset) { +matrix a_load_4(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint ubo_load = buffer[scalar_offset / 4][scalar_offset % 4]; + uint ubo_load = a[scalar_offset / 4][scalar_offset % 4]; const uint scalar_offset_1 = ((offset + 4u)) / 4; - uint ubo_load_1 = buffer[scalar_offset_1 / 4][scalar_offset_1 % 4]; + uint ubo_load_1 = a[scalar_offset_1 / 4][scalar_offset_1 % 4]; const uint scalar_offset_2 = ((offset + 8u)) / 4; - uint ubo_load_2 = buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]; + uint ubo_load_2 = a[scalar_offset_2 / 4][scalar_offset_2 % 4]; return matrix(vector(float16_t(f16tof32(ubo_load & 0xFFFF)), float16_t(f16tof32(ubo_load >> 16))), vector(float16_t(f16tof32(ubo_load_1 & 0xFFFF)), float16_t(f16tof32(ubo_load_1 >> 16))), vector(float16_t(f16tof32(ubo_load_2 & 0xFFFF)), float16_t(f16tof32(ubo_load_2 >> 16)))); } -Inner tint_symbol_3(uint4 buffer[64], uint offset) { - const Inner tint_symbol_7 = {tint_symbol_4(buffer, (offset + 0u))}; - return tint_symbol_7; +Inner a_load_3(uint offset) { + const Inner tint_symbol = {a_load_4((offset + 0u))}; + return tint_symbol; } -typedef Inner tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[64], uint offset) { +typedef Inner a_load_2_ret[4]; +a_load_2_ret a_load_2(uint offset) { Inner arr[4] = (Inner[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_3(buffer, (offset + (i * 64u))); + arr[i] = a_load_3((offset + (i * 64u))); } } return arr; } -Outer tint_symbol_1(uint4 buffer[64], uint offset) { - const Outer tint_symbol_8 = {tint_symbol_2(buffer, (offset + 0u))}; - return tint_symbol_8; +Outer a_load_1(uint offset) { + const Outer tint_symbol_1 = {a_load_2((offset + 0u))}; + return tint_symbol_1; } -typedef Outer tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[64], uint offset) { +typedef Outer a_load_ret[4]; +a_load_ret a_load(uint offset) { Outer arr_1[4] = (Outer[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr_1[i_1] = tint_symbol_1(buffer, (offset + (i_1 * 256u))); + arr_1[i_1] = a_load_1((offset + (i_1 * 256u))); } } return arr_1; @@ -53,11 +53,11 @@ tint_symbol_ret tint_symbol(uint4 buffer[64], uint offset) { [numthreads(1, 1, 1)] void f() { - const Outer l_a[4] = tint_symbol(a, 0u); - const Outer l_a_3 = tint_symbol_1(a, 768u); - const Inner l_a_3_a[4] = tint_symbol_2(a, 768u); - const Inner l_a_3_a_2 = tint_symbol_3(a, 896u); - const matrix l_a_3_a_2_m = tint_symbol_4(a, 896u); + const Outer l_a[4] = a_load(0u); + const Outer l_a_3 = a_load_1(768u); + const Inner l_a_3_a[4] = a_load_2(768u); + const Inner l_a_3_a_2 = a_load_3(896u); + const matrix l_a_3_a_2_m = a_load_4(896u); uint ubo_load_3 = a[56].y; const vector l_a_3_a_2_m_1 = vector(float16_t(f16tof32(ubo_load_3 & 0xFFFF)), float16_t(f16tof32(ubo_load_3 >> 16))); const float16_t l_a_3_a_2_m_1_0 = float16_t(f16tof32(((a[56].y) & 0xFFFF))); diff --git a/test/tint/buffer/uniform/std140/struct/mat3x2_f16/to_builtin.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat3x2_f16/to_builtin.wgsl.expected.dxc.hlsl index 3dfa58d1b6..6d30e52980 100644 --- a/test/tint/buffer/uniform/std140/struct/mat3x2_f16/to_builtin.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat3x2_f16/to_builtin.wgsl.expected.dxc.hlsl @@ -2,19 +2,19 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[32]; }; -matrix tint_symbol(uint4 buffer[32], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint ubo_load = buffer[scalar_offset / 4][scalar_offset % 4]; + uint ubo_load = u[scalar_offset / 4][scalar_offset % 4]; const uint scalar_offset_1 = ((offset + 4u)) / 4; - uint ubo_load_1 = buffer[scalar_offset_1 / 4][scalar_offset_1 % 4]; + uint ubo_load_1 = u[scalar_offset_1 / 4][scalar_offset_1 % 4]; const uint scalar_offset_2 = ((offset + 8u)) / 4; - uint ubo_load_2 = buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]; + uint ubo_load_2 = u[scalar_offset_2 / 4][scalar_offset_2 % 4]; return matrix(vector(float16_t(f16tof32(ubo_load & 0xFFFF)), float16_t(f16tof32(ubo_load >> 16))), vector(float16_t(f16tof32(ubo_load_1 & 0xFFFF)), float16_t(f16tof32(ubo_load_1 >> 16))), vector(float16_t(f16tof32(ubo_load_2 & 0xFFFF)), float16_t(f16tof32(ubo_load_2 >> 16)))); } [numthreads(1, 1, 1)] void f() { - const matrix t = transpose(tint_symbol(u, 260u)); + const matrix t = transpose(u_load(260u)); uint ubo_load_3 = u[0].z; const float16_t l = length(vector(float16_t(f16tof32(ubo_load_3 & 0xFFFF)), float16_t(f16tof32(ubo_load_3 >> 16))).yx); uint ubo_load_4 = u[0].z; diff --git a/test/tint/buffer/uniform/std140/struct/mat3x2_f16/to_fn.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat3x2_f16/to_fn.wgsl.expected.dxc.hlsl index b0b76cc796..c8164020d3 100644 --- a/test/tint/buffer/uniform/std140/struct/mat3x2_f16/to_fn.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat3x2_f16/to_fn.wgsl.expected.dxc.hlsl @@ -23,29 +23,29 @@ void d(vector v) { void e(float16_t f_1) { } -matrix tint_symbol_3(uint4 buffer[32], uint offset) { +matrix u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint ubo_load = buffer[scalar_offset / 4][scalar_offset % 4]; + uint ubo_load = u[scalar_offset / 4][scalar_offset % 4]; const uint scalar_offset_1 = ((offset + 4u)) / 4; - uint ubo_load_1 = buffer[scalar_offset_1 / 4][scalar_offset_1 % 4]; + uint ubo_load_1 = u[scalar_offset_1 / 4][scalar_offset_1 % 4]; const uint scalar_offset_2 = ((offset + 8u)) / 4; - uint ubo_load_2 = buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]; + uint ubo_load_2 = u[scalar_offset_2 / 4][scalar_offset_2 % 4]; return matrix(vector(float16_t(f16tof32(ubo_load & 0xFFFF)), float16_t(f16tof32(ubo_load >> 16))), vector(float16_t(f16tof32(ubo_load_1 & 0xFFFF)), float16_t(f16tof32(ubo_load_1 >> 16))), vector(float16_t(f16tof32(ubo_load_2 & 0xFFFF)), float16_t(f16tof32(ubo_load_2 >> 16)))); } -S tint_symbol_1(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_4 = ((offset + 64u)) / 4; - const S tint_symbol_5 = {asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), tint_symbol_3(buffer, (offset + 4u)), asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4])}; - return tint_symbol_5; + const S tint_symbol = {asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4]), u_load_3((offset + 4u)), asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4])}; + return tint_symbol; } -typedef S tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 128u))); + arr[i] = u_load_1((offset + (i * 128u))); } } return arr; @@ -53,9 +53,9 @@ tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); - b(tint_symbol_1(u, 256u)); - c(tint_symbol_3(u, 260u)); + a(u_load(0u)); + b(u_load_1(256u)); + c(u_load_3(260u)); uint ubo_load_3 = u[0].z; d(vector(float16_t(f16tof32(ubo_load_3 & 0xFFFF)), float16_t(f16tof32(ubo_load_3 >> 16))).yx); uint ubo_load_4 = u[0].z; diff --git a/test/tint/buffer/uniform/std140/struct/mat3x2_f16/to_private.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat3x2_f16/to_private.wgsl.expected.dxc.hlsl index ebcb8964e1..848a3958b1 100644 --- a/test/tint/buffer/uniform/std140/struct/mat3x2_f16/to_private.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat3x2_f16/to_private.wgsl.expected.dxc.hlsl @@ -9,29 +9,29 @@ cbuffer cbuffer_u : register(b0, space0) { }; static S p[4] = (S[4])0; -matrix tint_symbol_3(uint4 buffer[32], uint offset) { +matrix u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint ubo_load = buffer[scalar_offset / 4][scalar_offset % 4]; + uint ubo_load = u[scalar_offset / 4][scalar_offset % 4]; const uint scalar_offset_1 = ((offset + 4u)) / 4; - uint ubo_load_1 = buffer[scalar_offset_1 / 4][scalar_offset_1 % 4]; + uint ubo_load_1 = u[scalar_offset_1 / 4][scalar_offset_1 % 4]; const uint scalar_offset_2 = ((offset + 8u)) / 4; - uint ubo_load_2 = buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]; + uint ubo_load_2 = u[scalar_offset_2 / 4][scalar_offset_2 % 4]; return matrix(vector(float16_t(f16tof32(ubo_load & 0xFFFF)), float16_t(f16tof32(ubo_load >> 16))), vector(float16_t(f16tof32(ubo_load_1 & 0xFFFF)), float16_t(f16tof32(ubo_load_1 >> 16))), vector(float16_t(f16tof32(ubo_load_2 & 0xFFFF)), float16_t(f16tof32(ubo_load_2 >> 16)))); } -S tint_symbol_1(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_4 = ((offset + 64u)) / 4; - const S tint_symbol_5 = {asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), tint_symbol_3(buffer, (offset + 4u)), asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4])}; - return tint_symbol_5; + const S tint_symbol = {asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4]), u_load_3((offset + 4u)), asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4])}; + return tint_symbol; } -typedef S tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 128u))); + arr[i] = u_load_1((offset + (i * 128u))); } } return arr; @@ -39,9 +39,9 @@ tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); - p[1] = tint_symbol_1(u, 256u); - p[3].m = tint_symbol_3(u, 260u); + p = u_load(0u); + p[1] = u_load_1(256u); + p[3].m = u_load_3(260u); uint ubo_load_3 = u[0].z; p[1].m[0] = vector(float16_t(f16tof32(ubo_load_3 & 0xFFFF)), float16_t(f16tof32(ubo_load_3 >> 16))).yx; return; diff --git a/test/tint/buffer/uniform/std140/struct/mat3x2_f16/to_storage.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat3x2_f16/to_storage.wgsl.expected.dxc.hlsl index 2a909739b2..e1fb4d89df 100644 --- a/test/tint/buffer/uniform/std140/struct/mat3x2_f16/to_storage.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat3x2_f16/to_storage.wgsl.expected.dxc.hlsl @@ -9,50 +9,50 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol_3(RWByteAddressBuffer buffer, uint offset, matrix value) { - buffer.Store >((offset + 0u), value[0u]); - buffer.Store >((offset + 4u), value[1u]); - buffer.Store >((offset + 8u), value[2u]); +void s_store_3(uint offset, matrix value) { + s.Store >((offset + 0u), value[0u]); + s.Store >((offset + 4u), value[1u]); + s.Store >((offset + 8u), value[2u]); } -void tint_symbol_1(RWByteAddressBuffer buffer, uint offset, S value) { - buffer.Store((offset + 0u), asuint(value.before)); - tint_symbol_3(buffer, (offset + 4u), value.m); - buffer.Store((offset + 64u), asuint(value.after)); +void s_store_1(uint offset, S value) { + s.Store((offset + 0u), asuint(value.before)); + s_store_3((offset + 4u), value.m); + s.Store((offset + 64u), asuint(value.after)); } -void tint_symbol(RWByteAddressBuffer buffer, uint offset, S value[4]) { +void s_store(uint offset, S value[4]) { S array_1[4] = value; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - tint_symbol_1(buffer, (offset + (i * 128u)), array_1[i]); + s_store_1((offset + (i * 128u)), array_1[i]); } } } -matrix tint_symbol_8(uint4 buffer[32], uint offset) { +matrix u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint ubo_load = buffer[scalar_offset / 4][scalar_offset % 4]; + uint ubo_load = u[scalar_offset / 4][scalar_offset % 4]; const uint scalar_offset_1 = ((offset + 4u)) / 4; - uint ubo_load_1 = buffer[scalar_offset_1 / 4][scalar_offset_1 % 4]; + uint ubo_load_1 = u[scalar_offset_1 / 4][scalar_offset_1 % 4]; const uint scalar_offset_2 = ((offset + 8u)) / 4; - uint ubo_load_2 = buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]; + uint ubo_load_2 = u[scalar_offset_2 / 4][scalar_offset_2 % 4]; return matrix(vector(float16_t(f16tof32(ubo_load & 0xFFFF)), float16_t(f16tof32(ubo_load >> 16))), vector(float16_t(f16tof32(ubo_load_1 & 0xFFFF)), float16_t(f16tof32(ubo_load_1 >> 16))), vector(float16_t(f16tof32(ubo_load_2 & 0xFFFF)), float16_t(f16tof32(ubo_load_2 >> 16)))); } -S tint_symbol_6(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_4 = ((offset + 64u)) / 4; - const S tint_symbol_10 = {asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), tint_symbol_8(buffer, (offset + 4u)), asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4])}; - return tint_symbol_10; + const S tint_symbol = {asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4]), u_load_3((offset + 4u)), asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4])}; + return tint_symbol; } -typedef S tint_symbol_5_ret[4]; -tint_symbol_5_ret tint_symbol_5(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_6(buffer, (offset + (i_1 * 128u))); + arr[i_1] = u_load_1((offset + (i_1 * 128u))); } } return arr; @@ -60,9 +60,9 @@ tint_symbol_5_ret tint_symbol_5(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_5(u, 0u)); - tint_symbol_1(s, 128u, tint_symbol_6(u, 256u)); - tint_symbol_3(s, 388u, tint_symbol_8(u, 260u)); + s_store(0u, u_load(0u)); + s_store_1(128u, u_load_1(256u)); + s_store_3(388u, u_load_3(260u)); uint ubo_load_3 = u[0].z; s.Store >(132u, vector(float16_t(f16tof32(ubo_load_3 & 0xFFFF)), float16_t(f16tof32(ubo_load_3 >> 16))).yx); return; diff --git a/test/tint/buffer/uniform/std140/struct/mat3x2_f16/to_workgroup.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat3x2_f16/to_workgroup.wgsl.expected.dxc.hlsl index 9b8470622c..1d00b5b83e 100644 --- a/test/tint/buffer/uniform/std140/struct/mat3x2_f16/to_workgroup.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat3x2_f16/to_workgroup.wgsl.expected.dxc.hlsl @@ -13,29 +13,29 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -matrix tint_symbol_5(uint4 buffer[32], uint offset) { +matrix u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint ubo_load = buffer[scalar_offset / 4][scalar_offset % 4]; + uint ubo_load = u[scalar_offset / 4][scalar_offset % 4]; const uint scalar_offset_1 = ((offset + 4u)) / 4; - uint ubo_load_1 = buffer[scalar_offset_1 / 4][scalar_offset_1 % 4]; + uint ubo_load_1 = u[scalar_offset_1 / 4][scalar_offset_1 % 4]; const uint scalar_offset_2 = ((offset + 8u)) / 4; - uint ubo_load_2 = buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]; + uint ubo_load_2 = u[scalar_offset_2 / 4][scalar_offset_2 % 4]; return matrix(vector(float16_t(f16tof32(ubo_load & 0xFFFF)), float16_t(f16tof32(ubo_load >> 16))), vector(float16_t(f16tof32(ubo_load_1 & 0xFFFF)), float16_t(f16tof32(ubo_load_1 >> 16))), vector(float16_t(f16tof32(ubo_load_2 & 0xFFFF)), float16_t(f16tof32(ubo_load_2 >> 16)))); } -S tint_symbol_3(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_4 = ((offset + 64u)) / 4; - const S tint_symbol_8 = {asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), tint_symbol_5(buffer, (offset + 4u)), asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4])}; - return tint_symbol_8; + const S tint_symbol_3 = {asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4]), u_load_3((offset + 4u)), asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4])}; + return tint_symbol_3; } -typedef S tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_3(buffer, (offset + (i_1 * 128u))); + arr[i_1] = u_load_1((offset + (i_1 * 128u))); } } return arr; @@ -45,14 +45,14 @@ void f_inner(uint local_invocation_index) { { for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) { const uint i = idx; - const S tint_symbol_7 = (S)0; - w[i] = tint_symbol_7; + const S tint_symbol_2 = (S)0; + w[i] = tint_symbol_2; } } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); - w[1] = tint_symbol_3(u, 256u); - w[3].m = tint_symbol_5(u, 260u); + w = u_load(0u); + w[1] = u_load_1(256u); + w[3].m = u_load_3(260u); uint ubo_load_3 = u[0].z; w[1].m[0] = vector(float16_t(f16tof32(ubo_load_3 & 0xFFFF)), float16_t(f16tof32(ubo_load_3 >> 16))).yx; } diff --git a/test/tint/buffer/uniform/std140/struct/mat3x2_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat3x2_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl index 0860619062..6bd1f7f4e3 100644 --- a/test/tint/buffer/uniform/std140/struct/mat3x2_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat3x2_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl @@ -15,43 +15,43 @@ int i() { return counter; } -float3x2 tint_symbol_8(uint4 buffer[64], uint offset) { +float3x2 a_load_4(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = a[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = a[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = a[scalar_offset_2 / 4]; return float3x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy))); } -Inner tint_symbol_7(uint4 buffer[64], uint offset) { - const Inner tint_symbol_11 = {tint_symbol_8(buffer, (offset + 0u))}; - return tint_symbol_11; +Inner a_load_3(uint offset) { + const Inner tint_symbol_4 = {a_load_4((offset + 0u))}; + return tint_symbol_4; } -typedef Inner tint_symbol_6_ret[4]; -tint_symbol_6_ret tint_symbol_6(uint4 buffer[64], uint offset) { +typedef Inner a_load_2_ret[4]; +a_load_2_ret a_load_2(uint offset) { Inner arr[4] = (Inner[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_7(buffer, (offset + (i_1 * 64u))); + arr[i_1] = a_load_3((offset + (i_1 * 64u))); } } return arr; } -Outer tint_symbol_5(uint4 buffer[64], uint offset) { - const Outer tint_symbol_12 = {tint_symbol_6(buffer, (offset + 0u))}; - return tint_symbol_12; +Outer a_load_1(uint offset) { + const Outer tint_symbol_5 = {a_load_2((offset + 0u))}; + return tint_symbol_5; } -typedef Outer tint_symbol_4_ret[4]; -tint_symbol_4_ret tint_symbol_4(uint4 buffer[64], uint offset) { +typedef Outer a_load_ret[4]; +a_load_ret a_load(uint offset) { Outer arr_1[4] = (Outer[4])0; { for(uint i_2 = 0u; (i_2 < 4u); i_2 = (i_2 + 1u)) { - arr_1[i_2] = tint_symbol_5(buffer, (offset + (i_2 * 256u))); + arr_1[i_2] = a_load_1((offset + (i_2 * 256u))); } } return arr_1; @@ -62,11 +62,11 @@ void f() { const int p_a_i_save = i(); const int p_a_i_a_i_save = i(); const int p_a_i_a_i_m_i_save = i(); - const Outer l_a[4] = tint_symbol_4(a, 0u); - const Outer l_a_i = tint_symbol_5(a, (256u * uint(p_a_i_save))); - const Inner l_a_i_a[4] = tint_symbol_6(a, (256u * uint(p_a_i_save))); - const Inner l_a_i_a_i = tint_symbol_7(a, ((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); - const float3x2 l_a_i_a_i_m = tint_symbol_8(a, ((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); + const Outer l_a[4] = a_load(0u); + const Outer l_a_i = a_load_1((256u * uint(p_a_i_save))); + const Inner l_a_i_a[4] = a_load_2((256u * uint(p_a_i_save))); + const Inner l_a_i_a_i = a_load_3(((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); + const float3x2 l_a_i_a_i_m = a_load_4(((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); const uint scalar_offset_3 = ((((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save))) + (8u * uint(p_a_i_a_i_m_i_save)))) / 4; uint4 ubo_load_3 = a[scalar_offset_3 / 4]; const float2 l_a_i_a_i_m_i = asfloat(((scalar_offset_3 & 2) ? ubo_load_3.zw : ubo_load_3.xy)); diff --git a/test/tint/buffer/uniform/std140/struct/mat3x2_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat3x2_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl index 0860619062..6bd1f7f4e3 100644 --- a/test/tint/buffer/uniform/std140/struct/mat3x2_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat3x2_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl @@ -15,43 +15,43 @@ int i() { return counter; } -float3x2 tint_symbol_8(uint4 buffer[64], uint offset) { +float3x2 a_load_4(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = a[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = a[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = a[scalar_offset_2 / 4]; return float3x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy))); } -Inner tint_symbol_7(uint4 buffer[64], uint offset) { - const Inner tint_symbol_11 = {tint_symbol_8(buffer, (offset + 0u))}; - return tint_symbol_11; +Inner a_load_3(uint offset) { + const Inner tint_symbol_4 = {a_load_4((offset + 0u))}; + return tint_symbol_4; } -typedef Inner tint_symbol_6_ret[4]; -tint_symbol_6_ret tint_symbol_6(uint4 buffer[64], uint offset) { +typedef Inner a_load_2_ret[4]; +a_load_2_ret a_load_2(uint offset) { Inner arr[4] = (Inner[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_7(buffer, (offset + (i_1 * 64u))); + arr[i_1] = a_load_3((offset + (i_1 * 64u))); } } return arr; } -Outer tint_symbol_5(uint4 buffer[64], uint offset) { - const Outer tint_symbol_12 = {tint_symbol_6(buffer, (offset + 0u))}; - return tint_symbol_12; +Outer a_load_1(uint offset) { + const Outer tint_symbol_5 = {a_load_2((offset + 0u))}; + return tint_symbol_5; } -typedef Outer tint_symbol_4_ret[4]; -tint_symbol_4_ret tint_symbol_4(uint4 buffer[64], uint offset) { +typedef Outer a_load_ret[4]; +a_load_ret a_load(uint offset) { Outer arr_1[4] = (Outer[4])0; { for(uint i_2 = 0u; (i_2 < 4u); i_2 = (i_2 + 1u)) { - arr_1[i_2] = tint_symbol_5(buffer, (offset + (i_2 * 256u))); + arr_1[i_2] = a_load_1((offset + (i_2 * 256u))); } } return arr_1; @@ -62,11 +62,11 @@ void f() { const int p_a_i_save = i(); const int p_a_i_a_i_save = i(); const int p_a_i_a_i_m_i_save = i(); - const Outer l_a[4] = tint_symbol_4(a, 0u); - const Outer l_a_i = tint_symbol_5(a, (256u * uint(p_a_i_save))); - const Inner l_a_i_a[4] = tint_symbol_6(a, (256u * uint(p_a_i_save))); - const Inner l_a_i_a_i = tint_symbol_7(a, ((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); - const float3x2 l_a_i_a_i_m = tint_symbol_8(a, ((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); + const Outer l_a[4] = a_load(0u); + const Outer l_a_i = a_load_1((256u * uint(p_a_i_save))); + const Inner l_a_i_a[4] = a_load_2((256u * uint(p_a_i_save))); + const Inner l_a_i_a_i = a_load_3(((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); + const float3x2 l_a_i_a_i_m = a_load_4(((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); const uint scalar_offset_3 = ((((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save))) + (8u * uint(p_a_i_a_i_m_i_save)))) / 4; uint4 ubo_load_3 = a[scalar_offset_3 / 4]; const float2 l_a_i_a_i_m_i = asfloat(((scalar_offset_3 & 2) ? ubo_load_3.zw : ubo_load_3.xy)); diff --git a/test/tint/buffer/uniform/std140/struct/mat3x2_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat3x2_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl index 1dbefd7cdd..4164f822e0 100644 --- a/test/tint/buffer/uniform/std140/struct/mat3x2_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat3x2_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl @@ -9,43 +9,43 @@ cbuffer cbuffer_a : register(b0, space0) { uint4 a[64]; }; -float3x2 tint_symbol_4(uint4 buffer[64], uint offset) { +float3x2 a_load_4(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = a[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = a[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = a[scalar_offset_2 / 4]; return float3x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy))); } -Inner tint_symbol_3(uint4 buffer[64], uint offset) { - const Inner tint_symbol_7 = {tint_symbol_4(buffer, (offset + 0u))}; - return tint_symbol_7; +Inner a_load_3(uint offset) { + const Inner tint_symbol = {a_load_4((offset + 0u))}; + return tint_symbol; } -typedef Inner tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[64], uint offset) { +typedef Inner a_load_2_ret[4]; +a_load_2_ret a_load_2(uint offset) { Inner arr[4] = (Inner[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_3(buffer, (offset + (i * 64u))); + arr[i] = a_load_3((offset + (i * 64u))); } } return arr; } -Outer tint_symbol_1(uint4 buffer[64], uint offset) { - const Outer tint_symbol_8 = {tint_symbol_2(buffer, (offset + 0u))}; - return tint_symbol_8; +Outer a_load_1(uint offset) { + const Outer tint_symbol_1 = {a_load_2((offset + 0u))}; + return tint_symbol_1; } -typedef Outer tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[64], uint offset) { +typedef Outer a_load_ret[4]; +a_load_ret a_load(uint offset) { Outer arr_1[4] = (Outer[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr_1[i_1] = tint_symbol_1(buffer, (offset + (i_1 * 256u))); + arr_1[i_1] = a_load_1((offset + (i_1 * 256u))); } } return arr_1; @@ -53,11 +53,11 @@ tint_symbol_ret tint_symbol(uint4 buffer[64], uint offset) { [numthreads(1, 1, 1)] void f() { - const Outer l_a[4] = tint_symbol(a, 0u); - const Outer l_a_3 = tint_symbol_1(a, 768u); - const Inner l_a_3_a[4] = tint_symbol_2(a, 768u); - const Inner l_a_3_a_2 = tint_symbol_3(a, 896u); - const float3x2 l_a_3_a_2_m = tint_symbol_4(a, 896u); + const Outer l_a[4] = a_load(0u); + const Outer l_a_3 = a_load_1(768u); + const Inner l_a_3_a[4] = a_load_2(768u); + const Inner l_a_3_a_2 = a_load_3(896u); + const float3x2 l_a_3_a_2_m = a_load_4(896u); const float2 l_a_3_a_2_m_1 = asfloat(a[56].zw); const float l_a_3_a_2_m_1_0 = asfloat(a[56].z); return; diff --git a/test/tint/buffer/uniform/std140/struct/mat3x2_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat3x2_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl index 1dbefd7cdd..4164f822e0 100644 --- a/test/tint/buffer/uniform/std140/struct/mat3x2_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat3x2_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl @@ -9,43 +9,43 @@ cbuffer cbuffer_a : register(b0, space0) { uint4 a[64]; }; -float3x2 tint_symbol_4(uint4 buffer[64], uint offset) { +float3x2 a_load_4(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = a[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = a[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = a[scalar_offset_2 / 4]; return float3x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy))); } -Inner tint_symbol_3(uint4 buffer[64], uint offset) { - const Inner tint_symbol_7 = {tint_symbol_4(buffer, (offset + 0u))}; - return tint_symbol_7; +Inner a_load_3(uint offset) { + const Inner tint_symbol = {a_load_4((offset + 0u))}; + return tint_symbol; } -typedef Inner tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[64], uint offset) { +typedef Inner a_load_2_ret[4]; +a_load_2_ret a_load_2(uint offset) { Inner arr[4] = (Inner[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_3(buffer, (offset + (i * 64u))); + arr[i] = a_load_3((offset + (i * 64u))); } } return arr; } -Outer tint_symbol_1(uint4 buffer[64], uint offset) { - const Outer tint_symbol_8 = {tint_symbol_2(buffer, (offset + 0u))}; - return tint_symbol_8; +Outer a_load_1(uint offset) { + const Outer tint_symbol_1 = {a_load_2((offset + 0u))}; + return tint_symbol_1; } -typedef Outer tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[64], uint offset) { +typedef Outer a_load_ret[4]; +a_load_ret a_load(uint offset) { Outer arr_1[4] = (Outer[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr_1[i_1] = tint_symbol_1(buffer, (offset + (i_1 * 256u))); + arr_1[i_1] = a_load_1((offset + (i_1 * 256u))); } } return arr_1; @@ -53,11 +53,11 @@ tint_symbol_ret tint_symbol(uint4 buffer[64], uint offset) { [numthreads(1, 1, 1)] void f() { - const Outer l_a[4] = tint_symbol(a, 0u); - const Outer l_a_3 = tint_symbol_1(a, 768u); - const Inner l_a_3_a[4] = tint_symbol_2(a, 768u); - const Inner l_a_3_a_2 = tint_symbol_3(a, 896u); - const float3x2 l_a_3_a_2_m = tint_symbol_4(a, 896u); + const Outer l_a[4] = a_load(0u); + const Outer l_a_3 = a_load_1(768u); + const Inner l_a_3_a[4] = a_load_2(768u); + const Inner l_a_3_a_2 = a_load_3(896u); + const float3x2 l_a_3_a_2_m = a_load_4(896u); const float2 l_a_3_a_2_m_1 = asfloat(a[56].zw); const float l_a_3_a_2_m_1_0 = asfloat(a[56].z); return; diff --git a/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_builtin.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_builtin.wgsl.expected.dxc.hlsl index 2f2a028c58..996ef20dbe 100644 --- a/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_builtin.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_builtin.wgsl.expected.dxc.hlsl @@ -2,19 +2,19 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[32]; }; -float3x2 tint_symbol(uint4 buffer[32], uint offset) { +float3x2 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = u[scalar_offset_2 / 4]; return float3x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy))); } [numthreads(1, 1, 1)] void f() { - const float2x3 t = transpose(tint_symbol(u, 264u)); + const float2x3 t = transpose(u_load(264u)); const float l = length(asfloat(u[1].xy).yx); const float a = abs(asfloat(u[1].xy).yx.x); return; diff --git a/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_builtin.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_builtin.wgsl.expected.fxc.hlsl index 2f2a028c58..996ef20dbe 100644 --- a/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_builtin.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_builtin.wgsl.expected.fxc.hlsl @@ -2,19 +2,19 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[32]; }; -float3x2 tint_symbol(uint4 buffer[32], uint offset) { +float3x2 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = u[scalar_offset_2 / 4]; return float3x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy))); } [numthreads(1, 1, 1)] void f() { - const float2x3 t = transpose(tint_symbol(u, 264u)); + const float2x3 t = transpose(u_load(264u)); const float l = length(asfloat(u[1].xy).yx); const float a = abs(asfloat(u[1].xy).yx.x); return; diff --git a/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_fn.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_fn.wgsl.expected.dxc.hlsl index 0e791985da..a0d0b7ab90 100644 --- a/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_fn.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_fn.wgsl.expected.dxc.hlsl @@ -23,29 +23,29 @@ void d(float2 v) { void e(float f_1) { } -float3x2 tint_symbol_3(uint4 buffer[32], uint offset) { +float3x2 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = u[scalar_offset_2 / 4]; return float3x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy))); } -S tint_symbol_1(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_4 = ((offset + 64u)) / 4; - const S tint_symbol_5 = {asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), tint_symbol_3(buffer, (offset + 8u)), asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4])}; - return tint_symbol_5; + const S tint_symbol = {asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4]), u_load_3((offset + 8u)), asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4])}; + return tint_symbol; } -typedef S tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 128u))); + arr[i] = u_load_1((offset + (i * 128u))); } } return arr; @@ -53,9 +53,9 @@ tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); - b(tint_symbol_1(u, 256u)); - c(tint_symbol_3(u, 264u)); + a(u_load(0u)); + b(u_load_1(256u)); + c(u_load_3(264u)); d(asfloat(u[1].xy).yx); e(asfloat(u[1].xy).yx.x); return; diff --git a/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_fn.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_fn.wgsl.expected.fxc.hlsl index 0e791985da..a0d0b7ab90 100644 --- a/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_fn.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_fn.wgsl.expected.fxc.hlsl @@ -23,29 +23,29 @@ void d(float2 v) { void e(float f_1) { } -float3x2 tint_symbol_3(uint4 buffer[32], uint offset) { +float3x2 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = u[scalar_offset_2 / 4]; return float3x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy))); } -S tint_symbol_1(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_4 = ((offset + 64u)) / 4; - const S tint_symbol_5 = {asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), tint_symbol_3(buffer, (offset + 8u)), asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4])}; - return tint_symbol_5; + const S tint_symbol = {asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4]), u_load_3((offset + 8u)), asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4])}; + return tint_symbol; } -typedef S tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 128u))); + arr[i] = u_load_1((offset + (i * 128u))); } } return arr; @@ -53,9 +53,9 @@ tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); - b(tint_symbol_1(u, 256u)); - c(tint_symbol_3(u, 264u)); + a(u_load(0u)); + b(u_load_1(256u)); + c(u_load_3(264u)); d(asfloat(u[1].xy).yx); e(asfloat(u[1].xy).yx.x); return; diff --git a/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_private.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_private.wgsl.expected.dxc.hlsl index 5a5e8b1206..63c530a103 100644 --- a/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_private.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_private.wgsl.expected.dxc.hlsl @@ -9,29 +9,29 @@ cbuffer cbuffer_u : register(b0, space0) { }; static S p[4] = (S[4])0; -float3x2 tint_symbol_3(uint4 buffer[32], uint offset) { +float3x2 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = u[scalar_offset_2 / 4]; return float3x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy))); } -S tint_symbol_1(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_4 = ((offset + 64u)) / 4; - const S tint_symbol_5 = {asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), tint_symbol_3(buffer, (offset + 8u)), asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4])}; - return tint_symbol_5; + const S tint_symbol = {asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4]), u_load_3((offset + 8u)), asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4])}; + return tint_symbol; } -typedef S tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 128u))); + arr[i] = u_load_1((offset + (i * 128u))); } } return arr; @@ -39,9 +39,9 @@ tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); - p[1] = tint_symbol_1(u, 256u); - p[3].m = tint_symbol_3(u, 264u); + p = u_load(0u); + p[1] = u_load_1(256u); + p[3].m = u_load_3(264u); p[1].m[0] = asfloat(u[1].xy).yx; return; } diff --git a/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_private.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_private.wgsl.expected.fxc.hlsl index 5a5e8b1206..63c530a103 100644 --- a/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_private.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_private.wgsl.expected.fxc.hlsl @@ -9,29 +9,29 @@ cbuffer cbuffer_u : register(b0, space0) { }; static S p[4] = (S[4])0; -float3x2 tint_symbol_3(uint4 buffer[32], uint offset) { +float3x2 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = u[scalar_offset_2 / 4]; return float3x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy))); } -S tint_symbol_1(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_4 = ((offset + 64u)) / 4; - const S tint_symbol_5 = {asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), tint_symbol_3(buffer, (offset + 8u)), asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4])}; - return tint_symbol_5; + const S tint_symbol = {asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4]), u_load_3((offset + 8u)), asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4])}; + return tint_symbol; } -typedef S tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 128u))); + arr[i] = u_load_1((offset + (i * 128u))); } } return arr; @@ -39,9 +39,9 @@ tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); - p[1] = tint_symbol_1(u, 256u); - p[3].m = tint_symbol_3(u, 264u); + p = u_load(0u); + p[1] = u_load_1(256u); + p[3].m = u_load_3(264u); p[1].m[0] = asfloat(u[1].xy).yx; return; } diff --git a/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_storage.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_storage.wgsl.expected.dxc.hlsl index 50eb6e728d..0178d89532 100644 --- a/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_storage.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_storage.wgsl.expected.dxc.hlsl @@ -9,50 +9,50 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol_3(RWByteAddressBuffer buffer, uint offset, float3x2 value) { - buffer.Store2((offset + 0u), asuint(value[0u])); - buffer.Store2((offset + 8u), asuint(value[1u])); - buffer.Store2((offset + 16u), asuint(value[2u])); +void s_store_3(uint offset, float3x2 value) { + s.Store2((offset + 0u), asuint(value[0u])); + s.Store2((offset + 8u), asuint(value[1u])); + s.Store2((offset + 16u), asuint(value[2u])); } -void tint_symbol_1(RWByteAddressBuffer buffer, uint offset, S value) { - buffer.Store((offset + 0u), asuint(value.before)); - tint_symbol_3(buffer, (offset + 8u), value.m); - buffer.Store((offset + 64u), asuint(value.after)); +void s_store_1(uint offset, S value) { + s.Store((offset + 0u), asuint(value.before)); + s_store_3((offset + 8u), value.m); + s.Store((offset + 64u), asuint(value.after)); } -void tint_symbol(RWByteAddressBuffer buffer, uint offset, S value[4]) { +void s_store(uint offset, S value[4]) { S array_1[4] = value; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - tint_symbol_1(buffer, (offset + (i * 128u)), array_1[i]); + s_store_1((offset + (i * 128u)), array_1[i]); } } } -float3x2 tint_symbol_8(uint4 buffer[32], uint offset) { +float3x2 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = u[scalar_offset_2 / 4]; return float3x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy))); } -S tint_symbol_6(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_4 = ((offset + 64u)) / 4; - const S tint_symbol_10 = {asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), tint_symbol_8(buffer, (offset + 8u)), asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4])}; - return tint_symbol_10; + const S tint_symbol = {asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4]), u_load_3((offset + 8u)), asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4])}; + return tint_symbol; } -typedef S tint_symbol_5_ret[4]; -tint_symbol_5_ret tint_symbol_5(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_6(buffer, (offset + (i_1 * 128u))); + arr[i_1] = u_load_1((offset + (i_1 * 128u))); } } return arr; @@ -60,9 +60,9 @@ tint_symbol_5_ret tint_symbol_5(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_5(u, 0u)); - tint_symbol_1(s, 128u, tint_symbol_6(u, 256u)); - tint_symbol_3(s, 392u, tint_symbol_8(u, 264u)); + s_store(0u, u_load(0u)); + s_store_1(128u, u_load_1(256u)); + s_store_3(392u, u_load_3(264u)); s.Store2(136u, asuint(asfloat(u[1].xy).yx)); return; } diff --git a/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_storage.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_storage.wgsl.expected.fxc.hlsl index 50eb6e728d..0178d89532 100644 --- a/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_storage.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_storage.wgsl.expected.fxc.hlsl @@ -9,50 +9,50 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol_3(RWByteAddressBuffer buffer, uint offset, float3x2 value) { - buffer.Store2((offset + 0u), asuint(value[0u])); - buffer.Store2((offset + 8u), asuint(value[1u])); - buffer.Store2((offset + 16u), asuint(value[2u])); +void s_store_3(uint offset, float3x2 value) { + s.Store2((offset + 0u), asuint(value[0u])); + s.Store2((offset + 8u), asuint(value[1u])); + s.Store2((offset + 16u), asuint(value[2u])); } -void tint_symbol_1(RWByteAddressBuffer buffer, uint offset, S value) { - buffer.Store((offset + 0u), asuint(value.before)); - tint_symbol_3(buffer, (offset + 8u), value.m); - buffer.Store((offset + 64u), asuint(value.after)); +void s_store_1(uint offset, S value) { + s.Store((offset + 0u), asuint(value.before)); + s_store_3((offset + 8u), value.m); + s.Store((offset + 64u), asuint(value.after)); } -void tint_symbol(RWByteAddressBuffer buffer, uint offset, S value[4]) { +void s_store(uint offset, S value[4]) { S array_1[4] = value; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - tint_symbol_1(buffer, (offset + (i * 128u)), array_1[i]); + s_store_1((offset + (i * 128u)), array_1[i]); } } } -float3x2 tint_symbol_8(uint4 buffer[32], uint offset) { +float3x2 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = u[scalar_offset_2 / 4]; return float3x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy))); } -S tint_symbol_6(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_4 = ((offset + 64u)) / 4; - const S tint_symbol_10 = {asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), tint_symbol_8(buffer, (offset + 8u)), asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4])}; - return tint_symbol_10; + const S tint_symbol = {asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4]), u_load_3((offset + 8u)), asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4])}; + return tint_symbol; } -typedef S tint_symbol_5_ret[4]; -tint_symbol_5_ret tint_symbol_5(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_6(buffer, (offset + (i_1 * 128u))); + arr[i_1] = u_load_1((offset + (i_1 * 128u))); } } return arr; @@ -60,9 +60,9 @@ tint_symbol_5_ret tint_symbol_5(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_5(u, 0u)); - tint_symbol_1(s, 128u, tint_symbol_6(u, 256u)); - tint_symbol_3(s, 392u, tint_symbol_8(u, 264u)); + s_store(0u, u_load(0u)); + s_store_1(128u, u_load_1(256u)); + s_store_3(392u, u_load_3(264u)); s.Store2(136u, asuint(asfloat(u[1].xy).yx)); return; } diff --git a/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_workgroup.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_workgroup.wgsl.expected.dxc.hlsl index 35c26704ee..69aa657421 100644 --- a/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_workgroup.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_workgroup.wgsl.expected.dxc.hlsl @@ -13,29 +13,29 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -float3x2 tint_symbol_5(uint4 buffer[32], uint offset) { +float3x2 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = u[scalar_offset_2 / 4]; return float3x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy))); } -S tint_symbol_3(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_4 = ((offset + 64u)) / 4; - const S tint_symbol_8 = {asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), tint_symbol_5(buffer, (offset + 8u)), asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4])}; - return tint_symbol_8; + const S tint_symbol_3 = {asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4]), u_load_3((offset + 8u)), asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4])}; + return tint_symbol_3; } -typedef S tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_3(buffer, (offset + (i_1 * 128u))); + arr[i_1] = u_load_1((offset + (i_1 * 128u))); } } return arr; @@ -45,14 +45,14 @@ void f_inner(uint local_invocation_index) { { for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) { const uint i = idx; - const S tint_symbol_7 = (S)0; - w[i] = tint_symbol_7; + const S tint_symbol_2 = (S)0; + w[i] = tint_symbol_2; } } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); - w[1] = tint_symbol_3(u, 256u); - w[3].m = tint_symbol_5(u, 264u); + w = u_load(0u); + w[1] = u_load_1(256u); + w[3].m = u_load_3(264u); w[1].m[0] = asfloat(u[1].xy).yx; } diff --git a/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_workgroup.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_workgroup.wgsl.expected.fxc.hlsl index 35c26704ee..69aa657421 100644 --- a/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_workgroup.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat3x2_f32/to_workgroup.wgsl.expected.fxc.hlsl @@ -13,29 +13,29 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -float3x2 tint_symbol_5(uint4 buffer[32], uint offset) { +float3x2 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = u[scalar_offset_2 / 4]; return float3x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy))); } -S tint_symbol_3(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_4 = ((offset + 64u)) / 4; - const S tint_symbol_8 = {asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), tint_symbol_5(buffer, (offset + 8u)), asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4])}; - return tint_symbol_8; + const S tint_symbol_3 = {asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4]), u_load_3((offset + 8u)), asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4])}; + return tint_symbol_3; } -typedef S tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_3(buffer, (offset + (i_1 * 128u))); + arr[i_1] = u_load_1((offset + (i_1 * 128u))); } } return arr; @@ -45,14 +45,14 @@ void f_inner(uint local_invocation_index) { { for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) { const uint i = idx; - const S tint_symbol_7 = (S)0; - w[i] = tint_symbol_7; + const S tint_symbol_2 = (S)0; + w[i] = tint_symbol_2; } } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); - w[1] = tint_symbol_3(u, 256u); - w[3].m = tint_symbol_5(u, 264u); + w = u_load(0u); + w[1] = u_load_1(256u); + w[3].m = u_load_3(264u); w[1].m[0] = asfloat(u[1].xy).yx; } diff --git a/test/tint/buffer/uniform/std140/struct/mat3x3_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat3x3_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl index ef9e0c44bf..7d20776ae6 100644 --- a/test/tint/buffer/uniform/std140/struct/mat3x3_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat3x3_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl @@ -15,52 +15,52 @@ int i() { return counter; } -matrix tint_symbol_8(uint4 buffer[64], uint offset) { +matrix a_load_4(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = a[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = a[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = a[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); float16_t ubo_load_4_y = f16tof32(ubo_load_4[0] >> 16); return matrix(vector(ubo_load_xz[0], ubo_load_y, ubo_load_xz[1]), vector(ubo_load_2_xz[0], ubo_load_2_y, ubo_load_2_xz[1]), vector(ubo_load_4_xz[0], ubo_load_4_y, ubo_load_4_xz[1])); } -Inner tint_symbol_7(uint4 buffer[64], uint offset) { - const Inner tint_symbol_11 = {tint_symbol_8(buffer, (offset + 0u))}; - return tint_symbol_11; +Inner a_load_3(uint offset) { + const Inner tint_symbol_4 = {a_load_4((offset + 0u))}; + return tint_symbol_4; } -typedef Inner tint_symbol_6_ret[4]; -tint_symbol_6_ret tint_symbol_6(uint4 buffer[64], uint offset) { +typedef Inner a_load_2_ret[4]; +a_load_2_ret a_load_2(uint offset) { Inner arr[4] = (Inner[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_7(buffer, (offset + (i_1 * 64u))); + arr[i_1] = a_load_3((offset + (i_1 * 64u))); } } return arr; } -Outer tint_symbol_5(uint4 buffer[64], uint offset) { - const Outer tint_symbol_12 = {tint_symbol_6(buffer, (offset + 0u))}; - return tint_symbol_12; +Outer a_load_1(uint offset) { + const Outer tint_symbol_5 = {a_load_2((offset + 0u))}; + return tint_symbol_5; } -typedef Outer tint_symbol_4_ret[4]; -tint_symbol_4_ret tint_symbol_4(uint4 buffer[64], uint offset) { +typedef Outer a_load_ret[4]; +a_load_ret a_load(uint offset) { Outer arr_1[4] = (Outer[4])0; { for(uint i_2 = 0u; (i_2 < 4u); i_2 = (i_2 + 1u)) { - arr_1[i_2] = tint_symbol_5(buffer, (offset + (i_2 * 256u))); + arr_1[i_2] = a_load_1((offset + (i_2 * 256u))); } } return arr_1; @@ -71,11 +71,11 @@ void f() { const int p_a_i_save = i(); const int p_a_i_a_i_save = i(); const int p_a_i_a_i_m_i_save = i(); - const Outer l_a[4] = tint_symbol_4(a, 0u); - const Outer l_a_i = tint_symbol_5(a, (256u * uint(p_a_i_save))); - const Inner l_a_i_a[4] = tint_symbol_6(a, (256u * uint(p_a_i_save))); - const Inner l_a_i_a_i = tint_symbol_7(a, ((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); - const matrix l_a_i_a_i_m = tint_symbol_8(a, ((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); + const Outer l_a[4] = a_load(0u); + const Outer l_a_i = a_load_1((256u * uint(p_a_i_save))); + const Inner l_a_i_a[4] = a_load_2((256u * uint(p_a_i_save))); + const Inner l_a_i_a_i = a_load_3(((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); + const matrix l_a_i_a_i_m = a_load_4(((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); const uint scalar_offset_3 = ((((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save))) + (8u * uint(p_a_i_a_i_m_i_save)))) / 4; uint4 ubo_load_7 = a[scalar_offset_3 / 4]; uint2 ubo_load_6 = ((scalar_offset_3 & 2) ? ubo_load_7.zw : ubo_load_7.xy); diff --git a/test/tint/buffer/uniform/std140/struct/mat3x3_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat3x3_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl index ed02e03516..9c68d907b1 100644 --- a/test/tint/buffer/uniform/std140/struct/mat3x3_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat3x3_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl @@ -9,52 +9,52 @@ cbuffer cbuffer_a : register(b0, space0) { uint4 a[64]; }; -matrix tint_symbol_4(uint4 buffer[64], uint offset) { +matrix a_load_4(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = a[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = a[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = a[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); float16_t ubo_load_4_y = f16tof32(ubo_load_4[0] >> 16); return matrix(vector(ubo_load_xz[0], ubo_load_y, ubo_load_xz[1]), vector(ubo_load_2_xz[0], ubo_load_2_y, ubo_load_2_xz[1]), vector(ubo_load_4_xz[0], ubo_load_4_y, ubo_load_4_xz[1])); } -Inner tint_symbol_3(uint4 buffer[64], uint offset) { - const Inner tint_symbol_7 = {tint_symbol_4(buffer, (offset + 0u))}; - return tint_symbol_7; +Inner a_load_3(uint offset) { + const Inner tint_symbol = {a_load_4((offset + 0u))}; + return tint_symbol; } -typedef Inner tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[64], uint offset) { +typedef Inner a_load_2_ret[4]; +a_load_2_ret a_load_2(uint offset) { Inner arr[4] = (Inner[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_3(buffer, (offset + (i * 64u))); + arr[i] = a_load_3((offset + (i * 64u))); } } return arr; } -Outer tint_symbol_1(uint4 buffer[64], uint offset) { - const Outer tint_symbol_8 = {tint_symbol_2(buffer, (offset + 0u))}; - return tint_symbol_8; +Outer a_load_1(uint offset) { + const Outer tint_symbol_1 = {a_load_2((offset + 0u))}; + return tint_symbol_1; } -typedef Outer tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[64], uint offset) { +typedef Outer a_load_ret[4]; +a_load_ret a_load(uint offset) { Outer arr_1[4] = (Outer[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr_1[i_1] = tint_symbol_1(buffer, (offset + (i_1 * 256u))); + arr_1[i_1] = a_load_1((offset + (i_1 * 256u))); } } return arr_1; @@ -62,11 +62,11 @@ tint_symbol_ret tint_symbol(uint4 buffer[64], uint offset) { [numthreads(1, 1, 1)] void f() { - const Outer l_a[4] = tint_symbol(a, 0u); - const Outer l_a_3 = tint_symbol_1(a, 768u); - const Inner l_a_3_a[4] = tint_symbol_2(a, 768u); - const Inner l_a_3_a_2 = tint_symbol_3(a, 896u); - const matrix l_a_3_a_2_m = tint_symbol_4(a, 896u); + const Outer l_a[4] = a_load(0u); + const Outer l_a_3 = a_load_1(768u); + const Inner l_a_3_a[4] = a_load_2(768u); + const Inner l_a_3_a_2 = a_load_3(896u); + const matrix l_a_3_a_2_m = a_load_4(896u); uint2 ubo_load_6 = a[56].zw; vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); float16_t ubo_load_6_y = f16tof32(ubo_load_6[0] >> 16); diff --git a/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_builtin.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_builtin.wgsl.expected.dxc.hlsl index f79425fa9b..b945e5521d 100644 --- a/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_builtin.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_builtin.wgsl.expected.dxc.hlsl @@ -2,19 +2,19 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[32]; }; -matrix tint_symbol(uint4 buffer[32], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = u[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); float16_t ubo_load_4_y = f16tof32(ubo_load_4[0] >> 16); @@ -23,7 +23,7 @@ matrix tint_symbol(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - const matrix t = transpose(tint_symbol(u, 264u)); + const matrix t = transpose(u_load(264u)); uint2 ubo_load_6 = u[1].xy; vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); float16_t ubo_load_6_y = f16tof32(ubo_load_6[0] >> 16); diff --git a/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_fn.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_fn.wgsl.expected.dxc.hlsl index 08bbf31c76..d53b8481ec 100644 --- a/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_fn.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_fn.wgsl.expected.dxc.hlsl @@ -23,38 +23,38 @@ void d(vector v) { void e(float16_t f_1) { } -matrix tint_symbol_3(uint4 buffer[32], uint offset) { +matrix u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = u[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); float16_t ubo_load_4_y = f16tof32(ubo_load_4[0] >> 16); return matrix(vector(ubo_load_xz[0], ubo_load_y, ubo_load_xz[1]), vector(ubo_load_2_xz[0], ubo_load_2_y, ubo_load_2_xz[1]), vector(ubo_load_4_xz[0], ubo_load_4_y, ubo_load_4_xz[1])); } -S tint_symbol_1(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_4 = ((offset + 64u)) / 4; - const S tint_symbol_5 = {asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), tint_symbol_3(buffer, (offset + 8u)), asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4])}; - return tint_symbol_5; + const S tint_symbol = {asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4]), u_load_3((offset + 8u)), asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4])}; + return tint_symbol; } -typedef S tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 128u))); + arr[i] = u_load_1((offset + (i * 128u))); } } return arr; @@ -62,9 +62,9 @@ tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); - b(tint_symbol_1(u, 256u)); - c(tint_symbol_3(u, 264u)); + a(u_load(0u)); + b(u_load_1(256u)); + c(u_load_3(264u)); uint2 ubo_load_6 = u[1].xy; vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); float16_t ubo_load_6_y = f16tof32(ubo_load_6[0] >> 16); diff --git a/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_private.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_private.wgsl.expected.dxc.hlsl index dffe3365bb..8b46a3dbc8 100644 --- a/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_private.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_private.wgsl.expected.dxc.hlsl @@ -9,38 +9,38 @@ cbuffer cbuffer_u : register(b0, space0) { }; static S p[4] = (S[4])0; -matrix tint_symbol_3(uint4 buffer[32], uint offset) { +matrix u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = u[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); float16_t ubo_load_4_y = f16tof32(ubo_load_4[0] >> 16); return matrix(vector(ubo_load_xz[0], ubo_load_y, ubo_load_xz[1]), vector(ubo_load_2_xz[0], ubo_load_2_y, ubo_load_2_xz[1]), vector(ubo_load_4_xz[0], ubo_load_4_y, ubo_load_4_xz[1])); } -S tint_symbol_1(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_4 = ((offset + 64u)) / 4; - const S tint_symbol_5 = {asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), tint_symbol_3(buffer, (offset + 8u)), asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4])}; - return tint_symbol_5; + const S tint_symbol = {asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4]), u_load_3((offset + 8u)), asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4])}; + return tint_symbol; } -typedef S tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 128u))); + arr[i] = u_load_1((offset + (i * 128u))); } } return arr; @@ -48,9 +48,9 @@ tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); - p[1] = tint_symbol_1(u, 256u); - p[3].m = tint_symbol_3(u, 264u); + p = u_load(0u); + p[1] = u_load_1(256u); + p[3].m = u_load_3(264u); uint2 ubo_load_6 = u[1].xy; vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); float16_t ubo_load_6_y = f16tof32(ubo_load_6[0] >> 16); diff --git a/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_storage.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_storage.wgsl.expected.dxc.hlsl index 35a1a179b1..fb8fe54690 100644 --- a/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_storage.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_storage.wgsl.expected.dxc.hlsl @@ -9,59 +9,59 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol_3(RWByteAddressBuffer buffer, uint offset, matrix value) { - buffer.Store >((offset + 0u), value[0u]); - buffer.Store >((offset + 8u), value[1u]); - buffer.Store >((offset + 16u), value[2u]); +void s_store_3(uint offset, matrix value) { + s.Store >((offset + 0u), value[0u]); + s.Store >((offset + 8u), value[1u]); + s.Store >((offset + 16u), value[2u]); } -void tint_symbol_1(RWByteAddressBuffer buffer, uint offset, S value) { - buffer.Store((offset + 0u), asuint(value.before)); - tint_symbol_3(buffer, (offset + 8u), value.m); - buffer.Store((offset + 64u), asuint(value.after)); +void s_store_1(uint offset, S value) { + s.Store((offset + 0u), asuint(value.before)); + s_store_3((offset + 8u), value.m); + s.Store((offset + 64u), asuint(value.after)); } -void tint_symbol(RWByteAddressBuffer buffer, uint offset, S value[4]) { +void s_store(uint offset, S value[4]) { S array_1[4] = value; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - tint_symbol_1(buffer, (offset + (i * 128u)), array_1[i]); + s_store_1((offset + (i * 128u)), array_1[i]); } } } -matrix tint_symbol_8(uint4 buffer[32], uint offset) { +matrix u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = u[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); float16_t ubo_load_4_y = f16tof32(ubo_load_4[0] >> 16); return matrix(vector(ubo_load_xz[0], ubo_load_y, ubo_load_xz[1]), vector(ubo_load_2_xz[0], ubo_load_2_y, ubo_load_2_xz[1]), vector(ubo_load_4_xz[0], ubo_load_4_y, ubo_load_4_xz[1])); } -S tint_symbol_6(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_4 = ((offset + 64u)) / 4; - const S tint_symbol_10 = {asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), tint_symbol_8(buffer, (offset + 8u)), asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4])}; - return tint_symbol_10; + const S tint_symbol = {asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4]), u_load_3((offset + 8u)), asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4])}; + return tint_symbol; } -typedef S tint_symbol_5_ret[4]; -tint_symbol_5_ret tint_symbol_5(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_6(buffer, (offset + (i_1 * 128u))); + arr[i_1] = u_load_1((offset + (i_1 * 128u))); } } return arr; @@ -69,9 +69,9 @@ tint_symbol_5_ret tint_symbol_5(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_5(u, 0u)); - tint_symbol_1(s, 128u, tint_symbol_6(u, 256u)); - tint_symbol_3(s, 392u, tint_symbol_8(u, 264u)); + s_store(0u, u_load(0u)); + s_store_1(128u, u_load_1(256u)); + s_store_3(392u, u_load_3(264u)); uint2 ubo_load_6 = u[1].xy; vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); float16_t ubo_load_6_y = f16tof32(ubo_load_6[0] >> 16); diff --git a/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_workgroup.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_workgroup.wgsl.expected.dxc.hlsl index 10d0d09862..da7bd705e2 100644 --- a/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_workgroup.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat3x3_f16/to_workgroup.wgsl.expected.dxc.hlsl @@ -13,38 +13,38 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -matrix tint_symbol_5(uint4 buffer[32], uint offset) { +matrix u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = u[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); float16_t ubo_load_4_y = f16tof32(ubo_load_4[0] >> 16); return matrix(vector(ubo_load_xz[0], ubo_load_y, ubo_load_xz[1]), vector(ubo_load_2_xz[0], ubo_load_2_y, ubo_load_2_xz[1]), vector(ubo_load_4_xz[0], ubo_load_4_y, ubo_load_4_xz[1])); } -S tint_symbol_3(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_4 = ((offset + 64u)) / 4; - const S tint_symbol_8 = {asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), tint_symbol_5(buffer, (offset + 8u)), asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4])}; - return tint_symbol_8; + const S tint_symbol_3 = {asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4]), u_load_3((offset + 8u)), asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4])}; + return tint_symbol_3; } -typedef S tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_3(buffer, (offset + (i_1 * 128u))); + arr[i_1] = u_load_1((offset + (i_1 * 128u))); } } return arr; @@ -54,14 +54,14 @@ void f_inner(uint local_invocation_index) { { for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) { const uint i = idx; - const S tint_symbol_7 = (S)0; - w[i] = tint_symbol_7; + const S tint_symbol_2 = (S)0; + w[i] = tint_symbol_2; } } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); - w[1] = tint_symbol_3(u, 256u); - w[3].m = tint_symbol_5(u, 264u); + w = u_load(0u); + w[1] = u_load_1(256u); + w[3].m = u_load_3(264u); uint2 ubo_load_6 = u[1].xy; vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); float16_t ubo_load_6_y = f16tof32(ubo_load_6[0] >> 16); diff --git a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl index debcd3fd88..3150091430 100644 --- a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl @@ -15,40 +15,40 @@ int i() { return counter; } -float3x3 tint_symbol_8(uint4 buffer[64], uint offset) { +float3x3 a_load_4(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz)); + return float3x3(asfloat(a[scalar_offset / 4].xyz), asfloat(a[scalar_offset_1 / 4].xyz), asfloat(a[scalar_offset_2 / 4].xyz)); } -Inner tint_symbol_7(uint4 buffer[64], uint offset) { - const Inner tint_symbol_11 = {tint_symbol_8(buffer, (offset + 0u))}; - return tint_symbol_11; +Inner a_load_3(uint offset) { + const Inner tint_symbol_4 = {a_load_4((offset + 0u))}; + return tint_symbol_4; } -typedef Inner tint_symbol_6_ret[4]; -tint_symbol_6_ret tint_symbol_6(uint4 buffer[64], uint offset) { +typedef Inner a_load_2_ret[4]; +a_load_2_ret a_load_2(uint offset) { Inner arr[4] = (Inner[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_7(buffer, (offset + (i_1 * 64u))); + arr[i_1] = a_load_3((offset + (i_1 * 64u))); } } return arr; } -Outer tint_symbol_5(uint4 buffer[64], uint offset) { - const Outer tint_symbol_12 = {tint_symbol_6(buffer, (offset + 0u))}; - return tint_symbol_12; +Outer a_load_1(uint offset) { + const Outer tint_symbol_5 = {a_load_2((offset + 0u))}; + return tint_symbol_5; } -typedef Outer tint_symbol_4_ret[4]; -tint_symbol_4_ret tint_symbol_4(uint4 buffer[64], uint offset) { +typedef Outer a_load_ret[4]; +a_load_ret a_load(uint offset) { Outer arr_1[4] = (Outer[4])0; { for(uint i_2 = 0u; (i_2 < 4u); i_2 = (i_2 + 1u)) { - arr_1[i_2] = tint_symbol_5(buffer, (offset + (i_2 * 256u))); + arr_1[i_2] = a_load_1((offset + (i_2 * 256u))); } } return arr_1; @@ -59,11 +59,11 @@ void f() { const int p_a_i_save = i(); const int p_a_i_a_i_save = i(); const int p_a_i_a_i_m_i_save = i(); - const Outer l_a[4] = tint_symbol_4(a, 0u); - const Outer l_a_i = tint_symbol_5(a, (256u * uint(p_a_i_save))); - const Inner l_a_i_a[4] = tint_symbol_6(a, (256u * uint(p_a_i_save))); - const Inner l_a_i_a_i = tint_symbol_7(a, ((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); - const float3x3 l_a_i_a_i_m = tint_symbol_8(a, ((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); + const Outer l_a[4] = a_load(0u); + const Outer l_a_i = a_load_1((256u * uint(p_a_i_save))); + const Inner l_a_i_a[4] = a_load_2((256u * uint(p_a_i_save))); + const Inner l_a_i_a_i = a_load_3(((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); + const float3x3 l_a_i_a_i_m = a_load_4(((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); const uint scalar_offset_3 = ((((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save))) + (16u * uint(p_a_i_a_i_m_i_save)))) / 4; const float3 l_a_i_a_i_m_i = asfloat(a[scalar_offset_3 / 4].xyz); const int tint_symbol = p_a_i_save; diff --git a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl index debcd3fd88..3150091430 100644 --- a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl @@ -15,40 +15,40 @@ int i() { return counter; } -float3x3 tint_symbol_8(uint4 buffer[64], uint offset) { +float3x3 a_load_4(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz)); + return float3x3(asfloat(a[scalar_offset / 4].xyz), asfloat(a[scalar_offset_1 / 4].xyz), asfloat(a[scalar_offset_2 / 4].xyz)); } -Inner tint_symbol_7(uint4 buffer[64], uint offset) { - const Inner tint_symbol_11 = {tint_symbol_8(buffer, (offset + 0u))}; - return tint_symbol_11; +Inner a_load_3(uint offset) { + const Inner tint_symbol_4 = {a_load_4((offset + 0u))}; + return tint_symbol_4; } -typedef Inner tint_symbol_6_ret[4]; -tint_symbol_6_ret tint_symbol_6(uint4 buffer[64], uint offset) { +typedef Inner a_load_2_ret[4]; +a_load_2_ret a_load_2(uint offset) { Inner arr[4] = (Inner[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_7(buffer, (offset + (i_1 * 64u))); + arr[i_1] = a_load_3((offset + (i_1 * 64u))); } } return arr; } -Outer tint_symbol_5(uint4 buffer[64], uint offset) { - const Outer tint_symbol_12 = {tint_symbol_6(buffer, (offset + 0u))}; - return tint_symbol_12; +Outer a_load_1(uint offset) { + const Outer tint_symbol_5 = {a_load_2((offset + 0u))}; + return tint_symbol_5; } -typedef Outer tint_symbol_4_ret[4]; -tint_symbol_4_ret tint_symbol_4(uint4 buffer[64], uint offset) { +typedef Outer a_load_ret[4]; +a_load_ret a_load(uint offset) { Outer arr_1[4] = (Outer[4])0; { for(uint i_2 = 0u; (i_2 < 4u); i_2 = (i_2 + 1u)) { - arr_1[i_2] = tint_symbol_5(buffer, (offset + (i_2 * 256u))); + arr_1[i_2] = a_load_1((offset + (i_2 * 256u))); } } return arr_1; @@ -59,11 +59,11 @@ void f() { const int p_a_i_save = i(); const int p_a_i_a_i_save = i(); const int p_a_i_a_i_m_i_save = i(); - const Outer l_a[4] = tint_symbol_4(a, 0u); - const Outer l_a_i = tint_symbol_5(a, (256u * uint(p_a_i_save))); - const Inner l_a_i_a[4] = tint_symbol_6(a, (256u * uint(p_a_i_save))); - const Inner l_a_i_a_i = tint_symbol_7(a, ((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); - const float3x3 l_a_i_a_i_m = tint_symbol_8(a, ((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); + const Outer l_a[4] = a_load(0u); + const Outer l_a_i = a_load_1((256u * uint(p_a_i_save))); + const Inner l_a_i_a[4] = a_load_2((256u * uint(p_a_i_save))); + const Inner l_a_i_a_i = a_load_3(((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); + const float3x3 l_a_i_a_i_m = a_load_4(((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); const uint scalar_offset_3 = ((((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save))) + (16u * uint(p_a_i_a_i_m_i_save)))) / 4; const float3 l_a_i_a_i_m_i = asfloat(a[scalar_offset_3 / 4].xyz); const int tint_symbol = p_a_i_save; diff --git a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl index 13f6480920..8a440a703c 100644 --- a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl @@ -9,40 +9,40 @@ cbuffer cbuffer_a : register(b0, space0) { uint4 a[64]; }; -float3x3 tint_symbol_4(uint4 buffer[64], uint offset) { +float3x3 a_load_4(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz)); + return float3x3(asfloat(a[scalar_offset / 4].xyz), asfloat(a[scalar_offset_1 / 4].xyz), asfloat(a[scalar_offset_2 / 4].xyz)); } -Inner tint_symbol_3(uint4 buffer[64], uint offset) { - const Inner tint_symbol_7 = {tint_symbol_4(buffer, (offset + 0u))}; - return tint_symbol_7; +Inner a_load_3(uint offset) { + const Inner tint_symbol = {a_load_4((offset + 0u))}; + return tint_symbol; } -typedef Inner tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[64], uint offset) { +typedef Inner a_load_2_ret[4]; +a_load_2_ret a_load_2(uint offset) { Inner arr[4] = (Inner[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_3(buffer, (offset + (i * 64u))); + arr[i] = a_load_3((offset + (i * 64u))); } } return arr; } -Outer tint_symbol_1(uint4 buffer[64], uint offset) { - const Outer tint_symbol_8 = {tint_symbol_2(buffer, (offset + 0u))}; - return tint_symbol_8; +Outer a_load_1(uint offset) { + const Outer tint_symbol_1 = {a_load_2((offset + 0u))}; + return tint_symbol_1; } -typedef Outer tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[64], uint offset) { +typedef Outer a_load_ret[4]; +a_load_ret a_load(uint offset) { Outer arr_1[4] = (Outer[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr_1[i_1] = tint_symbol_1(buffer, (offset + (i_1 * 256u))); + arr_1[i_1] = a_load_1((offset + (i_1 * 256u))); } } return arr_1; @@ -50,11 +50,11 @@ tint_symbol_ret tint_symbol(uint4 buffer[64], uint offset) { [numthreads(1, 1, 1)] void f() { - const Outer l_a[4] = tint_symbol(a, 0u); - const Outer l_a_3 = tint_symbol_1(a, 768u); - const Inner l_a_3_a[4] = tint_symbol_2(a, 768u); - const Inner l_a_3_a_2 = tint_symbol_3(a, 896u); - const float3x3 l_a_3_a_2_m = tint_symbol_4(a, 896u); + const Outer l_a[4] = a_load(0u); + const Outer l_a_3 = a_load_1(768u); + const Inner l_a_3_a[4] = a_load_2(768u); + const Inner l_a_3_a_2 = a_load_3(896u); + const float3x3 l_a_3_a_2_m = a_load_4(896u); const float3 l_a_3_a_2_m_1 = asfloat(a[57].xyz); const float l_a_3_a_2_m_1_0 = asfloat(a[57].x); return; diff --git a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl index 13f6480920..8a440a703c 100644 --- a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl @@ -9,40 +9,40 @@ cbuffer cbuffer_a : register(b0, space0) { uint4 a[64]; }; -float3x3 tint_symbol_4(uint4 buffer[64], uint offset) { +float3x3 a_load_4(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz)); + return float3x3(asfloat(a[scalar_offset / 4].xyz), asfloat(a[scalar_offset_1 / 4].xyz), asfloat(a[scalar_offset_2 / 4].xyz)); } -Inner tint_symbol_3(uint4 buffer[64], uint offset) { - const Inner tint_symbol_7 = {tint_symbol_4(buffer, (offset + 0u))}; - return tint_symbol_7; +Inner a_load_3(uint offset) { + const Inner tint_symbol = {a_load_4((offset + 0u))}; + return tint_symbol; } -typedef Inner tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[64], uint offset) { +typedef Inner a_load_2_ret[4]; +a_load_2_ret a_load_2(uint offset) { Inner arr[4] = (Inner[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_3(buffer, (offset + (i * 64u))); + arr[i] = a_load_3((offset + (i * 64u))); } } return arr; } -Outer tint_symbol_1(uint4 buffer[64], uint offset) { - const Outer tint_symbol_8 = {tint_symbol_2(buffer, (offset + 0u))}; - return tint_symbol_8; +Outer a_load_1(uint offset) { + const Outer tint_symbol_1 = {a_load_2((offset + 0u))}; + return tint_symbol_1; } -typedef Outer tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[64], uint offset) { +typedef Outer a_load_ret[4]; +a_load_ret a_load(uint offset) { Outer arr_1[4] = (Outer[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr_1[i_1] = tint_symbol_1(buffer, (offset + (i_1 * 256u))); + arr_1[i_1] = a_load_1((offset + (i_1 * 256u))); } } return arr_1; @@ -50,11 +50,11 @@ tint_symbol_ret tint_symbol(uint4 buffer[64], uint offset) { [numthreads(1, 1, 1)] void f() { - const Outer l_a[4] = tint_symbol(a, 0u); - const Outer l_a_3 = tint_symbol_1(a, 768u); - const Inner l_a_3_a[4] = tint_symbol_2(a, 768u); - const Inner l_a_3_a_2 = tint_symbol_3(a, 896u); - const float3x3 l_a_3_a_2_m = tint_symbol_4(a, 896u); + const Outer l_a[4] = a_load(0u); + const Outer l_a_3 = a_load_1(768u); + const Inner l_a_3_a[4] = a_load_2(768u); + const Inner l_a_3_a_2 = a_load_3(896u); + const float3x3 l_a_3_a_2_m = a_load_4(896u); const float3 l_a_3_a_2_m_1 = asfloat(a[57].xyz); const float l_a_3_a_2_m_1_0 = asfloat(a[57].x); return; diff --git a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_builtin.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_builtin.wgsl.expected.dxc.hlsl index 55e12dd016..2acaa507cc 100644 --- a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_builtin.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_builtin.wgsl.expected.dxc.hlsl @@ -2,16 +2,16 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[32]; }; -float3x3 tint_symbol(uint4 buffer[32], uint offset) { +float3x3 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz)); + return float3x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz)); } [numthreads(1, 1, 1)] void f() { - const float3x3 t = transpose(tint_symbol(u, 272u)); + const float3x3 t = transpose(u_load(272u)); const float l = length(asfloat(u[2].xyz).zxy); const float a = abs(asfloat(u[2].xyz).zxy.x); return; diff --git a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_builtin.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_builtin.wgsl.expected.fxc.hlsl index 55e12dd016..2acaa507cc 100644 --- a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_builtin.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_builtin.wgsl.expected.fxc.hlsl @@ -2,16 +2,16 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[32]; }; -float3x3 tint_symbol(uint4 buffer[32], uint offset) { +float3x3 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz)); + return float3x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz)); } [numthreads(1, 1, 1)] void f() { - const float3x3 t = transpose(tint_symbol(u, 272u)); + const float3x3 t = transpose(u_load(272u)); const float l = length(asfloat(u[2].xyz).zxy); const float a = abs(asfloat(u[2].xyz).zxy.x); return; diff --git a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_fn.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_fn.wgsl.expected.dxc.hlsl index 112cec232e..ea6921b687 100644 --- a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_fn.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_fn.wgsl.expected.dxc.hlsl @@ -23,26 +23,26 @@ void d(float3 v) { void e(float f_1) { } -float3x3 tint_symbol_3(uint4 buffer[32], uint offset) { +float3x3 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz)); + return float3x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz)); } -S tint_symbol_1(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_4 = ((offset + 64u)) / 4; - const S tint_symbol_5 = {asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), tint_symbol_3(buffer, (offset + 16u)), asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4])}; - return tint_symbol_5; + const S tint_symbol = {asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4]), u_load_3((offset + 16u)), asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4])}; + return tint_symbol; } -typedef S tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 128u))); + arr[i] = u_load_1((offset + (i * 128u))); } } return arr; @@ -50,9 +50,9 @@ tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); - b(tint_symbol_1(u, 256u)); - c(tint_symbol_3(u, 272u)); + a(u_load(0u)); + b(u_load_1(256u)); + c(u_load_3(272u)); d(asfloat(u[2].xyz).zxy); e(asfloat(u[2].xyz).zxy.x); return; diff --git a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_fn.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_fn.wgsl.expected.fxc.hlsl index 112cec232e..ea6921b687 100644 --- a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_fn.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_fn.wgsl.expected.fxc.hlsl @@ -23,26 +23,26 @@ void d(float3 v) { void e(float f_1) { } -float3x3 tint_symbol_3(uint4 buffer[32], uint offset) { +float3x3 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz)); + return float3x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz)); } -S tint_symbol_1(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_4 = ((offset + 64u)) / 4; - const S tint_symbol_5 = {asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), tint_symbol_3(buffer, (offset + 16u)), asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4])}; - return tint_symbol_5; + const S tint_symbol = {asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4]), u_load_3((offset + 16u)), asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4])}; + return tint_symbol; } -typedef S tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 128u))); + arr[i] = u_load_1((offset + (i * 128u))); } } return arr; @@ -50,9 +50,9 @@ tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); - b(tint_symbol_1(u, 256u)); - c(tint_symbol_3(u, 272u)); + a(u_load(0u)); + b(u_load_1(256u)); + c(u_load_3(272u)); d(asfloat(u[2].xyz).zxy); e(asfloat(u[2].xyz).zxy.x); return; diff --git a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_private.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_private.wgsl.expected.dxc.hlsl index 16455136da..e59e9fc36b 100644 --- a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_private.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_private.wgsl.expected.dxc.hlsl @@ -9,26 +9,26 @@ cbuffer cbuffer_u : register(b0, space0) { }; static S p[4] = (S[4])0; -float3x3 tint_symbol_3(uint4 buffer[32], uint offset) { +float3x3 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz)); + return float3x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz)); } -S tint_symbol_1(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_4 = ((offset + 64u)) / 4; - const S tint_symbol_5 = {asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), tint_symbol_3(buffer, (offset + 16u)), asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4])}; - return tint_symbol_5; + const S tint_symbol = {asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4]), u_load_3((offset + 16u)), asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4])}; + return tint_symbol; } -typedef S tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 128u))); + arr[i] = u_load_1((offset + (i * 128u))); } } return arr; @@ -36,9 +36,9 @@ tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); - p[1] = tint_symbol_1(u, 256u); - p[3].m = tint_symbol_3(u, 272u); + p = u_load(0u); + p[1] = u_load_1(256u); + p[3].m = u_load_3(272u); p[1].m[0] = asfloat(u[2].xyz).zxy; return; } diff --git a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_private.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_private.wgsl.expected.fxc.hlsl index 16455136da..e59e9fc36b 100644 --- a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_private.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_private.wgsl.expected.fxc.hlsl @@ -9,26 +9,26 @@ cbuffer cbuffer_u : register(b0, space0) { }; static S p[4] = (S[4])0; -float3x3 tint_symbol_3(uint4 buffer[32], uint offset) { +float3x3 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz)); + return float3x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz)); } -S tint_symbol_1(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_4 = ((offset + 64u)) / 4; - const S tint_symbol_5 = {asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), tint_symbol_3(buffer, (offset + 16u)), asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4])}; - return tint_symbol_5; + const S tint_symbol = {asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4]), u_load_3((offset + 16u)), asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4])}; + return tint_symbol; } -typedef S tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 128u))); + arr[i] = u_load_1((offset + (i * 128u))); } } return arr; @@ -36,9 +36,9 @@ tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); - p[1] = tint_symbol_1(u, 256u); - p[3].m = tint_symbol_3(u, 272u); + p = u_load(0u); + p[1] = u_load_1(256u); + p[3].m = u_load_3(272u); p[1].m[0] = asfloat(u[2].xyz).zxy; return; } diff --git a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_storage.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_storage.wgsl.expected.dxc.hlsl index c27c39378e..c3ff00ed3c 100644 --- a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_storage.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_storage.wgsl.expected.dxc.hlsl @@ -9,47 +9,47 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol_3(RWByteAddressBuffer buffer, uint offset, float3x3 value) { - buffer.Store3((offset + 0u), asuint(value[0u])); - buffer.Store3((offset + 16u), asuint(value[1u])); - buffer.Store3((offset + 32u), asuint(value[2u])); +void s_store_3(uint offset, float3x3 value) { + s.Store3((offset + 0u), asuint(value[0u])); + s.Store3((offset + 16u), asuint(value[1u])); + s.Store3((offset + 32u), asuint(value[2u])); } -void tint_symbol_1(RWByteAddressBuffer buffer, uint offset, S value) { - buffer.Store((offset + 0u), asuint(value.before)); - tint_symbol_3(buffer, (offset + 16u), value.m); - buffer.Store((offset + 64u), asuint(value.after)); +void s_store_1(uint offset, S value) { + s.Store((offset + 0u), asuint(value.before)); + s_store_3((offset + 16u), value.m); + s.Store((offset + 64u), asuint(value.after)); } -void tint_symbol(RWByteAddressBuffer buffer, uint offset, S value[4]) { +void s_store(uint offset, S value[4]) { S array_1[4] = value; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - tint_symbol_1(buffer, (offset + (i * 128u)), array_1[i]); + s_store_1((offset + (i * 128u)), array_1[i]); } } } -float3x3 tint_symbol_8(uint4 buffer[32], uint offset) { +float3x3 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz)); + return float3x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz)); } -S tint_symbol_6(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_4 = ((offset + 64u)) / 4; - const S tint_symbol_10 = {asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), tint_symbol_8(buffer, (offset + 16u)), asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4])}; - return tint_symbol_10; + const S tint_symbol = {asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4]), u_load_3((offset + 16u)), asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4])}; + return tint_symbol; } -typedef S tint_symbol_5_ret[4]; -tint_symbol_5_ret tint_symbol_5(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_6(buffer, (offset + (i_1 * 128u))); + arr[i_1] = u_load_1((offset + (i_1 * 128u))); } } return arr; @@ -57,9 +57,9 @@ tint_symbol_5_ret tint_symbol_5(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_5(u, 0u)); - tint_symbol_1(s, 128u, tint_symbol_6(u, 256u)); - tint_symbol_3(s, 400u, tint_symbol_8(u, 272u)); + s_store(0u, u_load(0u)); + s_store_1(128u, u_load_1(256u)); + s_store_3(400u, u_load_3(272u)); s.Store3(144u, asuint(asfloat(u[2].xyz).zxy)); return; } diff --git a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_storage.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_storage.wgsl.expected.fxc.hlsl index c27c39378e..c3ff00ed3c 100644 --- a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_storage.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_storage.wgsl.expected.fxc.hlsl @@ -9,47 +9,47 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol_3(RWByteAddressBuffer buffer, uint offset, float3x3 value) { - buffer.Store3((offset + 0u), asuint(value[0u])); - buffer.Store3((offset + 16u), asuint(value[1u])); - buffer.Store3((offset + 32u), asuint(value[2u])); +void s_store_3(uint offset, float3x3 value) { + s.Store3((offset + 0u), asuint(value[0u])); + s.Store3((offset + 16u), asuint(value[1u])); + s.Store3((offset + 32u), asuint(value[2u])); } -void tint_symbol_1(RWByteAddressBuffer buffer, uint offset, S value) { - buffer.Store((offset + 0u), asuint(value.before)); - tint_symbol_3(buffer, (offset + 16u), value.m); - buffer.Store((offset + 64u), asuint(value.after)); +void s_store_1(uint offset, S value) { + s.Store((offset + 0u), asuint(value.before)); + s_store_3((offset + 16u), value.m); + s.Store((offset + 64u), asuint(value.after)); } -void tint_symbol(RWByteAddressBuffer buffer, uint offset, S value[4]) { +void s_store(uint offset, S value[4]) { S array_1[4] = value; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - tint_symbol_1(buffer, (offset + (i * 128u)), array_1[i]); + s_store_1((offset + (i * 128u)), array_1[i]); } } } -float3x3 tint_symbol_8(uint4 buffer[32], uint offset) { +float3x3 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz)); + return float3x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz)); } -S tint_symbol_6(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_4 = ((offset + 64u)) / 4; - const S tint_symbol_10 = {asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), tint_symbol_8(buffer, (offset + 16u)), asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4])}; - return tint_symbol_10; + const S tint_symbol = {asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4]), u_load_3((offset + 16u)), asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4])}; + return tint_symbol; } -typedef S tint_symbol_5_ret[4]; -tint_symbol_5_ret tint_symbol_5(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_6(buffer, (offset + (i_1 * 128u))); + arr[i_1] = u_load_1((offset + (i_1 * 128u))); } } return arr; @@ -57,9 +57,9 @@ tint_symbol_5_ret tint_symbol_5(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_5(u, 0u)); - tint_symbol_1(s, 128u, tint_symbol_6(u, 256u)); - tint_symbol_3(s, 400u, tint_symbol_8(u, 272u)); + s_store(0u, u_load(0u)); + s_store_1(128u, u_load_1(256u)); + s_store_3(400u, u_load_3(272u)); s.Store3(144u, asuint(asfloat(u[2].xyz).zxy)); return; } diff --git a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_workgroup.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_workgroup.wgsl.expected.dxc.hlsl index e50deb19ff..137fcc421a 100644 --- a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_workgroup.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_workgroup.wgsl.expected.dxc.hlsl @@ -13,26 +13,26 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -float3x3 tint_symbol_5(uint4 buffer[32], uint offset) { +float3x3 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz)); + return float3x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz)); } -S tint_symbol_3(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_4 = ((offset + 64u)) / 4; - const S tint_symbol_8 = {asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), tint_symbol_5(buffer, (offset + 16u)), asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4])}; - return tint_symbol_8; + const S tint_symbol_3 = {asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4]), u_load_3((offset + 16u)), asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4])}; + return tint_symbol_3; } -typedef S tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_3(buffer, (offset + (i_1 * 128u))); + arr[i_1] = u_load_1((offset + (i_1 * 128u))); } } return arr; @@ -42,14 +42,14 @@ void f_inner(uint local_invocation_index) { { for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) { const uint i = idx; - const S tint_symbol_7 = (S)0; - w[i] = tint_symbol_7; + const S tint_symbol_2 = (S)0; + w[i] = tint_symbol_2; } } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); - w[1] = tint_symbol_3(u, 256u); - w[3].m = tint_symbol_5(u, 272u); + w = u_load(0u); + w[1] = u_load_1(256u); + w[3].m = u_load_3(272u); w[1].m[0] = asfloat(u[2].xyz).zxy; } diff --git a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_workgroup.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_workgroup.wgsl.expected.fxc.hlsl index e50deb19ff..137fcc421a 100644 --- a/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_workgroup.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat3x3_f32/to_workgroup.wgsl.expected.fxc.hlsl @@ -13,26 +13,26 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -float3x3 tint_symbol_5(uint4 buffer[32], uint offset) { +float3x3 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz)); + return float3x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz)); } -S tint_symbol_3(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_4 = ((offset + 64u)) / 4; - const S tint_symbol_8 = {asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), tint_symbol_5(buffer, (offset + 16u)), asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4])}; - return tint_symbol_8; + const S tint_symbol_3 = {asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4]), u_load_3((offset + 16u)), asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4])}; + return tint_symbol_3; } -typedef S tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_3(buffer, (offset + (i_1 * 128u))); + arr[i_1] = u_load_1((offset + (i_1 * 128u))); } } return arr; @@ -42,14 +42,14 @@ void f_inner(uint local_invocation_index) { { for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) { const uint i = idx; - const S tint_symbol_7 = (S)0; - w[i] = tint_symbol_7; + const S tint_symbol_2 = (S)0; + w[i] = tint_symbol_2; } } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); - w[1] = tint_symbol_3(u, 256u); - w[3].m = tint_symbol_5(u, 272u); + w = u_load(0u); + w[1] = u_load_1(256u); + w[3].m = u_load_3(272u); w[1].m[0] = asfloat(u[2].xyz).zxy; } diff --git a/test/tint/buffer/uniform/std140/struct/mat3x4_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat3x4_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl index 7487aeb0b7..4da33a1ab6 100644 --- a/test/tint/buffer/uniform/std140/struct/mat3x4_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat3x4_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl @@ -15,52 +15,52 @@ int i() { return counter; } -matrix tint_symbol_8(uint4 buffer[64], uint offset) { +matrix a_load_4(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = a[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = a[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); vector ubo_load_2_yw = vector(f16tof32(ubo_load_2 >> 16)); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = a[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); vector ubo_load_4_yw = vector(f16tof32(ubo_load_4 >> 16)); return matrix(vector(ubo_load_xz[0], ubo_load_yw[0], ubo_load_xz[1], ubo_load_yw[1]), vector(ubo_load_2_xz[0], ubo_load_2_yw[0], ubo_load_2_xz[1], ubo_load_2_yw[1]), vector(ubo_load_4_xz[0], ubo_load_4_yw[0], ubo_load_4_xz[1], ubo_load_4_yw[1])); } -Inner tint_symbol_7(uint4 buffer[64], uint offset) { - const Inner tint_symbol_11 = {tint_symbol_8(buffer, (offset + 0u))}; - return tint_symbol_11; +Inner a_load_3(uint offset) { + const Inner tint_symbol_4 = {a_load_4((offset + 0u))}; + return tint_symbol_4; } -typedef Inner tint_symbol_6_ret[4]; -tint_symbol_6_ret tint_symbol_6(uint4 buffer[64], uint offset) { +typedef Inner a_load_2_ret[4]; +a_load_2_ret a_load_2(uint offset) { Inner arr[4] = (Inner[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_7(buffer, (offset + (i_1 * 64u))); + arr[i_1] = a_load_3((offset + (i_1 * 64u))); } } return arr; } -Outer tint_symbol_5(uint4 buffer[64], uint offset) { - const Outer tint_symbol_12 = {tint_symbol_6(buffer, (offset + 0u))}; - return tint_symbol_12; +Outer a_load_1(uint offset) { + const Outer tint_symbol_5 = {a_load_2((offset + 0u))}; + return tint_symbol_5; } -typedef Outer tint_symbol_4_ret[4]; -tint_symbol_4_ret tint_symbol_4(uint4 buffer[64], uint offset) { +typedef Outer a_load_ret[4]; +a_load_ret a_load(uint offset) { Outer arr_1[4] = (Outer[4])0; { for(uint i_2 = 0u; (i_2 < 4u); i_2 = (i_2 + 1u)) { - arr_1[i_2] = tint_symbol_5(buffer, (offset + (i_2 * 256u))); + arr_1[i_2] = a_load_1((offset + (i_2 * 256u))); } } return arr_1; @@ -71,11 +71,11 @@ void f() { const int p_a_i_save = i(); const int p_a_i_a_i_save = i(); const int p_a_i_a_i_m_i_save = i(); - const Outer l_a[4] = tint_symbol_4(a, 0u); - const Outer l_a_i = tint_symbol_5(a, (256u * uint(p_a_i_save))); - const Inner l_a_i_a[4] = tint_symbol_6(a, (256u * uint(p_a_i_save))); - const Inner l_a_i_a_i = tint_symbol_7(a, ((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); - const matrix l_a_i_a_i_m = tint_symbol_8(a, ((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); + const Outer l_a[4] = a_load(0u); + const Outer l_a_i = a_load_1((256u * uint(p_a_i_save))); + const Inner l_a_i_a[4] = a_load_2((256u * uint(p_a_i_save))); + const Inner l_a_i_a_i = a_load_3(((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); + const matrix l_a_i_a_i_m = a_load_4(((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); const uint scalar_offset_3 = ((((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save))) + (8u * uint(p_a_i_a_i_m_i_save)))) / 4; uint4 ubo_load_7 = a[scalar_offset_3 / 4]; uint2 ubo_load_6 = ((scalar_offset_3 & 2) ? ubo_load_7.zw : ubo_load_7.xy); diff --git a/test/tint/buffer/uniform/std140/struct/mat3x4_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat3x4_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl index 356bff3d7c..6f58a61aa6 100644 --- a/test/tint/buffer/uniform/std140/struct/mat3x4_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat3x4_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl @@ -9,52 +9,52 @@ cbuffer cbuffer_a : register(b0, space0) { uint4 a[64]; }; -matrix tint_symbol_4(uint4 buffer[64], uint offset) { +matrix a_load_4(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = a[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = a[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); vector ubo_load_2_yw = vector(f16tof32(ubo_load_2 >> 16)); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = a[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); vector ubo_load_4_yw = vector(f16tof32(ubo_load_4 >> 16)); return matrix(vector(ubo_load_xz[0], ubo_load_yw[0], ubo_load_xz[1], ubo_load_yw[1]), vector(ubo_load_2_xz[0], ubo_load_2_yw[0], ubo_load_2_xz[1], ubo_load_2_yw[1]), vector(ubo_load_4_xz[0], ubo_load_4_yw[0], ubo_load_4_xz[1], ubo_load_4_yw[1])); } -Inner tint_symbol_3(uint4 buffer[64], uint offset) { - const Inner tint_symbol_7 = {tint_symbol_4(buffer, (offset + 0u))}; - return tint_symbol_7; +Inner a_load_3(uint offset) { + const Inner tint_symbol = {a_load_4((offset + 0u))}; + return tint_symbol; } -typedef Inner tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[64], uint offset) { +typedef Inner a_load_2_ret[4]; +a_load_2_ret a_load_2(uint offset) { Inner arr[4] = (Inner[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_3(buffer, (offset + (i * 64u))); + arr[i] = a_load_3((offset + (i * 64u))); } } return arr; } -Outer tint_symbol_1(uint4 buffer[64], uint offset) { - const Outer tint_symbol_8 = {tint_symbol_2(buffer, (offset + 0u))}; - return tint_symbol_8; +Outer a_load_1(uint offset) { + const Outer tint_symbol_1 = {a_load_2((offset + 0u))}; + return tint_symbol_1; } -typedef Outer tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[64], uint offset) { +typedef Outer a_load_ret[4]; +a_load_ret a_load(uint offset) { Outer arr_1[4] = (Outer[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr_1[i_1] = tint_symbol_1(buffer, (offset + (i_1 * 256u))); + arr_1[i_1] = a_load_1((offset + (i_1 * 256u))); } } return arr_1; @@ -62,11 +62,11 @@ tint_symbol_ret tint_symbol(uint4 buffer[64], uint offset) { [numthreads(1, 1, 1)] void f() { - const Outer l_a[4] = tint_symbol(a, 0u); - const Outer l_a_3 = tint_symbol_1(a, 768u); - const Inner l_a_3_a[4] = tint_symbol_2(a, 768u); - const Inner l_a_3_a_2 = tint_symbol_3(a, 896u); - const matrix l_a_3_a_2_m = tint_symbol_4(a, 896u); + const Outer l_a[4] = a_load(0u); + const Outer l_a_3 = a_load_1(768u); + const Inner l_a_3_a[4] = a_load_2(768u); + const Inner l_a_3_a_2 = a_load_3(896u); + const matrix l_a_3_a_2_m = a_load_4(896u); uint2 ubo_load_6 = a[56].zw; vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); vector ubo_load_6_yw = vector(f16tof32(ubo_load_6 >> 16)); diff --git a/test/tint/buffer/uniform/std140/struct/mat3x4_f16/to_builtin.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat3x4_f16/to_builtin.wgsl.expected.dxc.hlsl index b0b62a9f8c..49bc7aa373 100644 --- a/test/tint/buffer/uniform/std140/struct/mat3x4_f16/to_builtin.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat3x4_f16/to_builtin.wgsl.expected.dxc.hlsl @@ -2,19 +2,19 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[32]; }; -matrix tint_symbol(uint4 buffer[32], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); vector ubo_load_2_yw = vector(f16tof32(ubo_load_2 >> 16)); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = u[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); vector ubo_load_4_yw = vector(f16tof32(ubo_load_4 >> 16)); @@ -23,7 +23,7 @@ matrix tint_symbol(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - const matrix t = transpose(tint_symbol(u, 264u)); + const matrix t = transpose(u_load(264u)); uint2 ubo_load_6 = u[1].xy; vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); vector ubo_load_6_yw = vector(f16tof32(ubo_load_6 >> 16)); diff --git a/test/tint/buffer/uniform/std140/struct/mat3x4_f16/to_fn.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat3x4_f16/to_fn.wgsl.expected.dxc.hlsl index a190fc0440..9d1eebcaad 100644 --- a/test/tint/buffer/uniform/std140/struct/mat3x4_f16/to_fn.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat3x4_f16/to_fn.wgsl.expected.dxc.hlsl @@ -23,38 +23,38 @@ void d(vector v) { void e(float16_t f_1) { } -matrix tint_symbol_3(uint4 buffer[32], uint offset) { +matrix u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); vector ubo_load_2_yw = vector(f16tof32(ubo_load_2 >> 16)); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = u[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); vector ubo_load_4_yw = vector(f16tof32(ubo_load_4 >> 16)); return matrix(vector(ubo_load_xz[0], ubo_load_yw[0], ubo_load_xz[1], ubo_load_yw[1]), vector(ubo_load_2_xz[0], ubo_load_2_yw[0], ubo_load_2_xz[1], ubo_load_2_yw[1]), vector(ubo_load_4_xz[0], ubo_load_4_yw[0], ubo_load_4_xz[1], ubo_load_4_yw[1])); } -S tint_symbol_1(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_4 = ((offset + 64u)) / 4; - const S tint_symbol_5 = {asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), tint_symbol_3(buffer, (offset + 8u)), asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4])}; - return tint_symbol_5; + const S tint_symbol = {asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4]), u_load_3((offset + 8u)), asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4])}; + return tint_symbol; } -typedef S tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 128u))); + arr[i] = u_load_1((offset + (i * 128u))); } } return arr; @@ -62,9 +62,9 @@ tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); - b(tint_symbol_1(u, 256u)); - c(tint_symbol_3(u, 264u)); + a(u_load(0u)); + b(u_load_1(256u)); + c(u_load_3(264u)); uint2 ubo_load_6 = u[1].xy; vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); vector ubo_load_6_yw = vector(f16tof32(ubo_load_6 >> 16)); diff --git a/test/tint/buffer/uniform/std140/struct/mat3x4_f16/to_private.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat3x4_f16/to_private.wgsl.expected.dxc.hlsl index 60c2c7a64a..cf17cbed6a 100644 --- a/test/tint/buffer/uniform/std140/struct/mat3x4_f16/to_private.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat3x4_f16/to_private.wgsl.expected.dxc.hlsl @@ -9,38 +9,38 @@ cbuffer cbuffer_u : register(b0, space0) { }; static S p[4] = (S[4])0; -matrix tint_symbol_3(uint4 buffer[32], uint offset) { +matrix u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); vector ubo_load_2_yw = vector(f16tof32(ubo_load_2 >> 16)); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = u[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); vector ubo_load_4_yw = vector(f16tof32(ubo_load_4 >> 16)); return matrix(vector(ubo_load_xz[0], ubo_load_yw[0], ubo_load_xz[1], ubo_load_yw[1]), vector(ubo_load_2_xz[0], ubo_load_2_yw[0], ubo_load_2_xz[1], ubo_load_2_yw[1]), vector(ubo_load_4_xz[0], ubo_load_4_yw[0], ubo_load_4_xz[1], ubo_load_4_yw[1])); } -S tint_symbol_1(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_4 = ((offset + 64u)) / 4; - const S tint_symbol_5 = {asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), tint_symbol_3(buffer, (offset + 8u)), asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4])}; - return tint_symbol_5; + const S tint_symbol = {asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4]), u_load_3((offset + 8u)), asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4])}; + return tint_symbol; } -typedef S tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 128u))); + arr[i] = u_load_1((offset + (i * 128u))); } } return arr; @@ -48,9 +48,9 @@ tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); - p[1] = tint_symbol_1(u, 256u); - p[3].m = tint_symbol_3(u, 264u); + p = u_load(0u); + p[1] = u_load_1(256u); + p[3].m = u_load_3(264u); uint2 ubo_load_6 = u[1].xy; vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); vector ubo_load_6_yw = vector(f16tof32(ubo_load_6 >> 16)); diff --git a/test/tint/buffer/uniform/std140/struct/mat3x4_f16/to_storage.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat3x4_f16/to_storage.wgsl.expected.dxc.hlsl index 994f4fc3ef..d8f48aafd2 100644 --- a/test/tint/buffer/uniform/std140/struct/mat3x4_f16/to_storage.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat3x4_f16/to_storage.wgsl.expected.dxc.hlsl @@ -9,59 +9,59 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol_3(RWByteAddressBuffer buffer, uint offset, matrix value) { - buffer.Store >((offset + 0u), value[0u]); - buffer.Store >((offset + 8u), value[1u]); - buffer.Store >((offset + 16u), value[2u]); +void s_store_3(uint offset, matrix value) { + s.Store >((offset + 0u), value[0u]); + s.Store >((offset + 8u), value[1u]); + s.Store >((offset + 16u), value[2u]); } -void tint_symbol_1(RWByteAddressBuffer buffer, uint offset, S value) { - buffer.Store((offset + 0u), asuint(value.before)); - tint_symbol_3(buffer, (offset + 8u), value.m); - buffer.Store((offset + 64u), asuint(value.after)); +void s_store_1(uint offset, S value) { + s.Store((offset + 0u), asuint(value.before)); + s_store_3((offset + 8u), value.m); + s.Store((offset + 64u), asuint(value.after)); } -void tint_symbol(RWByteAddressBuffer buffer, uint offset, S value[4]) { +void s_store(uint offset, S value[4]) { S array_1[4] = value; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - tint_symbol_1(buffer, (offset + (i * 128u)), array_1[i]); + s_store_1((offset + (i * 128u)), array_1[i]); } } } -matrix tint_symbol_8(uint4 buffer[32], uint offset) { +matrix u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); vector ubo_load_2_yw = vector(f16tof32(ubo_load_2 >> 16)); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = u[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); vector ubo_load_4_yw = vector(f16tof32(ubo_load_4 >> 16)); return matrix(vector(ubo_load_xz[0], ubo_load_yw[0], ubo_load_xz[1], ubo_load_yw[1]), vector(ubo_load_2_xz[0], ubo_load_2_yw[0], ubo_load_2_xz[1], ubo_load_2_yw[1]), vector(ubo_load_4_xz[0], ubo_load_4_yw[0], ubo_load_4_xz[1], ubo_load_4_yw[1])); } -S tint_symbol_6(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_4 = ((offset + 64u)) / 4; - const S tint_symbol_10 = {asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), tint_symbol_8(buffer, (offset + 8u)), asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4])}; - return tint_symbol_10; + const S tint_symbol = {asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4]), u_load_3((offset + 8u)), asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4])}; + return tint_symbol; } -typedef S tint_symbol_5_ret[4]; -tint_symbol_5_ret tint_symbol_5(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_6(buffer, (offset + (i_1 * 128u))); + arr[i_1] = u_load_1((offset + (i_1 * 128u))); } } return arr; @@ -69,9 +69,9 @@ tint_symbol_5_ret tint_symbol_5(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_5(u, 0u)); - tint_symbol_1(s, 128u, tint_symbol_6(u, 256u)); - tint_symbol_3(s, 392u, tint_symbol_8(u, 264u)); + s_store(0u, u_load(0u)); + s_store_1(128u, u_load_1(256u)); + s_store_3(392u, u_load_3(264u)); uint2 ubo_load_6 = u[1].xy; vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); vector ubo_load_6_yw = vector(f16tof32(ubo_load_6 >> 16)); diff --git a/test/tint/buffer/uniform/std140/struct/mat3x4_f16/to_workgroup.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat3x4_f16/to_workgroup.wgsl.expected.dxc.hlsl index e0f83f81b0..e15cddc1ea 100644 --- a/test/tint/buffer/uniform/std140/struct/mat3x4_f16/to_workgroup.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat3x4_f16/to_workgroup.wgsl.expected.dxc.hlsl @@ -13,38 +13,38 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -matrix tint_symbol_5(uint4 buffer[32], uint offset) { +matrix u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); vector ubo_load_2_yw = vector(f16tof32(ubo_load_2 >> 16)); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = u[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); vector ubo_load_4_yw = vector(f16tof32(ubo_load_4 >> 16)); return matrix(vector(ubo_load_xz[0], ubo_load_yw[0], ubo_load_xz[1], ubo_load_yw[1]), vector(ubo_load_2_xz[0], ubo_load_2_yw[0], ubo_load_2_xz[1], ubo_load_2_yw[1]), vector(ubo_load_4_xz[0], ubo_load_4_yw[0], ubo_load_4_xz[1], ubo_load_4_yw[1])); } -S tint_symbol_3(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_4 = ((offset + 64u)) / 4; - const S tint_symbol_8 = {asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), tint_symbol_5(buffer, (offset + 8u)), asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4])}; - return tint_symbol_8; + const S tint_symbol_3 = {asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4]), u_load_3((offset + 8u)), asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4])}; + return tint_symbol_3; } -typedef S tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_3(buffer, (offset + (i_1 * 128u))); + arr[i_1] = u_load_1((offset + (i_1 * 128u))); } } return arr; @@ -54,14 +54,14 @@ void f_inner(uint local_invocation_index) { { for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) { const uint i = idx; - const S tint_symbol_7 = (S)0; - w[i] = tint_symbol_7; + const S tint_symbol_2 = (S)0; + w[i] = tint_symbol_2; } } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); - w[1] = tint_symbol_3(u, 256u); - w[3].m = tint_symbol_5(u, 264u); + w = u_load(0u); + w[1] = u_load_1(256u); + w[3].m = u_load_3(264u); uint2 ubo_load_6 = u[1].xy; vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); vector ubo_load_6_yw = vector(f16tof32(ubo_load_6 >> 16)); diff --git a/test/tint/buffer/uniform/std140/struct/mat3x4_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat3x4_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl index 2e5ba64303..efb46e712b 100644 --- a/test/tint/buffer/uniform/std140/struct/mat3x4_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat3x4_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl @@ -15,40 +15,40 @@ int i() { return counter; } -float3x4 tint_symbol_8(uint4 buffer[64], uint offset) { +float3x4 a_load_4(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); + return float3x4(asfloat(a[scalar_offset / 4]), asfloat(a[scalar_offset_1 / 4]), asfloat(a[scalar_offset_2 / 4])); } -Inner tint_symbol_7(uint4 buffer[64], uint offset) { - const Inner tint_symbol_11 = {tint_symbol_8(buffer, (offset + 0u))}; - return tint_symbol_11; +Inner a_load_3(uint offset) { + const Inner tint_symbol_4 = {a_load_4((offset + 0u))}; + return tint_symbol_4; } -typedef Inner tint_symbol_6_ret[4]; -tint_symbol_6_ret tint_symbol_6(uint4 buffer[64], uint offset) { +typedef Inner a_load_2_ret[4]; +a_load_2_ret a_load_2(uint offset) { Inner arr[4] = (Inner[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_7(buffer, (offset + (i_1 * 64u))); + arr[i_1] = a_load_3((offset + (i_1 * 64u))); } } return arr; } -Outer tint_symbol_5(uint4 buffer[64], uint offset) { - const Outer tint_symbol_12 = {tint_symbol_6(buffer, (offset + 0u))}; - return tint_symbol_12; +Outer a_load_1(uint offset) { + const Outer tint_symbol_5 = {a_load_2((offset + 0u))}; + return tint_symbol_5; } -typedef Outer tint_symbol_4_ret[4]; -tint_symbol_4_ret tint_symbol_4(uint4 buffer[64], uint offset) { +typedef Outer a_load_ret[4]; +a_load_ret a_load(uint offset) { Outer arr_1[4] = (Outer[4])0; { for(uint i_2 = 0u; (i_2 < 4u); i_2 = (i_2 + 1u)) { - arr_1[i_2] = tint_symbol_5(buffer, (offset + (i_2 * 256u))); + arr_1[i_2] = a_load_1((offset + (i_2 * 256u))); } } return arr_1; @@ -59,11 +59,11 @@ void f() { const int p_a_i_save = i(); const int p_a_i_a_i_save = i(); const int p_a_i_a_i_m_i_save = i(); - const Outer l_a[4] = tint_symbol_4(a, 0u); - const Outer l_a_i = tint_symbol_5(a, (256u * uint(p_a_i_save))); - const Inner l_a_i_a[4] = tint_symbol_6(a, (256u * uint(p_a_i_save))); - const Inner l_a_i_a_i = tint_symbol_7(a, ((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); - const float3x4 l_a_i_a_i_m = tint_symbol_8(a, ((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); + const Outer l_a[4] = a_load(0u); + const Outer l_a_i = a_load_1((256u * uint(p_a_i_save))); + const Inner l_a_i_a[4] = a_load_2((256u * uint(p_a_i_save))); + const Inner l_a_i_a_i = a_load_3(((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); + const float3x4 l_a_i_a_i_m = a_load_4(((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); const uint scalar_offset_3 = ((((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save))) + (16u * uint(p_a_i_a_i_m_i_save)))) / 4; const float4 l_a_i_a_i_m_i = asfloat(a[scalar_offset_3 / 4]); const int tint_symbol = p_a_i_save; diff --git a/test/tint/buffer/uniform/std140/struct/mat3x4_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat3x4_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl index 2e5ba64303..efb46e712b 100644 --- a/test/tint/buffer/uniform/std140/struct/mat3x4_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat3x4_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl @@ -15,40 +15,40 @@ int i() { return counter; } -float3x4 tint_symbol_8(uint4 buffer[64], uint offset) { +float3x4 a_load_4(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); + return float3x4(asfloat(a[scalar_offset / 4]), asfloat(a[scalar_offset_1 / 4]), asfloat(a[scalar_offset_2 / 4])); } -Inner tint_symbol_7(uint4 buffer[64], uint offset) { - const Inner tint_symbol_11 = {tint_symbol_8(buffer, (offset + 0u))}; - return tint_symbol_11; +Inner a_load_3(uint offset) { + const Inner tint_symbol_4 = {a_load_4((offset + 0u))}; + return tint_symbol_4; } -typedef Inner tint_symbol_6_ret[4]; -tint_symbol_6_ret tint_symbol_6(uint4 buffer[64], uint offset) { +typedef Inner a_load_2_ret[4]; +a_load_2_ret a_load_2(uint offset) { Inner arr[4] = (Inner[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_7(buffer, (offset + (i_1 * 64u))); + arr[i_1] = a_load_3((offset + (i_1 * 64u))); } } return arr; } -Outer tint_symbol_5(uint4 buffer[64], uint offset) { - const Outer tint_symbol_12 = {tint_symbol_6(buffer, (offset + 0u))}; - return tint_symbol_12; +Outer a_load_1(uint offset) { + const Outer tint_symbol_5 = {a_load_2((offset + 0u))}; + return tint_symbol_5; } -typedef Outer tint_symbol_4_ret[4]; -tint_symbol_4_ret tint_symbol_4(uint4 buffer[64], uint offset) { +typedef Outer a_load_ret[4]; +a_load_ret a_load(uint offset) { Outer arr_1[4] = (Outer[4])0; { for(uint i_2 = 0u; (i_2 < 4u); i_2 = (i_2 + 1u)) { - arr_1[i_2] = tint_symbol_5(buffer, (offset + (i_2 * 256u))); + arr_1[i_2] = a_load_1((offset + (i_2 * 256u))); } } return arr_1; @@ -59,11 +59,11 @@ void f() { const int p_a_i_save = i(); const int p_a_i_a_i_save = i(); const int p_a_i_a_i_m_i_save = i(); - const Outer l_a[4] = tint_symbol_4(a, 0u); - const Outer l_a_i = tint_symbol_5(a, (256u * uint(p_a_i_save))); - const Inner l_a_i_a[4] = tint_symbol_6(a, (256u * uint(p_a_i_save))); - const Inner l_a_i_a_i = tint_symbol_7(a, ((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); - const float3x4 l_a_i_a_i_m = tint_symbol_8(a, ((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); + const Outer l_a[4] = a_load(0u); + const Outer l_a_i = a_load_1((256u * uint(p_a_i_save))); + const Inner l_a_i_a[4] = a_load_2((256u * uint(p_a_i_save))); + const Inner l_a_i_a_i = a_load_3(((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); + const float3x4 l_a_i_a_i_m = a_load_4(((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); const uint scalar_offset_3 = ((((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save))) + (16u * uint(p_a_i_a_i_m_i_save)))) / 4; const float4 l_a_i_a_i_m_i = asfloat(a[scalar_offset_3 / 4]); const int tint_symbol = p_a_i_save; diff --git a/test/tint/buffer/uniform/std140/struct/mat3x4_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat3x4_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl index 26a9369508..e71e9778a1 100644 --- a/test/tint/buffer/uniform/std140/struct/mat3x4_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat3x4_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl @@ -9,40 +9,40 @@ cbuffer cbuffer_a : register(b0, space0) { uint4 a[64]; }; -float3x4 tint_symbol_4(uint4 buffer[64], uint offset) { +float3x4 a_load_4(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); + return float3x4(asfloat(a[scalar_offset / 4]), asfloat(a[scalar_offset_1 / 4]), asfloat(a[scalar_offset_2 / 4])); } -Inner tint_symbol_3(uint4 buffer[64], uint offset) { - const Inner tint_symbol_7 = {tint_symbol_4(buffer, (offset + 0u))}; - return tint_symbol_7; +Inner a_load_3(uint offset) { + const Inner tint_symbol = {a_load_4((offset + 0u))}; + return tint_symbol; } -typedef Inner tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[64], uint offset) { +typedef Inner a_load_2_ret[4]; +a_load_2_ret a_load_2(uint offset) { Inner arr[4] = (Inner[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_3(buffer, (offset + (i * 64u))); + arr[i] = a_load_3((offset + (i * 64u))); } } return arr; } -Outer tint_symbol_1(uint4 buffer[64], uint offset) { - const Outer tint_symbol_8 = {tint_symbol_2(buffer, (offset + 0u))}; - return tint_symbol_8; +Outer a_load_1(uint offset) { + const Outer tint_symbol_1 = {a_load_2((offset + 0u))}; + return tint_symbol_1; } -typedef Outer tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[64], uint offset) { +typedef Outer a_load_ret[4]; +a_load_ret a_load(uint offset) { Outer arr_1[4] = (Outer[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr_1[i_1] = tint_symbol_1(buffer, (offset + (i_1 * 256u))); + arr_1[i_1] = a_load_1((offset + (i_1 * 256u))); } } return arr_1; @@ -50,11 +50,11 @@ tint_symbol_ret tint_symbol(uint4 buffer[64], uint offset) { [numthreads(1, 1, 1)] void f() { - const Outer l_a[4] = tint_symbol(a, 0u); - const Outer l_a_3 = tint_symbol_1(a, 768u); - const Inner l_a_3_a[4] = tint_symbol_2(a, 768u); - const Inner l_a_3_a_2 = tint_symbol_3(a, 896u); - const float3x4 l_a_3_a_2_m = tint_symbol_4(a, 896u); + const Outer l_a[4] = a_load(0u); + const Outer l_a_3 = a_load_1(768u); + const Inner l_a_3_a[4] = a_load_2(768u); + const Inner l_a_3_a_2 = a_load_3(896u); + const float3x4 l_a_3_a_2_m = a_load_4(896u); const float4 l_a_3_a_2_m_1 = asfloat(a[57]); const float l_a_3_a_2_m_1_0 = asfloat(a[57].x); return; diff --git a/test/tint/buffer/uniform/std140/struct/mat3x4_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat3x4_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl index 26a9369508..e71e9778a1 100644 --- a/test/tint/buffer/uniform/std140/struct/mat3x4_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat3x4_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl @@ -9,40 +9,40 @@ cbuffer cbuffer_a : register(b0, space0) { uint4 a[64]; }; -float3x4 tint_symbol_4(uint4 buffer[64], uint offset) { +float3x4 a_load_4(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); + return float3x4(asfloat(a[scalar_offset / 4]), asfloat(a[scalar_offset_1 / 4]), asfloat(a[scalar_offset_2 / 4])); } -Inner tint_symbol_3(uint4 buffer[64], uint offset) { - const Inner tint_symbol_7 = {tint_symbol_4(buffer, (offset + 0u))}; - return tint_symbol_7; +Inner a_load_3(uint offset) { + const Inner tint_symbol = {a_load_4((offset + 0u))}; + return tint_symbol; } -typedef Inner tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[64], uint offset) { +typedef Inner a_load_2_ret[4]; +a_load_2_ret a_load_2(uint offset) { Inner arr[4] = (Inner[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_3(buffer, (offset + (i * 64u))); + arr[i] = a_load_3((offset + (i * 64u))); } } return arr; } -Outer tint_symbol_1(uint4 buffer[64], uint offset) { - const Outer tint_symbol_8 = {tint_symbol_2(buffer, (offset + 0u))}; - return tint_symbol_8; +Outer a_load_1(uint offset) { + const Outer tint_symbol_1 = {a_load_2((offset + 0u))}; + return tint_symbol_1; } -typedef Outer tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[64], uint offset) { +typedef Outer a_load_ret[4]; +a_load_ret a_load(uint offset) { Outer arr_1[4] = (Outer[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr_1[i_1] = tint_symbol_1(buffer, (offset + (i_1 * 256u))); + arr_1[i_1] = a_load_1((offset + (i_1 * 256u))); } } return arr_1; @@ -50,11 +50,11 @@ tint_symbol_ret tint_symbol(uint4 buffer[64], uint offset) { [numthreads(1, 1, 1)] void f() { - const Outer l_a[4] = tint_symbol(a, 0u); - const Outer l_a_3 = tint_symbol_1(a, 768u); - const Inner l_a_3_a[4] = tint_symbol_2(a, 768u); - const Inner l_a_3_a_2 = tint_symbol_3(a, 896u); - const float3x4 l_a_3_a_2_m = tint_symbol_4(a, 896u); + const Outer l_a[4] = a_load(0u); + const Outer l_a_3 = a_load_1(768u); + const Inner l_a_3_a[4] = a_load_2(768u); + const Inner l_a_3_a_2 = a_load_3(896u); + const float3x4 l_a_3_a_2_m = a_load_4(896u); const float4 l_a_3_a_2_m_1 = asfloat(a[57]); const float l_a_3_a_2_m_1_0 = asfloat(a[57].x); return; diff --git a/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_builtin.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_builtin.wgsl.expected.dxc.hlsl index 0826949b50..5db4bf59d4 100644 --- a/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_builtin.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_builtin.wgsl.expected.dxc.hlsl @@ -2,16 +2,16 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[32]; }; -float3x4 tint_symbol(uint4 buffer[32], uint offset) { +float3x4 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); + return float3x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4]), asfloat(u[scalar_offset_2 / 4])); } [numthreads(1, 1, 1)] void f() { - const float4x3 t = transpose(tint_symbol(u, 272u)); + const float4x3 t = transpose(u_load(272u)); const float l = length(asfloat(u[2]).ywxz); const float a = abs(asfloat(u[2]).ywxz.x); return; diff --git a/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_builtin.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_builtin.wgsl.expected.fxc.hlsl index 0826949b50..5db4bf59d4 100644 --- a/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_builtin.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_builtin.wgsl.expected.fxc.hlsl @@ -2,16 +2,16 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[32]; }; -float3x4 tint_symbol(uint4 buffer[32], uint offset) { +float3x4 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); + return float3x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4]), asfloat(u[scalar_offset_2 / 4])); } [numthreads(1, 1, 1)] void f() { - const float4x3 t = transpose(tint_symbol(u, 272u)); + const float4x3 t = transpose(u_load(272u)); const float l = length(asfloat(u[2]).ywxz); const float a = abs(asfloat(u[2]).ywxz.x); return; diff --git a/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_fn.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_fn.wgsl.expected.dxc.hlsl index 0bc1c2f0b4..413584cfb0 100644 --- a/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_fn.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_fn.wgsl.expected.dxc.hlsl @@ -23,26 +23,26 @@ void d(float4 v) { void e(float f_1) { } -float3x4 tint_symbol_3(uint4 buffer[32], uint offset) { +float3x4 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); + return float3x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4]), asfloat(u[scalar_offset_2 / 4])); } -S tint_symbol_1(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_4 = ((offset + 64u)) / 4; - const S tint_symbol_5 = {asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), tint_symbol_3(buffer, (offset + 16u)), asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4])}; - return tint_symbol_5; + const S tint_symbol = {asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4]), u_load_3((offset + 16u)), asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4])}; + return tint_symbol; } -typedef S tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 128u))); + arr[i] = u_load_1((offset + (i * 128u))); } } return arr; @@ -50,9 +50,9 @@ tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); - b(tint_symbol_1(u, 256u)); - c(tint_symbol_3(u, 272u)); + a(u_load(0u)); + b(u_load_1(256u)); + c(u_load_3(272u)); d(asfloat(u[2]).ywxz); e(asfloat(u[2]).ywxz.x); return; diff --git a/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_fn.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_fn.wgsl.expected.fxc.hlsl index 0bc1c2f0b4..413584cfb0 100644 --- a/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_fn.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_fn.wgsl.expected.fxc.hlsl @@ -23,26 +23,26 @@ void d(float4 v) { void e(float f_1) { } -float3x4 tint_symbol_3(uint4 buffer[32], uint offset) { +float3x4 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); + return float3x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4]), asfloat(u[scalar_offset_2 / 4])); } -S tint_symbol_1(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_4 = ((offset + 64u)) / 4; - const S tint_symbol_5 = {asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), tint_symbol_3(buffer, (offset + 16u)), asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4])}; - return tint_symbol_5; + const S tint_symbol = {asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4]), u_load_3((offset + 16u)), asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4])}; + return tint_symbol; } -typedef S tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 128u))); + arr[i] = u_load_1((offset + (i * 128u))); } } return arr; @@ -50,9 +50,9 @@ tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); - b(tint_symbol_1(u, 256u)); - c(tint_symbol_3(u, 272u)); + a(u_load(0u)); + b(u_load_1(256u)); + c(u_load_3(272u)); d(asfloat(u[2]).ywxz); e(asfloat(u[2]).ywxz.x); return; diff --git a/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_private.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_private.wgsl.expected.dxc.hlsl index d7e58d4609..9020119138 100644 --- a/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_private.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_private.wgsl.expected.dxc.hlsl @@ -9,26 +9,26 @@ cbuffer cbuffer_u : register(b0, space0) { }; static S p[4] = (S[4])0; -float3x4 tint_symbol_3(uint4 buffer[32], uint offset) { +float3x4 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); + return float3x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4]), asfloat(u[scalar_offset_2 / 4])); } -S tint_symbol_1(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_4 = ((offset + 64u)) / 4; - const S tint_symbol_5 = {asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), tint_symbol_3(buffer, (offset + 16u)), asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4])}; - return tint_symbol_5; + const S tint_symbol = {asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4]), u_load_3((offset + 16u)), asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4])}; + return tint_symbol; } -typedef S tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 128u))); + arr[i] = u_load_1((offset + (i * 128u))); } } return arr; @@ -36,9 +36,9 @@ tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); - p[1] = tint_symbol_1(u, 256u); - p[3].m = tint_symbol_3(u, 272u); + p = u_load(0u); + p[1] = u_load_1(256u); + p[3].m = u_load_3(272u); p[1].m[0] = asfloat(u[2]).ywxz; return; } diff --git a/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_private.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_private.wgsl.expected.fxc.hlsl index d7e58d4609..9020119138 100644 --- a/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_private.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_private.wgsl.expected.fxc.hlsl @@ -9,26 +9,26 @@ cbuffer cbuffer_u : register(b0, space0) { }; static S p[4] = (S[4])0; -float3x4 tint_symbol_3(uint4 buffer[32], uint offset) { +float3x4 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); + return float3x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4]), asfloat(u[scalar_offset_2 / 4])); } -S tint_symbol_1(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_4 = ((offset + 64u)) / 4; - const S tint_symbol_5 = {asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), tint_symbol_3(buffer, (offset + 16u)), asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4])}; - return tint_symbol_5; + const S tint_symbol = {asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4]), u_load_3((offset + 16u)), asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4])}; + return tint_symbol; } -typedef S tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 128u))); + arr[i] = u_load_1((offset + (i * 128u))); } } return arr; @@ -36,9 +36,9 @@ tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); - p[1] = tint_symbol_1(u, 256u); - p[3].m = tint_symbol_3(u, 272u); + p = u_load(0u); + p[1] = u_load_1(256u); + p[3].m = u_load_3(272u); p[1].m[0] = asfloat(u[2]).ywxz; return; } diff --git a/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_storage.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_storage.wgsl.expected.dxc.hlsl index ce77d82e50..66eb7edca1 100644 --- a/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_storage.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_storage.wgsl.expected.dxc.hlsl @@ -9,47 +9,47 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol_3(RWByteAddressBuffer buffer, uint offset, float3x4 value) { - buffer.Store4((offset + 0u), asuint(value[0u])); - buffer.Store4((offset + 16u), asuint(value[1u])); - buffer.Store4((offset + 32u), asuint(value[2u])); +void s_store_3(uint offset, float3x4 value) { + s.Store4((offset + 0u), asuint(value[0u])); + s.Store4((offset + 16u), asuint(value[1u])); + s.Store4((offset + 32u), asuint(value[2u])); } -void tint_symbol_1(RWByteAddressBuffer buffer, uint offset, S value) { - buffer.Store((offset + 0u), asuint(value.before)); - tint_symbol_3(buffer, (offset + 16u), value.m); - buffer.Store((offset + 64u), asuint(value.after)); +void s_store_1(uint offset, S value) { + s.Store((offset + 0u), asuint(value.before)); + s_store_3((offset + 16u), value.m); + s.Store((offset + 64u), asuint(value.after)); } -void tint_symbol(RWByteAddressBuffer buffer, uint offset, S value[4]) { +void s_store(uint offset, S value[4]) { S array_1[4] = value; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - tint_symbol_1(buffer, (offset + (i * 128u)), array_1[i]); + s_store_1((offset + (i * 128u)), array_1[i]); } } } -float3x4 tint_symbol_8(uint4 buffer[32], uint offset) { +float3x4 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); + return float3x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4]), asfloat(u[scalar_offset_2 / 4])); } -S tint_symbol_6(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_4 = ((offset + 64u)) / 4; - const S tint_symbol_10 = {asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), tint_symbol_8(buffer, (offset + 16u)), asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4])}; - return tint_symbol_10; + const S tint_symbol = {asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4]), u_load_3((offset + 16u)), asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4])}; + return tint_symbol; } -typedef S tint_symbol_5_ret[4]; -tint_symbol_5_ret tint_symbol_5(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_6(buffer, (offset + (i_1 * 128u))); + arr[i_1] = u_load_1((offset + (i_1 * 128u))); } } return arr; @@ -57,9 +57,9 @@ tint_symbol_5_ret tint_symbol_5(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_5(u, 0u)); - tint_symbol_1(s, 128u, tint_symbol_6(u, 256u)); - tint_symbol_3(s, 400u, tint_symbol_8(u, 272u)); + s_store(0u, u_load(0u)); + s_store_1(128u, u_load_1(256u)); + s_store_3(400u, u_load_3(272u)); s.Store4(144u, asuint(asfloat(u[2]).ywxz)); return; } diff --git a/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_storage.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_storage.wgsl.expected.fxc.hlsl index ce77d82e50..66eb7edca1 100644 --- a/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_storage.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_storage.wgsl.expected.fxc.hlsl @@ -9,47 +9,47 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol_3(RWByteAddressBuffer buffer, uint offset, float3x4 value) { - buffer.Store4((offset + 0u), asuint(value[0u])); - buffer.Store4((offset + 16u), asuint(value[1u])); - buffer.Store4((offset + 32u), asuint(value[2u])); +void s_store_3(uint offset, float3x4 value) { + s.Store4((offset + 0u), asuint(value[0u])); + s.Store4((offset + 16u), asuint(value[1u])); + s.Store4((offset + 32u), asuint(value[2u])); } -void tint_symbol_1(RWByteAddressBuffer buffer, uint offset, S value) { - buffer.Store((offset + 0u), asuint(value.before)); - tint_symbol_3(buffer, (offset + 16u), value.m); - buffer.Store((offset + 64u), asuint(value.after)); +void s_store_1(uint offset, S value) { + s.Store((offset + 0u), asuint(value.before)); + s_store_3((offset + 16u), value.m); + s.Store((offset + 64u), asuint(value.after)); } -void tint_symbol(RWByteAddressBuffer buffer, uint offset, S value[4]) { +void s_store(uint offset, S value[4]) { S array_1[4] = value; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - tint_symbol_1(buffer, (offset + (i * 128u)), array_1[i]); + s_store_1((offset + (i * 128u)), array_1[i]); } } } -float3x4 tint_symbol_8(uint4 buffer[32], uint offset) { +float3x4 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); + return float3x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4]), asfloat(u[scalar_offset_2 / 4])); } -S tint_symbol_6(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_4 = ((offset + 64u)) / 4; - const S tint_symbol_10 = {asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), tint_symbol_8(buffer, (offset + 16u)), asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4])}; - return tint_symbol_10; + const S tint_symbol = {asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4]), u_load_3((offset + 16u)), asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4])}; + return tint_symbol; } -typedef S tint_symbol_5_ret[4]; -tint_symbol_5_ret tint_symbol_5(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_6(buffer, (offset + (i_1 * 128u))); + arr[i_1] = u_load_1((offset + (i_1 * 128u))); } } return arr; @@ -57,9 +57,9 @@ tint_symbol_5_ret tint_symbol_5(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_5(u, 0u)); - tint_symbol_1(s, 128u, tint_symbol_6(u, 256u)); - tint_symbol_3(s, 400u, tint_symbol_8(u, 272u)); + s_store(0u, u_load(0u)); + s_store_1(128u, u_load_1(256u)); + s_store_3(400u, u_load_3(272u)); s.Store4(144u, asuint(asfloat(u[2]).ywxz)); return; } diff --git a/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_workgroup.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_workgroup.wgsl.expected.dxc.hlsl index 2188035f4e..7f2417bbdf 100644 --- a/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_workgroup.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_workgroup.wgsl.expected.dxc.hlsl @@ -13,26 +13,26 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -float3x4 tint_symbol_5(uint4 buffer[32], uint offset) { +float3x4 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); + return float3x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4]), asfloat(u[scalar_offset_2 / 4])); } -S tint_symbol_3(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_4 = ((offset + 64u)) / 4; - const S tint_symbol_8 = {asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), tint_symbol_5(buffer, (offset + 16u)), asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4])}; - return tint_symbol_8; + const S tint_symbol_3 = {asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4]), u_load_3((offset + 16u)), asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4])}; + return tint_symbol_3; } -typedef S tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_3(buffer, (offset + (i_1 * 128u))); + arr[i_1] = u_load_1((offset + (i_1 * 128u))); } } return arr; @@ -42,14 +42,14 @@ void f_inner(uint local_invocation_index) { { for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) { const uint i = idx; - const S tint_symbol_7 = (S)0; - w[i] = tint_symbol_7; + const S tint_symbol_2 = (S)0; + w[i] = tint_symbol_2; } } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); - w[1] = tint_symbol_3(u, 256u); - w[3].m = tint_symbol_5(u, 272u); + w = u_load(0u); + w[1] = u_load_1(256u); + w[3].m = u_load_3(272u); w[1].m[0] = asfloat(u[2]).ywxz; } diff --git a/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_workgroup.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_workgroup.wgsl.expected.fxc.hlsl index 2188035f4e..7f2417bbdf 100644 --- a/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_workgroup.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat3x4_f32/to_workgroup.wgsl.expected.fxc.hlsl @@ -13,26 +13,26 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -float3x4 tint_symbol_5(uint4 buffer[32], uint offset) { +float3x4 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); + return float3x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4]), asfloat(u[scalar_offset_2 / 4])); } -S tint_symbol_3(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_4 = ((offset + 64u)) / 4; - const S tint_symbol_8 = {asint(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), tint_symbol_5(buffer, (offset + 16u)), asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4])}; - return tint_symbol_8; + const S tint_symbol_3 = {asint(u[scalar_offset_3 / 4][scalar_offset_3 % 4]), u_load_3((offset + 16u)), asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4])}; + return tint_symbol_3; } -typedef S tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_3(buffer, (offset + (i_1 * 128u))); + arr[i_1] = u_load_1((offset + (i_1 * 128u))); } } return arr; @@ -42,14 +42,14 @@ void f_inner(uint local_invocation_index) { { for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) { const uint i = idx; - const S tint_symbol_7 = (S)0; - w[i] = tint_symbol_7; + const S tint_symbol_2 = (S)0; + w[i] = tint_symbol_2; } } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); - w[1] = tint_symbol_3(u, 256u); - w[3].m = tint_symbol_5(u, 272u); + w = u_load(0u); + w[1] = u_load_1(256u); + w[3].m = u_load_3(272u); w[1].m[0] = asfloat(u[2]).ywxz; } diff --git a/test/tint/buffer/uniform/std140/struct/mat4x2_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat4x2_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl index 2b3b6668e8..8f0ff8aaa9 100644 --- a/test/tint/buffer/uniform/std140/struct/mat4x2_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat4x2_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl @@ -15,45 +15,45 @@ int i() { return counter; } -matrix tint_symbol_8(uint4 buffer[64], uint offset) { +matrix a_load_4(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint ubo_load = buffer[scalar_offset / 4][scalar_offset % 4]; + uint ubo_load = a[scalar_offset / 4][scalar_offset % 4]; const uint scalar_offset_1 = ((offset + 4u)) / 4; - uint ubo_load_1 = buffer[scalar_offset_1 / 4][scalar_offset_1 % 4]; + uint ubo_load_1 = a[scalar_offset_1 / 4][scalar_offset_1 % 4]; const uint scalar_offset_2 = ((offset + 8u)) / 4; - uint ubo_load_2 = buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]; + uint ubo_load_2 = a[scalar_offset_2 / 4][scalar_offset_2 % 4]; const uint scalar_offset_3 = ((offset + 12u)) / 4; - uint ubo_load_3 = buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]; + uint ubo_load_3 = a[scalar_offset_3 / 4][scalar_offset_3 % 4]; return matrix(vector(float16_t(f16tof32(ubo_load & 0xFFFF)), float16_t(f16tof32(ubo_load >> 16))), vector(float16_t(f16tof32(ubo_load_1 & 0xFFFF)), float16_t(f16tof32(ubo_load_1 >> 16))), vector(float16_t(f16tof32(ubo_load_2 & 0xFFFF)), float16_t(f16tof32(ubo_load_2 >> 16))), vector(float16_t(f16tof32(ubo_load_3 & 0xFFFF)), float16_t(f16tof32(ubo_load_3 >> 16)))); } -Inner tint_symbol_7(uint4 buffer[64], uint offset) { - const Inner tint_symbol_11 = {tint_symbol_8(buffer, (offset + 0u))}; - return tint_symbol_11; +Inner a_load_3(uint offset) { + const Inner tint_symbol_4 = {a_load_4((offset + 0u))}; + return tint_symbol_4; } -typedef Inner tint_symbol_6_ret[4]; -tint_symbol_6_ret tint_symbol_6(uint4 buffer[64], uint offset) { +typedef Inner a_load_2_ret[4]; +a_load_2_ret a_load_2(uint offset) { Inner arr[4] = (Inner[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_7(buffer, (offset + (i_1 * 64u))); + arr[i_1] = a_load_3((offset + (i_1 * 64u))); } } return arr; } -Outer tint_symbol_5(uint4 buffer[64], uint offset) { - const Outer tint_symbol_12 = {tint_symbol_6(buffer, (offset + 0u))}; - return tint_symbol_12; +Outer a_load_1(uint offset) { + const Outer tint_symbol_5 = {a_load_2((offset + 0u))}; + return tint_symbol_5; } -typedef Outer tint_symbol_4_ret[4]; -tint_symbol_4_ret tint_symbol_4(uint4 buffer[64], uint offset) { +typedef Outer a_load_ret[4]; +a_load_ret a_load(uint offset) { Outer arr_1[4] = (Outer[4])0; { for(uint i_2 = 0u; (i_2 < 4u); i_2 = (i_2 + 1u)) { - arr_1[i_2] = tint_symbol_5(buffer, (offset + (i_2 * 256u))); + arr_1[i_2] = a_load_1((offset + (i_2 * 256u))); } } return arr_1; @@ -64,11 +64,11 @@ void f() { const int p_a_i_save = i(); const int p_a_i_a_i_save = i(); const int p_a_i_a_i_m_i_save = i(); - const Outer l_a[4] = tint_symbol_4(a, 0u); - const Outer l_a_i = tint_symbol_5(a, (256u * uint(p_a_i_save))); - const Inner l_a_i_a[4] = tint_symbol_6(a, (256u * uint(p_a_i_save))); - const Inner l_a_i_a_i = tint_symbol_7(a, ((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); - const matrix l_a_i_a_i_m = tint_symbol_8(a, ((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); + const Outer l_a[4] = a_load(0u); + const Outer l_a_i = a_load_1((256u * uint(p_a_i_save))); + const Inner l_a_i_a[4] = a_load_2((256u * uint(p_a_i_save))); + const Inner l_a_i_a_i = a_load_3(((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); + const matrix l_a_i_a_i_m = a_load_4(((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); const uint scalar_offset_4 = ((((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save))) + (4u * uint(p_a_i_a_i_m_i_save)))) / 4; uint ubo_load_4 = a[scalar_offset_4 / 4][scalar_offset_4 % 4]; const vector l_a_i_a_i_m_i = vector(float16_t(f16tof32(ubo_load_4 & 0xFFFF)), float16_t(f16tof32(ubo_load_4 >> 16))); diff --git a/test/tint/buffer/uniform/std140/struct/mat4x2_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat4x2_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl index 5da92cb51e..9e901ac2f3 100644 --- a/test/tint/buffer/uniform/std140/struct/mat4x2_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat4x2_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl @@ -9,45 +9,45 @@ cbuffer cbuffer_a : register(b0, space0) { uint4 a[64]; }; -matrix tint_symbol_4(uint4 buffer[64], uint offset) { +matrix a_load_4(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint ubo_load = buffer[scalar_offset / 4][scalar_offset % 4]; + uint ubo_load = a[scalar_offset / 4][scalar_offset % 4]; const uint scalar_offset_1 = ((offset + 4u)) / 4; - uint ubo_load_1 = buffer[scalar_offset_1 / 4][scalar_offset_1 % 4]; + uint ubo_load_1 = a[scalar_offset_1 / 4][scalar_offset_1 % 4]; const uint scalar_offset_2 = ((offset + 8u)) / 4; - uint ubo_load_2 = buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]; + uint ubo_load_2 = a[scalar_offset_2 / 4][scalar_offset_2 % 4]; const uint scalar_offset_3 = ((offset + 12u)) / 4; - uint ubo_load_3 = buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]; + uint ubo_load_3 = a[scalar_offset_3 / 4][scalar_offset_3 % 4]; return matrix(vector(float16_t(f16tof32(ubo_load & 0xFFFF)), float16_t(f16tof32(ubo_load >> 16))), vector(float16_t(f16tof32(ubo_load_1 & 0xFFFF)), float16_t(f16tof32(ubo_load_1 >> 16))), vector(float16_t(f16tof32(ubo_load_2 & 0xFFFF)), float16_t(f16tof32(ubo_load_2 >> 16))), vector(float16_t(f16tof32(ubo_load_3 & 0xFFFF)), float16_t(f16tof32(ubo_load_3 >> 16)))); } -Inner tint_symbol_3(uint4 buffer[64], uint offset) { - const Inner tint_symbol_7 = {tint_symbol_4(buffer, (offset + 0u))}; - return tint_symbol_7; +Inner a_load_3(uint offset) { + const Inner tint_symbol = {a_load_4((offset + 0u))}; + return tint_symbol; } -typedef Inner tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[64], uint offset) { +typedef Inner a_load_2_ret[4]; +a_load_2_ret a_load_2(uint offset) { Inner arr[4] = (Inner[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_3(buffer, (offset + (i * 64u))); + arr[i] = a_load_3((offset + (i * 64u))); } } return arr; } -Outer tint_symbol_1(uint4 buffer[64], uint offset) { - const Outer tint_symbol_8 = {tint_symbol_2(buffer, (offset + 0u))}; - return tint_symbol_8; +Outer a_load_1(uint offset) { + const Outer tint_symbol_1 = {a_load_2((offset + 0u))}; + return tint_symbol_1; } -typedef Outer tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[64], uint offset) { +typedef Outer a_load_ret[4]; +a_load_ret a_load(uint offset) { Outer arr_1[4] = (Outer[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr_1[i_1] = tint_symbol_1(buffer, (offset + (i_1 * 256u))); + arr_1[i_1] = a_load_1((offset + (i_1 * 256u))); } } return arr_1; @@ -55,11 +55,11 @@ tint_symbol_ret tint_symbol(uint4 buffer[64], uint offset) { [numthreads(1, 1, 1)] void f() { - const Outer l_a[4] = tint_symbol(a, 0u); - const Outer l_a_3 = tint_symbol_1(a, 768u); - const Inner l_a_3_a[4] = tint_symbol_2(a, 768u); - const Inner l_a_3_a_2 = tint_symbol_3(a, 896u); - const matrix l_a_3_a_2_m = tint_symbol_4(a, 896u); + const Outer l_a[4] = a_load(0u); + const Outer l_a_3 = a_load_1(768u); + const Inner l_a_3_a[4] = a_load_2(768u); + const Inner l_a_3_a_2 = a_load_3(896u); + const matrix l_a_3_a_2_m = a_load_4(896u); uint ubo_load_4 = a[56].y; const vector l_a_3_a_2_m_1 = vector(float16_t(f16tof32(ubo_load_4 & 0xFFFF)), float16_t(f16tof32(ubo_load_4 >> 16))); const float16_t l_a_3_a_2_m_1_0 = float16_t(f16tof32(((a[56].y) & 0xFFFF))); diff --git a/test/tint/buffer/uniform/std140/struct/mat4x2_f16/to_builtin.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat4x2_f16/to_builtin.wgsl.expected.dxc.hlsl index 81cfbc46f1..a713b66885 100644 --- a/test/tint/buffer/uniform/std140/struct/mat4x2_f16/to_builtin.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat4x2_f16/to_builtin.wgsl.expected.dxc.hlsl @@ -2,21 +2,21 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[32]; }; -matrix tint_symbol(uint4 buffer[32], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint ubo_load = buffer[scalar_offset / 4][scalar_offset % 4]; + uint ubo_load = u[scalar_offset / 4][scalar_offset % 4]; const uint scalar_offset_1 = ((offset + 4u)) / 4; - uint ubo_load_1 = buffer[scalar_offset_1 / 4][scalar_offset_1 % 4]; + uint ubo_load_1 = u[scalar_offset_1 / 4][scalar_offset_1 % 4]; const uint scalar_offset_2 = ((offset + 8u)) / 4; - uint ubo_load_2 = buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]; + uint ubo_load_2 = u[scalar_offset_2 / 4][scalar_offset_2 % 4]; const uint scalar_offset_3 = ((offset + 12u)) / 4; - uint ubo_load_3 = buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]; + uint ubo_load_3 = u[scalar_offset_3 / 4][scalar_offset_3 % 4]; return matrix(vector(float16_t(f16tof32(ubo_load & 0xFFFF)), float16_t(f16tof32(ubo_load >> 16))), vector(float16_t(f16tof32(ubo_load_1 & 0xFFFF)), float16_t(f16tof32(ubo_load_1 >> 16))), vector(float16_t(f16tof32(ubo_load_2 & 0xFFFF)), float16_t(f16tof32(ubo_load_2 >> 16))), vector(float16_t(f16tof32(ubo_load_3 & 0xFFFF)), float16_t(f16tof32(ubo_load_3 >> 16)))); } [numthreads(1, 1, 1)] void f() { - const matrix t = transpose(tint_symbol(u, 260u)); + const matrix t = transpose(u_load(260u)); uint ubo_load_4 = u[0].z; const float16_t l = length(vector(float16_t(f16tof32(ubo_load_4 & 0xFFFF)), float16_t(f16tof32(ubo_load_4 >> 16))).yx); uint ubo_load_5 = u[0].z; diff --git a/test/tint/buffer/uniform/std140/struct/mat4x2_f16/to_fn.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat4x2_f16/to_fn.wgsl.expected.dxc.hlsl index 7620fd986c..bee10d2f53 100644 --- a/test/tint/buffer/uniform/std140/struct/mat4x2_f16/to_fn.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat4x2_f16/to_fn.wgsl.expected.dxc.hlsl @@ -23,31 +23,31 @@ void d(vector v) { void e(float16_t f_1) { } -matrix tint_symbol_3(uint4 buffer[32], uint offset) { +matrix u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint ubo_load = buffer[scalar_offset / 4][scalar_offset % 4]; + uint ubo_load = u[scalar_offset / 4][scalar_offset % 4]; const uint scalar_offset_1 = ((offset + 4u)) / 4; - uint ubo_load_1 = buffer[scalar_offset_1 / 4][scalar_offset_1 % 4]; + uint ubo_load_1 = u[scalar_offset_1 / 4][scalar_offset_1 % 4]; const uint scalar_offset_2 = ((offset + 8u)) / 4; - uint ubo_load_2 = buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]; + uint ubo_load_2 = u[scalar_offset_2 / 4][scalar_offset_2 % 4]; const uint scalar_offset_3 = ((offset + 12u)) / 4; - uint ubo_load_3 = buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]; + uint ubo_load_3 = u[scalar_offset_3 / 4][scalar_offset_3 % 4]; return matrix(vector(float16_t(f16tof32(ubo_load & 0xFFFF)), float16_t(f16tof32(ubo_load >> 16))), vector(float16_t(f16tof32(ubo_load_1 & 0xFFFF)), float16_t(f16tof32(ubo_load_1 >> 16))), vector(float16_t(f16tof32(ubo_load_2 & 0xFFFF)), float16_t(f16tof32(ubo_load_2 >> 16))), vector(float16_t(f16tof32(ubo_load_3 & 0xFFFF)), float16_t(f16tof32(ubo_load_3 >> 16)))); } -S tint_symbol_1(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_4 = ((offset + 0u)) / 4; const uint scalar_offset_5 = ((offset + 64u)) / 4; - const S tint_symbol_5 = {asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), tint_symbol_3(buffer, (offset + 4u)), asint(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4])}; - return tint_symbol_5; + const S tint_symbol = {asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4]), u_load_3((offset + 4u)), asint(u[scalar_offset_5 / 4][scalar_offset_5 % 4])}; + return tint_symbol; } -typedef S tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 128u))); + arr[i] = u_load_1((offset + (i * 128u))); } } return arr; @@ -55,9 +55,9 @@ tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); - b(tint_symbol_1(u, 256u)); - c(tint_symbol_3(u, 260u)); + a(u_load(0u)); + b(u_load_1(256u)); + c(u_load_3(260u)); uint ubo_load_4 = u[0].z; d(vector(float16_t(f16tof32(ubo_load_4 & 0xFFFF)), float16_t(f16tof32(ubo_load_4 >> 16))).yx); uint ubo_load_5 = u[0].z; diff --git a/test/tint/buffer/uniform/std140/struct/mat4x2_f16/to_private.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat4x2_f16/to_private.wgsl.expected.dxc.hlsl index 717e390d34..b10d3d058b 100644 --- a/test/tint/buffer/uniform/std140/struct/mat4x2_f16/to_private.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat4x2_f16/to_private.wgsl.expected.dxc.hlsl @@ -9,31 +9,31 @@ cbuffer cbuffer_u : register(b0, space0) { }; static S p[4] = (S[4])0; -matrix tint_symbol_3(uint4 buffer[32], uint offset) { +matrix u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint ubo_load = buffer[scalar_offset / 4][scalar_offset % 4]; + uint ubo_load = u[scalar_offset / 4][scalar_offset % 4]; const uint scalar_offset_1 = ((offset + 4u)) / 4; - uint ubo_load_1 = buffer[scalar_offset_1 / 4][scalar_offset_1 % 4]; + uint ubo_load_1 = u[scalar_offset_1 / 4][scalar_offset_1 % 4]; const uint scalar_offset_2 = ((offset + 8u)) / 4; - uint ubo_load_2 = buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]; + uint ubo_load_2 = u[scalar_offset_2 / 4][scalar_offset_2 % 4]; const uint scalar_offset_3 = ((offset + 12u)) / 4; - uint ubo_load_3 = buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]; + uint ubo_load_3 = u[scalar_offset_3 / 4][scalar_offset_3 % 4]; return matrix(vector(float16_t(f16tof32(ubo_load & 0xFFFF)), float16_t(f16tof32(ubo_load >> 16))), vector(float16_t(f16tof32(ubo_load_1 & 0xFFFF)), float16_t(f16tof32(ubo_load_1 >> 16))), vector(float16_t(f16tof32(ubo_load_2 & 0xFFFF)), float16_t(f16tof32(ubo_load_2 >> 16))), vector(float16_t(f16tof32(ubo_load_3 & 0xFFFF)), float16_t(f16tof32(ubo_load_3 >> 16)))); } -S tint_symbol_1(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_4 = ((offset + 0u)) / 4; const uint scalar_offset_5 = ((offset + 64u)) / 4; - const S tint_symbol_5 = {asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), tint_symbol_3(buffer, (offset + 4u)), asint(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4])}; - return tint_symbol_5; + const S tint_symbol = {asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4]), u_load_3((offset + 4u)), asint(u[scalar_offset_5 / 4][scalar_offset_5 % 4])}; + return tint_symbol; } -typedef S tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 128u))); + arr[i] = u_load_1((offset + (i * 128u))); } } return arr; @@ -41,9 +41,9 @@ tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); - p[1] = tint_symbol_1(u, 256u); - p[3].m = tint_symbol_3(u, 260u); + p = u_load(0u); + p[1] = u_load_1(256u); + p[3].m = u_load_3(260u); uint ubo_load_4 = u[0].z; p[1].m[0] = vector(float16_t(f16tof32(ubo_load_4 & 0xFFFF)), float16_t(f16tof32(ubo_load_4 >> 16))).yx; return; diff --git a/test/tint/buffer/uniform/std140/struct/mat4x2_f16/to_storage.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat4x2_f16/to_storage.wgsl.expected.dxc.hlsl index 651a533813..aa6f5995ad 100644 --- a/test/tint/buffer/uniform/std140/struct/mat4x2_f16/to_storage.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat4x2_f16/to_storage.wgsl.expected.dxc.hlsl @@ -9,53 +9,53 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol_3(RWByteAddressBuffer buffer, uint offset, matrix value) { - buffer.Store >((offset + 0u), value[0u]); - buffer.Store >((offset + 4u), value[1u]); - buffer.Store >((offset + 8u), value[2u]); - buffer.Store >((offset + 12u), value[3u]); +void s_store_3(uint offset, matrix value) { + s.Store >((offset + 0u), value[0u]); + s.Store >((offset + 4u), value[1u]); + s.Store >((offset + 8u), value[2u]); + s.Store >((offset + 12u), value[3u]); } -void tint_symbol_1(RWByteAddressBuffer buffer, uint offset, S value) { - buffer.Store((offset + 0u), asuint(value.before)); - tint_symbol_3(buffer, (offset + 4u), value.m); - buffer.Store((offset + 64u), asuint(value.after)); +void s_store_1(uint offset, S value) { + s.Store((offset + 0u), asuint(value.before)); + s_store_3((offset + 4u), value.m); + s.Store((offset + 64u), asuint(value.after)); } -void tint_symbol(RWByteAddressBuffer buffer, uint offset, S value[4]) { +void s_store(uint offset, S value[4]) { S array_1[4] = value; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - tint_symbol_1(buffer, (offset + (i * 128u)), array_1[i]); + s_store_1((offset + (i * 128u)), array_1[i]); } } } -matrix tint_symbol_8(uint4 buffer[32], uint offset) { +matrix u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint ubo_load = buffer[scalar_offset / 4][scalar_offset % 4]; + uint ubo_load = u[scalar_offset / 4][scalar_offset % 4]; const uint scalar_offset_1 = ((offset + 4u)) / 4; - uint ubo_load_1 = buffer[scalar_offset_1 / 4][scalar_offset_1 % 4]; + uint ubo_load_1 = u[scalar_offset_1 / 4][scalar_offset_1 % 4]; const uint scalar_offset_2 = ((offset + 8u)) / 4; - uint ubo_load_2 = buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]; + uint ubo_load_2 = u[scalar_offset_2 / 4][scalar_offset_2 % 4]; const uint scalar_offset_3 = ((offset + 12u)) / 4; - uint ubo_load_3 = buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]; + uint ubo_load_3 = u[scalar_offset_3 / 4][scalar_offset_3 % 4]; return matrix(vector(float16_t(f16tof32(ubo_load & 0xFFFF)), float16_t(f16tof32(ubo_load >> 16))), vector(float16_t(f16tof32(ubo_load_1 & 0xFFFF)), float16_t(f16tof32(ubo_load_1 >> 16))), vector(float16_t(f16tof32(ubo_load_2 & 0xFFFF)), float16_t(f16tof32(ubo_load_2 >> 16))), vector(float16_t(f16tof32(ubo_load_3 & 0xFFFF)), float16_t(f16tof32(ubo_load_3 >> 16)))); } -S tint_symbol_6(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_4 = ((offset + 0u)) / 4; const uint scalar_offset_5 = ((offset + 64u)) / 4; - const S tint_symbol_10 = {asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), tint_symbol_8(buffer, (offset + 4u)), asint(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4])}; - return tint_symbol_10; + const S tint_symbol = {asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4]), u_load_3((offset + 4u)), asint(u[scalar_offset_5 / 4][scalar_offset_5 % 4])}; + return tint_symbol; } -typedef S tint_symbol_5_ret[4]; -tint_symbol_5_ret tint_symbol_5(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_6(buffer, (offset + (i_1 * 128u))); + arr[i_1] = u_load_1((offset + (i_1 * 128u))); } } return arr; @@ -63,9 +63,9 @@ tint_symbol_5_ret tint_symbol_5(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_5(u, 0u)); - tint_symbol_1(s, 128u, tint_symbol_6(u, 256u)); - tint_symbol_3(s, 388u, tint_symbol_8(u, 260u)); + s_store(0u, u_load(0u)); + s_store_1(128u, u_load_1(256u)); + s_store_3(388u, u_load_3(260u)); uint ubo_load_4 = u[0].z; s.Store >(132u, vector(float16_t(f16tof32(ubo_load_4 & 0xFFFF)), float16_t(f16tof32(ubo_load_4 >> 16))).yx); return; diff --git a/test/tint/buffer/uniform/std140/struct/mat4x2_f16/to_workgroup.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat4x2_f16/to_workgroup.wgsl.expected.dxc.hlsl index 334fe1eb1e..711625c7c3 100644 --- a/test/tint/buffer/uniform/std140/struct/mat4x2_f16/to_workgroup.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat4x2_f16/to_workgroup.wgsl.expected.dxc.hlsl @@ -13,31 +13,31 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -matrix tint_symbol_5(uint4 buffer[32], uint offset) { +matrix u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint ubo_load = buffer[scalar_offset / 4][scalar_offset % 4]; + uint ubo_load = u[scalar_offset / 4][scalar_offset % 4]; const uint scalar_offset_1 = ((offset + 4u)) / 4; - uint ubo_load_1 = buffer[scalar_offset_1 / 4][scalar_offset_1 % 4]; + uint ubo_load_1 = u[scalar_offset_1 / 4][scalar_offset_1 % 4]; const uint scalar_offset_2 = ((offset + 8u)) / 4; - uint ubo_load_2 = buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]; + uint ubo_load_2 = u[scalar_offset_2 / 4][scalar_offset_2 % 4]; const uint scalar_offset_3 = ((offset + 12u)) / 4; - uint ubo_load_3 = buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]; + uint ubo_load_3 = u[scalar_offset_3 / 4][scalar_offset_3 % 4]; return matrix(vector(float16_t(f16tof32(ubo_load & 0xFFFF)), float16_t(f16tof32(ubo_load >> 16))), vector(float16_t(f16tof32(ubo_load_1 & 0xFFFF)), float16_t(f16tof32(ubo_load_1 >> 16))), vector(float16_t(f16tof32(ubo_load_2 & 0xFFFF)), float16_t(f16tof32(ubo_load_2 >> 16))), vector(float16_t(f16tof32(ubo_load_3 & 0xFFFF)), float16_t(f16tof32(ubo_load_3 >> 16)))); } -S tint_symbol_3(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_4 = ((offset + 0u)) / 4; const uint scalar_offset_5 = ((offset + 64u)) / 4; - const S tint_symbol_8 = {asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), tint_symbol_5(buffer, (offset + 4u)), asint(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4])}; - return tint_symbol_8; + const S tint_symbol_3 = {asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4]), u_load_3((offset + 4u)), asint(u[scalar_offset_5 / 4][scalar_offset_5 % 4])}; + return tint_symbol_3; } -typedef S tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_3(buffer, (offset + (i_1 * 128u))); + arr[i_1] = u_load_1((offset + (i_1 * 128u))); } } return arr; @@ -47,14 +47,14 @@ void f_inner(uint local_invocation_index) { { for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) { const uint i = idx; - const S tint_symbol_7 = (S)0; - w[i] = tint_symbol_7; + const S tint_symbol_2 = (S)0; + w[i] = tint_symbol_2; } } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); - w[1] = tint_symbol_3(u, 256u); - w[3].m = tint_symbol_5(u, 260u); + w = u_load(0u); + w[1] = u_load_1(256u); + w[3].m = u_load_3(260u); uint ubo_load_4 = u[0].z; w[1].m[0] = vector(float16_t(f16tof32(ubo_load_4 & 0xFFFF)), float16_t(f16tof32(ubo_load_4 >> 16))).yx; } diff --git a/test/tint/buffer/uniform/std140/struct/mat4x2_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat4x2_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl index 055476920d..485a529e9c 100644 --- a/test/tint/buffer/uniform/std140/struct/mat4x2_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat4x2_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl @@ -15,45 +15,45 @@ int i() { return counter; } -float4x2 tint_symbol_8(uint4 buffer[64], uint offset) { +float4x2 a_load_4(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = a[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = a[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = a[scalar_offset_2 / 4]; const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_3 = a[scalar_offset_3 / 4]; return float4x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy)), asfloat(((scalar_offset_3 & 2) ? ubo_load_3.zw : ubo_load_3.xy))); } -Inner tint_symbol_7(uint4 buffer[64], uint offset) { - const Inner tint_symbol_11 = {tint_symbol_8(buffer, (offset + 0u))}; - return tint_symbol_11; +Inner a_load_3(uint offset) { + const Inner tint_symbol_4 = {a_load_4((offset + 0u))}; + return tint_symbol_4; } -typedef Inner tint_symbol_6_ret[4]; -tint_symbol_6_ret tint_symbol_6(uint4 buffer[64], uint offset) { +typedef Inner a_load_2_ret[4]; +a_load_2_ret a_load_2(uint offset) { Inner arr[4] = (Inner[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_7(buffer, (offset + (i_1 * 64u))); + arr[i_1] = a_load_3((offset + (i_1 * 64u))); } } return arr; } -Outer tint_symbol_5(uint4 buffer[64], uint offset) { - const Outer tint_symbol_12 = {tint_symbol_6(buffer, (offset + 0u))}; - return tint_symbol_12; +Outer a_load_1(uint offset) { + const Outer tint_symbol_5 = {a_load_2((offset + 0u))}; + return tint_symbol_5; } -typedef Outer tint_symbol_4_ret[4]; -tint_symbol_4_ret tint_symbol_4(uint4 buffer[64], uint offset) { +typedef Outer a_load_ret[4]; +a_load_ret a_load(uint offset) { Outer arr_1[4] = (Outer[4])0; { for(uint i_2 = 0u; (i_2 < 4u); i_2 = (i_2 + 1u)) { - arr_1[i_2] = tint_symbol_5(buffer, (offset + (i_2 * 256u))); + arr_1[i_2] = a_load_1((offset + (i_2 * 256u))); } } return arr_1; @@ -64,11 +64,11 @@ void f() { const int p_a_i_save = i(); const int p_a_i_a_i_save = i(); const int p_a_i_a_i_m_i_save = i(); - const Outer l_a[4] = tint_symbol_4(a, 0u); - const Outer l_a_i = tint_symbol_5(a, (256u * uint(p_a_i_save))); - const Inner l_a_i_a[4] = tint_symbol_6(a, (256u * uint(p_a_i_save))); - const Inner l_a_i_a_i = tint_symbol_7(a, ((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); - const float4x2 l_a_i_a_i_m = tint_symbol_8(a, ((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); + const Outer l_a[4] = a_load(0u); + const Outer l_a_i = a_load_1((256u * uint(p_a_i_save))); + const Inner l_a_i_a[4] = a_load_2((256u * uint(p_a_i_save))); + const Inner l_a_i_a_i = a_load_3(((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); + const float4x2 l_a_i_a_i_m = a_load_4(((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); const uint scalar_offset_4 = ((((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save))) + (8u * uint(p_a_i_a_i_m_i_save)))) / 4; uint4 ubo_load_4 = a[scalar_offset_4 / 4]; const float2 l_a_i_a_i_m_i = asfloat(((scalar_offset_4 & 2) ? ubo_load_4.zw : ubo_load_4.xy)); diff --git a/test/tint/buffer/uniform/std140/struct/mat4x2_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat4x2_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl index 055476920d..485a529e9c 100644 --- a/test/tint/buffer/uniform/std140/struct/mat4x2_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat4x2_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl @@ -15,45 +15,45 @@ int i() { return counter; } -float4x2 tint_symbol_8(uint4 buffer[64], uint offset) { +float4x2 a_load_4(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = a[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = a[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = a[scalar_offset_2 / 4]; const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_3 = a[scalar_offset_3 / 4]; return float4x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy)), asfloat(((scalar_offset_3 & 2) ? ubo_load_3.zw : ubo_load_3.xy))); } -Inner tint_symbol_7(uint4 buffer[64], uint offset) { - const Inner tint_symbol_11 = {tint_symbol_8(buffer, (offset + 0u))}; - return tint_symbol_11; +Inner a_load_3(uint offset) { + const Inner tint_symbol_4 = {a_load_4((offset + 0u))}; + return tint_symbol_4; } -typedef Inner tint_symbol_6_ret[4]; -tint_symbol_6_ret tint_symbol_6(uint4 buffer[64], uint offset) { +typedef Inner a_load_2_ret[4]; +a_load_2_ret a_load_2(uint offset) { Inner arr[4] = (Inner[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_7(buffer, (offset + (i_1 * 64u))); + arr[i_1] = a_load_3((offset + (i_1 * 64u))); } } return arr; } -Outer tint_symbol_5(uint4 buffer[64], uint offset) { - const Outer tint_symbol_12 = {tint_symbol_6(buffer, (offset + 0u))}; - return tint_symbol_12; +Outer a_load_1(uint offset) { + const Outer tint_symbol_5 = {a_load_2((offset + 0u))}; + return tint_symbol_5; } -typedef Outer tint_symbol_4_ret[4]; -tint_symbol_4_ret tint_symbol_4(uint4 buffer[64], uint offset) { +typedef Outer a_load_ret[4]; +a_load_ret a_load(uint offset) { Outer arr_1[4] = (Outer[4])0; { for(uint i_2 = 0u; (i_2 < 4u); i_2 = (i_2 + 1u)) { - arr_1[i_2] = tint_symbol_5(buffer, (offset + (i_2 * 256u))); + arr_1[i_2] = a_load_1((offset + (i_2 * 256u))); } } return arr_1; @@ -64,11 +64,11 @@ void f() { const int p_a_i_save = i(); const int p_a_i_a_i_save = i(); const int p_a_i_a_i_m_i_save = i(); - const Outer l_a[4] = tint_symbol_4(a, 0u); - const Outer l_a_i = tint_symbol_5(a, (256u * uint(p_a_i_save))); - const Inner l_a_i_a[4] = tint_symbol_6(a, (256u * uint(p_a_i_save))); - const Inner l_a_i_a_i = tint_symbol_7(a, ((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); - const float4x2 l_a_i_a_i_m = tint_symbol_8(a, ((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); + const Outer l_a[4] = a_load(0u); + const Outer l_a_i = a_load_1((256u * uint(p_a_i_save))); + const Inner l_a_i_a[4] = a_load_2((256u * uint(p_a_i_save))); + const Inner l_a_i_a_i = a_load_3(((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); + const float4x2 l_a_i_a_i_m = a_load_4(((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); const uint scalar_offset_4 = ((((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save))) + (8u * uint(p_a_i_a_i_m_i_save)))) / 4; uint4 ubo_load_4 = a[scalar_offset_4 / 4]; const float2 l_a_i_a_i_m_i = asfloat(((scalar_offset_4 & 2) ? ubo_load_4.zw : ubo_load_4.xy)); diff --git a/test/tint/buffer/uniform/std140/struct/mat4x2_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat4x2_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl index ec07ff80bb..bb1caafa52 100644 --- a/test/tint/buffer/uniform/std140/struct/mat4x2_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat4x2_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl @@ -9,45 +9,45 @@ cbuffer cbuffer_a : register(b0, space0) { uint4 a[64]; }; -float4x2 tint_symbol_4(uint4 buffer[64], uint offset) { +float4x2 a_load_4(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = a[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = a[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = a[scalar_offset_2 / 4]; const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_3 = a[scalar_offset_3 / 4]; return float4x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy)), asfloat(((scalar_offset_3 & 2) ? ubo_load_3.zw : ubo_load_3.xy))); } -Inner tint_symbol_3(uint4 buffer[64], uint offset) { - const Inner tint_symbol_7 = {tint_symbol_4(buffer, (offset + 0u))}; - return tint_symbol_7; +Inner a_load_3(uint offset) { + const Inner tint_symbol = {a_load_4((offset + 0u))}; + return tint_symbol; } -typedef Inner tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[64], uint offset) { +typedef Inner a_load_2_ret[4]; +a_load_2_ret a_load_2(uint offset) { Inner arr[4] = (Inner[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_3(buffer, (offset + (i * 64u))); + arr[i] = a_load_3((offset + (i * 64u))); } } return arr; } -Outer tint_symbol_1(uint4 buffer[64], uint offset) { - const Outer tint_symbol_8 = {tint_symbol_2(buffer, (offset + 0u))}; - return tint_symbol_8; +Outer a_load_1(uint offset) { + const Outer tint_symbol_1 = {a_load_2((offset + 0u))}; + return tint_symbol_1; } -typedef Outer tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[64], uint offset) { +typedef Outer a_load_ret[4]; +a_load_ret a_load(uint offset) { Outer arr_1[4] = (Outer[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr_1[i_1] = tint_symbol_1(buffer, (offset + (i_1 * 256u))); + arr_1[i_1] = a_load_1((offset + (i_1 * 256u))); } } return arr_1; @@ -55,11 +55,11 @@ tint_symbol_ret tint_symbol(uint4 buffer[64], uint offset) { [numthreads(1, 1, 1)] void f() { - const Outer l_a[4] = tint_symbol(a, 0u); - const Outer l_a_3 = tint_symbol_1(a, 768u); - const Inner l_a_3_a[4] = tint_symbol_2(a, 768u); - const Inner l_a_3_a_2 = tint_symbol_3(a, 896u); - const float4x2 l_a_3_a_2_m = tint_symbol_4(a, 896u); + const Outer l_a[4] = a_load(0u); + const Outer l_a_3 = a_load_1(768u); + const Inner l_a_3_a[4] = a_load_2(768u); + const Inner l_a_3_a_2 = a_load_3(896u); + const float4x2 l_a_3_a_2_m = a_load_4(896u); const float2 l_a_3_a_2_m_1 = asfloat(a[56].zw); const float l_a_3_a_2_m_1_0 = asfloat(a[56].z); return; diff --git a/test/tint/buffer/uniform/std140/struct/mat4x2_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat4x2_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl index ec07ff80bb..bb1caafa52 100644 --- a/test/tint/buffer/uniform/std140/struct/mat4x2_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat4x2_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl @@ -9,45 +9,45 @@ cbuffer cbuffer_a : register(b0, space0) { uint4 a[64]; }; -float4x2 tint_symbol_4(uint4 buffer[64], uint offset) { +float4x2 a_load_4(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = a[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = a[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = a[scalar_offset_2 / 4]; const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_3 = a[scalar_offset_3 / 4]; return float4x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy)), asfloat(((scalar_offset_3 & 2) ? ubo_load_3.zw : ubo_load_3.xy))); } -Inner tint_symbol_3(uint4 buffer[64], uint offset) { - const Inner tint_symbol_7 = {tint_symbol_4(buffer, (offset + 0u))}; - return tint_symbol_7; +Inner a_load_3(uint offset) { + const Inner tint_symbol = {a_load_4((offset + 0u))}; + return tint_symbol; } -typedef Inner tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[64], uint offset) { +typedef Inner a_load_2_ret[4]; +a_load_2_ret a_load_2(uint offset) { Inner arr[4] = (Inner[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_3(buffer, (offset + (i * 64u))); + arr[i] = a_load_3((offset + (i * 64u))); } } return arr; } -Outer tint_symbol_1(uint4 buffer[64], uint offset) { - const Outer tint_symbol_8 = {tint_symbol_2(buffer, (offset + 0u))}; - return tint_symbol_8; +Outer a_load_1(uint offset) { + const Outer tint_symbol_1 = {a_load_2((offset + 0u))}; + return tint_symbol_1; } -typedef Outer tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[64], uint offset) { +typedef Outer a_load_ret[4]; +a_load_ret a_load(uint offset) { Outer arr_1[4] = (Outer[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr_1[i_1] = tint_symbol_1(buffer, (offset + (i_1 * 256u))); + arr_1[i_1] = a_load_1((offset + (i_1 * 256u))); } } return arr_1; @@ -55,11 +55,11 @@ tint_symbol_ret tint_symbol(uint4 buffer[64], uint offset) { [numthreads(1, 1, 1)] void f() { - const Outer l_a[4] = tint_symbol(a, 0u); - const Outer l_a_3 = tint_symbol_1(a, 768u); - const Inner l_a_3_a[4] = tint_symbol_2(a, 768u); - const Inner l_a_3_a_2 = tint_symbol_3(a, 896u); - const float4x2 l_a_3_a_2_m = tint_symbol_4(a, 896u); + const Outer l_a[4] = a_load(0u); + const Outer l_a_3 = a_load_1(768u); + const Inner l_a_3_a[4] = a_load_2(768u); + const Inner l_a_3_a_2 = a_load_3(896u); + const float4x2 l_a_3_a_2_m = a_load_4(896u); const float2 l_a_3_a_2_m_1 = asfloat(a[56].zw); const float l_a_3_a_2_m_1_0 = asfloat(a[56].z); return; diff --git a/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_builtin.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_builtin.wgsl.expected.dxc.hlsl index 2d53757539..3b899df3c2 100644 --- a/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_builtin.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_builtin.wgsl.expected.dxc.hlsl @@ -2,21 +2,21 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[32]; }; -float4x2 tint_symbol(uint4 buffer[32], uint offset) { +float4x2 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = u[scalar_offset_2 / 4]; const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_3 = u[scalar_offset_3 / 4]; return float4x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy)), asfloat(((scalar_offset_3 & 2) ? ubo_load_3.zw : ubo_load_3.xy))); } [numthreads(1, 1, 1)] void f() { - const float2x4 t = transpose(tint_symbol(u, 264u)); + const float2x4 t = transpose(u_load(264u)); const float l = length(asfloat(u[1].xy).yx); const float a = abs(asfloat(u[1].xy).yx.x); return; diff --git a/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_builtin.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_builtin.wgsl.expected.fxc.hlsl index 2d53757539..3b899df3c2 100644 --- a/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_builtin.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_builtin.wgsl.expected.fxc.hlsl @@ -2,21 +2,21 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[32]; }; -float4x2 tint_symbol(uint4 buffer[32], uint offset) { +float4x2 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = u[scalar_offset_2 / 4]; const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_3 = u[scalar_offset_3 / 4]; return float4x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy)), asfloat(((scalar_offset_3 & 2) ? ubo_load_3.zw : ubo_load_3.xy))); } [numthreads(1, 1, 1)] void f() { - const float2x4 t = transpose(tint_symbol(u, 264u)); + const float2x4 t = transpose(u_load(264u)); const float l = length(asfloat(u[1].xy).yx); const float a = abs(asfloat(u[1].xy).yx.x); return; diff --git a/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_fn.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_fn.wgsl.expected.dxc.hlsl index 393469d291..75b5e33c0a 100644 --- a/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_fn.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_fn.wgsl.expected.dxc.hlsl @@ -23,31 +23,31 @@ void d(float2 v) { void e(float f_1) { } -float4x2 tint_symbol_3(uint4 buffer[32], uint offset) { +float4x2 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = u[scalar_offset_2 / 4]; const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_3 = u[scalar_offset_3 / 4]; return float4x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy)), asfloat(((scalar_offset_3 & 2) ? ubo_load_3.zw : ubo_load_3.xy))); } -S tint_symbol_1(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_4 = ((offset + 0u)) / 4; const uint scalar_offset_5 = ((offset + 64u)) / 4; - const S tint_symbol_5 = {asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), tint_symbol_3(buffer, (offset + 8u)), asint(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4])}; - return tint_symbol_5; + const S tint_symbol = {asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4]), u_load_3((offset + 8u)), asint(u[scalar_offset_5 / 4][scalar_offset_5 % 4])}; + return tint_symbol; } -typedef S tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 128u))); + arr[i] = u_load_1((offset + (i * 128u))); } } return arr; @@ -55,9 +55,9 @@ tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); - b(tint_symbol_1(u, 256u)); - c(tint_symbol_3(u, 264u)); + a(u_load(0u)); + b(u_load_1(256u)); + c(u_load_3(264u)); d(asfloat(u[1].xy).yx); e(asfloat(u[1].xy).yx.x); return; diff --git a/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_fn.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_fn.wgsl.expected.fxc.hlsl index 393469d291..75b5e33c0a 100644 --- a/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_fn.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_fn.wgsl.expected.fxc.hlsl @@ -23,31 +23,31 @@ void d(float2 v) { void e(float f_1) { } -float4x2 tint_symbol_3(uint4 buffer[32], uint offset) { +float4x2 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = u[scalar_offset_2 / 4]; const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_3 = u[scalar_offset_3 / 4]; return float4x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy)), asfloat(((scalar_offset_3 & 2) ? ubo_load_3.zw : ubo_load_3.xy))); } -S tint_symbol_1(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_4 = ((offset + 0u)) / 4; const uint scalar_offset_5 = ((offset + 64u)) / 4; - const S tint_symbol_5 = {asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), tint_symbol_3(buffer, (offset + 8u)), asint(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4])}; - return tint_symbol_5; + const S tint_symbol = {asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4]), u_load_3((offset + 8u)), asint(u[scalar_offset_5 / 4][scalar_offset_5 % 4])}; + return tint_symbol; } -typedef S tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 128u))); + arr[i] = u_load_1((offset + (i * 128u))); } } return arr; @@ -55,9 +55,9 @@ tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); - b(tint_symbol_1(u, 256u)); - c(tint_symbol_3(u, 264u)); + a(u_load(0u)); + b(u_load_1(256u)); + c(u_load_3(264u)); d(asfloat(u[1].xy).yx); e(asfloat(u[1].xy).yx.x); return; diff --git a/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_private.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_private.wgsl.expected.dxc.hlsl index 60c112b686..e52cbbdcf8 100644 --- a/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_private.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_private.wgsl.expected.dxc.hlsl @@ -9,31 +9,31 @@ cbuffer cbuffer_u : register(b0, space0) { }; static S p[4] = (S[4])0; -float4x2 tint_symbol_3(uint4 buffer[32], uint offset) { +float4x2 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = u[scalar_offset_2 / 4]; const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_3 = u[scalar_offset_3 / 4]; return float4x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy)), asfloat(((scalar_offset_3 & 2) ? ubo_load_3.zw : ubo_load_3.xy))); } -S tint_symbol_1(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_4 = ((offset + 0u)) / 4; const uint scalar_offset_5 = ((offset + 64u)) / 4; - const S tint_symbol_5 = {asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), tint_symbol_3(buffer, (offset + 8u)), asint(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4])}; - return tint_symbol_5; + const S tint_symbol = {asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4]), u_load_3((offset + 8u)), asint(u[scalar_offset_5 / 4][scalar_offset_5 % 4])}; + return tint_symbol; } -typedef S tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 128u))); + arr[i] = u_load_1((offset + (i * 128u))); } } return arr; @@ -41,9 +41,9 @@ tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); - p[1] = tint_symbol_1(u, 256u); - p[3].m = tint_symbol_3(u, 264u); + p = u_load(0u); + p[1] = u_load_1(256u); + p[3].m = u_load_3(264u); p[1].m[0] = asfloat(u[1].xy).yx; return; } diff --git a/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_private.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_private.wgsl.expected.fxc.hlsl index 60c112b686..e52cbbdcf8 100644 --- a/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_private.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_private.wgsl.expected.fxc.hlsl @@ -9,31 +9,31 @@ cbuffer cbuffer_u : register(b0, space0) { }; static S p[4] = (S[4])0; -float4x2 tint_symbol_3(uint4 buffer[32], uint offset) { +float4x2 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = u[scalar_offset_2 / 4]; const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_3 = u[scalar_offset_3 / 4]; return float4x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy)), asfloat(((scalar_offset_3 & 2) ? ubo_load_3.zw : ubo_load_3.xy))); } -S tint_symbol_1(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_4 = ((offset + 0u)) / 4; const uint scalar_offset_5 = ((offset + 64u)) / 4; - const S tint_symbol_5 = {asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), tint_symbol_3(buffer, (offset + 8u)), asint(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4])}; - return tint_symbol_5; + const S tint_symbol = {asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4]), u_load_3((offset + 8u)), asint(u[scalar_offset_5 / 4][scalar_offset_5 % 4])}; + return tint_symbol; } -typedef S tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 128u))); + arr[i] = u_load_1((offset + (i * 128u))); } } return arr; @@ -41,9 +41,9 @@ tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); - p[1] = tint_symbol_1(u, 256u); - p[3].m = tint_symbol_3(u, 264u); + p = u_load(0u); + p[1] = u_load_1(256u); + p[3].m = u_load_3(264u); p[1].m[0] = asfloat(u[1].xy).yx; return; } diff --git a/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_storage.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_storage.wgsl.expected.dxc.hlsl index bfc91abd51..81fa7039da 100644 --- a/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_storage.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_storage.wgsl.expected.dxc.hlsl @@ -9,53 +9,53 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol_3(RWByteAddressBuffer buffer, uint offset, float4x2 value) { - buffer.Store2((offset + 0u), asuint(value[0u])); - buffer.Store2((offset + 8u), asuint(value[1u])); - buffer.Store2((offset + 16u), asuint(value[2u])); - buffer.Store2((offset + 24u), asuint(value[3u])); +void s_store_3(uint offset, float4x2 value) { + s.Store2((offset + 0u), asuint(value[0u])); + s.Store2((offset + 8u), asuint(value[1u])); + s.Store2((offset + 16u), asuint(value[2u])); + s.Store2((offset + 24u), asuint(value[3u])); } -void tint_symbol_1(RWByteAddressBuffer buffer, uint offset, S value) { - buffer.Store((offset + 0u), asuint(value.before)); - tint_symbol_3(buffer, (offset + 8u), value.m); - buffer.Store((offset + 64u), asuint(value.after)); +void s_store_1(uint offset, S value) { + s.Store((offset + 0u), asuint(value.before)); + s_store_3((offset + 8u), value.m); + s.Store((offset + 64u), asuint(value.after)); } -void tint_symbol(RWByteAddressBuffer buffer, uint offset, S value[4]) { +void s_store(uint offset, S value[4]) { S array_1[4] = value; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - tint_symbol_1(buffer, (offset + (i * 128u)), array_1[i]); + s_store_1((offset + (i * 128u)), array_1[i]); } } } -float4x2 tint_symbol_8(uint4 buffer[32], uint offset) { +float4x2 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = u[scalar_offset_2 / 4]; const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_3 = u[scalar_offset_3 / 4]; return float4x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy)), asfloat(((scalar_offset_3 & 2) ? ubo_load_3.zw : ubo_load_3.xy))); } -S tint_symbol_6(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_4 = ((offset + 0u)) / 4; const uint scalar_offset_5 = ((offset + 64u)) / 4; - const S tint_symbol_10 = {asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), tint_symbol_8(buffer, (offset + 8u)), asint(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4])}; - return tint_symbol_10; + const S tint_symbol = {asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4]), u_load_3((offset + 8u)), asint(u[scalar_offset_5 / 4][scalar_offset_5 % 4])}; + return tint_symbol; } -typedef S tint_symbol_5_ret[4]; -tint_symbol_5_ret tint_symbol_5(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_6(buffer, (offset + (i_1 * 128u))); + arr[i_1] = u_load_1((offset + (i_1 * 128u))); } } return arr; @@ -63,9 +63,9 @@ tint_symbol_5_ret tint_symbol_5(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_5(u, 0u)); - tint_symbol_1(s, 128u, tint_symbol_6(u, 256u)); - tint_symbol_3(s, 392u, tint_symbol_8(u, 264u)); + s_store(0u, u_load(0u)); + s_store_1(128u, u_load_1(256u)); + s_store_3(392u, u_load_3(264u)); s.Store2(136u, asuint(asfloat(u[1].xy).yx)); return; } diff --git a/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_storage.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_storage.wgsl.expected.fxc.hlsl index bfc91abd51..81fa7039da 100644 --- a/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_storage.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_storage.wgsl.expected.fxc.hlsl @@ -9,53 +9,53 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol_3(RWByteAddressBuffer buffer, uint offset, float4x2 value) { - buffer.Store2((offset + 0u), asuint(value[0u])); - buffer.Store2((offset + 8u), asuint(value[1u])); - buffer.Store2((offset + 16u), asuint(value[2u])); - buffer.Store2((offset + 24u), asuint(value[3u])); +void s_store_3(uint offset, float4x2 value) { + s.Store2((offset + 0u), asuint(value[0u])); + s.Store2((offset + 8u), asuint(value[1u])); + s.Store2((offset + 16u), asuint(value[2u])); + s.Store2((offset + 24u), asuint(value[3u])); } -void tint_symbol_1(RWByteAddressBuffer buffer, uint offset, S value) { - buffer.Store((offset + 0u), asuint(value.before)); - tint_symbol_3(buffer, (offset + 8u), value.m); - buffer.Store((offset + 64u), asuint(value.after)); +void s_store_1(uint offset, S value) { + s.Store((offset + 0u), asuint(value.before)); + s_store_3((offset + 8u), value.m); + s.Store((offset + 64u), asuint(value.after)); } -void tint_symbol(RWByteAddressBuffer buffer, uint offset, S value[4]) { +void s_store(uint offset, S value[4]) { S array_1[4] = value; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - tint_symbol_1(buffer, (offset + (i * 128u)), array_1[i]); + s_store_1((offset + (i * 128u)), array_1[i]); } } } -float4x2 tint_symbol_8(uint4 buffer[32], uint offset) { +float4x2 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = u[scalar_offset_2 / 4]; const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_3 = u[scalar_offset_3 / 4]; return float4x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy)), asfloat(((scalar_offset_3 & 2) ? ubo_load_3.zw : ubo_load_3.xy))); } -S tint_symbol_6(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_4 = ((offset + 0u)) / 4; const uint scalar_offset_5 = ((offset + 64u)) / 4; - const S tint_symbol_10 = {asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), tint_symbol_8(buffer, (offset + 8u)), asint(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4])}; - return tint_symbol_10; + const S tint_symbol = {asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4]), u_load_3((offset + 8u)), asint(u[scalar_offset_5 / 4][scalar_offset_5 % 4])}; + return tint_symbol; } -typedef S tint_symbol_5_ret[4]; -tint_symbol_5_ret tint_symbol_5(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_6(buffer, (offset + (i_1 * 128u))); + arr[i_1] = u_load_1((offset + (i_1 * 128u))); } } return arr; @@ -63,9 +63,9 @@ tint_symbol_5_ret tint_symbol_5(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_5(u, 0u)); - tint_symbol_1(s, 128u, tint_symbol_6(u, 256u)); - tint_symbol_3(s, 392u, tint_symbol_8(u, 264u)); + s_store(0u, u_load(0u)); + s_store_1(128u, u_load_1(256u)); + s_store_3(392u, u_load_3(264u)); s.Store2(136u, asuint(asfloat(u[1].xy).yx)); return; } diff --git a/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_workgroup.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_workgroup.wgsl.expected.dxc.hlsl index 94f8f11500..4960ff3e2b 100644 --- a/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_workgroup.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_workgroup.wgsl.expected.dxc.hlsl @@ -13,31 +13,31 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -float4x2 tint_symbol_5(uint4 buffer[32], uint offset) { +float4x2 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = u[scalar_offset_2 / 4]; const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_3 = u[scalar_offset_3 / 4]; return float4x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy)), asfloat(((scalar_offset_3 & 2) ? ubo_load_3.zw : ubo_load_3.xy))); } -S tint_symbol_3(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_4 = ((offset + 0u)) / 4; const uint scalar_offset_5 = ((offset + 64u)) / 4; - const S tint_symbol_8 = {asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), tint_symbol_5(buffer, (offset + 8u)), asint(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4])}; - return tint_symbol_8; + const S tint_symbol_3 = {asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4]), u_load_3((offset + 8u)), asint(u[scalar_offset_5 / 4][scalar_offset_5 % 4])}; + return tint_symbol_3; } -typedef S tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_3(buffer, (offset + (i_1 * 128u))); + arr[i_1] = u_load_1((offset + (i_1 * 128u))); } } return arr; @@ -47,14 +47,14 @@ void f_inner(uint local_invocation_index) { { for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) { const uint i = idx; - const S tint_symbol_7 = (S)0; - w[i] = tint_symbol_7; + const S tint_symbol_2 = (S)0; + w[i] = tint_symbol_2; } } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); - w[1] = tint_symbol_3(u, 256u); - w[3].m = tint_symbol_5(u, 264u); + w = u_load(0u); + w[1] = u_load_1(256u); + w[3].m = u_load_3(264u); w[1].m[0] = asfloat(u[1].xy).yx; } diff --git a/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_workgroup.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_workgroup.wgsl.expected.fxc.hlsl index 94f8f11500..4960ff3e2b 100644 --- a/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_workgroup.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat4x2_f32/to_workgroup.wgsl.expected.fxc.hlsl @@ -13,31 +13,31 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -float4x2 tint_symbol_5(uint4 buffer[32], uint offset) { +float4x2 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = u[scalar_offset_2 / 4]; const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_3 = u[scalar_offset_3 / 4]; return float4x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy)), asfloat(((scalar_offset_3 & 2) ? ubo_load_3.zw : ubo_load_3.xy))); } -S tint_symbol_3(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_4 = ((offset + 0u)) / 4; const uint scalar_offset_5 = ((offset + 64u)) / 4; - const S tint_symbol_8 = {asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), tint_symbol_5(buffer, (offset + 8u)), asint(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4])}; - return tint_symbol_8; + const S tint_symbol_3 = {asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4]), u_load_3((offset + 8u)), asint(u[scalar_offset_5 / 4][scalar_offset_5 % 4])}; + return tint_symbol_3; } -typedef S tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_3(buffer, (offset + (i_1 * 128u))); + arr[i_1] = u_load_1((offset + (i_1 * 128u))); } } return arr; @@ -47,14 +47,14 @@ void f_inner(uint local_invocation_index) { { for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) { const uint i = idx; - const S tint_symbol_7 = (S)0; - w[i] = tint_symbol_7; + const S tint_symbol_2 = (S)0; + w[i] = tint_symbol_2; } } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); - w[1] = tint_symbol_3(u, 256u); - w[3].m = tint_symbol_5(u, 264u); + w = u_load(0u); + w[1] = u_load_1(256u); + w[3].m = u_load_3(264u); w[1].m[0] = asfloat(u[1].xy).yx; } diff --git a/test/tint/buffer/uniform/std140/struct/mat4x3_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat4x3_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl index 96d9ebc14c..5bc50ff262 100644 --- a/test/tint/buffer/uniform/std140/struct/mat4x3_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat4x3_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl @@ -15,57 +15,57 @@ int i() { return counter; } -matrix tint_symbol_8(uint4 buffer[64], uint offset) { +matrix a_load_4(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = a[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = a[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = a[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); float16_t ubo_load_4_y = f16tof32(ubo_load_4[0] >> 16); const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_7 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_7 = a[scalar_offset_3 / 4]; uint2 ubo_load_6 = ((scalar_offset_3 & 2) ? ubo_load_7.zw : ubo_load_7.xy); vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); float16_t ubo_load_6_y = f16tof32(ubo_load_6[0] >> 16); return matrix(vector(ubo_load_xz[0], ubo_load_y, ubo_load_xz[1]), vector(ubo_load_2_xz[0], ubo_load_2_y, ubo_load_2_xz[1]), vector(ubo_load_4_xz[0], ubo_load_4_y, ubo_load_4_xz[1]), vector(ubo_load_6_xz[0], ubo_load_6_y, ubo_load_6_xz[1])); } -Inner tint_symbol_7(uint4 buffer[64], uint offset) { - const Inner tint_symbol_11 = {tint_symbol_8(buffer, (offset + 0u))}; - return tint_symbol_11; +Inner a_load_3(uint offset) { + const Inner tint_symbol_4 = {a_load_4((offset + 0u))}; + return tint_symbol_4; } -typedef Inner tint_symbol_6_ret[4]; -tint_symbol_6_ret tint_symbol_6(uint4 buffer[64], uint offset) { +typedef Inner a_load_2_ret[4]; +a_load_2_ret a_load_2(uint offset) { Inner arr[4] = (Inner[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_7(buffer, (offset + (i_1 * 64u))); + arr[i_1] = a_load_3((offset + (i_1 * 64u))); } } return arr; } -Outer tint_symbol_5(uint4 buffer[64], uint offset) { - const Outer tint_symbol_12 = {tint_symbol_6(buffer, (offset + 0u))}; - return tint_symbol_12; +Outer a_load_1(uint offset) { + const Outer tint_symbol_5 = {a_load_2((offset + 0u))}; + return tint_symbol_5; } -typedef Outer tint_symbol_4_ret[4]; -tint_symbol_4_ret tint_symbol_4(uint4 buffer[64], uint offset) { +typedef Outer a_load_ret[4]; +a_load_ret a_load(uint offset) { Outer arr_1[4] = (Outer[4])0; { for(uint i_2 = 0u; (i_2 < 4u); i_2 = (i_2 + 1u)) { - arr_1[i_2] = tint_symbol_5(buffer, (offset + (i_2 * 256u))); + arr_1[i_2] = a_load_1((offset + (i_2 * 256u))); } } return arr_1; @@ -76,11 +76,11 @@ void f() { const int p_a_i_save = i(); const int p_a_i_a_i_save = i(); const int p_a_i_a_i_m_i_save = i(); - const Outer l_a[4] = tint_symbol_4(a, 0u); - const Outer l_a_i = tint_symbol_5(a, (256u * uint(p_a_i_save))); - const Inner l_a_i_a[4] = tint_symbol_6(a, (256u * uint(p_a_i_save))); - const Inner l_a_i_a_i = tint_symbol_7(a, ((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); - const matrix l_a_i_a_i_m = tint_symbol_8(a, ((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); + const Outer l_a[4] = a_load(0u); + const Outer l_a_i = a_load_1((256u * uint(p_a_i_save))); + const Inner l_a_i_a[4] = a_load_2((256u * uint(p_a_i_save))); + const Inner l_a_i_a_i = a_load_3(((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); + const matrix l_a_i_a_i_m = a_load_4(((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); const uint scalar_offset_4 = ((((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save))) + (8u * uint(p_a_i_a_i_m_i_save)))) / 4; uint4 ubo_load_9 = a[scalar_offset_4 / 4]; uint2 ubo_load_8 = ((scalar_offset_4 & 2) ? ubo_load_9.zw : ubo_load_9.xy); diff --git a/test/tint/buffer/uniform/std140/struct/mat4x3_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat4x3_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl index 7397fe333b..35dc20c335 100644 --- a/test/tint/buffer/uniform/std140/struct/mat4x3_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat4x3_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl @@ -9,57 +9,57 @@ cbuffer cbuffer_a : register(b0, space0) { uint4 a[64]; }; -matrix tint_symbol_4(uint4 buffer[64], uint offset) { +matrix a_load_4(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = a[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = a[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = a[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); float16_t ubo_load_4_y = f16tof32(ubo_load_4[0] >> 16); const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_7 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_7 = a[scalar_offset_3 / 4]; uint2 ubo_load_6 = ((scalar_offset_3 & 2) ? ubo_load_7.zw : ubo_load_7.xy); vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); float16_t ubo_load_6_y = f16tof32(ubo_load_6[0] >> 16); return matrix(vector(ubo_load_xz[0], ubo_load_y, ubo_load_xz[1]), vector(ubo_load_2_xz[0], ubo_load_2_y, ubo_load_2_xz[1]), vector(ubo_load_4_xz[0], ubo_load_4_y, ubo_load_4_xz[1]), vector(ubo_load_6_xz[0], ubo_load_6_y, ubo_load_6_xz[1])); } -Inner tint_symbol_3(uint4 buffer[64], uint offset) { - const Inner tint_symbol_7 = {tint_symbol_4(buffer, (offset + 0u))}; - return tint_symbol_7; +Inner a_load_3(uint offset) { + const Inner tint_symbol = {a_load_4((offset + 0u))}; + return tint_symbol; } -typedef Inner tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[64], uint offset) { +typedef Inner a_load_2_ret[4]; +a_load_2_ret a_load_2(uint offset) { Inner arr[4] = (Inner[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_3(buffer, (offset + (i * 64u))); + arr[i] = a_load_3((offset + (i * 64u))); } } return arr; } -Outer tint_symbol_1(uint4 buffer[64], uint offset) { - const Outer tint_symbol_8 = {tint_symbol_2(buffer, (offset + 0u))}; - return tint_symbol_8; +Outer a_load_1(uint offset) { + const Outer tint_symbol_1 = {a_load_2((offset + 0u))}; + return tint_symbol_1; } -typedef Outer tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[64], uint offset) { +typedef Outer a_load_ret[4]; +a_load_ret a_load(uint offset) { Outer arr_1[4] = (Outer[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr_1[i_1] = tint_symbol_1(buffer, (offset + (i_1 * 256u))); + arr_1[i_1] = a_load_1((offset + (i_1 * 256u))); } } return arr_1; @@ -67,11 +67,11 @@ tint_symbol_ret tint_symbol(uint4 buffer[64], uint offset) { [numthreads(1, 1, 1)] void f() { - const Outer l_a[4] = tint_symbol(a, 0u); - const Outer l_a_3 = tint_symbol_1(a, 768u); - const Inner l_a_3_a[4] = tint_symbol_2(a, 768u); - const Inner l_a_3_a_2 = tint_symbol_3(a, 896u); - const matrix l_a_3_a_2_m = tint_symbol_4(a, 896u); + const Outer l_a[4] = a_load(0u); + const Outer l_a_3 = a_load_1(768u); + const Inner l_a_3_a[4] = a_load_2(768u); + const Inner l_a_3_a_2 = a_load_3(896u); + const matrix l_a_3_a_2_m = a_load_4(896u); uint2 ubo_load_8 = a[56].zw; vector ubo_load_8_xz = vector(f16tof32(ubo_load_8 & 0xFFFF)); float16_t ubo_load_8_y = f16tof32(ubo_load_8[0] >> 16); diff --git a/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_builtin.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_builtin.wgsl.expected.dxc.hlsl index 3123f103cf..8a21954753 100644 --- a/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_builtin.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_builtin.wgsl.expected.dxc.hlsl @@ -2,24 +2,24 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[32]; }; -matrix tint_symbol(uint4 buffer[32], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = u[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); float16_t ubo_load_4_y = f16tof32(ubo_load_4[0] >> 16); const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_7 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_7 = u[scalar_offset_3 / 4]; uint2 ubo_load_6 = ((scalar_offset_3 & 2) ? ubo_load_7.zw : ubo_load_7.xy); vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); float16_t ubo_load_6_y = f16tof32(ubo_load_6[0] >> 16); @@ -28,7 +28,7 @@ matrix tint_symbol(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - const matrix t = transpose(tint_symbol(u, 264u)); + const matrix t = transpose(u_load(264u)); uint2 ubo_load_8 = u[1].xy; vector ubo_load_8_xz = vector(f16tof32(ubo_load_8 & 0xFFFF)); float16_t ubo_load_8_y = f16tof32(ubo_load_8[0] >> 16); diff --git a/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_fn.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_fn.wgsl.expected.dxc.hlsl index ef7574b814..22f98b314d 100644 --- a/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_fn.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_fn.wgsl.expected.dxc.hlsl @@ -23,43 +23,43 @@ void d(vector v) { void e(float16_t f_1) { } -matrix tint_symbol_3(uint4 buffer[32], uint offset) { +matrix u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = u[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); float16_t ubo_load_4_y = f16tof32(ubo_load_4[0] >> 16); const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_7 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_7 = u[scalar_offset_3 / 4]; uint2 ubo_load_6 = ((scalar_offset_3 & 2) ? ubo_load_7.zw : ubo_load_7.xy); vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); float16_t ubo_load_6_y = f16tof32(ubo_load_6[0] >> 16); return matrix(vector(ubo_load_xz[0], ubo_load_y, ubo_load_xz[1]), vector(ubo_load_2_xz[0], ubo_load_2_y, ubo_load_2_xz[1]), vector(ubo_load_4_xz[0], ubo_load_4_y, ubo_load_4_xz[1]), vector(ubo_load_6_xz[0], ubo_load_6_y, ubo_load_6_xz[1])); } -S tint_symbol_1(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_4 = ((offset + 0u)) / 4; const uint scalar_offset_5 = ((offset + 64u)) / 4; - const S tint_symbol_5 = {asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), tint_symbol_3(buffer, (offset + 8u)), asint(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4])}; - return tint_symbol_5; + const S tint_symbol = {asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4]), u_load_3((offset + 8u)), asint(u[scalar_offset_5 / 4][scalar_offset_5 % 4])}; + return tint_symbol; } -typedef S tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 128u))); + arr[i] = u_load_1((offset + (i * 128u))); } } return arr; @@ -67,9 +67,9 @@ tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); - b(tint_symbol_1(u, 256u)); - c(tint_symbol_3(u, 264u)); + a(u_load(0u)); + b(u_load_1(256u)); + c(u_load_3(264u)); uint2 ubo_load_8 = u[1].xy; vector ubo_load_8_xz = vector(f16tof32(ubo_load_8 & 0xFFFF)); float16_t ubo_load_8_y = f16tof32(ubo_load_8[0] >> 16); diff --git a/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_private.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_private.wgsl.expected.dxc.hlsl index d2aaceed4c..4d0072fe99 100644 --- a/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_private.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_private.wgsl.expected.dxc.hlsl @@ -9,43 +9,43 @@ cbuffer cbuffer_u : register(b0, space0) { }; static S p[4] = (S[4])0; -matrix tint_symbol_3(uint4 buffer[32], uint offset) { +matrix u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = u[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); float16_t ubo_load_4_y = f16tof32(ubo_load_4[0] >> 16); const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_7 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_7 = u[scalar_offset_3 / 4]; uint2 ubo_load_6 = ((scalar_offset_3 & 2) ? ubo_load_7.zw : ubo_load_7.xy); vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); float16_t ubo_load_6_y = f16tof32(ubo_load_6[0] >> 16); return matrix(vector(ubo_load_xz[0], ubo_load_y, ubo_load_xz[1]), vector(ubo_load_2_xz[0], ubo_load_2_y, ubo_load_2_xz[1]), vector(ubo_load_4_xz[0], ubo_load_4_y, ubo_load_4_xz[1]), vector(ubo_load_6_xz[0], ubo_load_6_y, ubo_load_6_xz[1])); } -S tint_symbol_1(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_4 = ((offset + 0u)) / 4; const uint scalar_offset_5 = ((offset + 64u)) / 4; - const S tint_symbol_5 = {asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), tint_symbol_3(buffer, (offset + 8u)), asint(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4])}; - return tint_symbol_5; + const S tint_symbol = {asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4]), u_load_3((offset + 8u)), asint(u[scalar_offset_5 / 4][scalar_offset_5 % 4])}; + return tint_symbol; } -typedef S tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 128u))); + arr[i] = u_load_1((offset + (i * 128u))); } } return arr; @@ -53,9 +53,9 @@ tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); - p[1] = tint_symbol_1(u, 256u); - p[3].m = tint_symbol_3(u, 264u); + p = u_load(0u); + p[1] = u_load_1(256u); + p[3].m = u_load_3(264u); uint2 ubo_load_8 = u[1].xy; vector ubo_load_8_xz = vector(f16tof32(ubo_load_8 & 0xFFFF)); float16_t ubo_load_8_y = f16tof32(ubo_load_8[0] >> 16); diff --git a/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_storage.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_storage.wgsl.expected.dxc.hlsl index f4e10acd33..8bc864e9a5 100644 --- a/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_storage.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_storage.wgsl.expected.dxc.hlsl @@ -9,65 +9,65 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol_3(RWByteAddressBuffer buffer, uint offset, matrix value) { - buffer.Store >((offset + 0u), value[0u]); - buffer.Store >((offset + 8u), value[1u]); - buffer.Store >((offset + 16u), value[2u]); - buffer.Store >((offset + 24u), value[3u]); +void s_store_3(uint offset, matrix value) { + s.Store >((offset + 0u), value[0u]); + s.Store >((offset + 8u), value[1u]); + s.Store >((offset + 16u), value[2u]); + s.Store >((offset + 24u), value[3u]); } -void tint_symbol_1(RWByteAddressBuffer buffer, uint offset, S value) { - buffer.Store((offset + 0u), asuint(value.before)); - tint_symbol_3(buffer, (offset + 8u), value.m); - buffer.Store((offset + 64u), asuint(value.after)); +void s_store_1(uint offset, S value) { + s.Store((offset + 0u), asuint(value.before)); + s_store_3((offset + 8u), value.m); + s.Store((offset + 64u), asuint(value.after)); } -void tint_symbol(RWByteAddressBuffer buffer, uint offset, S value[4]) { +void s_store(uint offset, S value[4]) { S array_1[4] = value; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - tint_symbol_1(buffer, (offset + (i * 128u)), array_1[i]); + s_store_1((offset + (i * 128u)), array_1[i]); } } } -matrix tint_symbol_8(uint4 buffer[32], uint offset) { +matrix u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = u[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); float16_t ubo_load_4_y = f16tof32(ubo_load_4[0] >> 16); const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_7 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_7 = u[scalar_offset_3 / 4]; uint2 ubo_load_6 = ((scalar_offset_3 & 2) ? ubo_load_7.zw : ubo_load_7.xy); vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); float16_t ubo_load_6_y = f16tof32(ubo_load_6[0] >> 16); return matrix(vector(ubo_load_xz[0], ubo_load_y, ubo_load_xz[1]), vector(ubo_load_2_xz[0], ubo_load_2_y, ubo_load_2_xz[1]), vector(ubo_load_4_xz[0], ubo_load_4_y, ubo_load_4_xz[1]), vector(ubo_load_6_xz[0], ubo_load_6_y, ubo_load_6_xz[1])); } -S tint_symbol_6(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_4 = ((offset + 0u)) / 4; const uint scalar_offset_5 = ((offset + 64u)) / 4; - const S tint_symbol_10 = {asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), tint_symbol_8(buffer, (offset + 8u)), asint(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4])}; - return tint_symbol_10; + const S tint_symbol = {asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4]), u_load_3((offset + 8u)), asint(u[scalar_offset_5 / 4][scalar_offset_5 % 4])}; + return tint_symbol; } -typedef S tint_symbol_5_ret[4]; -tint_symbol_5_ret tint_symbol_5(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_6(buffer, (offset + (i_1 * 128u))); + arr[i_1] = u_load_1((offset + (i_1 * 128u))); } } return arr; @@ -75,9 +75,9 @@ tint_symbol_5_ret tint_symbol_5(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_5(u, 0u)); - tint_symbol_1(s, 128u, tint_symbol_6(u, 256u)); - tint_symbol_3(s, 392u, tint_symbol_8(u, 264u)); + s_store(0u, u_load(0u)); + s_store_1(128u, u_load_1(256u)); + s_store_3(392u, u_load_3(264u)); uint2 ubo_load_8 = u[1].xy; vector ubo_load_8_xz = vector(f16tof32(ubo_load_8 & 0xFFFF)); float16_t ubo_load_8_y = f16tof32(ubo_load_8[0] >> 16); diff --git a/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_workgroup.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_workgroup.wgsl.expected.dxc.hlsl index c6607408bb..034f243685 100644 --- a/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_workgroup.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat4x3_f16/to_workgroup.wgsl.expected.dxc.hlsl @@ -13,43 +13,43 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -matrix tint_symbol_5(uint4 buffer[32], uint offset) { +matrix u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = u[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); float16_t ubo_load_4_y = f16tof32(ubo_load_4[0] >> 16); const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_7 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_7 = u[scalar_offset_3 / 4]; uint2 ubo_load_6 = ((scalar_offset_3 & 2) ? ubo_load_7.zw : ubo_load_7.xy); vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); float16_t ubo_load_6_y = f16tof32(ubo_load_6[0] >> 16); return matrix(vector(ubo_load_xz[0], ubo_load_y, ubo_load_xz[1]), vector(ubo_load_2_xz[0], ubo_load_2_y, ubo_load_2_xz[1]), vector(ubo_load_4_xz[0], ubo_load_4_y, ubo_load_4_xz[1]), vector(ubo_load_6_xz[0], ubo_load_6_y, ubo_load_6_xz[1])); } -S tint_symbol_3(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_4 = ((offset + 0u)) / 4; const uint scalar_offset_5 = ((offset + 64u)) / 4; - const S tint_symbol_8 = {asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), tint_symbol_5(buffer, (offset + 8u)), asint(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4])}; - return tint_symbol_8; + const S tint_symbol_3 = {asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4]), u_load_3((offset + 8u)), asint(u[scalar_offset_5 / 4][scalar_offset_5 % 4])}; + return tint_symbol_3; } -typedef S tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_3(buffer, (offset + (i_1 * 128u))); + arr[i_1] = u_load_1((offset + (i_1 * 128u))); } } return arr; @@ -59,14 +59,14 @@ void f_inner(uint local_invocation_index) { { for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) { const uint i = idx; - const S tint_symbol_7 = (S)0; - w[i] = tint_symbol_7; + const S tint_symbol_2 = (S)0; + w[i] = tint_symbol_2; } } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); - w[1] = tint_symbol_3(u, 256u); - w[3].m = tint_symbol_5(u, 264u); + w = u_load(0u); + w[1] = u_load_1(256u); + w[3].m = u_load_3(264u); uint2 ubo_load_8 = u[1].xy; vector ubo_load_8_xz = vector(f16tof32(ubo_load_8 & 0xFFFF)); float16_t ubo_load_8_y = f16tof32(ubo_load_8[0] >> 16); diff --git a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl index 907314e548..c8e4d7a814 100644 --- a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl @@ -15,41 +15,41 @@ int i() { return counter; } -float4x3 tint_symbol_8(uint4 buffer[64], uint offset) { +float4x3 a_load_4(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz)); + return float4x3(asfloat(a[scalar_offset / 4].xyz), asfloat(a[scalar_offset_1 / 4].xyz), asfloat(a[scalar_offset_2 / 4].xyz), asfloat(a[scalar_offset_3 / 4].xyz)); } -Inner tint_symbol_7(uint4 buffer[64], uint offset) { - const Inner tint_symbol_11 = {tint_symbol_8(buffer, (offset + 0u))}; - return tint_symbol_11; +Inner a_load_3(uint offset) { + const Inner tint_symbol_4 = {a_load_4((offset + 0u))}; + return tint_symbol_4; } -typedef Inner tint_symbol_6_ret[4]; -tint_symbol_6_ret tint_symbol_6(uint4 buffer[64], uint offset) { +typedef Inner a_load_2_ret[4]; +a_load_2_ret a_load_2(uint offset) { Inner arr[4] = (Inner[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_7(buffer, (offset + (i_1 * 64u))); + arr[i_1] = a_load_3((offset + (i_1 * 64u))); } } return arr; } -Outer tint_symbol_5(uint4 buffer[64], uint offset) { - const Outer tint_symbol_12 = {tint_symbol_6(buffer, (offset + 0u))}; - return tint_symbol_12; +Outer a_load_1(uint offset) { + const Outer tint_symbol_5 = {a_load_2((offset + 0u))}; + return tint_symbol_5; } -typedef Outer tint_symbol_4_ret[4]; -tint_symbol_4_ret tint_symbol_4(uint4 buffer[64], uint offset) { +typedef Outer a_load_ret[4]; +a_load_ret a_load(uint offset) { Outer arr_1[4] = (Outer[4])0; { for(uint i_2 = 0u; (i_2 < 4u); i_2 = (i_2 + 1u)) { - arr_1[i_2] = tint_symbol_5(buffer, (offset + (i_2 * 256u))); + arr_1[i_2] = a_load_1((offset + (i_2 * 256u))); } } return arr_1; @@ -60,11 +60,11 @@ void f() { const int p_a_i_save = i(); const int p_a_i_a_i_save = i(); const int p_a_i_a_i_m_i_save = i(); - const Outer l_a[4] = tint_symbol_4(a, 0u); - const Outer l_a_i = tint_symbol_5(a, (256u * uint(p_a_i_save))); - const Inner l_a_i_a[4] = tint_symbol_6(a, (256u * uint(p_a_i_save))); - const Inner l_a_i_a_i = tint_symbol_7(a, ((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); - const float4x3 l_a_i_a_i_m = tint_symbol_8(a, ((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); + const Outer l_a[4] = a_load(0u); + const Outer l_a_i = a_load_1((256u * uint(p_a_i_save))); + const Inner l_a_i_a[4] = a_load_2((256u * uint(p_a_i_save))); + const Inner l_a_i_a_i = a_load_3(((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); + const float4x3 l_a_i_a_i_m = a_load_4(((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); const uint scalar_offset_4 = ((((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save))) + (16u * uint(p_a_i_a_i_m_i_save)))) / 4; const float3 l_a_i_a_i_m_i = asfloat(a[scalar_offset_4 / 4].xyz); const int tint_symbol = p_a_i_save; diff --git a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl index 907314e548..c8e4d7a814 100644 --- a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl @@ -15,41 +15,41 @@ int i() { return counter; } -float4x3 tint_symbol_8(uint4 buffer[64], uint offset) { +float4x3 a_load_4(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz)); + return float4x3(asfloat(a[scalar_offset / 4].xyz), asfloat(a[scalar_offset_1 / 4].xyz), asfloat(a[scalar_offset_2 / 4].xyz), asfloat(a[scalar_offset_3 / 4].xyz)); } -Inner tint_symbol_7(uint4 buffer[64], uint offset) { - const Inner tint_symbol_11 = {tint_symbol_8(buffer, (offset + 0u))}; - return tint_symbol_11; +Inner a_load_3(uint offset) { + const Inner tint_symbol_4 = {a_load_4((offset + 0u))}; + return tint_symbol_4; } -typedef Inner tint_symbol_6_ret[4]; -tint_symbol_6_ret tint_symbol_6(uint4 buffer[64], uint offset) { +typedef Inner a_load_2_ret[4]; +a_load_2_ret a_load_2(uint offset) { Inner arr[4] = (Inner[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_7(buffer, (offset + (i_1 * 64u))); + arr[i_1] = a_load_3((offset + (i_1 * 64u))); } } return arr; } -Outer tint_symbol_5(uint4 buffer[64], uint offset) { - const Outer tint_symbol_12 = {tint_symbol_6(buffer, (offset + 0u))}; - return tint_symbol_12; +Outer a_load_1(uint offset) { + const Outer tint_symbol_5 = {a_load_2((offset + 0u))}; + return tint_symbol_5; } -typedef Outer tint_symbol_4_ret[4]; -tint_symbol_4_ret tint_symbol_4(uint4 buffer[64], uint offset) { +typedef Outer a_load_ret[4]; +a_load_ret a_load(uint offset) { Outer arr_1[4] = (Outer[4])0; { for(uint i_2 = 0u; (i_2 < 4u); i_2 = (i_2 + 1u)) { - arr_1[i_2] = tint_symbol_5(buffer, (offset + (i_2 * 256u))); + arr_1[i_2] = a_load_1((offset + (i_2 * 256u))); } } return arr_1; @@ -60,11 +60,11 @@ void f() { const int p_a_i_save = i(); const int p_a_i_a_i_save = i(); const int p_a_i_a_i_m_i_save = i(); - const Outer l_a[4] = tint_symbol_4(a, 0u); - const Outer l_a_i = tint_symbol_5(a, (256u * uint(p_a_i_save))); - const Inner l_a_i_a[4] = tint_symbol_6(a, (256u * uint(p_a_i_save))); - const Inner l_a_i_a_i = tint_symbol_7(a, ((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); - const float4x3 l_a_i_a_i_m = tint_symbol_8(a, ((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); + const Outer l_a[4] = a_load(0u); + const Outer l_a_i = a_load_1((256u * uint(p_a_i_save))); + const Inner l_a_i_a[4] = a_load_2((256u * uint(p_a_i_save))); + const Inner l_a_i_a_i = a_load_3(((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); + const float4x3 l_a_i_a_i_m = a_load_4(((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); const uint scalar_offset_4 = ((((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save))) + (16u * uint(p_a_i_a_i_m_i_save)))) / 4; const float3 l_a_i_a_i_m_i = asfloat(a[scalar_offset_4 / 4].xyz); const int tint_symbol = p_a_i_save; diff --git a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl index a678c85775..9813d97bba 100644 --- a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl @@ -9,41 +9,41 @@ cbuffer cbuffer_a : register(b0, space0) { uint4 a[64]; }; -float4x3 tint_symbol_4(uint4 buffer[64], uint offset) { +float4x3 a_load_4(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz)); + return float4x3(asfloat(a[scalar_offset / 4].xyz), asfloat(a[scalar_offset_1 / 4].xyz), asfloat(a[scalar_offset_2 / 4].xyz), asfloat(a[scalar_offset_3 / 4].xyz)); } -Inner tint_symbol_3(uint4 buffer[64], uint offset) { - const Inner tint_symbol_7 = {tint_symbol_4(buffer, (offset + 0u))}; - return tint_symbol_7; +Inner a_load_3(uint offset) { + const Inner tint_symbol = {a_load_4((offset + 0u))}; + return tint_symbol; } -typedef Inner tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[64], uint offset) { +typedef Inner a_load_2_ret[4]; +a_load_2_ret a_load_2(uint offset) { Inner arr[4] = (Inner[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_3(buffer, (offset + (i * 64u))); + arr[i] = a_load_3((offset + (i * 64u))); } } return arr; } -Outer tint_symbol_1(uint4 buffer[64], uint offset) { - const Outer tint_symbol_8 = {tint_symbol_2(buffer, (offset + 0u))}; - return tint_symbol_8; +Outer a_load_1(uint offset) { + const Outer tint_symbol_1 = {a_load_2((offset + 0u))}; + return tint_symbol_1; } -typedef Outer tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[64], uint offset) { +typedef Outer a_load_ret[4]; +a_load_ret a_load(uint offset) { Outer arr_1[4] = (Outer[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr_1[i_1] = tint_symbol_1(buffer, (offset + (i_1 * 256u))); + arr_1[i_1] = a_load_1((offset + (i_1 * 256u))); } } return arr_1; @@ -51,11 +51,11 @@ tint_symbol_ret tint_symbol(uint4 buffer[64], uint offset) { [numthreads(1, 1, 1)] void f() { - const Outer l_a[4] = tint_symbol(a, 0u); - const Outer l_a_3 = tint_symbol_1(a, 768u); - const Inner l_a_3_a[4] = tint_symbol_2(a, 768u); - const Inner l_a_3_a_2 = tint_symbol_3(a, 896u); - const float4x3 l_a_3_a_2_m = tint_symbol_4(a, 896u); + const Outer l_a[4] = a_load(0u); + const Outer l_a_3 = a_load_1(768u); + const Inner l_a_3_a[4] = a_load_2(768u); + const Inner l_a_3_a_2 = a_load_3(896u); + const float4x3 l_a_3_a_2_m = a_load_4(896u); const float3 l_a_3_a_2_m_1 = asfloat(a[57].xyz); const float l_a_3_a_2_m_1_0 = asfloat(a[57].x); return; diff --git a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl index a678c85775..9813d97bba 100644 --- a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl @@ -9,41 +9,41 @@ cbuffer cbuffer_a : register(b0, space0) { uint4 a[64]; }; -float4x3 tint_symbol_4(uint4 buffer[64], uint offset) { +float4x3 a_load_4(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz)); + return float4x3(asfloat(a[scalar_offset / 4].xyz), asfloat(a[scalar_offset_1 / 4].xyz), asfloat(a[scalar_offset_2 / 4].xyz), asfloat(a[scalar_offset_3 / 4].xyz)); } -Inner tint_symbol_3(uint4 buffer[64], uint offset) { - const Inner tint_symbol_7 = {tint_symbol_4(buffer, (offset + 0u))}; - return tint_symbol_7; +Inner a_load_3(uint offset) { + const Inner tint_symbol = {a_load_4((offset + 0u))}; + return tint_symbol; } -typedef Inner tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[64], uint offset) { +typedef Inner a_load_2_ret[4]; +a_load_2_ret a_load_2(uint offset) { Inner arr[4] = (Inner[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_3(buffer, (offset + (i * 64u))); + arr[i] = a_load_3((offset + (i * 64u))); } } return arr; } -Outer tint_symbol_1(uint4 buffer[64], uint offset) { - const Outer tint_symbol_8 = {tint_symbol_2(buffer, (offset + 0u))}; - return tint_symbol_8; +Outer a_load_1(uint offset) { + const Outer tint_symbol_1 = {a_load_2((offset + 0u))}; + return tint_symbol_1; } -typedef Outer tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[64], uint offset) { +typedef Outer a_load_ret[4]; +a_load_ret a_load(uint offset) { Outer arr_1[4] = (Outer[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr_1[i_1] = tint_symbol_1(buffer, (offset + (i_1 * 256u))); + arr_1[i_1] = a_load_1((offset + (i_1 * 256u))); } } return arr_1; @@ -51,11 +51,11 @@ tint_symbol_ret tint_symbol(uint4 buffer[64], uint offset) { [numthreads(1, 1, 1)] void f() { - const Outer l_a[4] = tint_symbol(a, 0u); - const Outer l_a_3 = tint_symbol_1(a, 768u); - const Inner l_a_3_a[4] = tint_symbol_2(a, 768u); - const Inner l_a_3_a_2 = tint_symbol_3(a, 896u); - const float4x3 l_a_3_a_2_m = tint_symbol_4(a, 896u); + const Outer l_a[4] = a_load(0u); + const Outer l_a_3 = a_load_1(768u); + const Inner l_a_3_a[4] = a_load_2(768u); + const Inner l_a_3_a_2 = a_load_3(896u); + const float4x3 l_a_3_a_2_m = a_load_4(896u); const float3 l_a_3_a_2_m_1 = asfloat(a[57].xyz); const float l_a_3_a_2_m_1_0 = asfloat(a[57].x); return; diff --git a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_builtin.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_builtin.wgsl.expected.dxc.hlsl index 37cf50303b..14506b1c1c 100644 --- a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_builtin.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_builtin.wgsl.expected.dxc.hlsl @@ -2,17 +2,17 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[48]; }; -float4x3 tint_symbol(uint4 buffer[48], uint offset) { +float4x3 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz)); + return float4x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz), asfloat(u[scalar_offset_3 / 4].xyz)); } [numthreads(1, 1, 1)] void f() { - const float3x4 t = transpose(tint_symbol(u, 400u)); + const float3x4 t = transpose(u_load(400u)); const float l = length(asfloat(u[2].xyz).zxy); const float a = abs(asfloat(u[2].xyz).zxy.x); return; diff --git a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_builtin.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_builtin.wgsl.expected.fxc.hlsl index 37cf50303b..14506b1c1c 100644 --- a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_builtin.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_builtin.wgsl.expected.fxc.hlsl @@ -2,17 +2,17 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[48]; }; -float4x3 tint_symbol(uint4 buffer[48], uint offset) { +float4x3 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz)); + return float4x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz), asfloat(u[scalar_offset_3 / 4].xyz)); } [numthreads(1, 1, 1)] void f() { - const float3x4 t = transpose(tint_symbol(u, 400u)); + const float3x4 t = transpose(u_load(400u)); const float l = length(asfloat(u[2].xyz).zxy); const float a = abs(asfloat(u[2].xyz).zxy.x); return; diff --git a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_fn.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_fn.wgsl.expected.dxc.hlsl index 2fadcffb9b..a1a374c90b 100644 --- a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_fn.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_fn.wgsl.expected.dxc.hlsl @@ -23,27 +23,27 @@ void d(float3 v) { void e(float f_1) { } -float4x3 tint_symbol_3(uint4 buffer[48], uint offset) { +float4x3 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz)); + return float4x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz), asfloat(u[scalar_offset_3 / 4].xyz)); } -S tint_symbol_1(uint4 buffer[48], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_4 = ((offset + 0u)) / 4; const uint scalar_offset_5 = ((offset + 128u)) / 4; - const S tint_symbol_5 = {asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), tint_symbol_3(buffer, (offset + 16u)), asint(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4])}; - return tint_symbol_5; + const S tint_symbol = {asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4]), u_load_3((offset + 16u)), asint(u[scalar_offset_5 / 4][scalar_offset_5 % 4])}; + return tint_symbol; } -typedef S tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[48], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 192u))); + arr[i] = u_load_1((offset + (i * 192u))); } } return arr; @@ -51,9 +51,9 @@ tint_symbol_ret tint_symbol(uint4 buffer[48], uint offset) { [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); - b(tint_symbol_1(u, 384u)); - c(tint_symbol_3(u, 400u)); + a(u_load(0u)); + b(u_load_1(384u)); + c(u_load_3(400u)); d(asfloat(u[2].xyz).zxy); e(asfloat(u[2].xyz).zxy.x); return; diff --git a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_fn.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_fn.wgsl.expected.fxc.hlsl index 2fadcffb9b..a1a374c90b 100644 --- a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_fn.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_fn.wgsl.expected.fxc.hlsl @@ -23,27 +23,27 @@ void d(float3 v) { void e(float f_1) { } -float4x3 tint_symbol_3(uint4 buffer[48], uint offset) { +float4x3 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz)); + return float4x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz), asfloat(u[scalar_offset_3 / 4].xyz)); } -S tint_symbol_1(uint4 buffer[48], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_4 = ((offset + 0u)) / 4; const uint scalar_offset_5 = ((offset + 128u)) / 4; - const S tint_symbol_5 = {asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), tint_symbol_3(buffer, (offset + 16u)), asint(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4])}; - return tint_symbol_5; + const S tint_symbol = {asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4]), u_load_3((offset + 16u)), asint(u[scalar_offset_5 / 4][scalar_offset_5 % 4])}; + return tint_symbol; } -typedef S tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[48], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 192u))); + arr[i] = u_load_1((offset + (i * 192u))); } } return arr; @@ -51,9 +51,9 @@ tint_symbol_ret tint_symbol(uint4 buffer[48], uint offset) { [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); - b(tint_symbol_1(u, 384u)); - c(tint_symbol_3(u, 400u)); + a(u_load(0u)); + b(u_load_1(384u)); + c(u_load_3(400u)); d(asfloat(u[2].xyz).zxy); e(asfloat(u[2].xyz).zxy.x); return; diff --git a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_private.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_private.wgsl.expected.dxc.hlsl index 5426bb4c03..c4d3042407 100644 --- a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_private.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_private.wgsl.expected.dxc.hlsl @@ -9,27 +9,27 @@ cbuffer cbuffer_u : register(b0, space0) { }; static S p[4] = (S[4])0; -float4x3 tint_symbol_3(uint4 buffer[48], uint offset) { +float4x3 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz)); + return float4x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz), asfloat(u[scalar_offset_3 / 4].xyz)); } -S tint_symbol_1(uint4 buffer[48], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_4 = ((offset + 0u)) / 4; const uint scalar_offset_5 = ((offset + 128u)) / 4; - const S tint_symbol_5 = {asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), tint_symbol_3(buffer, (offset + 16u)), asint(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4])}; - return tint_symbol_5; + const S tint_symbol = {asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4]), u_load_3((offset + 16u)), asint(u[scalar_offset_5 / 4][scalar_offset_5 % 4])}; + return tint_symbol; } -typedef S tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[48], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 192u))); + arr[i] = u_load_1((offset + (i * 192u))); } } return arr; @@ -37,9 +37,9 @@ tint_symbol_ret tint_symbol(uint4 buffer[48], uint offset) { [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); - p[1] = tint_symbol_1(u, 384u); - p[3].m = tint_symbol_3(u, 400u); + p = u_load(0u); + p[1] = u_load_1(384u); + p[3].m = u_load_3(400u); p[1].m[0] = asfloat(u[2].xyz).zxy; return; } diff --git a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_private.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_private.wgsl.expected.fxc.hlsl index 5426bb4c03..c4d3042407 100644 --- a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_private.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_private.wgsl.expected.fxc.hlsl @@ -9,27 +9,27 @@ cbuffer cbuffer_u : register(b0, space0) { }; static S p[4] = (S[4])0; -float4x3 tint_symbol_3(uint4 buffer[48], uint offset) { +float4x3 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz)); + return float4x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz), asfloat(u[scalar_offset_3 / 4].xyz)); } -S tint_symbol_1(uint4 buffer[48], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_4 = ((offset + 0u)) / 4; const uint scalar_offset_5 = ((offset + 128u)) / 4; - const S tint_symbol_5 = {asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), tint_symbol_3(buffer, (offset + 16u)), asint(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4])}; - return tint_symbol_5; + const S tint_symbol = {asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4]), u_load_3((offset + 16u)), asint(u[scalar_offset_5 / 4][scalar_offset_5 % 4])}; + return tint_symbol; } -typedef S tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[48], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 192u))); + arr[i] = u_load_1((offset + (i * 192u))); } } return arr; @@ -37,9 +37,9 @@ tint_symbol_ret tint_symbol(uint4 buffer[48], uint offset) { [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); - p[1] = tint_symbol_1(u, 384u); - p[3].m = tint_symbol_3(u, 400u); + p = u_load(0u); + p[1] = u_load_1(384u); + p[3].m = u_load_3(400u); p[1].m[0] = asfloat(u[2].xyz).zxy; return; } diff --git a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_storage.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_storage.wgsl.expected.dxc.hlsl index 9f86bd8f27..df60f517cf 100644 --- a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_storage.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_storage.wgsl.expected.dxc.hlsl @@ -9,49 +9,49 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol_3(RWByteAddressBuffer buffer, uint offset, float4x3 value) { - buffer.Store3((offset + 0u), asuint(value[0u])); - buffer.Store3((offset + 16u), asuint(value[1u])); - buffer.Store3((offset + 32u), asuint(value[2u])); - buffer.Store3((offset + 48u), asuint(value[3u])); +void s_store_3(uint offset, float4x3 value) { + s.Store3((offset + 0u), asuint(value[0u])); + s.Store3((offset + 16u), asuint(value[1u])); + s.Store3((offset + 32u), asuint(value[2u])); + s.Store3((offset + 48u), asuint(value[3u])); } -void tint_symbol_1(RWByteAddressBuffer buffer, uint offset, S value) { - buffer.Store((offset + 0u), asuint(value.before)); - tint_symbol_3(buffer, (offset + 16u), value.m); - buffer.Store((offset + 128u), asuint(value.after)); +void s_store_1(uint offset, S value) { + s.Store((offset + 0u), asuint(value.before)); + s_store_3((offset + 16u), value.m); + s.Store((offset + 128u), asuint(value.after)); } -void tint_symbol(RWByteAddressBuffer buffer, uint offset, S value[4]) { +void s_store(uint offset, S value[4]) { S array_1[4] = value; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - tint_symbol_1(buffer, (offset + (i * 192u)), array_1[i]); + s_store_1((offset + (i * 192u)), array_1[i]); } } } -float4x3 tint_symbol_8(uint4 buffer[48], uint offset) { +float4x3 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz)); + return float4x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz), asfloat(u[scalar_offset_3 / 4].xyz)); } -S tint_symbol_6(uint4 buffer[48], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_4 = ((offset + 0u)) / 4; const uint scalar_offset_5 = ((offset + 128u)) / 4; - const S tint_symbol_10 = {asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), tint_symbol_8(buffer, (offset + 16u)), asint(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4])}; - return tint_symbol_10; + const S tint_symbol = {asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4]), u_load_3((offset + 16u)), asint(u[scalar_offset_5 / 4][scalar_offset_5 % 4])}; + return tint_symbol; } -typedef S tint_symbol_5_ret[4]; -tint_symbol_5_ret tint_symbol_5(uint4 buffer[48], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_6(buffer, (offset + (i_1 * 192u))); + arr[i_1] = u_load_1((offset + (i_1 * 192u))); } } return arr; @@ -59,9 +59,9 @@ tint_symbol_5_ret tint_symbol_5(uint4 buffer[48], uint offset) { [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_5(u, 0u)); - tint_symbol_1(s, 192u, tint_symbol_6(u, 384u)); - tint_symbol_3(s, 592u, tint_symbol_8(u, 400u)); + s_store(0u, u_load(0u)); + s_store_1(192u, u_load_1(384u)); + s_store_3(592u, u_load_3(400u)); s.Store3(208u, asuint(asfloat(u[2].xyz).zxy)); return; } diff --git a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_storage.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_storage.wgsl.expected.fxc.hlsl index 9f86bd8f27..df60f517cf 100644 --- a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_storage.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_storage.wgsl.expected.fxc.hlsl @@ -9,49 +9,49 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol_3(RWByteAddressBuffer buffer, uint offset, float4x3 value) { - buffer.Store3((offset + 0u), asuint(value[0u])); - buffer.Store3((offset + 16u), asuint(value[1u])); - buffer.Store3((offset + 32u), asuint(value[2u])); - buffer.Store3((offset + 48u), asuint(value[3u])); +void s_store_3(uint offset, float4x3 value) { + s.Store3((offset + 0u), asuint(value[0u])); + s.Store3((offset + 16u), asuint(value[1u])); + s.Store3((offset + 32u), asuint(value[2u])); + s.Store3((offset + 48u), asuint(value[3u])); } -void tint_symbol_1(RWByteAddressBuffer buffer, uint offset, S value) { - buffer.Store((offset + 0u), asuint(value.before)); - tint_symbol_3(buffer, (offset + 16u), value.m); - buffer.Store((offset + 128u), asuint(value.after)); +void s_store_1(uint offset, S value) { + s.Store((offset + 0u), asuint(value.before)); + s_store_3((offset + 16u), value.m); + s.Store((offset + 128u), asuint(value.after)); } -void tint_symbol(RWByteAddressBuffer buffer, uint offset, S value[4]) { +void s_store(uint offset, S value[4]) { S array_1[4] = value; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - tint_symbol_1(buffer, (offset + (i * 192u)), array_1[i]); + s_store_1((offset + (i * 192u)), array_1[i]); } } } -float4x3 tint_symbol_8(uint4 buffer[48], uint offset) { +float4x3 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz)); + return float4x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz), asfloat(u[scalar_offset_3 / 4].xyz)); } -S tint_symbol_6(uint4 buffer[48], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_4 = ((offset + 0u)) / 4; const uint scalar_offset_5 = ((offset + 128u)) / 4; - const S tint_symbol_10 = {asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), tint_symbol_8(buffer, (offset + 16u)), asint(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4])}; - return tint_symbol_10; + const S tint_symbol = {asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4]), u_load_3((offset + 16u)), asint(u[scalar_offset_5 / 4][scalar_offset_5 % 4])}; + return tint_symbol; } -typedef S tint_symbol_5_ret[4]; -tint_symbol_5_ret tint_symbol_5(uint4 buffer[48], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_6(buffer, (offset + (i_1 * 192u))); + arr[i_1] = u_load_1((offset + (i_1 * 192u))); } } return arr; @@ -59,9 +59,9 @@ tint_symbol_5_ret tint_symbol_5(uint4 buffer[48], uint offset) { [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_5(u, 0u)); - tint_symbol_1(s, 192u, tint_symbol_6(u, 384u)); - tint_symbol_3(s, 592u, tint_symbol_8(u, 400u)); + s_store(0u, u_load(0u)); + s_store_1(192u, u_load_1(384u)); + s_store_3(592u, u_load_3(400u)); s.Store3(208u, asuint(asfloat(u[2].xyz).zxy)); return; } diff --git a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_workgroup.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_workgroup.wgsl.expected.dxc.hlsl index 11ebf40498..c75730bd46 100644 --- a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_workgroup.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_workgroup.wgsl.expected.dxc.hlsl @@ -13,27 +13,27 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -float4x3 tint_symbol_5(uint4 buffer[48], uint offset) { +float4x3 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz)); + return float4x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz), asfloat(u[scalar_offset_3 / 4].xyz)); } -S tint_symbol_3(uint4 buffer[48], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_4 = ((offset + 0u)) / 4; const uint scalar_offset_5 = ((offset + 128u)) / 4; - const S tint_symbol_8 = {asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), tint_symbol_5(buffer, (offset + 16u)), asint(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4])}; - return tint_symbol_8; + const S tint_symbol_3 = {asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4]), u_load_3((offset + 16u)), asint(u[scalar_offset_5 / 4][scalar_offset_5 % 4])}; + return tint_symbol_3; } -typedef S tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[48], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_3(buffer, (offset + (i_1 * 192u))); + arr[i_1] = u_load_1((offset + (i_1 * 192u))); } } return arr; @@ -43,14 +43,14 @@ void f_inner(uint local_invocation_index) { { for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) { const uint i = idx; - const S tint_symbol_7 = (S)0; - w[i] = tint_symbol_7; + const S tint_symbol_2 = (S)0; + w[i] = tint_symbol_2; } } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); - w[1] = tint_symbol_3(u, 384u); - w[3].m = tint_symbol_5(u, 400u); + w = u_load(0u); + w[1] = u_load_1(384u); + w[3].m = u_load_3(400u); w[1].m[0] = asfloat(u[2].xyz).zxy; } diff --git a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_workgroup.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_workgroup.wgsl.expected.fxc.hlsl index 11ebf40498..c75730bd46 100644 --- a/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_workgroup.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat4x3_f32/to_workgroup.wgsl.expected.fxc.hlsl @@ -13,27 +13,27 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -float4x3 tint_symbol_5(uint4 buffer[48], uint offset) { +float4x3 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz)); + return float4x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz), asfloat(u[scalar_offset_3 / 4].xyz)); } -S tint_symbol_3(uint4 buffer[48], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_4 = ((offset + 0u)) / 4; const uint scalar_offset_5 = ((offset + 128u)) / 4; - const S tint_symbol_8 = {asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), tint_symbol_5(buffer, (offset + 16u)), asint(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4])}; - return tint_symbol_8; + const S tint_symbol_3 = {asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4]), u_load_3((offset + 16u)), asint(u[scalar_offset_5 / 4][scalar_offset_5 % 4])}; + return tint_symbol_3; } -typedef S tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[48], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_3(buffer, (offset + (i_1 * 192u))); + arr[i_1] = u_load_1((offset + (i_1 * 192u))); } } return arr; @@ -43,14 +43,14 @@ void f_inner(uint local_invocation_index) { { for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) { const uint i = idx; - const S tint_symbol_7 = (S)0; - w[i] = tint_symbol_7; + const S tint_symbol_2 = (S)0; + w[i] = tint_symbol_2; } } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); - w[1] = tint_symbol_3(u, 384u); - w[3].m = tint_symbol_5(u, 400u); + w = u_load(0u); + w[1] = u_load_1(384u); + w[3].m = u_load_3(400u); w[1].m[0] = asfloat(u[2].xyz).zxy; } diff --git a/test/tint/buffer/uniform/std140/struct/mat4x4_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat4x4_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl index c0fa0aa6d5..5693c96f5e 100644 --- a/test/tint/buffer/uniform/std140/struct/mat4x4_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat4x4_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl @@ -15,57 +15,57 @@ int i() { return counter; } -matrix tint_symbol_8(uint4 buffer[64], uint offset) { +matrix a_load_4(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = a[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = a[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); vector ubo_load_2_yw = vector(f16tof32(ubo_load_2 >> 16)); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = a[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); vector ubo_load_4_yw = vector(f16tof32(ubo_load_4 >> 16)); const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_7 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_7 = a[scalar_offset_3 / 4]; uint2 ubo_load_6 = ((scalar_offset_3 & 2) ? ubo_load_7.zw : ubo_load_7.xy); vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); vector ubo_load_6_yw = vector(f16tof32(ubo_load_6 >> 16)); return matrix(vector(ubo_load_xz[0], ubo_load_yw[0], ubo_load_xz[1], ubo_load_yw[1]), vector(ubo_load_2_xz[0], ubo_load_2_yw[0], ubo_load_2_xz[1], ubo_load_2_yw[1]), vector(ubo_load_4_xz[0], ubo_load_4_yw[0], ubo_load_4_xz[1], ubo_load_4_yw[1]), vector(ubo_load_6_xz[0], ubo_load_6_yw[0], ubo_load_6_xz[1], ubo_load_6_yw[1])); } -Inner tint_symbol_7(uint4 buffer[64], uint offset) { - const Inner tint_symbol_11 = {tint_symbol_8(buffer, (offset + 0u))}; - return tint_symbol_11; +Inner a_load_3(uint offset) { + const Inner tint_symbol_4 = {a_load_4((offset + 0u))}; + return tint_symbol_4; } -typedef Inner tint_symbol_6_ret[4]; -tint_symbol_6_ret tint_symbol_6(uint4 buffer[64], uint offset) { +typedef Inner a_load_2_ret[4]; +a_load_2_ret a_load_2(uint offset) { Inner arr[4] = (Inner[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_7(buffer, (offset + (i_1 * 64u))); + arr[i_1] = a_load_3((offset + (i_1 * 64u))); } } return arr; } -Outer tint_symbol_5(uint4 buffer[64], uint offset) { - const Outer tint_symbol_12 = {tint_symbol_6(buffer, (offset + 0u))}; - return tint_symbol_12; +Outer a_load_1(uint offset) { + const Outer tint_symbol_5 = {a_load_2((offset + 0u))}; + return tint_symbol_5; } -typedef Outer tint_symbol_4_ret[4]; -tint_symbol_4_ret tint_symbol_4(uint4 buffer[64], uint offset) { +typedef Outer a_load_ret[4]; +a_load_ret a_load(uint offset) { Outer arr_1[4] = (Outer[4])0; { for(uint i_2 = 0u; (i_2 < 4u); i_2 = (i_2 + 1u)) { - arr_1[i_2] = tint_symbol_5(buffer, (offset + (i_2 * 256u))); + arr_1[i_2] = a_load_1((offset + (i_2 * 256u))); } } return arr_1; @@ -76,11 +76,11 @@ void f() { const int p_a_i_save = i(); const int p_a_i_a_i_save = i(); const int p_a_i_a_i_m_i_save = i(); - const Outer l_a[4] = tint_symbol_4(a, 0u); - const Outer l_a_i = tint_symbol_5(a, (256u * uint(p_a_i_save))); - const Inner l_a_i_a[4] = tint_symbol_6(a, (256u * uint(p_a_i_save))); - const Inner l_a_i_a_i = tint_symbol_7(a, ((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); - const matrix l_a_i_a_i_m = tint_symbol_8(a, ((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); + const Outer l_a[4] = a_load(0u); + const Outer l_a_i = a_load_1((256u * uint(p_a_i_save))); + const Inner l_a_i_a[4] = a_load_2((256u * uint(p_a_i_save))); + const Inner l_a_i_a_i = a_load_3(((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); + const matrix l_a_i_a_i_m = a_load_4(((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); const uint scalar_offset_4 = ((((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save))) + (8u * uint(p_a_i_a_i_m_i_save)))) / 4; uint4 ubo_load_9 = a[scalar_offset_4 / 4]; uint2 ubo_load_8 = ((scalar_offset_4 & 2) ? ubo_load_9.zw : ubo_load_9.xy); diff --git a/test/tint/buffer/uniform/std140/struct/mat4x4_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat4x4_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl index 5af54cf8b4..a4113d0c01 100644 --- a/test/tint/buffer/uniform/std140/struct/mat4x4_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat4x4_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl @@ -9,57 +9,57 @@ cbuffer cbuffer_a : register(b0, space0) { uint4 a[64]; }; -matrix tint_symbol_4(uint4 buffer[64], uint offset) { +matrix a_load_4(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = a[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = a[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); vector ubo_load_2_yw = vector(f16tof32(ubo_load_2 >> 16)); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = a[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); vector ubo_load_4_yw = vector(f16tof32(ubo_load_4 >> 16)); const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_7 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_7 = a[scalar_offset_3 / 4]; uint2 ubo_load_6 = ((scalar_offset_3 & 2) ? ubo_load_7.zw : ubo_load_7.xy); vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); vector ubo_load_6_yw = vector(f16tof32(ubo_load_6 >> 16)); return matrix(vector(ubo_load_xz[0], ubo_load_yw[0], ubo_load_xz[1], ubo_load_yw[1]), vector(ubo_load_2_xz[0], ubo_load_2_yw[0], ubo_load_2_xz[1], ubo_load_2_yw[1]), vector(ubo_load_4_xz[0], ubo_load_4_yw[0], ubo_load_4_xz[1], ubo_load_4_yw[1]), vector(ubo_load_6_xz[0], ubo_load_6_yw[0], ubo_load_6_xz[1], ubo_load_6_yw[1])); } -Inner tint_symbol_3(uint4 buffer[64], uint offset) { - const Inner tint_symbol_7 = {tint_symbol_4(buffer, (offset + 0u))}; - return tint_symbol_7; +Inner a_load_3(uint offset) { + const Inner tint_symbol = {a_load_4((offset + 0u))}; + return tint_symbol; } -typedef Inner tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[64], uint offset) { +typedef Inner a_load_2_ret[4]; +a_load_2_ret a_load_2(uint offset) { Inner arr[4] = (Inner[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_3(buffer, (offset + (i * 64u))); + arr[i] = a_load_3((offset + (i * 64u))); } } return arr; } -Outer tint_symbol_1(uint4 buffer[64], uint offset) { - const Outer tint_symbol_8 = {tint_symbol_2(buffer, (offset + 0u))}; - return tint_symbol_8; +Outer a_load_1(uint offset) { + const Outer tint_symbol_1 = {a_load_2((offset + 0u))}; + return tint_symbol_1; } -typedef Outer tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[64], uint offset) { +typedef Outer a_load_ret[4]; +a_load_ret a_load(uint offset) { Outer arr_1[4] = (Outer[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr_1[i_1] = tint_symbol_1(buffer, (offset + (i_1 * 256u))); + arr_1[i_1] = a_load_1((offset + (i_1 * 256u))); } } return arr_1; @@ -67,11 +67,11 @@ tint_symbol_ret tint_symbol(uint4 buffer[64], uint offset) { [numthreads(1, 1, 1)] void f() { - const Outer l_a[4] = tint_symbol(a, 0u); - const Outer l_a_3 = tint_symbol_1(a, 768u); - const Inner l_a_3_a[4] = tint_symbol_2(a, 768u); - const Inner l_a_3_a_2 = tint_symbol_3(a, 896u); - const matrix l_a_3_a_2_m = tint_symbol_4(a, 896u); + const Outer l_a[4] = a_load(0u); + const Outer l_a_3 = a_load_1(768u); + const Inner l_a_3_a[4] = a_load_2(768u); + const Inner l_a_3_a_2 = a_load_3(896u); + const matrix l_a_3_a_2_m = a_load_4(896u); uint2 ubo_load_8 = a[56].zw; vector ubo_load_8_xz = vector(f16tof32(ubo_load_8 & 0xFFFF)); vector ubo_load_8_yw = vector(f16tof32(ubo_load_8 >> 16)); diff --git a/test/tint/buffer/uniform/std140/struct/mat4x4_f16/to_builtin.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat4x4_f16/to_builtin.wgsl.expected.dxc.hlsl index fdce8e0732..0862cbb977 100644 --- a/test/tint/buffer/uniform/std140/struct/mat4x4_f16/to_builtin.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat4x4_f16/to_builtin.wgsl.expected.dxc.hlsl @@ -2,24 +2,24 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[32]; }; -matrix tint_symbol(uint4 buffer[32], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); vector ubo_load_2_yw = vector(f16tof32(ubo_load_2 >> 16)); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = u[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); vector ubo_load_4_yw = vector(f16tof32(ubo_load_4 >> 16)); const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_7 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_7 = u[scalar_offset_3 / 4]; uint2 ubo_load_6 = ((scalar_offset_3 & 2) ? ubo_load_7.zw : ubo_load_7.xy); vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); vector ubo_load_6_yw = vector(f16tof32(ubo_load_6 >> 16)); @@ -28,7 +28,7 @@ matrix tint_symbol(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - const matrix t = transpose(tint_symbol(u, 264u)); + const matrix t = transpose(u_load(264u)); uint2 ubo_load_8 = u[1].xy; vector ubo_load_8_xz = vector(f16tof32(ubo_load_8 & 0xFFFF)); vector ubo_load_8_yw = vector(f16tof32(ubo_load_8 >> 16)); diff --git a/test/tint/buffer/uniform/std140/struct/mat4x4_f16/to_fn.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat4x4_f16/to_fn.wgsl.expected.dxc.hlsl index 9b871b4361..d2a32b08dd 100644 --- a/test/tint/buffer/uniform/std140/struct/mat4x4_f16/to_fn.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat4x4_f16/to_fn.wgsl.expected.dxc.hlsl @@ -23,43 +23,43 @@ void d(vector v) { void e(float16_t f_1) { } -matrix tint_symbol_3(uint4 buffer[32], uint offset) { +matrix u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); vector ubo_load_2_yw = vector(f16tof32(ubo_load_2 >> 16)); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = u[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); vector ubo_load_4_yw = vector(f16tof32(ubo_load_4 >> 16)); const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_7 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_7 = u[scalar_offset_3 / 4]; uint2 ubo_load_6 = ((scalar_offset_3 & 2) ? ubo_load_7.zw : ubo_load_7.xy); vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); vector ubo_load_6_yw = vector(f16tof32(ubo_load_6 >> 16)); return matrix(vector(ubo_load_xz[0], ubo_load_yw[0], ubo_load_xz[1], ubo_load_yw[1]), vector(ubo_load_2_xz[0], ubo_load_2_yw[0], ubo_load_2_xz[1], ubo_load_2_yw[1]), vector(ubo_load_4_xz[0], ubo_load_4_yw[0], ubo_load_4_xz[1], ubo_load_4_yw[1]), vector(ubo_load_6_xz[0], ubo_load_6_yw[0], ubo_load_6_xz[1], ubo_load_6_yw[1])); } -S tint_symbol_1(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_4 = ((offset + 0u)) / 4; const uint scalar_offset_5 = ((offset + 64u)) / 4; - const S tint_symbol_5 = {asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), tint_symbol_3(buffer, (offset + 8u)), asint(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4])}; - return tint_symbol_5; + const S tint_symbol = {asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4]), u_load_3((offset + 8u)), asint(u[scalar_offset_5 / 4][scalar_offset_5 % 4])}; + return tint_symbol; } -typedef S tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 128u))); + arr[i] = u_load_1((offset + (i * 128u))); } } return arr; @@ -67,9 +67,9 @@ tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); - b(tint_symbol_1(u, 256u)); - c(tint_symbol_3(u, 264u)); + a(u_load(0u)); + b(u_load_1(256u)); + c(u_load_3(264u)); uint2 ubo_load_8 = u[1].xy; vector ubo_load_8_xz = vector(f16tof32(ubo_load_8 & 0xFFFF)); vector ubo_load_8_yw = vector(f16tof32(ubo_load_8 >> 16)); diff --git a/test/tint/buffer/uniform/std140/struct/mat4x4_f16/to_private.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat4x4_f16/to_private.wgsl.expected.dxc.hlsl index 8b11bb5d4a..dab85ac21f 100644 --- a/test/tint/buffer/uniform/std140/struct/mat4x4_f16/to_private.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat4x4_f16/to_private.wgsl.expected.dxc.hlsl @@ -9,43 +9,43 @@ cbuffer cbuffer_u : register(b0, space0) { }; static S p[4] = (S[4])0; -matrix tint_symbol_3(uint4 buffer[32], uint offset) { +matrix u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); vector ubo_load_2_yw = vector(f16tof32(ubo_load_2 >> 16)); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = u[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); vector ubo_load_4_yw = vector(f16tof32(ubo_load_4 >> 16)); const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_7 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_7 = u[scalar_offset_3 / 4]; uint2 ubo_load_6 = ((scalar_offset_3 & 2) ? ubo_load_7.zw : ubo_load_7.xy); vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); vector ubo_load_6_yw = vector(f16tof32(ubo_load_6 >> 16)); return matrix(vector(ubo_load_xz[0], ubo_load_yw[0], ubo_load_xz[1], ubo_load_yw[1]), vector(ubo_load_2_xz[0], ubo_load_2_yw[0], ubo_load_2_xz[1], ubo_load_2_yw[1]), vector(ubo_load_4_xz[0], ubo_load_4_yw[0], ubo_load_4_xz[1], ubo_load_4_yw[1]), vector(ubo_load_6_xz[0], ubo_load_6_yw[0], ubo_load_6_xz[1], ubo_load_6_yw[1])); } -S tint_symbol_1(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_4 = ((offset + 0u)) / 4; const uint scalar_offset_5 = ((offset + 64u)) / 4; - const S tint_symbol_5 = {asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), tint_symbol_3(buffer, (offset + 8u)), asint(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4])}; - return tint_symbol_5; + const S tint_symbol = {asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4]), u_load_3((offset + 8u)), asint(u[scalar_offset_5 / 4][scalar_offset_5 % 4])}; + return tint_symbol; } -typedef S tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 128u))); + arr[i] = u_load_1((offset + (i * 128u))); } } return arr; @@ -53,9 +53,9 @@ tint_symbol_ret tint_symbol(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); - p[1] = tint_symbol_1(u, 256u); - p[3].m = tint_symbol_3(u, 264u); + p = u_load(0u); + p[1] = u_load_1(256u); + p[3].m = u_load_3(264u); uint2 ubo_load_8 = u[1].xy; vector ubo_load_8_xz = vector(f16tof32(ubo_load_8 & 0xFFFF)); vector ubo_load_8_yw = vector(f16tof32(ubo_load_8 >> 16)); diff --git a/test/tint/buffer/uniform/std140/struct/mat4x4_f16/to_storage.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat4x4_f16/to_storage.wgsl.expected.dxc.hlsl index 4ec616b615..5f4c7bb4b6 100644 --- a/test/tint/buffer/uniform/std140/struct/mat4x4_f16/to_storage.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat4x4_f16/to_storage.wgsl.expected.dxc.hlsl @@ -9,65 +9,65 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol_3(RWByteAddressBuffer buffer, uint offset, matrix value) { - buffer.Store >((offset + 0u), value[0u]); - buffer.Store >((offset + 8u), value[1u]); - buffer.Store >((offset + 16u), value[2u]); - buffer.Store >((offset + 24u), value[3u]); +void s_store_3(uint offset, matrix value) { + s.Store >((offset + 0u), value[0u]); + s.Store >((offset + 8u), value[1u]); + s.Store >((offset + 16u), value[2u]); + s.Store >((offset + 24u), value[3u]); } -void tint_symbol_1(RWByteAddressBuffer buffer, uint offset, S value) { - buffer.Store((offset + 0u), asuint(value.before)); - tint_symbol_3(buffer, (offset + 8u), value.m); - buffer.Store((offset + 64u), asuint(value.after)); +void s_store_1(uint offset, S value) { + s.Store((offset + 0u), asuint(value.before)); + s_store_3((offset + 8u), value.m); + s.Store((offset + 64u), asuint(value.after)); } -void tint_symbol(RWByteAddressBuffer buffer, uint offset, S value[4]) { +void s_store(uint offset, S value[4]) { S array_1[4] = value; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - tint_symbol_1(buffer, (offset + (i * 128u)), array_1[i]); + s_store_1((offset + (i * 128u)), array_1[i]); } } } -matrix tint_symbol_8(uint4 buffer[32], uint offset) { +matrix u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); vector ubo_load_2_yw = vector(f16tof32(ubo_load_2 >> 16)); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = u[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); vector ubo_load_4_yw = vector(f16tof32(ubo_load_4 >> 16)); const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_7 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_7 = u[scalar_offset_3 / 4]; uint2 ubo_load_6 = ((scalar_offset_3 & 2) ? ubo_load_7.zw : ubo_load_7.xy); vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); vector ubo_load_6_yw = vector(f16tof32(ubo_load_6 >> 16)); return matrix(vector(ubo_load_xz[0], ubo_load_yw[0], ubo_load_xz[1], ubo_load_yw[1]), vector(ubo_load_2_xz[0], ubo_load_2_yw[0], ubo_load_2_xz[1], ubo_load_2_yw[1]), vector(ubo_load_4_xz[0], ubo_load_4_yw[0], ubo_load_4_xz[1], ubo_load_4_yw[1]), vector(ubo_load_6_xz[0], ubo_load_6_yw[0], ubo_load_6_xz[1], ubo_load_6_yw[1])); } -S tint_symbol_6(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_4 = ((offset + 0u)) / 4; const uint scalar_offset_5 = ((offset + 64u)) / 4; - const S tint_symbol_10 = {asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), tint_symbol_8(buffer, (offset + 8u)), asint(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4])}; - return tint_symbol_10; + const S tint_symbol = {asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4]), u_load_3((offset + 8u)), asint(u[scalar_offset_5 / 4][scalar_offset_5 % 4])}; + return tint_symbol; } -typedef S tint_symbol_5_ret[4]; -tint_symbol_5_ret tint_symbol_5(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_6(buffer, (offset + (i_1 * 128u))); + arr[i_1] = u_load_1((offset + (i_1 * 128u))); } } return arr; @@ -75,9 +75,9 @@ tint_symbol_5_ret tint_symbol_5(uint4 buffer[32], uint offset) { [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_5(u, 0u)); - tint_symbol_1(s, 128u, tint_symbol_6(u, 256u)); - tint_symbol_3(s, 392u, tint_symbol_8(u, 264u)); + s_store(0u, u_load(0u)); + s_store_1(128u, u_load_1(256u)); + s_store_3(392u, u_load_3(264u)); uint2 ubo_load_8 = u[1].xy; vector ubo_load_8_xz = vector(f16tof32(ubo_load_8 & 0xFFFF)); vector ubo_load_8_yw = vector(f16tof32(ubo_load_8 >> 16)); diff --git a/test/tint/buffer/uniform/std140/struct/mat4x4_f16/to_workgroup.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat4x4_f16/to_workgroup.wgsl.expected.dxc.hlsl index 45f86b8d07..89c43ae392 100644 --- a/test/tint/buffer/uniform/std140/struct/mat4x4_f16/to_workgroup.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat4x4_f16/to_workgroup.wgsl.expected.dxc.hlsl @@ -13,43 +13,43 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -matrix tint_symbol_5(uint4 buffer[32], uint offset) { +matrix u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); vector ubo_load_2_yw = vector(f16tof32(ubo_load_2 >> 16)); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = u[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); vector ubo_load_4_yw = vector(f16tof32(ubo_load_4 >> 16)); const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_7 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_7 = u[scalar_offset_3 / 4]; uint2 ubo_load_6 = ((scalar_offset_3 & 2) ? ubo_load_7.zw : ubo_load_7.xy); vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); vector ubo_load_6_yw = vector(f16tof32(ubo_load_6 >> 16)); return matrix(vector(ubo_load_xz[0], ubo_load_yw[0], ubo_load_xz[1], ubo_load_yw[1]), vector(ubo_load_2_xz[0], ubo_load_2_yw[0], ubo_load_2_xz[1], ubo_load_2_yw[1]), vector(ubo_load_4_xz[0], ubo_load_4_yw[0], ubo_load_4_xz[1], ubo_load_4_yw[1]), vector(ubo_load_6_xz[0], ubo_load_6_yw[0], ubo_load_6_xz[1], ubo_load_6_yw[1])); } -S tint_symbol_3(uint4 buffer[32], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_4 = ((offset + 0u)) / 4; const uint scalar_offset_5 = ((offset + 64u)) / 4; - const S tint_symbol_8 = {asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), tint_symbol_5(buffer, (offset + 8u)), asint(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4])}; - return tint_symbol_8; + const S tint_symbol_3 = {asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4]), u_load_3((offset + 8u)), asint(u[scalar_offset_5 / 4][scalar_offset_5 % 4])}; + return tint_symbol_3; } -typedef S tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[32], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_3(buffer, (offset + (i_1 * 128u))); + arr[i_1] = u_load_1((offset + (i_1 * 128u))); } } return arr; @@ -59,14 +59,14 @@ void f_inner(uint local_invocation_index) { { for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) { const uint i = idx; - const S tint_symbol_7 = (S)0; - w[i] = tint_symbol_7; + const S tint_symbol_2 = (S)0; + w[i] = tint_symbol_2; } } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); - w[1] = tint_symbol_3(u, 256u); - w[3].m = tint_symbol_5(u, 264u); + w = u_load(0u); + w[1] = u_load_1(256u); + w[3].m = u_load_3(264u); uint2 ubo_load_8 = u[1].xy; vector ubo_load_8_xz = vector(f16tof32(ubo_load_8 & 0xFFFF)); vector ubo_load_8_yw = vector(f16tof32(ubo_load_8 >> 16)); diff --git a/test/tint/buffer/uniform/std140/struct/mat4x4_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat4x4_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl index 00296471b1..98da6df09e 100644 --- a/test/tint/buffer/uniform/std140/struct/mat4x4_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat4x4_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl @@ -15,41 +15,41 @@ int i() { return counter; } -float4x4 tint_symbol_8(uint4 buffer[64], uint offset) { +float4x4 a_load_4(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]), asfloat(buffer[scalar_offset_3 / 4])); + return float4x4(asfloat(a[scalar_offset / 4]), asfloat(a[scalar_offset_1 / 4]), asfloat(a[scalar_offset_2 / 4]), asfloat(a[scalar_offset_3 / 4])); } -Inner tint_symbol_7(uint4 buffer[64], uint offset) { - const Inner tint_symbol_11 = {tint_symbol_8(buffer, (offset + 0u))}; - return tint_symbol_11; +Inner a_load_3(uint offset) { + const Inner tint_symbol_4 = {a_load_4((offset + 0u))}; + return tint_symbol_4; } -typedef Inner tint_symbol_6_ret[4]; -tint_symbol_6_ret tint_symbol_6(uint4 buffer[64], uint offset) { +typedef Inner a_load_2_ret[4]; +a_load_2_ret a_load_2(uint offset) { Inner arr[4] = (Inner[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_7(buffer, (offset + (i_1 * 64u))); + arr[i_1] = a_load_3((offset + (i_1 * 64u))); } } return arr; } -Outer tint_symbol_5(uint4 buffer[64], uint offset) { - const Outer tint_symbol_12 = {tint_symbol_6(buffer, (offset + 0u))}; - return tint_symbol_12; +Outer a_load_1(uint offset) { + const Outer tint_symbol_5 = {a_load_2((offset + 0u))}; + return tint_symbol_5; } -typedef Outer tint_symbol_4_ret[4]; -tint_symbol_4_ret tint_symbol_4(uint4 buffer[64], uint offset) { +typedef Outer a_load_ret[4]; +a_load_ret a_load(uint offset) { Outer arr_1[4] = (Outer[4])0; { for(uint i_2 = 0u; (i_2 < 4u); i_2 = (i_2 + 1u)) { - arr_1[i_2] = tint_symbol_5(buffer, (offset + (i_2 * 256u))); + arr_1[i_2] = a_load_1((offset + (i_2 * 256u))); } } return arr_1; @@ -60,11 +60,11 @@ void f() { const int p_a_i_save = i(); const int p_a_i_a_i_save = i(); const int p_a_i_a_i_m_i_save = i(); - const Outer l_a[4] = tint_symbol_4(a, 0u); - const Outer l_a_i = tint_symbol_5(a, (256u * uint(p_a_i_save))); - const Inner l_a_i_a[4] = tint_symbol_6(a, (256u * uint(p_a_i_save))); - const Inner l_a_i_a_i = tint_symbol_7(a, ((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); - const float4x4 l_a_i_a_i_m = tint_symbol_8(a, ((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); + const Outer l_a[4] = a_load(0u); + const Outer l_a_i = a_load_1((256u * uint(p_a_i_save))); + const Inner l_a_i_a[4] = a_load_2((256u * uint(p_a_i_save))); + const Inner l_a_i_a_i = a_load_3(((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); + const float4x4 l_a_i_a_i_m = a_load_4(((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); const uint scalar_offset_4 = ((((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save))) + (16u * uint(p_a_i_a_i_m_i_save)))) / 4; const float4 l_a_i_a_i_m_i = asfloat(a[scalar_offset_4 / 4]); const int tint_symbol = p_a_i_save; diff --git a/test/tint/buffer/uniform/std140/struct/mat4x4_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat4x4_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl index 00296471b1..98da6df09e 100644 --- a/test/tint/buffer/uniform/std140/struct/mat4x4_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat4x4_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl @@ -15,41 +15,41 @@ int i() { return counter; } -float4x4 tint_symbol_8(uint4 buffer[64], uint offset) { +float4x4 a_load_4(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]), asfloat(buffer[scalar_offset_3 / 4])); + return float4x4(asfloat(a[scalar_offset / 4]), asfloat(a[scalar_offset_1 / 4]), asfloat(a[scalar_offset_2 / 4]), asfloat(a[scalar_offset_3 / 4])); } -Inner tint_symbol_7(uint4 buffer[64], uint offset) { - const Inner tint_symbol_11 = {tint_symbol_8(buffer, (offset + 0u))}; - return tint_symbol_11; +Inner a_load_3(uint offset) { + const Inner tint_symbol_4 = {a_load_4((offset + 0u))}; + return tint_symbol_4; } -typedef Inner tint_symbol_6_ret[4]; -tint_symbol_6_ret tint_symbol_6(uint4 buffer[64], uint offset) { +typedef Inner a_load_2_ret[4]; +a_load_2_ret a_load_2(uint offset) { Inner arr[4] = (Inner[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_7(buffer, (offset + (i_1 * 64u))); + arr[i_1] = a_load_3((offset + (i_1 * 64u))); } } return arr; } -Outer tint_symbol_5(uint4 buffer[64], uint offset) { - const Outer tint_symbol_12 = {tint_symbol_6(buffer, (offset + 0u))}; - return tint_symbol_12; +Outer a_load_1(uint offset) { + const Outer tint_symbol_5 = {a_load_2((offset + 0u))}; + return tint_symbol_5; } -typedef Outer tint_symbol_4_ret[4]; -tint_symbol_4_ret tint_symbol_4(uint4 buffer[64], uint offset) { +typedef Outer a_load_ret[4]; +a_load_ret a_load(uint offset) { Outer arr_1[4] = (Outer[4])0; { for(uint i_2 = 0u; (i_2 < 4u); i_2 = (i_2 + 1u)) { - arr_1[i_2] = tint_symbol_5(buffer, (offset + (i_2 * 256u))); + arr_1[i_2] = a_load_1((offset + (i_2 * 256u))); } } return arr_1; @@ -60,11 +60,11 @@ void f() { const int p_a_i_save = i(); const int p_a_i_a_i_save = i(); const int p_a_i_a_i_m_i_save = i(); - const Outer l_a[4] = tint_symbol_4(a, 0u); - const Outer l_a_i = tint_symbol_5(a, (256u * uint(p_a_i_save))); - const Inner l_a_i_a[4] = tint_symbol_6(a, (256u * uint(p_a_i_save))); - const Inner l_a_i_a_i = tint_symbol_7(a, ((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); - const float4x4 l_a_i_a_i_m = tint_symbol_8(a, ((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); + const Outer l_a[4] = a_load(0u); + const Outer l_a_i = a_load_1((256u * uint(p_a_i_save))); + const Inner l_a_i_a[4] = a_load_2((256u * uint(p_a_i_save))); + const Inner l_a_i_a_i = a_load_3(((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); + const float4x4 l_a_i_a_i_m = a_load_4(((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save)))); const uint scalar_offset_4 = ((((256u * uint(p_a_i_save)) + (64u * uint(p_a_i_a_i_save))) + (16u * uint(p_a_i_a_i_m_i_save)))) / 4; const float4 l_a_i_a_i_m_i = asfloat(a[scalar_offset_4 / 4]); const int tint_symbol = p_a_i_save; diff --git a/test/tint/buffer/uniform/std140/struct/mat4x4_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat4x4_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl index 045c9d30fc..87c51a7319 100644 --- a/test/tint/buffer/uniform/std140/struct/mat4x4_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat4x4_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl @@ -9,41 +9,41 @@ cbuffer cbuffer_a : register(b0, space0) { uint4 a[64]; }; -float4x4 tint_symbol_4(uint4 buffer[64], uint offset) { +float4x4 a_load_4(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]), asfloat(buffer[scalar_offset_3 / 4])); + return float4x4(asfloat(a[scalar_offset / 4]), asfloat(a[scalar_offset_1 / 4]), asfloat(a[scalar_offset_2 / 4]), asfloat(a[scalar_offset_3 / 4])); } -Inner tint_symbol_3(uint4 buffer[64], uint offset) { - const Inner tint_symbol_7 = {tint_symbol_4(buffer, (offset + 0u))}; - return tint_symbol_7; +Inner a_load_3(uint offset) { + const Inner tint_symbol = {a_load_4((offset + 0u))}; + return tint_symbol; } -typedef Inner tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[64], uint offset) { +typedef Inner a_load_2_ret[4]; +a_load_2_ret a_load_2(uint offset) { Inner arr[4] = (Inner[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_3(buffer, (offset + (i * 64u))); + arr[i] = a_load_3((offset + (i * 64u))); } } return arr; } -Outer tint_symbol_1(uint4 buffer[64], uint offset) { - const Outer tint_symbol_8 = {tint_symbol_2(buffer, (offset + 0u))}; - return tint_symbol_8; +Outer a_load_1(uint offset) { + const Outer tint_symbol_1 = {a_load_2((offset + 0u))}; + return tint_symbol_1; } -typedef Outer tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[64], uint offset) { +typedef Outer a_load_ret[4]; +a_load_ret a_load(uint offset) { Outer arr_1[4] = (Outer[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr_1[i_1] = tint_symbol_1(buffer, (offset + (i_1 * 256u))); + arr_1[i_1] = a_load_1((offset + (i_1 * 256u))); } } return arr_1; @@ -51,11 +51,11 @@ tint_symbol_ret tint_symbol(uint4 buffer[64], uint offset) { [numthreads(1, 1, 1)] void f() { - const Outer l_a[4] = tint_symbol(a, 0u); - const Outer l_a_3 = tint_symbol_1(a, 768u); - const Inner l_a_3_a[4] = tint_symbol_2(a, 768u); - const Inner l_a_3_a_2 = tint_symbol_3(a, 896u); - const float4x4 l_a_3_a_2_m = tint_symbol_4(a, 896u); + const Outer l_a[4] = a_load(0u); + const Outer l_a_3 = a_load_1(768u); + const Inner l_a_3_a[4] = a_load_2(768u); + const Inner l_a_3_a_2 = a_load_3(896u); + const float4x4 l_a_3_a_2_m = a_load_4(896u); const float4 l_a_3_a_2_m_1 = asfloat(a[57]); const float l_a_3_a_2_m_1_0 = asfloat(a[57].x); return; diff --git a/test/tint/buffer/uniform/std140/struct/mat4x4_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat4x4_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl index 045c9d30fc..87c51a7319 100644 --- a/test/tint/buffer/uniform/std140/struct/mat4x4_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat4x4_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl @@ -9,41 +9,41 @@ cbuffer cbuffer_a : register(b0, space0) { uint4 a[64]; }; -float4x4 tint_symbol_4(uint4 buffer[64], uint offset) { +float4x4 a_load_4(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]), asfloat(buffer[scalar_offset_3 / 4])); + return float4x4(asfloat(a[scalar_offset / 4]), asfloat(a[scalar_offset_1 / 4]), asfloat(a[scalar_offset_2 / 4]), asfloat(a[scalar_offset_3 / 4])); } -Inner tint_symbol_3(uint4 buffer[64], uint offset) { - const Inner tint_symbol_7 = {tint_symbol_4(buffer, (offset + 0u))}; - return tint_symbol_7; +Inner a_load_3(uint offset) { + const Inner tint_symbol = {a_load_4((offset + 0u))}; + return tint_symbol; } -typedef Inner tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[64], uint offset) { +typedef Inner a_load_2_ret[4]; +a_load_2_ret a_load_2(uint offset) { Inner arr[4] = (Inner[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_3(buffer, (offset + (i * 64u))); + arr[i] = a_load_3((offset + (i * 64u))); } } return arr; } -Outer tint_symbol_1(uint4 buffer[64], uint offset) { - const Outer tint_symbol_8 = {tint_symbol_2(buffer, (offset + 0u))}; - return tint_symbol_8; +Outer a_load_1(uint offset) { + const Outer tint_symbol_1 = {a_load_2((offset + 0u))}; + return tint_symbol_1; } -typedef Outer tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[64], uint offset) { +typedef Outer a_load_ret[4]; +a_load_ret a_load(uint offset) { Outer arr_1[4] = (Outer[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr_1[i_1] = tint_symbol_1(buffer, (offset + (i_1 * 256u))); + arr_1[i_1] = a_load_1((offset + (i_1 * 256u))); } } return arr_1; @@ -51,11 +51,11 @@ tint_symbol_ret tint_symbol(uint4 buffer[64], uint offset) { [numthreads(1, 1, 1)] void f() { - const Outer l_a[4] = tint_symbol(a, 0u); - const Outer l_a_3 = tint_symbol_1(a, 768u); - const Inner l_a_3_a[4] = tint_symbol_2(a, 768u); - const Inner l_a_3_a_2 = tint_symbol_3(a, 896u); - const float4x4 l_a_3_a_2_m = tint_symbol_4(a, 896u); + const Outer l_a[4] = a_load(0u); + const Outer l_a_3 = a_load_1(768u); + const Inner l_a_3_a[4] = a_load_2(768u); + const Inner l_a_3_a_2 = a_load_3(896u); + const float4x4 l_a_3_a_2_m = a_load_4(896u); const float4 l_a_3_a_2_m_1 = asfloat(a[57]); const float l_a_3_a_2_m_1_0 = asfloat(a[57].x); return; diff --git a/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_builtin.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_builtin.wgsl.expected.dxc.hlsl index 8748244589..eea3459591 100644 --- a/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_builtin.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_builtin.wgsl.expected.dxc.hlsl @@ -2,17 +2,17 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[48]; }; -float4x4 tint_symbol(uint4 buffer[48], uint offset) { +float4x4 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]), asfloat(buffer[scalar_offset_3 / 4])); + return float4x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4]), asfloat(u[scalar_offset_2 / 4]), asfloat(u[scalar_offset_3 / 4])); } [numthreads(1, 1, 1)] void f() { - const float4x4 t = transpose(tint_symbol(u, 400u)); + const float4x4 t = transpose(u_load(400u)); const float l = length(asfloat(u[2]).ywxz); const float a = abs(asfloat(u[2]).ywxz.x); return; diff --git a/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_builtin.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_builtin.wgsl.expected.fxc.hlsl index 8748244589..eea3459591 100644 --- a/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_builtin.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_builtin.wgsl.expected.fxc.hlsl @@ -2,17 +2,17 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[48]; }; -float4x4 tint_symbol(uint4 buffer[48], uint offset) { +float4x4 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]), asfloat(buffer[scalar_offset_3 / 4])); + return float4x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4]), asfloat(u[scalar_offset_2 / 4]), asfloat(u[scalar_offset_3 / 4])); } [numthreads(1, 1, 1)] void f() { - const float4x4 t = transpose(tint_symbol(u, 400u)); + const float4x4 t = transpose(u_load(400u)); const float l = length(asfloat(u[2]).ywxz); const float a = abs(asfloat(u[2]).ywxz.x); return; diff --git a/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_fn.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_fn.wgsl.expected.dxc.hlsl index 4aaff711eb..a722da6a74 100644 --- a/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_fn.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_fn.wgsl.expected.dxc.hlsl @@ -23,27 +23,27 @@ void d(float4 v) { void e(float f_1) { } -float4x4 tint_symbol_3(uint4 buffer[48], uint offset) { +float4x4 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]), asfloat(buffer[scalar_offset_3 / 4])); + return float4x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4]), asfloat(u[scalar_offset_2 / 4]), asfloat(u[scalar_offset_3 / 4])); } -S tint_symbol_1(uint4 buffer[48], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_4 = ((offset + 0u)) / 4; const uint scalar_offset_5 = ((offset + 128u)) / 4; - const S tint_symbol_5 = {asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), tint_symbol_3(buffer, (offset + 16u)), asint(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4])}; - return tint_symbol_5; + const S tint_symbol = {asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4]), u_load_3((offset + 16u)), asint(u[scalar_offset_5 / 4][scalar_offset_5 % 4])}; + return tint_symbol; } -typedef S tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[48], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 192u))); + arr[i] = u_load_1((offset + (i * 192u))); } } return arr; @@ -51,9 +51,9 @@ tint_symbol_ret tint_symbol(uint4 buffer[48], uint offset) { [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); - b(tint_symbol_1(u, 384u)); - c(tint_symbol_3(u, 400u)); + a(u_load(0u)); + b(u_load_1(384u)); + c(u_load_3(400u)); d(asfloat(u[2]).ywxz); e(asfloat(u[2]).ywxz.x); return; diff --git a/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_fn.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_fn.wgsl.expected.fxc.hlsl index 4aaff711eb..a722da6a74 100644 --- a/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_fn.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_fn.wgsl.expected.fxc.hlsl @@ -23,27 +23,27 @@ void d(float4 v) { void e(float f_1) { } -float4x4 tint_symbol_3(uint4 buffer[48], uint offset) { +float4x4 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]), asfloat(buffer[scalar_offset_3 / 4])); + return float4x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4]), asfloat(u[scalar_offset_2 / 4]), asfloat(u[scalar_offset_3 / 4])); } -S tint_symbol_1(uint4 buffer[48], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_4 = ((offset + 0u)) / 4; const uint scalar_offset_5 = ((offset + 128u)) / 4; - const S tint_symbol_5 = {asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), tint_symbol_3(buffer, (offset + 16u)), asint(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4])}; - return tint_symbol_5; + const S tint_symbol = {asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4]), u_load_3((offset + 16u)), asint(u[scalar_offset_5 / 4][scalar_offset_5 % 4])}; + return tint_symbol; } -typedef S tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[48], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 192u))); + arr[i] = u_load_1((offset + (i * 192u))); } } return arr; @@ -51,9 +51,9 @@ tint_symbol_ret tint_symbol(uint4 buffer[48], uint offset) { [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); - b(tint_symbol_1(u, 384u)); - c(tint_symbol_3(u, 400u)); + a(u_load(0u)); + b(u_load_1(384u)); + c(u_load_3(400u)); d(asfloat(u[2]).ywxz); e(asfloat(u[2]).ywxz.x); return; diff --git a/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_private.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_private.wgsl.expected.dxc.hlsl index be131209f5..86eea248fa 100644 --- a/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_private.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_private.wgsl.expected.dxc.hlsl @@ -9,27 +9,27 @@ cbuffer cbuffer_u : register(b0, space0) { }; static S p[4] = (S[4])0; -float4x4 tint_symbol_3(uint4 buffer[48], uint offset) { +float4x4 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]), asfloat(buffer[scalar_offset_3 / 4])); + return float4x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4]), asfloat(u[scalar_offset_2 / 4]), asfloat(u[scalar_offset_3 / 4])); } -S tint_symbol_1(uint4 buffer[48], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_4 = ((offset + 0u)) / 4; const uint scalar_offset_5 = ((offset + 128u)) / 4; - const S tint_symbol_5 = {asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), tint_symbol_3(buffer, (offset + 16u)), asint(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4])}; - return tint_symbol_5; + const S tint_symbol = {asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4]), u_load_3((offset + 16u)), asint(u[scalar_offset_5 / 4][scalar_offset_5 % 4])}; + return tint_symbol; } -typedef S tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[48], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 192u))); + arr[i] = u_load_1((offset + (i * 192u))); } } return arr; @@ -37,9 +37,9 @@ tint_symbol_ret tint_symbol(uint4 buffer[48], uint offset) { [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); - p[1] = tint_symbol_1(u, 384u); - p[3].m = tint_symbol_3(u, 400u); + p = u_load(0u); + p[1] = u_load_1(384u); + p[3].m = u_load_3(400u); p[1].m[0] = asfloat(u[2]).ywxz; return; } diff --git a/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_private.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_private.wgsl.expected.fxc.hlsl index be131209f5..86eea248fa 100644 --- a/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_private.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_private.wgsl.expected.fxc.hlsl @@ -9,27 +9,27 @@ cbuffer cbuffer_u : register(b0, space0) { }; static S p[4] = (S[4])0; -float4x4 tint_symbol_3(uint4 buffer[48], uint offset) { +float4x4 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]), asfloat(buffer[scalar_offset_3 / 4])); + return float4x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4]), asfloat(u[scalar_offset_2 / 4]), asfloat(u[scalar_offset_3 / 4])); } -S tint_symbol_1(uint4 buffer[48], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_4 = ((offset + 0u)) / 4; const uint scalar_offset_5 = ((offset + 128u)) / 4; - const S tint_symbol_5 = {asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), tint_symbol_3(buffer, (offset + 16u)), asint(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4])}; - return tint_symbol_5; + const S tint_symbol = {asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4]), u_load_3((offset + 16u)), asint(u[scalar_offset_5 / 4][scalar_offset_5 % 4])}; + return tint_symbol; } -typedef S tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[48], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr[i] = tint_symbol_1(buffer, (offset + (i * 192u))); + arr[i] = u_load_1((offset + (i * 192u))); } } return arr; @@ -37,9 +37,9 @@ tint_symbol_ret tint_symbol(uint4 buffer[48], uint offset) { [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); - p[1] = tint_symbol_1(u, 384u); - p[3].m = tint_symbol_3(u, 400u); + p = u_load(0u); + p[1] = u_load_1(384u); + p[3].m = u_load_3(400u); p[1].m[0] = asfloat(u[2]).ywxz; return; } diff --git a/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_storage.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_storage.wgsl.expected.dxc.hlsl index 9f194ab201..c88e221802 100644 --- a/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_storage.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_storage.wgsl.expected.dxc.hlsl @@ -9,49 +9,49 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol_3(RWByteAddressBuffer buffer, uint offset, float4x4 value) { - buffer.Store4((offset + 0u), asuint(value[0u])); - buffer.Store4((offset + 16u), asuint(value[1u])); - buffer.Store4((offset + 32u), asuint(value[2u])); - buffer.Store4((offset + 48u), asuint(value[3u])); +void s_store_3(uint offset, float4x4 value) { + s.Store4((offset + 0u), asuint(value[0u])); + s.Store4((offset + 16u), asuint(value[1u])); + s.Store4((offset + 32u), asuint(value[2u])); + s.Store4((offset + 48u), asuint(value[3u])); } -void tint_symbol_1(RWByteAddressBuffer buffer, uint offset, S value) { - buffer.Store((offset + 0u), asuint(value.before)); - tint_symbol_3(buffer, (offset + 16u), value.m); - buffer.Store((offset + 128u), asuint(value.after)); +void s_store_1(uint offset, S value) { + s.Store((offset + 0u), asuint(value.before)); + s_store_3((offset + 16u), value.m); + s.Store((offset + 128u), asuint(value.after)); } -void tint_symbol(RWByteAddressBuffer buffer, uint offset, S value[4]) { +void s_store(uint offset, S value[4]) { S array_1[4] = value; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - tint_symbol_1(buffer, (offset + (i * 192u)), array_1[i]); + s_store_1((offset + (i * 192u)), array_1[i]); } } } -float4x4 tint_symbol_8(uint4 buffer[48], uint offset) { +float4x4 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]), asfloat(buffer[scalar_offset_3 / 4])); + return float4x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4]), asfloat(u[scalar_offset_2 / 4]), asfloat(u[scalar_offset_3 / 4])); } -S tint_symbol_6(uint4 buffer[48], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_4 = ((offset + 0u)) / 4; const uint scalar_offset_5 = ((offset + 128u)) / 4; - const S tint_symbol_10 = {asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), tint_symbol_8(buffer, (offset + 16u)), asint(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4])}; - return tint_symbol_10; + const S tint_symbol = {asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4]), u_load_3((offset + 16u)), asint(u[scalar_offset_5 / 4][scalar_offset_5 % 4])}; + return tint_symbol; } -typedef S tint_symbol_5_ret[4]; -tint_symbol_5_ret tint_symbol_5(uint4 buffer[48], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_6(buffer, (offset + (i_1 * 192u))); + arr[i_1] = u_load_1((offset + (i_1 * 192u))); } } return arr; @@ -59,9 +59,9 @@ tint_symbol_5_ret tint_symbol_5(uint4 buffer[48], uint offset) { [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_5(u, 0u)); - tint_symbol_1(s, 192u, tint_symbol_6(u, 384u)); - tint_symbol_3(s, 592u, tint_symbol_8(u, 400u)); + s_store(0u, u_load(0u)); + s_store_1(192u, u_load_1(384u)); + s_store_3(592u, u_load_3(400u)); s.Store4(208u, asuint(asfloat(u[2]).ywxz)); return; } diff --git a/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_storage.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_storage.wgsl.expected.fxc.hlsl index 9f194ab201..c88e221802 100644 --- a/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_storage.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_storage.wgsl.expected.fxc.hlsl @@ -9,49 +9,49 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol_3(RWByteAddressBuffer buffer, uint offset, float4x4 value) { - buffer.Store4((offset + 0u), asuint(value[0u])); - buffer.Store4((offset + 16u), asuint(value[1u])); - buffer.Store4((offset + 32u), asuint(value[2u])); - buffer.Store4((offset + 48u), asuint(value[3u])); +void s_store_3(uint offset, float4x4 value) { + s.Store4((offset + 0u), asuint(value[0u])); + s.Store4((offset + 16u), asuint(value[1u])); + s.Store4((offset + 32u), asuint(value[2u])); + s.Store4((offset + 48u), asuint(value[3u])); } -void tint_symbol_1(RWByteAddressBuffer buffer, uint offset, S value) { - buffer.Store((offset + 0u), asuint(value.before)); - tint_symbol_3(buffer, (offset + 16u), value.m); - buffer.Store((offset + 128u), asuint(value.after)); +void s_store_1(uint offset, S value) { + s.Store((offset + 0u), asuint(value.before)); + s_store_3((offset + 16u), value.m); + s.Store((offset + 128u), asuint(value.after)); } -void tint_symbol(RWByteAddressBuffer buffer, uint offset, S value[4]) { +void s_store(uint offset, S value[4]) { S array_1[4] = value; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - tint_symbol_1(buffer, (offset + (i * 192u)), array_1[i]); + s_store_1((offset + (i * 192u)), array_1[i]); } } } -float4x4 tint_symbol_8(uint4 buffer[48], uint offset) { +float4x4 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]), asfloat(buffer[scalar_offset_3 / 4])); + return float4x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4]), asfloat(u[scalar_offset_2 / 4]), asfloat(u[scalar_offset_3 / 4])); } -S tint_symbol_6(uint4 buffer[48], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_4 = ((offset + 0u)) / 4; const uint scalar_offset_5 = ((offset + 128u)) / 4; - const S tint_symbol_10 = {asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), tint_symbol_8(buffer, (offset + 16u)), asint(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4])}; - return tint_symbol_10; + const S tint_symbol = {asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4]), u_load_3((offset + 16u)), asint(u[scalar_offset_5 / 4][scalar_offset_5 % 4])}; + return tint_symbol; } -typedef S tint_symbol_5_ret[4]; -tint_symbol_5_ret tint_symbol_5(uint4 buffer[48], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_6(buffer, (offset + (i_1 * 192u))); + arr[i_1] = u_load_1((offset + (i_1 * 192u))); } } return arr; @@ -59,9 +59,9 @@ tint_symbol_5_ret tint_symbol_5(uint4 buffer[48], uint offset) { [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_5(u, 0u)); - tint_symbol_1(s, 192u, tint_symbol_6(u, 384u)); - tint_symbol_3(s, 592u, tint_symbol_8(u, 400u)); + s_store(0u, u_load(0u)); + s_store_1(192u, u_load_1(384u)); + s_store_3(592u, u_load_3(400u)); s.Store4(208u, asuint(asfloat(u[2]).ywxz)); return; } diff --git a/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_workgroup.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_workgroup.wgsl.expected.dxc.hlsl index 5bf6274243..14e015d1ad 100644 --- a/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_workgroup.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_workgroup.wgsl.expected.dxc.hlsl @@ -13,27 +13,27 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -float4x4 tint_symbol_5(uint4 buffer[48], uint offset) { +float4x4 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]), asfloat(buffer[scalar_offset_3 / 4])); + return float4x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4]), asfloat(u[scalar_offset_2 / 4]), asfloat(u[scalar_offset_3 / 4])); } -S tint_symbol_3(uint4 buffer[48], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_4 = ((offset + 0u)) / 4; const uint scalar_offset_5 = ((offset + 128u)) / 4; - const S tint_symbol_8 = {asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), tint_symbol_5(buffer, (offset + 16u)), asint(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4])}; - return tint_symbol_8; + const S tint_symbol_3 = {asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4]), u_load_3((offset + 16u)), asint(u[scalar_offset_5 / 4][scalar_offset_5 % 4])}; + return tint_symbol_3; } -typedef S tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[48], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_3(buffer, (offset + (i_1 * 192u))); + arr[i_1] = u_load_1((offset + (i_1 * 192u))); } } return arr; @@ -43,14 +43,14 @@ void f_inner(uint local_invocation_index) { { for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) { const uint i = idx; - const S tint_symbol_7 = (S)0; - w[i] = tint_symbol_7; + const S tint_symbol_2 = (S)0; + w[i] = tint_symbol_2; } } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); - w[1] = tint_symbol_3(u, 384u); - w[3].m = tint_symbol_5(u, 400u); + w = u_load(0u); + w[1] = u_load_1(384u); + w[3].m = u_load_3(400u); w[1].m[0] = asfloat(u[2]).ywxz; } diff --git a/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_workgroup.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_workgroup.wgsl.expected.fxc.hlsl index 5bf6274243..14e015d1ad 100644 --- a/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_workgroup.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/struct/mat4x4_f32/to_workgroup.wgsl.expected.fxc.hlsl @@ -13,27 +13,27 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -float4x4 tint_symbol_5(uint4 buffer[48], uint offset) { +float4x4 u_load_3(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]), asfloat(buffer[scalar_offset_3 / 4])); + return float4x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4]), asfloat(u[scalar_offset_2 / 4]), asfloat(u[scalar_offset_3 / 4])); } -S tint_symbol_3(uint4 buffer[48], uint offset) { +S u_load_1(uint offset) { const uint scalar_offset_4 = ((offset + 0u)) / 4; const uint scalar_offset_5 = ((offset + 128u)) / 4; - const S tint_symbol_8 = {asint(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), tint_symbol_5(buffer, (offset + 16u)), asint(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4])}; - return tint_symbol_8; + const S tint_symbol_3 = {asint(u[scalar_offset_4 / 4][scalar_offset_4 % 4]), u_load_3((offset + 16u)), asint(u[scalar_offset_5 / 4][scalar_offset_5 % 4])}; + return tint_symbol_3; } -typedef S tint_symbol_2_ret[4]; -tint_symbol_2_ret tint_symbol_2(uint4 buffer[48], uint offset) { +typedef S u_load_ret[4]; +u_load_ret u_load(uint offset) { S arr[4] = (S[4])0; { for(uint i_1 = 0u; (i_1 < 4u); i_1 = (i_1 + 1u)) { - arr[i_1] = tint_symbol_3(buffer, (offset + (i_1 * 192u))); + arr[i_1] = u_load_1((offset + (i_1 * 192u))); } } return arr; @@ -43,14 +43,14 @@ void f_inner(uint local_invocation_index) { { for(uint idx = local_invocation_index; (idx < 4u); idx = (idx + 1u)) { const uint i = idx; - const S tint_symbol_7 = (S)0; - w[i] = tint_symbol_7; + const S tint_symbol_2 = (S)0; + w[i] = tint_symbol_2; } } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); - w[1] = tint_symbol_3(u, 384u); - w[3].m = tint_symbol_5(u, 400u); + w = u_load(0u); + w[1] = u_load_1(384u); + w[3].m = u_load_3(400u); w[1].m[0] = asfloat(u[2]).ywxz; } diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x2_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat2x2_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl index 5dc66f6559..1e95708c2d 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat2x2_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat2x2_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl @@ -8,18 +8,18 @@ int i() { return counter; } -matrix tint_symbol(uint4 buffer[1], uint offset) { +matrix m_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint ubo_load = buffer[scalar_offset / 4][scalar_offset % 4]; + uint ubo_load = m[scalar_offset / 4][scalar_offset % 4]; const uint scalar_offset_1 = ((offset + 4u)) / 4; - uint ubo_load_1 = buffer[scalar_offset_1 / 4][scalar_offset_1 % 4]; + uint ubo_load_1 = m[scalar_offset_1 / 4][scalar_offset_1 % 4]; return matrix(vector(float16_t(f16tof32(ubo_load & 0xFFFF)), float16_t(f16tof32(ubo_load >> 16))), vector(float16_t(f16tof32(ubo_load_1 & 0xFFFF)), float16_t(f16tof32(ubo_load_1 >> 16)))); } [numthreads(1, 1, 1)] void f() { const int p_m_i_save = i(); - const matrix l_m = tint_symbol(m, 0u); + const matrix l_m = m_load(0u); const uint scalar_offset_2 = ((4u * uint(p_m_i_save))) / 4; uint ubo_load_2 = m[scalar_offset_2 / 4][scalar_offset_2 % 4]; const vector l_m_i = vector(float16_t(f16tof32(ubo_load_2 & 0xFFFF)), float16_t(f16tof32(ubo_load_2 >> 16))); diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x2_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat2x2_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl index b381bd2305..2f18f9d1c5 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat2x2_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat2x2_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl @@ -8,17 +8,17 @@ int i() { return counter; } -matrix tint_symbol(uint4 buffer[1], uint offset) { +matrix m_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint ubo_load = buffer[scalar_offset / 4][scalar_offset % 4]; + uint ubo_load = m[scalar_offset / 4][scalar_offset % 4]; const uint scalar_offset_1 = ((offset + 4u)) / 4; - uint ubo_load_1 = buffer[scalar_offset_1 / 4][scalar_offset_1 % 4]; + uint ubo_load_1 = m[scalar_offset_1 / 4][scalar_offset_1 % 4]; return matrix(vector(float16_t(f16tof32(ubo_load & 0xFFFF)), float16_t(f16tof32(ubo_load >> 16))), vector(float16_t(f16tof32(ubo_load_1 & 0xFFFF)), float16_t(f16tof32(ubo_load_1 >> 16)))); } [numthreads(1, 1, 1)] void f() { - const matrix l_m = tint_symbol(m, 0u); + const matrix l_m = m_load(0u); uint ubo_load_2 = m[0].y; const vector l_m_1 = vector(float16_t(f16tof32(ubo_load_2 & 0xFFFF)), float16_t(f16tof32(ubo_load_2 >> 16))); return; diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x2_f16/to_builtin.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat2x2_f16/to_builtin.wgsl.expected.dxc.hlsl index 794631160f..3fa79e9cb4 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat2x2_f16/to_builtin.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat2x2_f16/to_builtin.wgsl.expected.dxc.hlsl @@ -2,17 +2,17 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[1]; }; -matrix tint_symbol(uint4 buffer[1], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint ubo_load = buffer[scalar_offset / 4][scalar_offset % 4]; + uint ubo_load = u[scalar_offset / 4][scalar_offset % 4]; const uint scalar_offset_1 = ((offset + 4u)) / 4; - uint ubo_load_1 = buffer[scalar_offset_1 / 4][scalar_offset_1 % 4]; + uint ubo_load_1 = u[scalar_offset_1 / 4][scalar_offset_1 % 4]; return matrix(vector(float16_t(f16tof32(ubo_load & 0xFFFF)), float16_t(f16tof32(ubo_load >> 16))), vector(float16_t(f16tof32(ubo_load_1 & 0xFFFF)), float16_t(f16tof32(ubo_load_1 >> 16)))); } [numthreads(1, 1, 1)] void f() { - const matrix t = transpose(tint_symbol(u, 0u)); + const matrix t = transpose(u_load(0u)); uint ubo_load_2 = u[0].y; const float16_t l = length(vector(float16_t(f16tof32(ubo_load_2 & 0xFFFF)), float16_t(f16tof32(ubo_load_2 >> 16)))); uint ubo_load_3 = u[0].x; diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x2_f16/to_fn.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat2x2_f16/to_fn.wgsl.expected.dxc.hlsl index 6e0c6f2363..08379bcaf6 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat2x2_f16/to_fn.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat2x2_f16/to_fn.wgsl.expected.dxc.hlsl @@ -11,17 +11,17 @@ void b(vector v) { void c(float16_t f_1) { } -matrix tint_symbol(uint4 buffer[1], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint ubo_load = buffer[scalar_offset / 4][scalar_offset % 4]; + uint ubo_load = u[scalar_offset / 4][scalar_offset % 4]; const uint scalar_offset_1 = ((offset + 4u)) / 4; - uint ubo_load_1 = buffer[scalar_offset_1 / 4][scalar_offset_1 % 4]; + uint ubo_load_1 = u[scalar_offset_1 / 4][scalar_offset_1 % 4]; return matrix(vector(float16_t(f16tof32(ubo_load & 0xFFFF)), float16_t(f16tof32(ubo_load >> 16))), vector(float16_t(f16tof32(ubo_load_1 & 0xFFFF)), float16_t(f16tof32(ubo_load_1 >> 16)))); } [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); + a(u_load(0u)); uint ubo_load_2 = u[0].y; b(vector(float16_t(f16tof32(ubo_load_2 & 0xFFFF)), float16_t(f16tof32(ubo_load_2 >> 16)))); uint ubo_load_3 = u[0].y; diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x2_f16/to_private.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat2x2_f16/to_private.wgsl.expected.dxc.hlsl index 649090ffd4..1f4594bc9f 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat2x2_f16/to_private.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat2x2_f16/to_private.wgsl.expected.dxc.hlsl @@ -3,17 +3,17 @@ cbuffer cbuffer_u : register(b0, space0) { }; static matrix p = matrix(float16_t(0.0h), float16_t(0.0h), float16_t(0.0h), float16_t(0.0h)); -matrix tint_symbol(uint4 buffer[1], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint ubo_load = buffer[scalar_offset / 4][scalar_offset % 4]; + uint ubo_load = u[scalar_offset / 4][scalar_offset % 4]; const uint scalar_offset_1 = ((offset + 4u)) / 4; - uint ubo_load_1 = buffer[scalar_offset_1 / 4][scalar_offset_1 % 4]; + uint ubo_load_1 = u[scalar_offset_1 / 4][scalar_offset_1 % 4]; return matrix(vector(float16_t(f16tof32(ubo_load & 0xFFFF)), float16_t(f16tof32(ubo_load >> 16))), vector(float16_t(f16tof32(ubo_load_1 & 0xFFFF)), float16_t(f16tof32(ubo_load_1 >> 16)))); } [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); + p = u_load(0u); uint ubo_load_2 = u[0].x; p[1] = vector(float16_t(f16tof32(ubo_load_2 & 0xFFFF)), float16_t(f16tof32(ubo_load_2 >> 16))); uint ubo_load_3 = u[0].x; diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x2_f16/to_storage.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat2x2_f16/to_storage.wgsl.expected.dxc.hlsl index 365c3b2aa4..761a254780 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat2x2_f16/to_storage.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat2x2_f16/to_storage.wgsl.expected.dxc.hlsl @@ -3,22 +3,22 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol(RWByteAddressBuffer buffer, uint offset, matrix value) { - buffer.Store >((offset + 0u), value[0u]); - buffer.Store >((offset + 4u), value[1u]); +void s_store(uint offset, matrix value) { + s.Store >((offset + 0u), value[0u]); + s.Store >((offset + 4u), value[1u]); } -matrix tint_symbol_2(uint4 buffer[1], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint ubo_load = buffer[scalar_offset / 4][scalar_offset % 4]; + uint ubo_load = u[scalar_offset / 4][scalar_offset % 4]; const uint scalar_offset_1 = ((offset + 4u)) / 4; - uint ubo_load_1 = buffer[scalar_offset_1 / 4][scalar_offset_1 % 4]; + uint ubo_load_1 = u[scalar_offset_1 / 4][scalar_offset_1 % 4]; return matrix(vector(float16_t(f16tof32(ubo_load & 0xFFFF)), float16_t(f16tof32(ubo_load >> 16))), vector(float16_t(f16tof32(ubo_load_1 & 0xFFFF)), float16_t(f16tof32(ubo_load_1 >> 16)))); } [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_2(u, 0u)); + s_store(0u, u_load(0u)); uint ubo_load_2 = u[0].x; s.Store >(4u, vector(float16_t(f16tof32(ubo_load_2 & 0xFFFF)), float16_t(f16tof32(ubo_load_2 >> 16)))); uint ubo_load_3 = u[0].x; diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x2_f16/to_workgroup.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat2x2_f16/to_workgroup.wgsl.expected.dxc.hlsl index 3bf9f07968..fd7ef272f3 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat2x2_f16/to_workgroup.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat2x2_f16/to_workgroup.wgsl.expected.dxc.hlsl @@ -7,11 +7,11 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -matrix tint_symbol_2(uint4 buffer[1], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint ubo_load = buffer[scalar_offset / 4][scalar_offset % 4]; + uint ubo_load = u[scalar_offset / 4][scalar_offset % 4]; const uint scalar_offset_1 = ((offset + 4u)) / 4; - uint ubo_load_1 = buffer[scalar_offset_1 / 4][scalar_offset_1 % 4]; + uint ubo_load_1 = u[scalar_offset_1 / 4][scalar_offset_1 % 4]; return matrix(vector(float16_t(f16tof32(ubo_load & 0xFFFF)), float16_t(f16tof32(ubo_load >> 16))), vector(float16_t(f16tof32(ubo_load_1 & 0xFFFF)), float16_t(f16tof32(ubo_load_1 >> 16)))); } @@ -20,7 +20,7 @@ void f_inner(uint local_invocation_index) { w = matrix((float16_t(0.0h)).xx, (float16_t(0.0h)).xx); } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); + w = u_load(0u); uint ubo_load_2 = u[0].x; w[1] = vector(float16_t(f16tof32(ubo_load_2 & 0xFFFF)), float16_t(f16tof32(ubo_load_2 >> 16))); uint ubo_load_3 = u[0].x; diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x2_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat2x2_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl index 4eeea708c4..1cdcf59cd7 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat2x2_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat2x2_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl @@ -8,18 +8,18 @@ int i() { return counter; } -float2x2 tint_symbol(uint4 buffer[1], uint offset) { +float2x2 m_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = m[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = m[scalar_offset_1 / 4]; return float2x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy))); } [numthreads(1, 1, 1)] void f() { const int p_m_i_save = i(); - const float2x2 l_m = tint_symbol(m, 0u); + const float2x2 l_m = m_load(0u); const uint scalar_offset_2 = ((8u * uint(p_m_i_save))) / 4; uint4 ubo_load_2 = m[scalar_offset_2 / 4]; const float2 l_m_i = asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy)); diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x2_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat2x2_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl index 4eeea708c4..1cdcf59cd7 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat2x2_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat2x2_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl @@ -8,18 +8,18 @@ int i() { return counter; } -float2x2 tint_symbol(uint4 buffer[1], uint offset) { +float2x2 m_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = m[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = m[scalar_offset_1 / 4]; return float2x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy))); } [numthreads(1, 1, 1)] void f() { const int p_m_i_save = i(); - const float2x2 l_m = tint_symbol(m, 0u); + const float2x2 l_m = m_load(0u); const uint scalar_offset_2 = ((8u * uint(p_m_i_save))) / 4; uint4 ubo_load_2 = m[scalar_offset_2 / 4]; const float2 l_m_i = asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy)); diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x2_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat2x2_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl index 1193c5ac31..485ba3d2e6 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat2x2_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat2x2_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl @@ -8,17 +8,17 @@ int i() { return counter; } -float2x2 tint_symbol(uint4 buffer[1], uint offset) { +float2x2 m_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = m[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = m[scalar_offset_1 / 4]; return float2x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy))); } [numthreads(1, 1, 1)] void f() { - const float2x2 l_m = tint_symbol(m, 0u); + const float2x2 l_m = m_load(0u); const float2 l_m_1 = asfloat(m[0].zw); return; } diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x2_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat2x2_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl index 1193c5ac31..485ba3d2e6 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat2x2_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat2x2_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl @@ -8,17 +8,17 @@ int i() { return counter; } -float2x2 tint_symbol(uint4 buffer[1], uint offset) { +float2x2 m_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = m[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = m[scalar_offset_1 / 4]; return float2x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy))); } [numthreads(1, 1, 1)] void f() { - const float2x2 l_m = tint_symbol(m, 0u); + const float2x2 l_m = m_load(0u); const float2 l_m_1 = asfloat(m[0].zw); return; } diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x2_f32/to_builtin.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat2x2_f32/to_builtin.wgsl.expected.dxc.hlsl index 693985f50f..e3db60be68 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat2x2_f32/to_builtin.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat2x2_f32/to_builtin.wgsl.expected.dxc.hlsl @@ -2,17 +2,17 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[1]; }; -float2x2 tint_symbol(uint4 buffer[1], uint offset) { +float2x2 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; return float2x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy))); } [numthreads(1, 1, 1)] void f() { - const float2x2 t = transpose(tint_symbol(u, 0u)); + const float2x2 t = transpose(u_load(0u)); const float l = length(asfloat(u[0].zw)); const float a = abs(asfloat(u[0].xy).yx.x); return; diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x2_f32/to_builtin.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat2x2_f32/to_builtin.wgsl.expected.fxc.hlsl index 693985f50f..e3db60be68 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat2x2_f32/to_builtin.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat2x2_f32/to_builtin.wgsl.expected.fxc.hlsl @@ -2,17 +2,17 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[1]; }; -float2x2 tint_symbol(uint4 buffer[1], uint offset) { +float2x2 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; return float2x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy))); } [numthreads(1, 1, 1)] void f() { - const float2x2 t = transpose(tint_symbol(u, 0u)); + const float2x2 t = transpose(u_load(0u)); const float l = length(asfloat(u[0].zw)); const float a = abs(asfloat(u[0].xy).yx.x); return; diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x2_f32/to_fn.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat2x2_f32/to_fn.wgsl.expected.dxc.hlsl index 0f4581e3f8..d127d167d7 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat2x2_f32/to_fn.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat2x2_f32/to_fn.wgsl.expected.dxc.hlsl @@ -11,17 +11,17 @@ void b(float2 v) { void c(float f_1) { } -float2x2 tint_symbol(uint4 buffer[1], uint offset) { +float2x2 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; return float2x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy))); } [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); + a(u_load(0u)); b(asfloat(u[0].zw)); b(asfloat(u[0].zw).yx); c(asfloat(u[0].z)); diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x2_f32/to_fn.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat2x2_f32/to_fn.wgsl.expected.fxc.hlsl index 0f4581e3f8..d127d167d7 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat2x2_f32/to_fn.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat2x2_f32/to_fn.wgsl.expected.fxc.hlsl @@ -11,17 +11,17 @@ void b(float2 v) { void c(float f_1) { } -float2x2 tint_symbol(uint4 buffer[1], uint offset) { +float2x2 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; return float2x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy))); } [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); + a(u_load(0u)); b(asfloat(u[0].zw)); b(asfloat(u[0].zw).yx); c(asfloat(u[0].z)); diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x2_f32/to_private.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat2x2_f32/to_private.wgsl.expected.dxc.hlsl index daa1db48de..eed39f4dba 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat2x2_f32/to_private.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat2x2_f32/to_private.wgsl.expected.dxc.hlsl @@ -3,17 +3,17 @@ cbuffer cbuffer_u : register(b0, space0) { }; static float2x2 p = float2x2(0.0f, 0.0f, 0.0f, 0.0f); -float2x2 tint_symbol(uint4 buffer[1], uint offset) { +float2x2 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; return float2x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy))); } [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); + p = u_load(0u); p[1] = asfloat(u[0].xy); p[1] = asfloat(u[0].xy).yx; p[0][1] = asfloat(u[0].z); diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x2_f32/to_private.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat2x2_f32/to_private.wgsl.expected.fxc.hlsl index daa1db48de..eed39f4dba 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat2x2_f32/to_private.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat2x2_f32/to_private.wgsl.expected.fxc.hlsl @@ -3,17 +3,17 @@ cbuffer cbuffer_u : register(b0, space0) { }; static float2x2 p = float2x2(0.0f, 0.0f, 0.0f, 0.0f); -float2x2 tint_symbol(uint4 buffer[1], uint offset) { +float2x2 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; return float2x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy))); } [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); + p = u_load(0u); p[1] = asfloat(u[0].xy); p[1] = asfloat(u[0].xy).yx; p[0][1] = asfloat(u[0].z); diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x2_f32/to_storage.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat2x2_f32/to_storage.wgsl.expected.dxc.hlsl index 9457624d6e..8192601fe0 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat2x2_f32/to_storage.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat2x2_f32/to_storage.wgsl.expected.dxc.hlsl @@ -3,22 +3,22 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol(RWByteAddressBuffer buffer, uint offset, float2x2 value) { - buffer.Store2((offset + 0u), asuint(value[0u])); - buffer.Store2((offset + 8u), asuint(value[1u])); +void s_store(uint offset, float2x2 value) { + s.Store2((offset + 0u), asuint(value[0u])); + s.Store2((offset + 8u), asuint(value[1u])); } -float2x2 tint_symbol_2(uint4 buffer[1], uint offset) { +float2x2 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; return float2x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy))); } [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_2(u, 0u)); + s_store(0u, u_load(0u)); s.Store2(8u, asuint(asfloat(u[0].xy))); s.Store2(8u, asuint(asfloat(u[0].xy).yx)); s.Store(4u, asuint(asfloat(u[0].z))); diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x2_f32/to_storage.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat2x2_f32/to_storage.wgsl.expected.fxc.hlsl index 9457624d6e..8192601fe0 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat2x2_f32/to_storage.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat2x2_f32/to_storage.wgsl.expected.fxc.hlsl @@ -3,22 +3,22 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol(RWByteAddressBuffer buffer, uint offset, float2x2 value) { - buffer.Store2((offset + 0u), asuint(value[0u])); - buffer.Store2((offset + 8u), asuint(value[1u])); +void s_store(uint offset, float2x2 value) { + s.Store2((offset + 0u), asuint(value[0u])); + s.Store2((offset + 8u), asuint(value[1u])); } -float2x2 tint_symbol_2(uint4 buffer[1], uint offset) { +float2x2 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; return float2x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy))); } [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_2(u, 0u)); + s_store(0u, u_load(0u)); s.Store2(8u, asuint(asfloat(u[0].xy))); s.Store2(8u, asuint(asfloat(u[0].xy).yx)); s.Store(4u, asuint(asfloat(u[0].z))); diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x2_f32/to_workgroup.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat2x2_f32/to_workgroup.wgsl.expected.dxc.hlsl index fe32b58017..cefd072b0e 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat2x2_f32/to_workgroup.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat2x2_f32/to_workgroup.wgsl.expected.dxc.hlsl @@ -7,11 +7,11 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -float2x2 tint_symbol_2(uint4 buffer[1], uint offset) { +float2x2 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; return float2x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy))); } @@ -20,7 +20,7 @@ void f_inner(uint local_invocation_index) { w = float2x2((0.0f).xx, (0.0f).xx); } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); + w = u_load(0u); w[1] = asfloat(u[0].xy); w[1] = asfloat(u[0].xy).yx; w[0][1] = asfloat(u[0].z); diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x2_f32/to_workgroup.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat2x2_f32/to_workgroup.wgsl.expected.fxc.hlsl index fe32b58017..cefd072b0e 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat2x2_f32/to_workgroup.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat2x2_f32/to_workgroup.wgsl.expected.fxc.hlsl @@ -7,11 +7,11 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -float2x2 tint_symbol_2(uint4 buffer[1], uint offset) { +float2x2 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; return float2x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy))); } @@ -20,7 +20,7 @@ void f_inner(uint local_invocation_index) { w = float2x2((0.0f).xx, (0.0f).xx); } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); + w = u_load(0u); w[1] = asfloat(u[0].xy); w[1] = asfloat(u[0].xy).yx; w[0][1] = asfloat(u[0].z); diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x3_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat2x3_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl index c493360d88..a5ed6597e9 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat2x3_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat2x3_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl @@ -8,14 +8,14 @@ int i() { return counter; } -matrix tint_symbol(uint4 buffer[1], uint offset) { +matrix m_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = m[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = m[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); @@ -25,7 +25,7 @@ matrix tint_symbol(uint4 buffer[1], uint offset) { [numthreads(1, 1, 1)] void f() { const int p_m_i_save = i(); - const matrix l_m = tint_symbol(m, 0u); + const matrix l_m = m_load(0u); const uint scalar_offset_2 = ((8u * uint(p_m_i_save))) / 4; uint4 ubo_load_5 = m[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x3_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat2x3_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl index 994033f212..cfc15e9fe2 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat2x3_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat2x3_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl @@ -8,14 +8,14 @@ int i() { return counter; } -matrix tint_symbol(uint4 buffer[1], uint offset) { +matrix m_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = m[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = m[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); @@ -24,7 +24,7 @@ matrix tint_symbol(uint4 buffer[1], uint offset) { [numthreads(1, 1, 1)] void f() { - const matrix l_m = tint_symbol(m, 0u); + const matrix l_m = m_load(0u); uint2 ubo_load_4 = m[0].zw; vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); float16_t ubo_load_4_y = f16tof32(ubo_load_4[0] >> 16); diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x3_f16/to_builtin.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat2x3_f16/to_builtin.wgsl.expected.dxc.hlsl index c3d16520b2..0b5ddc1caf 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat2x3_f16/to_builtin.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat2x3_f16/to_builtin.wgsl.expected.dxc.hlsl @@ -2,14 +2,14 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[1]; }; -matrix tint_symbol(uint4 buffer[1], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); @@ -18,7 +18,7 @@ matrix tint_symbol(uint4 buffer[1], uint offset) { [numthreads(1, 1, 1)] void f() { - const matrix t = transpose(tint_symbol(u, 0u)); + const matrix t = transpose(u_load(0u)); uint2 ubo_load_4 = u[0].zw; vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); float16_t ubo_load_4_y = f16tof32(ubo_load_4[0] >> 16); diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x3_f16/to_fn.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat2x3_f16/to_fn.wgsl.expected.dxc.hlsl index 4003a4e669..01a0ae3fc4 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat2x3_f16/to_fn.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat2x3_f16/to_fn.wgsl.expected.dxc.hlsl @@ -11,14 +11,14 @@ void b(vector v) { void c(float16_t f_1) { } -matrix tint_symbol(uint4 buffer[1], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); @@ -27,7 +27,7 @@ matrix tint_symbol(uint4 buffer[1], uint offset) { [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); + a(u_load(0u)); uint2 ubo_load_4 = u[0].zw; vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); float16_t ubo_load_4_y = f16tof32(ubo_load_4[0] >> 16); diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x3_f16/to_private.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat2x3_f16/to_private.wgsl.expected.dxc.hlsl index 5cec9ae445..fcf95b9e24 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat2x3_f16/to_private.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat2x3_f16/to_private.wgsl.expected.dxc.hlsl @@ -3,14 +3,14 @@ cbuffer cbuffer_u : register(b0, space0) { }; static matrix p = matrix(float16_t(0.0h), float16_t(0.0h), float16_t(0.0h), float16_t(0.0h), float16_t(0.0h), float16_t(0.0h)); -matrix tint_symbol(uint4 buffer[1], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); @@ -19,7 +19,7 @@ matrix tint_symbol(uint4 buffer[1], uint offset) { [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); + p = u_load(0u); uint2 ubo_load_4 = u[0].xy; vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); float16_t ubo_load_4_y = f16tof32(ubo_load_4[0] >> 16); diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x3_f16/to_storage.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat2x3_f16/to_storage.wgsl.expected.dxc.hlsl index 4655996284..fc9f1309b2 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat2x3_f16/to_storage.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat2x3_f16/to_storage.wgsl.expected.dxc.hlsl @@ -3,19 +3,19 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol(RWByteAddressBuffer buffer, uint offset, matrix value) { - buffer.Store >((offset + 0u), value[0u]); - buffer.Store >((offset + 8u), value[1u]); +void s_store(uint offset, matrix value) { + s.Store >((offset + 0u), value[0u]); + s.Store >((offset + 8u), value[1u]); } -matrix tint_symbol_2(uint4 buffer[1], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); @@ -24,7 +24,7 @@ matrix tint_symbol_2(uint4 buffer[1], uint offset) { [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_2(u, 0u)); + s_store(0u, u_load(0u)); uint2 ubo_load_4 = u[0].xy; vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); float16_t ubo_load_4_y = f16tof32(ubo_load_4[0] >> 16); diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x3_f16/to_workgroup.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat2x3_f16/to_workgroup.wgsl.expected.dxc.hlsl index 58266645b4..9dff33a284 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat2x3_f16/to_workgroup.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat2x3_f16/to_workgroup.wgsl.expected.dxc.hlsl @@ -7,14 +7,14 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -matrix tint_symbol_2(uint4 buffer[1], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); @@ -26,7 +26,7 @@ void f_inner(uint local_invocation_index) { w = matrix((float16_t(0.0h)).xxx, (float16_t(0.0h)).xxx); } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); + w = u_load(0u); uint2 ubo_load_4 = u[0].xy; vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); float16_t ubo_load_4_y = f16tof32(ubo_load_4[0] >> 16); diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl index 0cf7edc3f0..f5e556770f 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl @@ -8,16 +8,16 @@ int i() { return counter; } -float2x3 tint_symbol(uint4 buffer[2], uint offset) { +float2x3 m_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz)); + return float2x3(asfloat(m[scalar_offset / 4].xyz), asfloat(m[scalar_offset_1 / 4].xyz)); } [numthreads(1, 1, 1)] void f() { const int p_m_i_save = i(); - const float2x3 l_m = tint_symbol(m, 0u); + const float2x3 l_m = m_load(0u); const uint scalar_offset_2 = ((16u * uint(p_m_i_save))) / 4; const float3 l_m_i = asfloat(m[scalar_offset_2 / 4].xyz); return; diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl index 0cf7edc3f0..f5e556770f 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl @@ -8,16 +8,16 @@ int i() { return counter; } -float2x3 tint_symbol(uint4 buffer[2], uint offset) { +float2x3 m_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz)); + return float2x3(asfloat(m[scalar_offset / 4].xyz), asfloat(m[scalar_offset_1 / 4].xyz)); } [numthreads(1, 1, 1)] void f() { const int p_m_i_save = i(); - const float2x3 l_m = tint_symbol(m, 0u); + const float2x3 l_m = m_load(0u); const uint scalar_offset_2 = ((16u * uint(p_m_i_save))) / 4; const float3 l_m_i = asfloat(m[scalar_offset_2 / 4].xyz); return; diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl index e43ed37e69..cd583052cf 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl @@ -8,15 +8,15 @@ int i() { return counter; } -float2x3 tint_symbol(uint4 buffer[2], uint offset) { +float2x3 m_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz)); + return float2x3(asfloat(m[scalar_offset / 4].xyz), asfloat(m[scalar_offset_1 / 4].xyz)); } [numthreads(1, 1, 1)] void f() { - const float2x3 l_m = tint_symbol(m, 0u); + const float2x3 l_m = m_load(0u); const float3 l_m_1 = asfloat(m[1].xyz); return; } diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl index e43ed37e69..cd583052cf 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl @@ -8,15 +8,15 @@ int i() { return counter; } -float2x3 tint_symbol(uint4 buffer[2], uint offset) { +float2x3 m_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz)); + return float2x3(asfloat(m[scalar_offset / 4].xyz), asfloat(m[scalar_offset_1 / 4].xyz)); } [numthreads(1, 1, 1)] void f() { - const float2x3 l_m = tint_symbol(m, 0u); + const float2x3 l_m = m_load(0u); const float3 l_m_1 = asfloat(m[1].xyz); return; } diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/to_builtin.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/to_builtin.wgsl.expected.dxc.hlsl index 8f85f93264..8e3d21477a 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/to_builtin.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/to_builtin.wgsl.expected.dxc.hlsl @@ -2,15 +2,15 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[2]; }; -float2x3 tint_symbol(uint4 buffer[2], uint offset) { +float2x3 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz)); + return float2x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz)); } [numthreads(1, 1, 1)] void f() { - const float3x2 t = transpose(tint_symbol(u, 0u)); + const float3x2 t = transpose(u_load(0u)); const float l = length(asfloat(u[1].xyz)); const float a = abs(asfloat(u[0].xyz).zxy.x); return; diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/to_builtin.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/to_builtin.wgsl.expected.fxc.hlsl index 8f85f93264..8e3d21477a 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/to_builtin.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/to_builtin.wgsl.expected.fxc.hlsl @@ -2,15 +2,15 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[2]; }; -float2x3 tint_symbol(uint4 buffer[2], uint offset) { +float2x3 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz)); + return float2x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz)); } [numthreads(1, 1, 1)] void f() { - const float3x2 t = transpose(tint_symbol(u, 0u)); + const float3x2 t = transpose(u_load(0u)); const float l = length(asfloat(u[1].xyz)); const float a = abs(asfloat(u[0].xyz).zxy.x); return; diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/to_fn.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/to_fn.wgsl.expected.dxc.hlsl index 1fc478dec2..88a6667a22 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/to_fn.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/to_fn.wgsl.expected.dxc.hlsl @@ -11,15 +11,15 @@ void b(float3 v) { void c(float f_1) { } -float2x3 tint_symbol(uint4 buffer[2], uint offset) { +float2x3 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz)); + return float2x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz)); } [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); + a(u_load(0u)); b(asfloat(u[1].xyz)); b(asfloat(u[1].xyz).zxy); c(asfloat(u[1].x)); diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/to_fn.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/to_fn.wgsl.expected.fxc.hlsl index 1fc478dec2..88a6667a22 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/to_fn.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/to_fn.wgsl.expected.fxc.hlsl @@ -11,15 +11,15 @@ void b(float3 v) { void c(float f_1) { } -float2x3 tint_symbol(uint4 buffer[2], uint offset) { +float2x3 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz)); + return float2x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz)); } [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); + a(u_load(0u)); b(asfloat(u[1].xyz)); b(asfloat(u[1].xyz).zxy); c(asfloat(u[1].x)); diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/to_private.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/to_private.wgsl.expected.dxc.hlsl index 568d66f7d4..34f88b45f2 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/to_private.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/to_private.wgsl.expected.dxc.hlsl @@ -3,15 +3,15 @@ cbuffer cbuffer_u : register(b0, space0) { }; static float2x3 p = float2x3(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f); -float2x3 tint_symbol(uint4 buffer[2], uint offset) { +float2x3 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz)); + return float2x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz)); } [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); + p = u_load(0u); p[1] = asfloat(u[0].xyz); p[1] = asfloat(u[0].xyz).zxy; p[0][1] = asfloat(u[1].x); diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/to_private.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/to_private.wgsl.expected.fxc.hlsl index 568d66f7d4..34f88b45f2 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/to_private.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/to_private.wgsl.expected.fxc.hlsl @@ -3,15 +3,15 @@ cbuffer cbuffer_u : register(b0, space0) { }; static float2x3 p = float2x3(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f); -float2x3 tint_symbol(uint4 buffer[2], uint offset) { +float2x3 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz)); + return float2x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz)); } [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); + p = u_load(0u); p[1] = asfloat(u[0].xyz); p[1] = asfloat(u[0].xyz).zxy; p[0][1] = asfloat(u[1].x); diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/to_storage.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/to_storage.wgsl.expected.dxc.hlsl index c3906ddd6b..f6eeff68e0 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/to_storage.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/to_storage.wgsl.expected.dxc.hlsl @@ -3,20 +3,20 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol(RWByteAddressBuffer buffer, uint offset, float2x3 value) { - buffer.Store3((offset + 0u), asuint(value[0u])); - buffer.Store3((offset + 16u), asuint(value[1u])); +void s_store(uint offset, float2x3 value) { + s.Store3((offset + 0u), asuint(value[0u])); + s.Store3((offset + 16u), asuint(value[1u])); } -float2x3 tint_symbol_2(uint4 buffer[2], uint offset) { +float2x3 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz)); + return float2x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz)); } [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_2(u, 0u)); + s_store(0u, u_load(0u)); s.Store3(16u, asuint(asfloat(u[0].xyz))); s.Store3(16u, asuint(asfloat(u[0].xyz).zxy)); s.Store(4u, asuint(asfloat(u[1].x))); diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/to_storage.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/to_storage.wgsl.expected.fxc.hlsl index c3906ddd6b..f6eeff68e0 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/to_storage.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/to_storage.wgsl.expected.fxc.hlsl @@ -3,20 +3,20 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol(RWByteAddressBuffer buffer, uint offset, float2x3 value) { - buffer.Store3((offset + 0u), asuint(value[0u])); - buffer.Store3((offset + 16u), asuint(value[1u])); +void s_store(uint offset, float2x3 value) { + s.Store3((offset + 0u), asuint(value[0u])); + s.Store3((offset + 16u), asuint(value[1u])); } -float2x3 tint_symbol_2(uint4 buffer[2], uint offset) { +float2x3 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz)); + return float2x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz)); } [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_2(u, 0u)); + s_store(0u, u_load(0u)); s.Store3(16u, asuint(asfloat(u[0].xyz))); s.Store3(16u, asuint(asfloat(u[0].xyz).zxy)); s.Store(4u, asuint(asfloat(u[1].x))); diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/to_workgroup.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/to_workgroup.wgsl.expected.dxc.hlsl index bdc3667279..354b1de212 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/to_workgroup.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/to_workgroup.wgsl.expected.dxc.hlsl @@ -7,10 +7,10 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -float2x3 tint_symbol_2(uint4 buffer[2], uint offset) { +float2x3 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz)); + return float2x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz)); } void f_inner(uint local_invocation_index) { @@ -18,7 +18,7 @@ void f_inner(uint local_invocation_index) { w = float2x3((0.0f).xxx, (0.0f).xxx); } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); + w = u_load(0u); w[1] = asfloat(u[0].xyz); w[1] = asfloat(u[0].xyz).zxy; w[0][1] = asfloat(u[1].x); diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/to_workgroup.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/to_workgroup.wgsl.expected.fxc.hlsl index bdc3667279..354b1de212 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/to_workgroup.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat2x3_f32/to_workgroup.wgsl.expected.fxc.hlsl @@ -7,10 +7,10 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -float2x3 tint_symbol_2(uint4 buffer[2], uint offset) { +float2x3 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz)); + return float2x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz)); } void f_inner(uint local_invocation_index) { @@ -18,7 +18,7 @@ void f_inner(uint local_invocation_index) { w = float2x3((0.0f).xxx, (0.0f).xxx); } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); + w = u_load(0u); w[1] = asfloat(u[0].xyz); w[1] = asfloat(u[0].xyz).zxy; w[0][1] = asfloat(u[1].x); diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x4_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat2x4_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl index aafb4cc2b3..15d94452e6 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat2x4_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat2x4_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl @@ -8,14 +8,14 @@ int i() { return counter; } -matrix tint_symbol(uint4 buffer[1], uint offset) { +matrix m_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = m[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = m[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); vector ubo_load_2_yw = vector(f16tof32(ubo_load_2 >> 16)); @@ -25,7 +25,7 @@ matrix tint_symbol(uint4 buffer[1], uint offset) { [numthreads(1, 1, 1)] void f() { const int p_m_i_save = i(); - const matrix l_m = tint_symbol(m, 0u); + const matrix l_m = m_load(0u); const uint scalar_offset_2 = ((8u * uint(p_m_i_save))) / 4; uint4 ubo_load_5 = m[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x4_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat2x4_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl index 26c453354e..8e0eff700e 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat2x4_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat2x4_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl @@ -8,14 +8,14 @@ int i() { return counter; } -matrix tint_symbol(uint4 buffer[1], uint offset) { +matrix m_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = m[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = m[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); vector ubo_load_2_yw = vector(f16tof32(ubo_load_2 >> 16)); @@ -24,7 +24,7 @@ matrix tint_symbol(uint4 buffer[1], uint offset) { [numthreads(1, 1, 1)] void f() { - const matrix l_m = tint_symbol(m, 0u); + const matrix l_m = m_load(0u); uint2 ubo_load_4 = m[0].zw; vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); vector ubo_load_4_yw = vector(f16tof32(ubo_load_4 >> 16)); diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x4_f16/to_builtin.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat2x4_f16/to_builtin.wgsl.expected.dxc.hlsl index 8fc92b146c..25814a4d9f 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat2x4_f16/to_builtin.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat2x4_f16/to_builtin.wgsl.expected.dxc.hlsl @@ -2,14 +2,14 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[1]; }; -matrix tint_symbol(uint4 buffer[1], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); vector ubo_load_2_yw = vector(f16tof32(ubo_load_2 >> 16)); @@ -18,7 +18,7 @@ matrix tint_symbol(uint4 buffer[1], uint offset) { [numthreads(1, 1, 1)] void f() { - const matrix t = transpose(tint_symbol(u, 0u)); + const matrix t = transpose(u_load(0u)); uint2 ubo_load_4 = u[0].zw; vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); vector ubo_load_4_yw = vector(f16tof32(ubo_load_4 >> 16)); diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x4_f16/to_fn.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat2x4_f16/to_fn.wgsl.expected.dxc.hlsl index 82bbdcc838..7da7108fbf 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat2x4_f16/to_fn.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat2x4_f16/to_fn.wgsl.expected.dxc.hlsl @@ -11,14 +11,14 @@ void b(vector v) { void c(float16_t f_1) { } -matrix tint_symbol(uint4 buffer[1], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); vector ubo_load_2_yw = vector(f16tof32(ubo_load_2 >> 16)); @@ -27,7 +27,7 @@ matrix tint_symbol(uint4 buffer[1], uint offset) { [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); + a(u_load(0u)); uint2 ubo_load_4 = u[0].zw; vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); vector ubo_load_4_yw = vector(f16tof32(ubo_load_4 >> 16)); diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x4_f16/to_private.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat2x4_f16/to_private.wgsl.expected.dxc.hlsl index 9781a40b57..273f324ffd 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat2x4_f16/to_private.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat2x4_f16/to_private.wgsl.expected.dxc.hlsl @@ -3,14 +3,14 @@ cbuffer cbuffer_u : register(b0, space0) { }; static matrix p = matrix(float16_t(0.0h), float16_t(0.0h), float16_t(0.0h), float16_t(0.0h), float16_t(0.0h), float16_t(0.0h), float16_t(0.0h), float16_t(0.0h)); -matrix tint_symbol(uint4 buffer[1], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); vector ubo_load_2_yw = vector(f16tof32(ubo_load_2 >> 16)); @@ -19,7 +19,7 @@ matrix tint_symbol(uint4 buffer[1], uint offset) { [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); + p = u_load(0u); uint2 ubo_load_4 = u[0].xy; vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); vector ubo_load_4_yw = vector(f16tof32(ubo_load_4 >> 16)); diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x4_f16/to_storage.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat2x4_f16/to_storage.wgsl.expected.dxc.hlsl index bd96423f78..24e5e8785c 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat2x4_f16/to_storage.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat2x4_f16/to_storage.wgsl.expected.dxc.hlsl @@ -3,19 +3,19 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol(RWByteAddressBuffer buffer, uint offset, matrix value) { - buffer.Store >((offset + 0u), value[0u]); - buffer.Store >((offset + 8u), value[1u]); +void s_store(uint offset, matrix value) { + s.Store >((offset + 0u), value[0u]); + s.Store >((offset + 8u), value[1u]); } -matrix tint_symbol_2(uint4 buffer[1], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); vector ubo_load_2_yw = vector(f16tof32(ubo_load_2 >> 16)); @@ -24,7 +24,7 @@ matrix tint_symbol_2(uint4 buffer[1], uint offset) { [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_2(u, 0u)); + s_store(0u, u_load(0u)); uint2 ubo_load_4 = u[0].xy; vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); vector ubo_load_4_yw = vector(f16tof32(ubo_load_4 >> 16)); diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x4_f16/to_workgroup.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat2x4_f16/to_workgroup.wgsl.expected.dxc.hlsl index dc8da4d4e9..74fb79862c 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat2x4_f16/to_workgroup.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat2x4_f16/to_workgroup.wgsl.expected.dxc.hlsl @@ -7,14 +7,14 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -matrix tint_symbol_2(uint4 buffer[1], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); vector ubo_load_2_yw = vector(f16tof32(ubo_load_2 >> 16)); @@ -26,7 +26,7 @@ void f_inner(uint local_invocation_index) { w = matrix((float16_t(0.0h)).xxxx, (float16_t(0.0h)).xxxx); } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); + w = u_load(0u); uint2 ubo_load_4 = u[0].xy; vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); vector ubo_load_4_yw = vector(f16tof32(ubo_load_4 >> 16)); diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x4_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat2x4_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl index c31f9b94a8..a43b55bb63 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat2x4_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat2x4_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl @@ -8,16 +8,16 @@ int i() { return counter; } -float2x4 tint_symbol(uint4 buffer[2], uint offset) { +float2x4 m_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4])); + return float2x4(asfloat(m[scalar_offset / 4]), asfloat(m[scalar_offset_1 / 4])); } [numthreads(1, 1, 1)] void f() { const int p_m_i_save = i(); - const float2x4 l_m = tint_symbol(m, 0u); + const float2x4 l_m = m_load(0u); const uint scalar_offset_2 = ((16u * uint(p_m_i_save))) / 4; const float4 l_m_i = asfloat(m[scalar_offset_2 / 4]); return; diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x4_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat2x4_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl index c31f9b94a8..a43b55bb63 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat2x4_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat2x4_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl @@ -8,16 +8,16 @@ int i() { return counter; } -float2x4 tint_symbol(uint4 buffer[2], uint offset) { +float2x4 m_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4])); + return float2x4(asfloat(m[scalar_offset / 4]), asfloat(m[scalar_offset_1 / 4])); } [numthreads(1, 1, 1)] void f() { const int p_m_i_save = i(); - const float2x4 l_m = tint_symbol(m, 0u); + const float2x4 l_m = m_load(0u); const uint scalar_offset_2 = ((16u * uint(p_m_i_save))) / 4; const float4 l_m_i = asfloat(m[scalar_offset_2 / 4]); return; diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x4_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat2x4_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl index 5f5a358cb3..91ca51df26 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat2x4_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat2x4_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl @@ -8,15 +8,15 @@ int i() { return counter; } -float2x4 tint_symbol(uint4 buffer[2], uint offset) { +float2x4 m_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4])); + return float2x4(asfloat(m[scalar_offset / 4]), asfloat(m[scalar_offset_1 / 4])); } [numthreads(1, 1, 1)] void f() { - const float2x4 l_m = tint_symbol(m, 0u); + const float2x4 l_m = m_load(0u); const float4 l_m_1 = asfloat(m[1]); return; } diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x4_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat2x4_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl index 5f5a358cb3..91ca51df26 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat2x4_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat2x4_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl @@ -8,15 +8,15 @@ int i() { return counter; } -float2x4 tint_symbol(uint4 buffer[2], uint offset) { +float2x4 m_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4])); + return float2x4(asfloat(m[scalar_offset / 4]), asfloat(m[scalar_offset_1 / 4])); } [numthreads(1, 1, 1)] void f() { - const float2x4 l_m = tint_symbol(m, 0u); + const float2x4 l_m = m_load(0u); const float4 l_m_1 = asfloat(m[1]); return; } diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x4_f32/to_builtin.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat2x4_f32/to_builtin.wgsl.expected.dxc.hlsl index 77df7cf77a..e3d1bd3be6 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat2x4_f32/to_builtin.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat2x4_f32/to_builtin.wgsl.expected.dxc.hlsl @@ -2,15 +2,15 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[2]; }; -float2x4 tint_symbol(uint4 buffer[2], uint offset) { +float2x4 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4])); + return float2x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4])); } [numthreads(1, 1, 1)] void f() { - const float4x2 t = transpose(tint_symbol(u, 0u)); + const float4x2 t = transpose(u_load(0u)); const float l = length(asfloat(u[1])); const float a = abs(asfloat(u[0]).ywxz.x); return; diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x4_f32/to_builtin.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat2x4_f32/to_builtin.wgsl.expected.fxc.hlsl index 77df7cf77a..e3d1bd3be6 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat2x4_f32/to_builtin.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat2x4_f32/to_builtin.wgsl.expected.fxc.hlsl @@ -2,15 +2,15 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[2]; }; -float2x4 tint_symbol(uint4 buffer[2], uint offset) { +float2x4 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4])); + return float2x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4])); } [numthreads(1, 1, 1)] void f() { - const float4x2 t = transpose(tint_symbol(u, 0u)); + const float4x2 t = transpose(u_load(0u)); const float l = length(asfloat(u[1])); const float a = abs(asfloat(u[0]).ywxz.x); return; diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x4_f32/to_fn.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat2x4_f32/to_fn.wgsl.expected.dxc.hlsl index 5f643898ed..a9cf737ef2 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat2x4_f32/to_fn.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat2x4_f32/to_fn.wgsl.expected.dxc.hlsl @@ -11,15 +11,15 @@ void b(float4 v) { void c(float f_1) { } -float2x4 tint_symbol(uint4 buffer[2], uint offset) { +float2x4 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4])); + return float2x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4])); } [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); + a(u_load(0u)); b(asfloat(u[1])); b(asfloat(u[1]).ywxz); c(asfloat(u[1].x)); diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x4_f32/to_fn.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat2x4_f32/to_fn.wgsl.expected.fxc.hlsl index 5f643898ed..a9cf737ef2 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat2x4_f32/to_fn.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat2x4_f32/to_fn.wgsl.expected.fxc.hlsl @@ -11,15 +11,15 @@ void b(float4 v) { void c(float f_1) { } -float2x4 tint_symbol(uint4 buffer[2], uint offset) { +float2x4 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4])); + return float2x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4])); } [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); + a(u_load(0u)); b(asfloat(u[1])); b(asfloat(u[1]).ywxz); c(asfloat(u[1].x)); diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x4_f32/to_private.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat2x4_f32/to_private.wgsl.expected.dxc.hlsl index c81f69449c..f65cd34640 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat2x4_f32/to_private.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat2x4_f32/to_private.wgsl.expected.dxc.hlsl @@ -3,15 +3,15 @@ cbuffer cbuffer_u : register(b0, space0) { }; static float2x4 p = float2x4(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f); -float2x4 tint_symbol(uint4 buffer[2], uint offset) { +float2x4 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4])); + return float2x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4])); } [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); + p = u_load(0u); p[1] = asfloat(u[0]); p[1] = asfloat(u[0]).ywxz; p[0][1] = asfloat(u[1].x); diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x4_f32/to_private.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat2x4_f32/to_private.wgsl.expected.fxc.hlsl index c81f69449c..f65cd34640 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat2x4_f32/to_private.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat2x4_f32/to_private.wgsl.expected.fxc.hlsl @@ -3,15 +3,15 @@ cbuffer cbuffer_u : register(b0, space0) { }; static float2x4 p = float2x4(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f); -float2x4 tint_symbol(uint4 buffer[2], uint offset) { +float2x4 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4])); + return float2x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4])); } [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); + p = u_load(0u); p[1] = asfloat(u[0]); p[1] = asfloat(u[0]).ywxz; p[0][1] = asfloat(u[1].x); diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x4_f32/to_storage.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat2x4_f32/to_storage.wgsl.expected.dxc.hlsl index 8bc830a3fa..1f27b2f198 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat2x4_f32/to_storage.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat2x4_f32/to_storage.wgsl.expected.dxc.hlsl @@ -3,20 +3,20 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol(RWByteAddressBuffer buffer, uint offset, float2x4 value) { - buffer.Store4((offset + 0u), asuint(value[0u])); - buffer.Store4((offset + 16u), asuint(value[1u])); +void s_store(uint offset, float2x4 value) { + s.Store4((offset + 0u), asuint(value[0u])); + s.Store4((offset + 16u), asuint(value[1u])); } -float2x4 tint_symbol_2(uint4 buffer[2], uint offset) { +float2x4 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4])); + return float2x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4])); } [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_2(u, 0u)); + s_store(0u, u_load(0u)); s.Store4(16u, asuint(asfloat(u[0]))); s.Store4(16u, asuint(asfloat(u[0]).ywxz)); s.Store(4u, asuint(asfloat(u[1].x))); diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x4_f32/to_storage.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat2x4_f32/to_storage.wgsl.expected.fxc.hlsl index 8bc830a3fa..1f27b2f198 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat2x4_f32/to_storage.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat2x4_f32/to_storage.wgsl.expected.fxc.hlsl @@ -3,20 +3,20 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol(RWByteAddressBuffer buffer, uint offset, float2x4 value) { - buffer.Store4((offset + 0u), asuint(value[0u])); - buffer.Store4((offset + 16u), asuint(value[1u])); +void s_store(uint offset, float2x4 value) { + s.Store4((offset + 0u), asuint(value[0u])); + s.Store4((offset + 16u), asuint(value[1u])); } -float2x4 tint_symbol_2(uint4 buffer[2], uint offset) { +float2x4 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4])); + return float2x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4])); } [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_2(u, 0u)); + s_store(0u, u_load(0u)); s.Store4(16u, asuint(asfloat(u[0]))); s.Store4(16u, asuint(asfloat(u[0]).ywxz)); s.Store(4u, asuint(asfloat(u[1].x))); diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x4_f32/to_workgroup.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat2x4_f32/to_workgroup.wgsl.expected.dxc.hlsl index 23c91dd0f9..91fa59d4ed 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat2x4_f32/to_workgroup.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat2x4_f32/to_workgroup.wgsl.expected.dxc.hlsl @@ -7,10 +7,10 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -float2x4 tint_symbol_2(uint4 buffer[2], uint offset) { +float2x4 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4])); + return float2x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4])); } void f_inner(uint local_invocation_index) { @@ -18,7 +18,7 @@ void f_inner(uint local_invocation_index) { w = float2x4((0.0f).xxxx, (0.0f).xxxx); } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); + w = u_load(0u); w[1] = asfloat(u[0]); w[1] = asfloat(u[0]).ywxz; w[0][1] = asfloat(u[1].x); diff --git a/test/tint/buffer/uniform/std140/unnested/mat2x4_f32/to_workgroup.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat2x4_f32/to_workgroup.wgsl.expected.fxc.hlsl index 23c91dd0f9..91fa59d4ed 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat2x4_f32/to_workgroup.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat2x4_f32/to_workgroup.wgsl.expected.fxc.hlsl @@ -7,10 +7,10 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -float2x4 tint_symbol_2(uint4 buffer[2], uint offset) { +float2x4 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4])); + return float2x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4])); } void f_inner(uint local_invocation_index) { @@ -18,7 +18,7 @@ void f_inner(uint local_invocation_index) { w = float2x4((0.0f).xxxx, (0.0f).xxxx); } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); + w = u_load(0u); w[1] = asfloat(u[0]); w[1] = asfloat(u[0]).ywxz; w[0][1] = asfloat(u[1].x); diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x2_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat3x2_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl index 710277f3c5..4a24013777 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat3x2_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat3x2_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl @@ -8,20 +8,20 @@ int i() { return counter; } -matrix tint_symbol(uint4 buffer[1], uint offset) { +matrix m_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint ubo_load = buffer[scalar_offset / 4][scalar_offset % 4]; + uint ubo_load = m[scalar_offset / 4][scalar_offset % 4]; const uint scalar_offset_1 = ((offset + 4u)) / 4; - uint ubo_load_1 = buffer[scalar_offset_1 / 4][scalar_offset_1 % 4]; + uint ubo_load_1 = m[scalar_offset_1 / 4][scalar_offset_1 % 4]; const uint scalar_offset_2 = ((offset + 8u)) / 4; - uint ubo_load_2 = buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]; + uint ubo_load_2 = m[scalar_offset_2 / 4][scalar_offset_2 % 4]; return matrix(vector(float16_t(f16tof32(ubo_load & 0xFFFF)), float16_t(f16tof32(ubo_load >> 16))), vector(float16_t(f16tof32(ubo_load_1 & 0xFFFF)), float16_t(f16tof32(ubo_load_1 >> 16))), vector(float16_t(f16tof32(ubo_load_2 & 0xFFFF)), float16_t(f16tof32(ubo_load_2 >> 16)))); } [numthreads(1, 1, 1)] void f() { const int p_m_i_save = i(); - const matrix l_m = tint_symbol(m, 0u); + const matrix l_m = m_load(0u); const uint scalar_offset_3 = ((4u * uint(p_m_i_save))) / 4; uint ubo_load_3 = m[scalar_offset_3 / 4][scalar_offset_3 % 4]; const vector l_m_i = vector(float16_t(f16tof32(ubo_load_3 & 0xFFFF)), float16_t(f16tof32(ubo_load_3 >> 16))); diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x2_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat3x2_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl index c5bbdca7a7..16eec730e2 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat3x2_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat3x2_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl @@ -8,19 +8,19 @@ int i() { return counter; } -matrix tint_symbol(uint4 buffer[1], uint offset) { +matrix m_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint ubo_load = buffer[scalar_offset / 4][scalar_offset % 4]; + uint ubo_load = m[scalar_offset / 4][scalar_offset % 4]; const uint scalar_offset_1 = ((offset + 4u)) / 4; - uint ubo_load_1 = buffer[scalar_offset_1 / 4][scalar_offset_1 % 4]; + uint ubo_load_1 = m[scalar_offset_1 / 4][scalar_offset_1 % 4]; const uint scalar_offset_2 = ((offset + 8u)) / 4; - uint ubo_load_2 = buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]; + uint ubo_load_2 = m[scalar_offset_2 / 4][scalar_offset_2 % 4]; return matrix(vector(float16_t(f16tof32(ubo_load & 0xFFFF)), float16_t(f16tof32(ubo_load >> 16))), vector(float16_t(f16tof32(ubo_load_1 & 0xFFFF)), float16_t(f16tof32(ubo_load_1 >> 16))), vector(float16_t(f16tof32(ubo_load_2 & 0xFFFF)), float16_t(f16tof32(ubo_load_2 >> 16)))); } [numthreads(1, 1, 1)] void f() { - const matrix l_m = tint_symbol(m, 0u); + const matrix l_m = m_load(0u); uint ubo_load_3 = m[0].y; const vector l_m_1 = vector(float16_t(f16tof32(ubo_load_3 & 0xFFFF)), float16_t(f16tof32(ubo_load_3 >> 16))); return; diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x2_f16/to_builtin.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat3x2_f16/to_builtin.wgsl.expected.dxc.hlsl index c0992037de..90576a1287 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat3x2_f16/to_builtin.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat3x2_f16/to_builtin.wgsl.expected.dxc.hlsl @@ -2,19 +2,19 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[1]; }; -matrix tint_symbol(uint4 buffer[1], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint ubo_load = buffer[scalar_offset / 4][scalar_offset % 4]; + uint ubo_load = u[scalar_offset / 4][scalar_offset % 4]; const uint scalar_offset_1 = ((offset + 4u)) / 4; - uint ubo_load_1 = buffer[scalar_offset_1 / 4][scalar_offset_1 % 4]; + uint ubo_load_1 = u[scalar_offset_1 / 4][scalar_offset_1 % 4]; const uint scalar_offset_2 = ((offset + 8u)) / 4; - uint ubo_load_2 = buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]; + uint ubo_load_2 = u[scalar_offset_2 / 4][scalar_offset_2 % 4]; return matrix(vector(float16_t(f16tof32(ubo_load & 0xFFFF)), float16_t(f16tof32(ubo_load >> 16))), vector(float16_t(f16tof32(ubo_load_1 & 0xFFFF)), float16_t(f16tof32(ubo_load_1 >> 16))), vector(float16_t(f16tof32(ubo_load_2 & 0xFFFF)), float16_t(f16tof32(ubo_load_2 >> 16)))); } [numthreads(1, 1, 1)] void f() { - const matrix t = transpose(tint_symbol(u, 0u)); + const matrix t = transpose(u_load(0u)); uint ubo_load_3 = u[0].y; const float16_t l = length(vector(float16_t(f16tof32(ubo_load_3 & 0xFFFF)), float16_t(f16tof32(ubo_load_3 >> 16)))); uint ubo_load_4 = u[0].x; diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x2_f16/to_fn.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat3x2_f16/to_fn.wgsl.expected.dxc.hlsl index 0de6e6d0d3..d72a11add0 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat3x2_f16/to_fn.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat3x2_f16/to_fn.wgsl.expected.dxc.hlsl @@ -11,19 +11,19 @@ void b(vector v) { void c(float16_t f_1) { } -matrix tint_symbol(uint4 buffer[1], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint ubo_load = buffer[scalar_offset / 4][scalar_offset % 4]; + uint ubo_load = u[scalar_offset / 4][scalar_offset % 4]; const uint scalar_offset_1 = ((offset + 4u)) / 4; - uint ubo_load_1 = buffer[scalar_offset_1 / 4][scalar_offset_1 % 4]; + uint ubo_load_1 = u[scalar_offset_1 / 4][scalar_offset_1 % 4]; const uint scalar_offset_2 = ((offset + 8u)) / 4; - uint ubo_load_2 = buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]; + uint ubo_load_2 = u[scalar_offset_2 / 4][scalar_offset_2 % 4]; return matrix(vector(float16_t(f16tof32(ubo_load & 0xFFFF)), float16_t(f16tof32(ubo_load >> 16))), vector(float16_t(f16tof32(ubo_load_1 & 0xFFFF)), float16_t(f16tof32(ubo_load_1 >> 16))), vector(float16_t(f16tof32(ubo_load_2 & 0xFFFF)), float16_t(f16tof32(ubo_load_2 >> 16)))); } [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); + a(u_load(0u)); uint ubo_load_3 = u[0].y; b(vector(float16_t(f16tof32(ubo_load_3 & 0xFFFF)), float16_t(f16tof32(ubo_load_3 >> 16)))); uint ubo_load_4 = u[0].y; diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x2_f16/to_private.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat3x2_f16/to_private.wgsl.expected.dxc.hlsl index ae2fee4777..2f58709744 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat3x2_f16/to_private.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat3x2_f16/to_private.wgsl.expected.dxc.hlsl @@ -3,19 +3,19 @@ cbuffer cbuffer_u : register(b0, space0) { }; static matrix p = matrix(float16_t(0.0h), float16_t(0.0h), float16_t(0.0h), float16_t(0.0h), float16_t(0.0h), float16_t(0.0h)); -matrix tint_symbol(uint4 buffer[1], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint ubo_load = buffer[scalar_offset / 4][scalar_offset % 4]; + uint ubo_load = u[scalar_offset / 4][scalar_offset % 4]; const uint scalar_offset_1 = ((offset + 4u)) / 4; - uint ubo_load_1 = buffer[scalar_offset_1 / 4][scalar_offset_1 % 4]; + uint ubo_load_1 = u[scalar_offset_1 / 4][scalar_offset_1 % 4]; const uint scalar_offset_2 = ((offset + 8u)) / 4; - uint ubo_load_2 = buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]; + uint ubo_load_2 = u[scalar_offset_2 / 4][scalar_offset_2 % 4]; return matrix(vector(float16_t(f16tof32(ubo_load & 0xFFFF)), float16_t(f16tof32(ubo_load >> 16))), vector(float16_t(f16tof32(ubo_load_1 & 0xFFFF)), float16_t(f16tof32(ubo_load_1 >> 16))), vector(float16_t(f16tof32(ubo_load_2 & 0xFFFF)), float16_t(f16tof32(ubo_load_2 >> 16)))); } [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); + p = u_load(0u); uint ubo_load_3 = u[0].x; p[1] = vector(float16_t(f16tof32(ubo_load_3 & 0xFFFF)), float16_t(f16tof32(ubo_load_3 >> 16))); uint ubo_load_4 = u[0].x; diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x2_f16/to_storage.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat3x2_f16/to_storage.wgsl.expected.dxc.hlsl index ad86e04321..8f1abd24c4 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat3x2_f16/to_storage.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat3x2_f16/to_storage.wgsl.expected.dxc.hlsl @@ -3,25 +3,25 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol(RWByteAddressBuffer buffer, uint offset, matrix value) { - buffer.Store >((offset + 0u), value[0u]); - buffer.Store >((offset + 4u), value[1u]); - buffer.Store >((offset + 8u), value[2u]); +void s_store(uint offset, matrix value) { + s.Store >((offset + 0u), value[0u]); + s.Store >((offset + 4u), value[1u]); + s.Store >((offset + 8u), value[2u]); } -matrix tint_symbol_2(uint4 buffer[1], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint ubo_load = buffer[scalar_offset / 4][scalar_offset % 4]; + uint ubo_load = u[scalar_offset / 4][scalar_offset % 4]; const uint scalar_offset_1 = ((offset + 4u)) / 4; - uint ubo_load_1 = buffer[scalar_offset_1 / 4][scalar_offset_1 % 4]; + uint ubo_load_1 = u[scalar_offset_1 / 4][scalar_offset_1 % 4]; const uint scalar_offset_2 = ((offset + 8u)) / 4; - uint ubo_load_2 = buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]; + uint ubo_load_2 = u[scalar_offset_2 / 4][scalar_offset_2 % 4]; return matrix(vector(float16_t(f16tof32(ubo_load & 0xFFFF)), float16_t(f16tof32(ubo_load >> 16))), vector(float16_t(f16tof32(ubo_load_1 & 0xFFFF)), float16_t(f16tof32(ubo_load_1 >> 16))), vector(float16_t(f16tof32(ubo_load_2 & 0xFFFF)), float16_t(f16tof32(ubo_load_2 >> 16)))); } [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_2(u, 0u)); + s_store(0u, u_load(0u)); uint ubo_load_3 = u[0].x; s.Store >(4u, vector(float16_t(f16tof32(ubo_load_3 & 0xFFFF)), float16_t(f16tof32(ubo_load_3 >> 16)))); uint ubo_load_4 = u[0].x; diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x2_f16/to_workgroup.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat3x2_f16/to_workgroup.wgsl.expected.dxc.hlsl index 2b66c9ae9d..81aeb3956d 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat3x2_f16/to_workgroup.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat3x2_f16/to_workgroup.wgsl.expected.dxc.hlsl @@ -7,13 +7,13 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -matrix tint_symbol_2(uint4 buffer[1], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint ubo_load = buffer[scalar_offset / 4][scalar_offset % 4]; + uint ubo_load = u[scalar_offset / 4][scalar_offset % 4]; const uint scalar_offset_1 = ((offset + 4u)) / 4; - uint ubo_load_1 = buffer[scalar_offset_1 / 4][scalar_offset_1 % 4]; + uint ubo_load_1 = u[scalar_offset_1 / 4][scalar_offset_1 % 4]; const uint scalar_offset_2 = ((offset + 8u)) / 4; - uint ubo_load_2 = buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]; + uint ubo_load_2 = u[scalar_offset_2 / 4][scalar_offset_2 % 4]; return matrix(vector(float16_t(f16tof32(ubo_load & 0xFFFF)), float16_t(f16tof32(ubo_load >> 16))), vector(float16_t(f16tof32(ubo_load_1 & 0xFFFF)), float16_t(f16tof32(ubo_load_1 >> 16))), vector(float16_t(f16tof32(ubo_load_2 & 0xFFFF)), float16_t(f16tof32(ubo_load_2 >> 16)))); } @@ -22,7 +22,7 @@ void f_inner(uint local_invocation_index) { w = matrix((float16_t(0.0h)).xx, (float16_t(0.0h)).xx, (float16_t(0.0h)).xx); } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); + w = u_load(0u); uint ubo_load_3 = u[0].x; w[1] = vector(float16_t(f16tof32(ubo_load_3 & 0xFFFF)), float16_t(f16tof32(ubo_load_3 >> 16))); uint ubo_load_4 = u[0].x; diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x2_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat3x2_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl index 4e7e2c6268..ab3a9ec3dd 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat3x2_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat3x2_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl @@ -8,20 +8,20 @@ int i() { return counter; } -float3x2 tint_symbol(uint4 buffer[2], uint offset) { +float3x2 m_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = m[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = m[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = m[scalar_offset_2 / 4]; return float3x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy))); } [numthreads(1, 1, 1)] void f() { const int p_m_i_save = i(); - const float3x2 l_m = tint_symbol(m, 0u); + const float3x2 l_m = m_load(0u); const uint scalar_offset_3 = ((8u * uint(p_m_i_save))) / 4; uint4 ubo_load_3 = m[scalar_offset_3 / 4]; const float2 l_m_i = asfloat(((scalar_offset_3 & 2) ? ubo_load_3.zw : ubo_load_3.xy)); diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x2_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat3x2_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl index 4e7e2c6268..ab3a9ec3dd 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat3x2_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat3x2_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl @@ -8,20 +8,20 @@ int i() { return counter; } -float3x2 tint_symbol(uint4 buffer[2], uint offset) { +float3x2 m_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = m[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = m[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = m[scalar_offset_2 / 4]; return float3x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy))); } [numthreads(1, 1, 1)] void f() { const int p_m_i_save = i(); - const float3x2 l_m = tint_symbol(m, 0u); + const float3x2 l_m = m_load(0u); const uint scalar_offset_3 = ((8u * uint(p_m_i_save))) / 4; uint4 ubo_load_3 = m[scalar_offset_3 / 4]; const float2 l_m_i = asfloat(((scalar_offset_3 & 2) ? ubo_load_3.zw : ubo_load_3.xy)); diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x2_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat3x2_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl index fb5623cebc..8542e5b026 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat3x2_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat3x2_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl @@ -8,19 +8,19 @@ int i() { return counter; } -float3x2 tint_symbol(uint4 buffer[2], uint offset) { +float3x2 m_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = m[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = m[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = m[scalar_offset_2 / 4]; return float3x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy))); } [numthreads(1, 1, 1)] void f() { - const float3x2 l_m = tint_symbol(m, 0u); + const float3x2 l_m = m_load(0u); const float2 l_m_1 = asfloat(m[0].zw); return; } diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x2_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat3x2_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl index fb5623cebc..8542e5b026 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat3x2_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat3x2_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl @@ -8,19 +8,19 @@ int i() { return counter; } -float3x2 tint_symbol(uint4 buffer[2], uint offset) { +float3x2 m_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = m[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = m[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = m[scalar_offset_2 / 4]; return float3x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy))); } [numthreads(1, 1, 1)] void f() { - const float3x2 l_m = tint_symbol(m, 0u); + const float3x2 l_m = m_load(0u); const float2 l_m_1 = asfloat(m[0].zw); return; } diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x2_f32/to_builtin.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat3x2_f32/to_builtin.wgsl.expected.dxc.hlsl index b94dd862e1..eb1b6314c7 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat3x2_f32/to_builtin.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat3x2_f32/to_builtin.wgsl.expected.dxc.hlsl @@ -2,19 +2,19 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[2]; }; -float3x2 tint_symbol(uint4 buffer[2], uint offset) { +float3x2 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = u[scalar_offset_2 / 4]; return float3x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy))); } [numthreads(1, 1, 1)] void f() { - const float2x3 t = transpose(tint_symbol(u, 0u)); + const float2x3 t = transpose(u_load(0u)); const float l = length(asfloat(u[0].zw)); const float a = abs(asfloat(u[0].xy).yx.x); return; diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x2_f32/to_builtin.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat3x2_f32/to_builtin.wgsl.expected.fxc.hlsl index b94dd862e1..eb1b6314c7 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat3x2_f32/to_builtin.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat3x2_f32/to_builtin.wgsl.expected.fxc.hlsl @@ -2,19 +2,19 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[2]; }; -float3x2 tint_symbol(uint4 buffer[2], uint offset) { +float3x2 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = u[scalar_offset_2 / 4]; return float3x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy))); } [numthreads(1, 1, 1)] void f() { - const float2x3 t = transpose(tint_symbol(u, 0u)); + const float2x3 t = transpose(u_load(0u)); const float l = length(asfloat(u[0].zw)); const float a = abs(asfloat(u[0].xy).yx.x); return; diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x2_f32/to_fn.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat3x2_f32/to_fn.wgsl.expected.dxc.hlsl index 029fe0afb8..58bfbc5b08 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat3x2_f32/to_fn.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat3x2_f32/to_fn.wgsl.expected.dxc.hlsl @@ -11,19 +11,19 @@ void b(float2 v) { void c(float f_1) { } -float3x2 tint_symbol(uint4 buffer[2], uint offset) { +float3x2 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = u[scalar_offset_2 / 4]; return float3x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy))); } [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); + a(u_load(0u)); b(asfloat(u[0].zw)); b(asfloat(u[0].zw).yx); c(asfloat(u[0].z)); diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x2_f32/to_fn.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat3x2_f32/to_fn.wgsl.expected.fxc.hlsl index 029fe0afb8..58bfbc5b08 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat3x2_f32/to_fn.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat3x2_f32/to_fn.wgsl.expected.fxc.hlsl @@ -11,19 +11,19 @@ void b(float2 v) { void c(float f_1) { } -float3x2 tint_symbol(uint4 buffer[2], uint offset) { +float3x2 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = u[scalar_offset_2 / 4]; return float3x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy))); } [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); + a(u_load(0u)); b(asfloat(u[0].zw)); b(asfloat(u[0].zw).yx); c(asfloat(u[0].z)); diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x2_f32/to_private.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat3x2_f32/to_private.wgsl.expected.dxc.hlsl index 7915694beb..918d899c78 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat3x2_f32/to_private.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat3x2_f32/to_private.wgsl.expected.dxc.hlsl @@ -3,19 +3,19 @@ cbuffer cbuffer_u : register(b0, space0) { }; static float3x2 p = float3x2(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f); -float3x2 tint_symbol(uint4 buffer[2], uint offset) { +float3x2 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = u[scalar_offset_2 / 4]; return float3x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy))); } [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); + p = u_load(0u); p[1] = asfloat(u[0].xy); p[1] = asfloat(u[0].xy).yx; p[0][1] = asfloat(u[0].z); diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x2_f32/to_private.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat3x2_f32/to_private.wgsl.expected.fxc.hlsl index 7915694beb..918d899c78 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat3x2_f32/to_private.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat3x2_f32/to_private.wgsl.expected.fxc.hlsl @@ -3,19 +3,19 @@ cbuffer cbuffer_u : register(b0, space0) { }; static float3x2 p = float3x2(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f); -float3x2 tint_symbol(uint4 buffer[2], uint offset) { +float3x2 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = u[scalar_offset_2 / 4]; return float3x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy))); } [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); + p = u_load(0u); p[1] = asfloat(u[0].xy); p[1] = asfloat(u[0].xy).yx; p[0][1] = asfloat(u[0].z); diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x2_f32/to_storage.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat3x2_f32/to_storage.wgsl.expected.dxc.hlsl index f469a9513e..c722d94a8f 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat3x2_f32/to_storage.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat3x2_f32/to_storage.wgsl.expected.dxc.hlsl @@ -3,25 +3,25 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol(RWByteAddressBuffer buffer, uint offset, float3x2 value) { - buffer.Store2((offset + 0u), asuint(value[0u])); - buffer.Store2((offset + 8u), asuint(value[1u])); - buffer.Store2((offset + 16u), asuint(value[2u])); +void s_store(uint offset, float3x2 value) { + s.Store2((offset + 0u), asuint(value[0u])); + s.Store2((offset + 8u), asuint(value[1u])); + s.Store2((offset + 16u), asuint(value[2u])); } -float3x2 tint_symbol_2(uint4 buffer[2], uint offset) { +float3x2 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = u[scalar_offset_2 / 4]; return float3x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy))); } [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_2(u, 0u)); + s_store(0u, u_load(0u)); s.Store2(8u, asuint(asfloat(u[0].xy))); s.Store2(8u, asuint(asfloat(u[0].xy).yx)); s.Store(4u, asuint(asfloat(u[0].z))); diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x2_f32/to_storage.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat3x2_f32/to_storage.wgsl.expected.fxc.hlsl index f469a9513e..c722d94a8f 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat3x2_f32/to_storage.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat3x2_f32/to_storage.wgsl.expected.fxc.hlsl @@ -3,25 +3,25 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol(RWByteAddressBuffer buffer, uint offset, float3x2 value) { - buffer.Store2((offset + 0u), asuint(value[0u])); - buffer.Store2((offset + 8u), asuint(value[1u])); - buffer.Store2((offset + 16u), asuint(value[2u])); +void s_store(uint offset, float3x2 value) { + s.Store2((offset + 0u), asuint(value[0u])); + s.Store2((offset + 8u), asuint(value[1u])); + s.Store2((offset + 16u), asuint(value[2u])); } -float3x2 tint_symbol_2(uint4 buffer[2], uint offset) { +float3x2 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = u[scalar_offset_2 / 4]; return float3x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy))); } [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_2(u, 0u)); + s_store(0u, u_load(0u)); s.Store2(8u, asuint(asfloat(u[0].xy))); s.Store2(8u, asuint(asfloat(u[0].xy).yx)); s.Store(4u, asuint(asfloat(u[0].z))); diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x2_f32/to_workgroup.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat3x2_f32/to_workgroup.wgsl.expected.dxc.hlsl index 745a64668b..a752f254be 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat3x2_f32/to_workgroup.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat3x2_f32/to_workgroup.wgsl.expected.dxc.hlsl @@ -7,13 +7,13 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -float3x2 tint_symbol_2(uint4 buffer[2], uint offset) { +float3x2 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = u[scalar_offset_2 / 4]; return float3x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy))); } @@ -22,7 +22,7 @@ void f_inner(uint local_invocation_index) { w = float3x2((0.0f).xx, (0.0f).xx, (0.0f).xx); } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); + w = u_load(0u); w[1] = asfloat(u[0].xy); w[1] = asfloat(u[0].xy).yx; w[0][1] = asfloat(u[0].z); diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x2_f32/to_workgroup.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat3x2_f32/to_workgroup.wgsl.expected.fxc.hlsl index 745a64668b..a752f254be 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat3x2_f32/to_workgroup.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat3x2_f32/to_workgroup.wgsl.expected.fxc.hlsl @@ -7,13 +7,13 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -float3x2 tint_symbol_2(uint4 buffer[2], uint offset) { +float3x2 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = u[scalar_offset_2 / 4]; return float3x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy))); } @@ -22,7 +22,7 @@ void f_inner(uint local_invocation_index) { w = float3x2((0.0f).xx, (0.0f).xx, (0.0f).xx); } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); + w = u_load(0u); w[1] = asfloat(u[0].xy); w[1] = asfloat(u[0].xy).yx; w[0][1] = asfloat(u[0].z); diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x3_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat3x3_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl index 9e974153bb..85e9fd4efa 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat3x3_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat3x3_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl @@ -8,19 +8,19 @@ int i() { return counter; } -matrix tint_symbol(uint4 buffer[2], uint offset) { +matrix m_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = m[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = m[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = m[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); float16_t ubo_load_4_y = f16tof32(ubo_load_4[0] >> 16); @@ -30,7 +30,7 @@ matrix tint_symbol(uint4 buffer[2], uint offset) { [numthreads(1, 1, 1)] void f() { const int p_m_i_save = i(); - const matrix l_m = tint_symbol(m, 0u); + const matrix l_m = m_load(0u); const uint scalar_offset_3 = ((8u * uint(p_m_i_save))) / 4; uint4 ubo_load_7 = m[scalar_offset_3 / 4]; uint2 ubo_load_6 = ((scalar_offset_3 & 2) ? ubo_load_7.zw : ubo_load_7.xy); diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x3_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat3x3_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl index f1b227c2d0..42b3ef9cb7 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat3x3_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat3x3_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl @@ -8,19 +8,19 @@ int i() { return counter; } -matrix tint_symbol(uint4 buffer[2], uint offset) { +matrix m_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = m[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = m[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = m[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); float16_t ubo_load_4_y = f16tof32(ubo_load_4[0] >> 16); @@ -29,7 +29,7 @@ matrix tint_symbol(uint4 buffer[2], uint offset) { [numthreads(1, 1, 1)] void f() { - const matrix l_m = tint_symbol(m, 0u); + const matrix l_m = m_load(0u); uint2 ubo_load_6 = m[0].zw; vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); float16_t ubo_load_6_y = f16tof32(ubo_load_6[0] >> 16); diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x3_f16/to_builtin.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat3x3_f16/to_builtin.wgsl.expected.dxc.hlsl index 437c9aa2be..3891c4dc28 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat3x3_f16/to_builtin.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat3x3_f16/to_builtin.wgsl.expected.dxc.hlsl @@ -2,19 +2,19 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[2]; }; -matrix tint_symbol(uint4 buffer[2], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = u[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); float16_t ubo_load_4_y = f16tof32(ubo_load_4[0] >> 16); @@ -23,7 +23,7 @@ matrix tint_symbol(uint4 buffer[2], uint offset) { [numthreads(1, 1, 1)] void f() { - const matrix t = transpose(tint_symbol(u, 0u)); + const matrix t = transpose(u_load(0u)); uint2 ubo_load_6 = u[0].zw; vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); float16_t ubo_load_6_y = f16tof32(ubo_load_6[0] >> 16); diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x3_f16/to_fn.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat3x3_f16/to_fn.wgsl.expected.dxc.hlsl index a6528bd34b..d73bcdbfba 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat3x3_f16/to_fn.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat3x3_f16/to_fn.wgsl.expected.dxc.hlsl @@ -11,19 +11,19 @@ void b(vector v) { void c(float16_t f_1) { } -matrix tint_symbol(uint4 buffer[2], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = u[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); float16_t ubo_load_4_y = f16tof32(ubo_load_4[0] >> 16); @@ -32,7 +32,7 @@ matrix tint_symbol(uint4 buffer[2], uint offset) { [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); + a(u_load(0u)); uint2 ubo_load_6 = u[0].zw; vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); float16_t ubo_load_6_y = f16tof32(ubo_load_6[0] >> 16); diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x3_f16/to_private.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat3x3_f16/to_private.wgsl.expected.dxc.hlsl index fe3d739e5b..95145aeabf 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat3x3_f16/to_private.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat3x3_f16/to_private.wgsl.expected.dxc.hlsl @@ -3,19 +3,19 @@ cbuffer cbuffer_u : register(b0, space0) { }; static matrix p = matrix(float16_t(0.0h), float16_t(0.0h), float16_t(0.0h), float16_t(0.0h), float16_t(0.0h), float16_t(0.0h), float16_t(0.0h), float16_t(0.0h), float16_t(0.0h)); -matrix tint_symbol(uint4 buffer[2], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = u[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); float16_t ubo_load_4_y = f16tof32(ubo_load_4[0] >> 16); @@ -24,7 +24,7 @@ matrix tint_symbol(uint4 buffer[2], uint offset) { [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); + p = u_load(0u); uint2 ubo_load_6 = u[0].xy; vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); float16_t ubo_load_6_y = f16tof32(ubo_load_6[0] >> 16); diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x3_f16/to_storage.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat3x3_f16/to_storage.wgsl.expected.dxc.hlsl index 2a2db34847..83865b7f86 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat3x3_f16/to_storage.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat3x3_f16/to_storage.wgsl.expected.dxc.hlsl @@ -3,25 +3,25 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol(RWByteAddressBuffer buffer, uint offset, matrix value) { - buffer.Store >((offset + 0u), value[0u]); - buffer.Store >((offset + 8u), value[1u]); - buffer.Store >((offset + 16u), value[2u]); +void s_store(uint offset, matrix value) { + s.Store >((offset + 0u), value[0u]); + s.Store >((offset + 8u), value[1u]); + s.Store >((offset + 16u), value[2u]); } -matrix tint_symbol_2(uint4 buffer[2], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = u[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); float16_t ubo_load_4_y = f16tof32(ubo_load_4[0] >> 16); @@ -30,7 +30,7 @@ matrix tint_symbol_2(uint4 buffer[2], uint offset) { [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_2(u, 0u)); + s_store(0u, u_load(0u)); uint2 ubo_load_6 = u[0].xy; vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); float16_t ubo_load_6_y = f16tof32(ubo_load_6[0] >> 16); diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x3_f16/to_workgroup.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat3x3_f16/to_workgroup.wgsl.expected.dxc.hlsl index b6830ac1e2..e5e9a62075 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat3x3_f16/to_workgroup.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat3x3_f16/to_workgroup.wgsl.expected.dxc.hlsl @@ -7,19 +7,19 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -matrix tint_symbol_2(uint4 buffer[2], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = u[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); float16_t ubo_load_4_y = f16tof32(ubo_load_4[0] >> 16); @@ -31,7 +31,7 @@ void f_inner(uint local_invocation_index) { w = matrix((float16_t(0.0h)).xxx, (float16_t(0.0h)).xxx, (float16_t(0.0h)).xxx); } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); + w = u_load(0u); uint2 ubo_load_6 = u[0].xy; vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); float16_t ubo_load_6_y = f16tof32(ubo_load_6[0] >> 16); diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl index ee3d2c3d09..03e472ae7e 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl @@ -8,17 +8,17 @@ int i() { return counter; } -float3x3 tint_symbol(uint4 buffer[3], uint offset) { +float3x3 m_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz)); + return float3x3(asfloat(m[scalar_offset / 4].xyz), asfloat(m[scalar_offset_1 / 4].xyz), asfloat(m[scalar_offset_2 / 4].xyz)); } [numthreads(1, 1, 1)] void f() { const int p_m_i_save = i(); - const float3x3 l_m = tint_symbol(m, 0u); + const float3x3 l_m = m_load(0u); const uint scalar_offset_3 = ((16u * uint(p_m_i_save))) / 4; const float3 l_m_i = asfloat(m[scalar_offset_3 / 4].xyz); return; diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl index ee3d2c3d09..03e472ae7e 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl @@ -8,17 +8,17 @@ int i() { return counter; } -float3x3 tint_symbol(uint4 buffer[3], uint offset) { +float3x3 m_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz)); + return float3x3(asfloat(m[scalar_offset / 4].xyz), asfloat(m[scalar_offset_1 / 4].xyz), asfloat(m[scalar_offset_2 / 4].xyz)); } [numthreads(1, 1, 1)] void f() { const int p_m_i_save = i(); - const float3x3 l_m = tint_symbol(m, 0u); + const float3x3 l_m = m_load(0u); const uint scalar_offset_3 = ((16u * uint(p_m_i_save))) / 4; const float3 l_m_i = asfloat(m[scalar_offset_3 / 4].xyz); return; diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl index bc49773229..8eeb77417a 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl @@ -8,16 +8,16 @@ int i() { return counter; } -float3x3 tint_symbol(uint4 buffer[3], uint offset) { +float3x3 m_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz)); + return float3x3(asfloat(m[scalar_offset / 4].xyz), asfloat(m[scalar_offset_1 / 4].xyz), asfloat(m[scalar_offset_2 / 4].xyz)); } [numthreads(1, 1, 1)] void f() { - const float3x3 l_m = tint_symbol(m, 0u); + const float3x3 l_m = m_load(0u); const float3 l_m_1 = asfloat(m[1].xyz); return; } diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl index bc49773229..8eeb77417a 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl @@ -8,16 +8,16 @@ int i() { return counter; } -float3x3 tint_symbol(uint4 buffer[3], uint offset) { +float3x3 m_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz)); + return float3x3(asfloat(m[scalar_offset / 4].xyz), asfloat(m[scalar_offset_1 / 4].xyz), asfloat(m[scalar_offset_2 / 4].xyz)); } [numthreads(1, 1, 1)] void f() { - const float3x3 l_m = tint_symbol(m, 0u); + const float3x3 l_m = m_load(0u); const float3 l_m_1 = asfloat(m[1].xyz); return; } diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/to_builtin.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/to_builtin.wgsl.expected.dxc.hlsl index 47e86dee70..cb5a604ef2 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/to_builtin.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/to_builtin.wgsl.expected.dxc.hlsl @@ -2,16 +2,16 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[3]; }; -float3x3 tint_symbol(uint4 buffer[3], uint offset) { +float3x3 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz)); + return float3x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz)); } [numthreads(1, 1, 1)] void f() { - const float3x3 t = transpose(tint_symbol(u, 0u)); + const float3x3 t = transpose(u_load(0u)); const float l = length(asfloat(u[1].xyz)); const float a = abs(asfloat(u[0].xyz).zxy.x); return; diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/to_builtin.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/to_builtin.wgsl.expected.fxc.hlsl index 47e86dee70..cb5a604ef2 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/to_builtin.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/to_builtin.wgsl.expected.fxc.hlsl @@ -2,16 +2,16 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[3]; }; -float3x3 tint_symbol(uint4 buffer[3], uint offset) { +float3x3 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz)); + return float3x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz)); } [numthreads(1, 1, 1)] void f() { - const float3x3 t = transpose(tint_symbol(u, 0u)); + const float3x3 t = transpose(u_load(0u)); const float l = length(asfloat(u[1].xyz)); const float a = abs(asfloat(u[0].xyz).zxy.x); return; diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/to_fn.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/to_fn.wgsl.expected.dxc.hlsl index e871bd06f7..84429e6e69 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/to_fn.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/to_fn.wgsl.expected.dxc.hlsl @@ -11,16 +11,16 @@ void b(float3 v) { void c(float f_1) { } -float3x3 tint_symbol(uint4 buffer[3], uint offset) { +float3x3 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz)); + return float3x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz)); } [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); + a(u_load(0u)); b(asfloat(u[1].xyz)); b(asfloat(u[1].xyz).zxy); c(asfloat(u[1].x)); diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/to_fn.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/to_fn.wgsl.expected.fxc.hlsl index e871bd06f7..84429e6e69 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/to_fn.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/to_fn.wgsl.expected.fxc.hlsl @@ -11,16 +11,16 @@ void b(float3 v) { void c(float f_1) { } -float3x3 tint_symbol(uint4 buffer[3], uint offset) { +float3x3 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz)); + return float3x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz)); } [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); + a(u_load(0u)); b(asfloat(u[1].xyz)); b(asfloat(u[1].xyz).zxy); c(asfloat(u[1].x)); diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/to_private.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/to_private.wgsl.expected.dxc.hlsl index 0d4ad6dba3..d9ef708c5d 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/to_private.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/to_private.wgsl.expected.dxc.hlsl @@ -3,16 +3,16 @@ cbuffer cbuffer_u : register(b0, space0) { }; static float3x3 p = float3x3(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f); -float3x3 tint_symbol(uint4 buffer[3], uint offset) { +float3x3 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz)); + return float3x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz)); } [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); + p = u_load(0u); p[1] = asfloat(u[0].xyz); p[1] = asfloat(u[0].xyz).zxy; p[0][1] = asfloat(u[1].x); diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/to_private.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/to_private.wgsl.expected.fxc.hlsl index 0d4ad6dba3..d9ef708c5d 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/to_private.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/to_private.wgsl.expected.fxc.hlsl @@ -3,16 +3,16 @@ cbuffer cbuffer_u : register(b0, space0) { }; static float3x3 p = float3x3(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f); -float3x3 tint_symbol(uint4 buffer[3], uint offset) { +float3x3 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz)); + return float3x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz)); } [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); + p = u_load(0u); p[1] = asfloat(u[0].xyz); p[1] = asfloat(u[0].xyz).zxy; p[0][1] = asfloat(u[1].x); diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/to_storage.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/to_storage.wgsl.expected.dxc.hlsl index 6b28dd2a8d..b33d3d376f 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/to_storage.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/to_storage.wgsl.expected.dxc.hlsl @@ -3,22 +3,22 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol(RWByteAddressBuffer buffer, uint offset, float3x3 value) { - buffer.Store3((offset + 0u), asuint(value[0u])); - buffer.Store3((offset + 16u), asuint(value[1u])); - buffer.Store3((offset + 32u), asuint(value[2u])); +void s_store(uint offset, float3x3 value) { + s.Store3((offset + 0u), asuint(value[0u])); + s.Store3((offset + 16u), asuint(value[1u])); + s.Store3((offset + 32u), asuint(value[2u])); } -float3x3 tint_symbol_2(uint4 buffer[3], uint offset) { +float3x3 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz)); + return float3x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz)); } [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_2(u, 0u)); + s_store(0u, u_load(0u)); s.Store3(16u, asuint(asfloat(u[0].xyz))); s.Store3(16u, asuint(asfloat(u[0].xyz).zxy)); s.Store(4u, asuint(asfloat(u[1].x))); diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/to_storage.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/to_storage.wgsl.expected.fxc.hlsl index 6b28dd2a8d..b33d3d376f 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/to_storage.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/to_storage.wgsl.expected.fxc.hlsl @@ -3,22 +3,22 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol(RWByteAddressBuffer buffer, uint offset, float3x3 value) { - buffer.Store3((offset + 0u), asuint(value[0u])); - buffer.Store3((offset + 16u), asuint(value[1u])); - buffer.Store3((offset + 32u), asuint(value[2u])); +void s_store(uint offset, float3x3 value) { + s.Store3((offset + 0u), asuint(value[0u])); + s.Store3((offset + 16u), asuint(value[1u])); + s.Store3((offset + 32u), asuint(value[2u])); } -float3x3 tint_symbol_2(uint4 buffer[3], uint offset) { +float3x3 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz)); + return float3x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz)); } [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_2(u, 0u)); + s_store(0u, u_load(0u)); s.Store3(16u, asuint(asfloat(u[0].xyz))); s.Store3(16u, asuint(asfloat(u[0].xyz).zxy)); s.Store(4u, asuint(asfloat(u[1].x))); diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/to_workgroup.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/to_workgroup.wgsl.expected.dxc.hlsl index b51cc7d00d..93b9072054 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/to_workgroup.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/to_workgroup.wgsl.expected.dxc.hlsl @@ -7,11 +7,11 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -float3x3 tint_symbol_2(uint4 buffer[3], uint offset) { +float3x3 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz)); + return float3x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz)); } void f_inner(uint local_invocation_index) { @@ -19,7 +19,7 @@ void f_inner(uint local_invocation_index) { w = float3x3((0.0f).xxx, (0.0f).xxx, (0.0f).xxx); } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); + w = u_load(0u); w[1] = asfloat(u[0].xyz); w[1] = asfloat(u[0].xyz).zxy; w[0][1] = asfloat(u[1].x); diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/to_workgroup.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/to_workgroup.wgsl.expected.fxc.hlsl index b51cc7d00d..93b9072054 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/to_workgroup.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat3x3_f32/to_workgroup.wgsl.expected.fxc.hlsl @@ -7,11 +7,11 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -float3x3 tint_symbol_2(uint4 buffer[3], uint offset) { +float3x3 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz)); + return float3x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz)); } void f_inner(uint local_invocation_index) { @@ -19,7 +19,7 @@ void f_inner(uint local_invocation_index) { w = float3x3((0.0f).xxx, (0.0f).xxx, (0.0f).xxx); } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); + w = u_load(0u); w[1] = asfloat(u[0].xyz); w[1] = asfloat(u[0].xyz).zxy; w[0][1] = asfloat(u[1].x); diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x4_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat3x4_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl index 6373d70bda..6912190e8b 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat3x4_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat3x4_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl @@ -8,19 +8,19 @@ int i() { return counter; } -matrix tint_symbol(uint4 buffer[2], uint offset) { +matrix m_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = m[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = m[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); vector ubo_load_2_yw = vector(f16tof32(ubo_load_2 >> 16)); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = m[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); vector ubo_load_4_yw = vector(f16tof32(ubo_load_4 >> 16)); @@ -30,7 +30,7 @@ matrix tint_symbol(uint4 buffer[2], uint offset) { [numthreads(1, 1, 1)] void f() { const int p_m_i_save = i(); - const matrix l_m = tint_symbol(m, 0u); + const matrix l_m = m_load(0u); const uint scalar_offset_3 = ((8u * uint(p_m_i_save))) / 4; uint4 ubo_load_7 = m[scalar_offset_3 / 4]; uint2 ubo_load_6 = ((scalar_offset_3 & 2) ? ubo_load_7.zw : ubo_load_7.xy); diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x4_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat3x4_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl index cfc99eaa68..51b67f413f 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat3x4_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat3x4_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl @@ -8,19 +8,19 @@ int i() { return counter; } -matrix tint_symbol(uint4 buffer[2], uint offset) { +matrix m_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = m[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = m[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); vector ubo_load_2_yw = vector(f16tof32(ubo_load_2 >> 16)); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = m[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); vector ubo_load_4_yw = vector(f16tof32(ubo_load_4 >> 16)); @@ -29,7 +29,7 @@ matrix tint_symbol(uint4 buffer[2], uint offset) { [numthreads(1, 1, 1)] void f() { - const matrix l_m = tint_symbol(m, 0u); + const matrix l_m = m_load(0u); uint2 ubo_load_6 = m[0].zw; vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); vector ubo_load_6_yw = vector(f16tof32(ubo_load_6 >> 16)); diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x4_f16/to_builtin.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat3x4_f16/to_builtin.wgsl.expected.dxc.hlsl index 80a685f8ae..6f26e4e667 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat3x4_f16/to_builtin.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat3x4_f16/to_builtin.wgsl.expected.dxc.hlsl @@ -2,19 +2,19 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[2]; }; -matrix tint_symbol(uint4 buffer[2], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); vector ubo_load_2_yw = vector(f16tof32(ubo_load_2 >> 16)); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = u[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); vector ubo_load_4_yw = vector(f16tof32(ubo_load_4 >> 16)); @@ -23,7 +23,7 @@ matrix tint_symbol(uint4 buffer[2], uint offset) { [numthreads(1, 1, 1)] void f() { - const matrix t = transpose(tint_symbol(u, 0u)); + const matrix t = transpose(u_load(0u)); uint2 ubo_load_6 = u[0].zw; vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); vector ubo_load_6_yw = vector(f16tof32(ubo_load_6 >> 16)); diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x4_f16/to_fn.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat3x4_f16/to_fn.wgsl.expected.dxc.hlsl index e92c783910..898279f082 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat3x4_f16/to_fn.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat3x4_f16/to_fn.wgsl.expected.dxc.hlsl @@ -11,19 +11,19 @@ void b(vector v) { void c(float16_t f_1) { } -matrix tint_symbol(uint4 buffer[2], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); vector ubo_load_2_yw = vector(f16tof32(ubo_load_2 >> 16)); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = u[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); vector ubo_load_4_yw = vector(f16tof32(ubo_load_4 >> 16)); @@ -32,7 +32,7 @@ matrix tint_symbol(uint4 buffer[2], uint offset) { [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); + a(u_load(0u)); uint2 ubo_load_6 = u[0].zw; vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); vector ubo_load_6_yw = vector(f16tof32(ubo_load_6 >> 16)); diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x4_f16/to_private.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat3x4_f16/to_private.wgsl.expected.dxc.hlsl index 1d40f2bd05..6fadd347a9 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat3x4_f16/to_private.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat3x4_f16/to_private.wgsl.expected.dxc.hlsl @@ -3,19 +3,19 @@ cbuffer cbuffer_u : register(b0, space0) { }; static matrix p = matrix(float16_t(0.0h), float16_t(0.0h), float16_t(0.0h), float16_t(0.0h), float16_t(0.0h), float16_t(0.0h), float16_t(0.0h), float16_t(0.0h), float16_t(0.0h), float16_t(0.0h), float16_t(0.0h), float16_t(0.0h)); -matrix tint_symbol(uint4 buffer[2], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); vector ubo_load_2_yw = vector(f16tof32(ubo_load_2 >> 16)); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = u[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); vector ubo_load_4_yw = vector(f16tof32(ubo_load_4 >> 16)); @@ -24,7 +24,7 @@ matrix tint_symbol(uint4 buffer[2], uint offset) { [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); + p = u_load(0u); uint2 ubo_load_6 = u[0].xy; vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); vector ubo_load_6_yw = vector(f16tof32(ubo_load_6 >> 16)); diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x4_f16/to_storage.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat3x4_f16/to_storage.wgsl.expected.dxc.hlsl index a4c97e93c9..62dbf46688 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat3x4_f16/to_storage.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat3x4_f16/to_storage.wgsl.expected.dxc.hlsl @@ -3,25 +3,25 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol(RWByteAddressBuffer buffer, uint offset, matrix value) { - buffer.Store >((offset + 0u), value[0u]); - buffer.Store >((offset + 8u), value[1u]); - buffer.Store >((offset + 16u), value[2u]); +void s_store(uint offset, matrix value) { + s.Store >((offset + 0u), value[0u]); + s.Store >((offset + 8u), value[1u]); + s.Store >((offset + 16u), value[2u]); } -matrix tint_symbol_2(uint4 buffer[2], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); vector ubo_load_2_yw = vector(f16tof32(ubo_load_2 >> 16)); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = u[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); vector ubo_load_4_yw = vector(f16tof32(ubo_load_4 >> 16)); @@ -30,7 +30,7 @@ matrix tint_symbol_2(uint4 buffer[2], uint offset) { [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_2(u, 0u)); + s_store(0u, u_load(0u)); uint2 ubo_load_6 = u[0].xy; vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); vector ubo_load_6_yw = vector(f16tof32(ubo_load_6 >> 16)); diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x4_f16/to_workgroup.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat3x4_f16/to_workgroup.wgsl.expected.dxc.hlsl index 5dd688890e..068f1f8b05 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat3x4_f16/to_workgroup.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat3x4_f16/to_workgroup.wgsl.expected.dxc.hlsl @@ -7,19 +7,19 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -matrix tint_symbol_2(uint4 buffer[2], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); vector ubo_load_2_yw = vector(f16tof32(ubo_load_2 >> 16)); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = u[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); vector ubo_load_4_yw = vector(f16tof32(ubo_load_4 >> 16)); @@ -31,7 +31,7 @@ void f_inner(uint local_invocation_index) { w = matrix((float16_t(0.0h)).xxxx, (float16_t(0.0h)).xxxx, (float16_t(0.0h)).xxxx); } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); + w = u_load(0u); uint2 ubo_load_6 = u[0].xy; vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); vector ubo_load_6_yw = vector(f16tof32(ubo_load_6 >> 16)); diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x4_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat3x4_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl index 4fad9a24dc..94382d6673 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat3x4_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat3x4_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl @@ -8,17 +8,17 @@ int i() { return counter; } -float3x4 tint_symbol(uint4 buffer[3], uint offset) { +float3x4 m_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); + return float3x4(asfloat(m[scalar_offset / 4]), asfloat(m[scalar_offset_1 / 4]), asfloat(m[scalar_offset_2 / 4])); } [numthreads(1, 1, 1)] void f() { const int p_m_i_save = i(); - const float3x4 l_m = tint_symbol(m, 0u); + const float3x4 l_m = m_load(0u); const uint scalar_offset_3 = ((16u * uint(p_m_i_save))) / 4; const float4 l_m_i = asfloat(m[scalar_offset_3 / 4]); return; diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x4_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat3x4_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl index 4fad9a24dc..94382d6673 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat3x4_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat3x4_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl @@ -8,17 +8,17 @@ int i() { return counter; } -float3x4 tint_symbol(uint4 buffer[3], uint offset) { +float3x4 m_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); + return float3x4(asfloat(m[scalar_offset / 4]), asfloat(m[scalar_offset_1 / 4]), asfloat(m[scalar_offset_2 / 4])); } [numthreads(1, 1, 1)] void f() { const int p_m_i_save = i(); - const float3x4 l_m = tint_symbol(m, 0u); + const float3x4 l_m = m_load(0u); const uint scalar_offset_3 = ((16u * uint(p_m_i_save))) / 4; const float4 l_m_i = asfloat(m[scalar_offset_3 / 4]); return; diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x4_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat3x4_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl index c45de93d83..0894f80054 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat3x4_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat3x4_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl @@ -8,16 +8,16 @@ int i() { return counter; } -float3x4 tint_symbol(uint4 buffer[3], uint offset) { +float3x4 m_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); + return float3x4(asfloat(m[scalar_offset / 4]), asfloat(m[scalar_offset_1 / 4]), asfloat(m[scalar_offset_2 / 4])); } [numthreads(1, 1, 1)] void f() { - const float3x4 l_m = tint_symbol(m, 0u); + const float3x4 l_m = m_load(0u); const float4 l_m_1 = asfloat(m[1]); return; } diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x4_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat3x4_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl index c45de93d83..0894f80054 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat3x4_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat3x4_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl @@ -8,16 +8,16 @@ int i() { return counter; } -float3x4 tint_symbol(uint4 buffer[3], uint offset) { +float3x4 m_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); + return float3x4(asfloat(m[scalar_offset / 4]), asfloat(m[scalar_offset_1 / 4]), asfloat(m[scalar_offset_2 / 4])); } [numthreads(1, 1, 1)] void f() { - const float3x4 l_m = tint_symbol(m, 0u); + const float3x4 l_m = m_load(0u); const float4 l_m_1 = asfloat(m[1]); return; } diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x4_f32/to_builtin.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat3x4_f32/to_builtin.wgsl.expected.dxc.hlsl index 619729e960..487a656d37 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat3x4_f32/to_builtin.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat3x4_f32/to_builtin.wgsl.expected.dxc.hlsl @@ -2,16 +2,16 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[3]; }; -float3x4 tint_symbol(uint4 buffer[3], uint offset) { +float3x4 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); + return float3x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4]), asfloat(u[scalar_offset_2 / 4])); } [numthreads(1, 1, 1)] void f() { - const float4x3 t = transpose(tint_symbol(u, 0u)); + const float4x3 t = transpose(u_load(0u)); const float l = length(asfloat(u[1])); const float a = abs(asfloat(u[0]).ywxz.x); return; diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x4_f32/to_builtin.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat3x4_f32/to_builtin.wgsl.expected.fxc.hlsl index 619729e960..487a656d37 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat3x4_f32/to_builtin.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat3x4_f32/to_builtin.wgsl.expected.fxc.hlsl @@ -2,16 +2,16 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[3]; }; -float3x4 tint_symbol(uint4 buffer[3], uint offset) { +float3x4 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); + return float3x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4]), asfloat(u[scalar_offset_2 / 4])); } [numthreads(1, 1, 1)] void f() { - const float4x3 t = transpose(tint_symbol(u, 0u)); + const float4x3 t = transpose(u_load(0u)); const float l = length(asfloat(u[1])); const float a = abs(asfloat(u[0]).ywxz.x); return; diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x4_f32/to_fn.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat3x4_f32/to_fn.wgsl.expected.dxc.hlsl index 697aafcbb7..50197df349 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat3x4_f32/to_fn.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat3x4_f32/to_fn.wgsl.expected.dxc.hlsl @@ -11,16 +11,16 @@ void b(float4 v) { void c(float f_1) { } -float3x4 tint_symbol(uint4 buffer[3], uint offset) { +float3x4 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); + return float3x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4]), asfloat(u[scalar_offset_2 / 4])); } [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); + a(u_load(0u)); b(asfloat(u[1])); b(asfloat(u[1]).ywxz); c(asfloat(u[1].x)); diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x4_f32/to_fn.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat3x4_f32/to_fn.wgsl.expected.fxc.hlsl index 697aafcbb7..50197df349 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat3x4_f32/to_fn.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat3x4_f32/to_fn.wgsl.expected.fxc.hlsl @@ -11,16 +11,16 @@ void b(float4 v) { void c(float f_1) { } -float3x4 tint_symbol(uint4 buffer[3], uint offset) { +float3x4 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); + return float3x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4]), asfloat(u[scalar_offset_2 / 4])); } [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); + a(u_load(0u)); b(asfloat(u[1])); b(asfloat(u[1]).ywxz); c(asfloat(u[1].x)); diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x4_f32/to_private.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat3x4_f32/to_private.wgsl.expected.dxc.hlsl index f6518d9209..cb7c9540f9 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat3x4_f32/to_private.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat3x4_f32/to_private.wgsl.expected.dxc.hlsl @@ -3,16 +3,16 @@ cbuffer cbuffer_u : register(b0, space0) { }; static float3x4 p = float3x4(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f); -float3x4 tint_symbol(uint4 buffer[3], uint offset) { +float3x4 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); + return float3x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4]), asfloat(u[scalar_offset_2 / 4])); } [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); + p = u_load(0u); p[1] = asfloat(u[0]); p[1] = asfloat(u[0]).ywxz; p[0][1] = asfloat(u[1].x); diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x4_f32/to_private.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat3x4_f32/to_private.wgsl.expected.fxc.hlsl index f6518d9209..cb7c9540f9 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat3x4_f32/to_private.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat3x4_f32/to_private.wgsl.expected.fxc.hlsl @@ -3,16 +3,16 @@ cbuffer cbuffer_u : register(b0, space0) { }; static float3x4 p = float3x4(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f); -float3x4 tint_symbol(uint4 buffer[3], uint offset) { +float3x4 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); + return float3x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4]), asfloat(u[scalar_offset_2 / 4])); } [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); + p = u_load(0u); p[1] = asfloat(u[0]); p[1] = asfloat(u[0]).ywxz; p[0][1] = asfloat(u[1].x); diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x4_f32/to_storage.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat3x4_f32/to_storage.wgsl.expected.dxc.hlsl index 7891cea987..68fca84858 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat3x4_f32/to_storage.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat3x4_f32/to_storage.wgsl.expected.dxc.hlsl @@ -3,22 +3,22 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol(RWByteAddressBuffer buffer, uint offset, float3x4 value) { - buffer.Store4((offset + 0u), asuint(value[0u])); - buffer.Store4((offset + 16u), asuint(value[1u])); - buffer.Store4((offset + 32u), asuint(value[2u])); +void s_store(uint offset, float3x4 value) { + s.Store4((offset + 0u), asuint(value[0u])); + s.Store4((offset + 16u), asuint(value[1u])); + s.Store4((offset + 32u), asuint(value[2u])); } -float3x4 tint_symbol_2(uint4 buffer[3], uint offset) { +float3x4 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); + return float3x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4]), asfloat(u[scalar_offset_2 / 4])); } [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_2(u, 0u)); + s_store(0u, u_load(0u)); s.Store4(16u, asuint(asfloat(u[0]))); s.Store4(16u, asuint(asfloat(u[0]).ywxz)); s.Store(4u, asuint(asfloat(u[1].x))); diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x4_f32/to_storage.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat3x4_f32/to_storage.wgsl.expected.fxc.hlsl index 7891cea987..68fca84858 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat3x4_f32/to_storage.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat3x4_f32/to_storage.wgsl.expected.fxc.hlsl @@ -3,22 +3,22 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol(RWByteAddressBuffer buffer, uint offset, float3x4 value) { - buffer.Store4((offset + 0u), asuint(value[0u])); - buffer.Store4((offset + 16u), asuint(value[1u])); - buffer.Store4((offset + 32u), asuint(value[2u])); +void s_store(uint offset, float3x4 value) { + s.Store4((offset + 0u), asuint(value[0u])); + s.Store4((offset + 16u), asuint(value[1u])); + s.Store4((offset + 32u), asuint(value[2u])); } -float3x4 tint_symbol_2(uint4 buffer[3], uint offset) { +float3x4 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); + return float3x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4]), asfloat(u[scalar_offset_2 / 4])); } [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_2(u, 0u)); + s_store(0u, u_load(0u)); s.Store4(16u, asuint(asfloat(u[0]))); s.Store4(16u, asuint(asfloat(u[0]).ywxz)); s.Store(4u, asuint(asfloat(u[1].x))); diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x4_f32/to_workgroup.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat3x4_f32/to_workgroup.wgsl.expected.dxc.hlsl index 84b835f522..cca92d7244 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat3x4_f32/to_workgroup.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat3x4_f32/to_workgroup.wgsl.expected.dxc.hlsl @@ -7,11 +7,11 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -float3x4 tint_symbol_2(uint4 buffer[3], uint offset) { +float3x4 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); + return float3x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4]), asfloat(u[scalar_offset_2 / 4])); } void f_inner(uint local_invocation_index) { @@ -19,7 +19,7 @@ void f_inner(uint local_invocation_index) { w = float3x4((0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx); } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); + w = u_load(0u); w[1] = asfloat(u[0]); w[1] = asfloat(u[0]).ywxz; w[0][1] = asfloat(u[1].x); diff --git a/test/tint/buffer/uniform/std140/unnested/mat3x4_f32/to_workgroup.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat3x4_f32/to_workgroup.wgsl.expected.fxc.hlsl index 84b835f522..cca92d7244 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat3x4_f32/to_workgroup.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat3x4_f32/to_workgroup.wgsl.expected.fxc.hlsl @@ -7,11 +7,11 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -float3x4 tint_symbol_2(uint4 buffer[3], uint offset) { +float3x4 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); + return float3x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4]), asfloat(u[scalar_offset_2 / 4])); } void f_inner(uint local_invocation_index) { @@ -19,7 +19,7 @@ void f_inner(uint local_invocation_index) { w = float3x4((0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx); } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); + w = u_load(0u); w[1] = asfloat(u[0]); w[1] = asfloat(u[0]).ywxz; w[0][1] = asfloat(u[1].x); diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x2_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat4x2_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl index fe97f69c17..9cf4954657 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat4x2_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat4x2_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl @@ -8,22 +8,22 @@ int i() { return counter; } -matrix tint_symbol(uint4 buffer[1], uint offset) { +matrix m_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint ubo_load = buffer[scalar_offset / 4][scalar_offset % 4]; + uint ubo_load = m[scalar_offset / 4][scalar_offset % 4]; const uint scalar_offset_1 = ((offset + 4u)) / 4; - uint ubo_load_1 = buffer[scalar_offset_1 / 4][scalar_offset_1 % 4]; + uint ubo_load_1 = m[scalar_offset_1 / 4][scalar_offset_1 % 4]; const uint scalar_offset_2 = ((offset + 8u)) / 4; - uint ubo_load_2 = buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]; + uint ubo_load_2 = m[scalar_offset_2 / 4][scalar_offset_2 % 4]; const uint scalar_offset_3 = ((offset + 12u)) / 4; - uint ubo_load_3 = buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]; + uint ubo_load_3 = m[scalar_offset_3 / 4][scalar_offset_3 % 4]; return matrix(vector(float16_t(f16tof32(ubo_load & 0xFFFF)), float16_t(f16tof32(ubo_load >> 16))), vector(float16_t(f16tof32(ubo_load_1 & 0xFFFF)), float16_t(f16tof32(ubo_load_1 >> 16))), vector(float16_t(f16tof32(ubo_load_2 & 0xFFFF)), float16_t(f16tof32(ubo_load_2 >> 16))), vector(float16_t(f16tof32(ubo_load_3 & 0xFFFF)), float16_t(f16tof32(ubo_load_3 >> 16)))); } [numthreads(1, 1, 1)] void f() { const int p_m_i_save = i(); - const matrix l_m = tint_symbol(m, 0u); + const matrix l_m = m_load(0u); const uint scalar_offset_4 = ((4u * uint(p_m_i_save))) / 4; uint ubo_load_4 = m[scalar_offset_4 / 4][scalar_offset_4 % 4]; const vector l_m_i = vector(float16_t(f16tof32(ubo_load_4 & 0xFFFF)), float16_t(f16tof32(ubo_load_4 >> 16))); diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x2_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat4x2_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl index e56d25aa04..7851588376 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat4x2_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat4x2_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl @@ -8,21 +8,21 @@ int i() { return counter; } -matrix tint_symbol(uint4 buffer[1], uint offset) { +matrix m_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint ubo_load = buffer[scalar_offset / 4][scalar_offset % 4]; + uint ubo_load = m[scalar_offset / 4][scalar_offset % 4]; const uint scalar_offset_1 = ((offset + 4u)) / 4; - uint ubo_load_1 = buffer[scalar_offset_1 / 4][scalar_offset_1 % 4]; + uint ubo_load_1 = m[scalar_offset_1 / 4][scalar_offset_1 % 4]; const uint scalar_offset_2 = ((offset + 8u)) / 4; - uint ubo_load_2 = buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]; + uint ubo_load_2 = m[scalar_offset_2 / 4][scalar_offset_2 % 4]; const uint scalar_offset_3 = ((offset + 12u)) / 4; - uint ubo_load_3 = buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]; + uint ubo_load_3 = m[scalar_offset_3 / 4][scalar_offset_3 % 4]; return matrix(vector(float16_t(f16tof32(ubo_load & 0xFFFF)), float16_t(f16tof32(ubo_load >> 16))), vector(float16_t(f16tof32(ubo_load_1 & 0xFFFF)), float16_t(f16tof32(ubo_load_1 >> 16))), vector(float16_t(f16tof32(ubo_load_2 & 0xFFFF)), float16_t(f16tof32(ubo_load_2 >> 16))), vector(float16_t(f16tof32(ubo_load_3 & 0xFFFF)), float16_t(f16tof32(ubo_load_3 >> 16)))); } [numthreads(1, 1, 1)] void f() { - const matrix l_m = tint_symbol(m, 0u); + const matrix l_m = m_load(0u); uint ubo_load_4 = m[0].y; const vector l_m_1 = vector(float16_t(f16tof32(ubo_load_4 & 0xFFFF)), float16_t(f16tof32(ubo_load_4 >> 16))); return; diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x2_f16/to_builtin.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat4x2_f16/to_builtin.wgsl.expected.dxc.hlsl index 1c208e2f44..cf953cba3d 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat4x2_f16/to_builtin.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat4x2_f16/to_builtin.wgsl.expected.dxc.hlsl @@ -2,21 +2,21 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[1]; }; -matrix tint_symbol(uint4 buffer[1], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint ubo_load = buffer[scalar_offset / 4][scalar_offset % 4]; + uint ubo_load = u[scalar_offset / 4][scalar_offset % 4]; const uint scalar_offset_1 = ((offset + 4u)) / 4; - uint ubo_load_1 = buffer[scalar_offset_1 / 4][scalar_offset_1 % 4]; + uint ubo_load_1 = u[scalar_offset_1 / 4][scalar_offset_1 % 4]; const uint scalar_offset_2 = ((offset + 8u)) / 4; - uint ubo_load_2 = buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]; + uint ubo_load_2 = u[scalar_offset_2 / 4][scalar_offset_2 % 4]; const uint scalar_offset_3 = ((offset + 12u)) / 4; - uint ubo_load_3 = buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]; + uint ubo_load_3 = u[scalar_offset_3 / 4][scalar_offset_3 % 4]; return matrix(vector(float16_t(f16tof32(ubo_load & 0xFFFF)), float16_t(f16tof32(ubo_load >> 16))), vector(float16_t(f16tof32(ubo_load_1 & 0xFFFF)), float16_t(f16tof32(ubo_load_1 >> 16))), vector(float16_t(f16tof32(ubo_load_2 & 0xFFFF)), float16_t(f16tof32(ubo_load_2 >> 16))), vector(float16_t(f16tof32(ubo_load_3 & 0xFFFF)), float16_t(f16tof32(ubo_load_3 >> 16)))); } [numthreads(1, 1, 1)] void f() { - const matrix t = transpose(tint_symbol(u, 0u)); + const matrix t = transpose(u_load(0u)); uint ubo_load_4 = u[0].y; const float16_t l = length(vector(float16_t(f16tof32(ubo_load_4 & 0xFFFF)), float16_t(f16tof32(ubo_load_4 >> 16)))); uint ubo_load_5 = u[0].x; diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x2_f16/to_fn.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat4x2_f16/to_fn.wgsl.expected.dxc.hlsl index a5ffec04f2..7bac854aa8 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat4x2_f16/to_fn.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat4x2_f16/to_fn.wgsl.expected.dxc.hlsl @@ -11,21 +11,21 @@ void b(vector v) { void c(float16_t f_1) { } -matrix tint_symbol(uint4 buffer[1], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint ubo_load = buffer[scalar_offset / 4][scalar_offset % 4]; + uint ubo_load = u[scalar_offset / 4][scalar_offset % 4]; const uint scalar_offset_1 = ((offset + 4u)) / 4; - uint ubo_load_1 = buffer[scalar_offset_1 / 4][scalar_offset_1 % 4]; + uint ubo_load_1 = u[scalar_offset_1 / 4][scalar_offset_1 % 4]; const uint scalar_offset_2 = ((offset + 8u)) / 4; - uint ubo_load_2 = buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]; + uint ubo_load_2 = u[scalar_offset_2 / 4][scalar_offset_2 % 4]; const uint scalar_offset_3 = ((offset + 12u)) / 4; - uint ubo_load_3 = buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]; + uint ubo_load_3 = u[scalar_offset_3 / 4][scalar_offset_3 % 4]; return matrix(vector(float16_t(f16tof32(ubo_load & 0xFFFF)), float16_t(f16tof32(ubo_load >> 16))), vector(float16_t(f16tof32(ubo_load_1 & 0xFFFF)), float16_t(f16tof32(ubo_load_1 >> 16))), vector(float16_t(f16tof32(ubo_load_2 & 0xFFFF)), float16_t(f16tof32(ubo_load_2 >> 16))), vector(float16_t(f16tof32(ubo_load_3 & 0xFFFF)), float16_t(f16tof32(ubo_load_3 >> 16)))); } [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); + a(u_load(0u)); uint ubo_load_4 = u[0].y; b(vector(float16_t(f16tof32(ubo_load_4 & 0xFFFF)), float16_t(f16tof32(ubo_load_4 >> 16)))); uint ubo_load_5 = u[0].y; diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x2_f16/to_private.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat4x2_f16/to_private.wgsl.expected.dxc.hlsl index bbd9415fd3..8bc2c9cd1a 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat4x2_f16/to_private.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat4x2_f16/to_private.wgsl.expected.dxc.hlsl @@ -3,21 +3,21 @@ cbuffer cbuffer_u : register(b0, space0) { }; static matrix p = matrix(float16_t(0.0h), float16_t(0.0h), float16_t(0.0h), float16_t(0.0h), float16_t(0.0h), float16_t(0.0h), float16_t(0.0h), float16_t(0.0h)); -matrix tint_symbol(uint4 buffer[1], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint ubo_load = buffer[scalar_offset / 4][scalar_offset % 4]; + uint ubo_load = u[scalar_offset / 4][scalar_offset % 4]; const uint scalar_offset_1 = ((offset + 4u)) / 4; - uint ubo_load_1 = buffer[scalar_offset_1 / 4][scalar_offset_1 % 4]; + uint ubo_load_1 = u[scalar_offset_1 / 4][scalar_offset_1 % 4]; const uint scalar_offset_2 = ((offset + 8u)) / 4; - uint ubo_load_2 = buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]; + uint ubo_load_2 = u[scalar_offset_2 / 4][scalar_offset_2 % 4]; const uint scalar_offset_3 = ((offset + 12u)) / 4; - uint ubo_load_3 = buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]; + uint ubo_load_3 = u[scalar_offset_3 / 4][scalar_offset_3 % 4]; return matrix(vector(float16_t(f16tof32(ubo_load & 0xFFFF)), float16_t(f16tof32(ubo_load >> 16))), vector(float16_t(f16tof32(ubo_load_1 & 0xFFFF)), float16_t(f16tof32(ubo_load_1 >> 16))), vector(float16_t(f16tof32(ubo_load_2 & 0xFFFF)), float16_t(f16tof32(ubo_load_2 >> 16))), vector(float16_t(f16tof32(ubo_load_3 & 0xFFFF)), float16_t(f16tof32(ubo_load_3 >> 16)))); } [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); + p = u_load(0u); uint ubo_load_4 = u[0].x; p[1] = vector(float16_t(f16tof32(ubo_load_4 & 0xFFFF)), float16_t(f16tof32(ubo_load_4 >> 16))); uint ubo_load_5 = u[0].x; diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x2_f16/to_storage.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat4x2_f16/to_storage.wgsl.expected.dxc.hlsl index df857d027a..af7729d195 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat4x2_f16/to_storage.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat4x2_f16/to_storage.wgsl.expected.dxc.hlsl @@ -3,28 +3,28 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol(RWByteAddressBuffer buffer, uint offset, matrix value) { - buffer.Store >((offset + 0u), value[0u]); - buffer.Store >((offset + 4u), value[1u]); - buffer.Store >((offset + 8u), value[2u]); - buffer.Store >((offset + 12u), value[3u]); +void s_store(uint offset, matrix value) { + s.Store >((offset + 0u), value[0u]); + s.Store >((offset + 4u), value[1u]); + s.Store >((offset + 8u), value[2u]); + s.Store >((offset + 12u), value[3u]); } -matrix tint_symbol_2(uint4 buffer[1], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint ubo_load = buffer[scalar_offset / 4][scalar_offset % 4]; + uint ubo_load = u[scalar_offset / 4][scalar_offset % 4]; const uint scalar_offset_1 = ((offset + 4u)) / 4; - uint ubo_load_1 = buffer[scalar_offset_1 / 4][scalar_offset_1 % 4]; + uint ubo_load_1 = u[scalar_offset_1 / 4][scalar_offset_1 % 4]; const uint scalar_offset_2 = ((offset + 8u)) / 4; - uint ubo_load_2 = buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]; + uint ubo_load_2 = u[scalar_offset_2 / 4][scalar_offset_2 % 4]; const uint scalar_offset_3 = ((offset + 12u)) / 4; - uint ubo_load_3 = buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]; + uint ubo_load_3 = u[scalar_offset_3 / 4][scalar_offset_3 % 4]; return matrix(vector(float16_t(f16tof32(ubo_load & 0xFFFF)), float16_t(f16tof32(ubo_load >> 16))), vector(float16_t(f16tof32(ubo_load_1 & 0xFFFF)), float16_t(f16tof32(ubo_load_1 >> 16))), vector(float16_t(f16tof32(ubo_load_2 & 0xFFFF)), float16_t(f16tof32(ubo_load_2 >> 16))), vector(float16_t(f16tof32(ubo_load_3 & 0xFFFF)), float16_t(f16tof32(ubo_load_3 >> 16)))); } [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_2(u, 0u)); + s_store(0u, u_load(0u)); uint ubo_load_4 = u[0].x; s.Store >(4u, vector(float16_t(f16tof32(ubo_load_4 & 0xFFFF)), float16_t(f16tof32(ubo_load_4 >> 16)))); uint ubo_load_5 = u[0].x; diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x2_f16/to_workgroup.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat4x2_f16/to_workgroup.wgsl.expected.dxc.hlsl index a3baa30f3c..bff7ee9e30 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat4x2_f16/to_workgroup.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat4x2_f16/to_workgroup.wgsl.expected.dxc.hlsl @@ -7,15 +7,15 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -matrix tint_symbol_2(uint4 buffer[1], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint ubo_load = buffer[scalar_offset / 4][scalar_offset % 4]; + uint ubo_load = u[scalar_offset / 4][scalar_offset % 4]; const uint scalar_offset_1 = ((offset + 4u)) / 4; - uint ubo_load_1 = buffer[scalar_offset_1 / 4][scalar_offset_1 % 4]; + uint ubo_load_1 = u[scalar_offset_1 / 4][scalar_offset_1 % 4]; const uint scalar_offset_2 = ((offset + 8u)) / 4; - uint ubo_load_2 = buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]; + uint ubo_load_2 = u[scalar_offset_2 / 4][scalar_offset_2 % 4]; const uint scalar_offset_3 = ((offset + 12u)) / 4; - uint ubo_load_3 = buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]; + uint ubo_load_3 = u[scalar_offset_3 / 4][scalar_offset_3 % 4]; return matrix(vector(float16_t(f16tof32(ubo_load & 0xFFFF)), float16_t(f16tof32(ubo_load >> 16))), vector(float16_t(f16tof32(ubo_load_1 & 0xFFFF)), float16_t(f16tof32(ubo_load_1 >> 16))), vector(float16_t(f16tof32(ubo_load_2 & 0xFFFF)), float16_t(f16tof32(ubo_load_2 >> 16))), vector(float16_t(f16tof32(ubo_load_3 & 0xFFFF)), float16_t(f16tof32(ubo_load_3 >> 16)))); } @@ -24,7 +24,7 @@ void f_inner(uint local_invocation_index) { w = matrix((float16_t(0.0h)).xx, (float16_t(0.0h)).xx, (float16_t(0.0h)).xx, (float16_t(0.0h)).xx); } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); + w = u_load(0u); uint ubo_load_4 = u[0].x; w[1] = vector(float16_t(f16tof32(ubo_load_4 & 0xFFFF)), float16_t(f16tof32(ubo_load_4 >> 16))); uint ubo_load_5 = u[0].x; diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x2_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat4x2_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl index 1f128d519f..842b37d747 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat4x2_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat4x2_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl @@ -8,22 +8,22 @@ int i() { return counter; } -float4x2 tint_symbol(uint4 buffer[2], uint offset) { +float4x2 m_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = m[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = m[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = m[scalar_offset_2 / 4]; const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_3 = m[scalar_offset_3 / 4]; return float4x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy)), asfloat(((scalar_offset_3 & 2) ? ubo_load_3.zw : ubo_load_3.xy))); } [numthreads(1, 1, 1)] void f() { const int p_m_i_save = i(); - const float4x2 l_m = tint_symbol(m, 0u); + const float4x2 l_m = m_load(0u); const uint scalar_offset_4 = ((8u * uint(p_m_i_save))) / 4; uint4 ubo_load_4 = m[scalar_offset_4 / 4]; const float2 l_m_i = asfloat(((scalar_offset_4 & 2) ? ubo_load_4.zw : ubo_load_4.xy)); diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x2_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat4x2_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl index 1f128d519f..842b37d747 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat4x2_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat4x2_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl @@ -8,22 +8,22 @@ int i() { return counter; } -float4x2 tint_symbol(uint4 buffer[2], uint offset) { +float4x2 m_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = m[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = m[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = m[scalar_offset_2 / 4]; const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_3 = m[scalar_offset_3 / 4]; return float4x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy)), asfloat(((scalar_offset_3 & 2) ? ubo_load_3.zw : ubo_load_3.xy))); } [numthreads(1, 1, 1)] void f() { const int p_m_i_save = i(); - const float4x2 l_m = tint_symbol(m, 0u); + const float4x2 l_m = m_load(0u); const uint scalar_offset_4 = ((8u * uint(p_m_i_save))) / 4; uint4 ubo_load_4 = m[scalar_offset_4 / 4]; const float2 l_m_i = asfloat(((scalar_offset_4 & 2) ? ubo_load_4.zw : ubo_load_4.xy)); diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x2_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat4x2_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl index db46be59fc..2b44d3053c 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat4x2_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat4x2_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl @@ -8,21 +8,21 @@ int i() { return counter; } -float4x2 tint_symbol(uint4 buffer[2], uint offset) { +float4x2 m_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = m[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = m[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = m[scalar_offset_2 / 4]; const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_3 = m[scalar_offset_3 / 4]; return float4x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy)), asfloat(((scalar_offset_3 & 2) ? ubo_load_3.zw : ubo_load_3.xy))); } [numthreads(1, 1, 1)] void f() { - const float4x2 l_m = tint_symbol(m, 0u); + const float4x2 l_m = m_load(0u); const float2 l_m_1 = asfloat(m[0].zw); return; } diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x2_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat4x2_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl index db46be59fc..2b44d3053c 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat4x2_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat4x2_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl @@ -8,21 +8,21 @@ int i() { return counter; } -float4x2 tint_symbol(uint4 buffer[2], uint offset) { +float4x2 m_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = m[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = m[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = m[scalar_offset_2 / 4]; const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_3 = m[scalar_offset_3 / 4]; return float4x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy)), asfloat(((scalar_offset_3 & 2) ? ubo_load_3.zw : ubo_load_3.xy))); } [numthreads(1, 1, 1)] void f() { - const float4x2 l_m = tint_symbol(m, 0u); + const float4x2 l_m = m_load(0u); const float2 l_m_1 = asfloat(m[0].zw); return; } diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x2_f32/to_builtin.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat4x2_f32/to_builtin.wgsl.expected.dxc.hlsl index 051e0934b1..d2d9b67720 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat4x2_f32/to_builtin.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat4x2_f32/to_builtin.wgsl.expected.dxc.hlsl @@ -2,21 +2,21 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[2]; }; -float4x2 tint_symbol(uint4 buffer[2], uint offset) { +float4x2 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = u[scalar_offset_2 / 4]; const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_3 = u[scalar_offset_3 / 4]; return float4x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy)), asfloat(((scalar_offset_3 & 2) ? ubo_load_3.zw : ubo_load_3.xy))); } [numthreads(1, 1, 1)] void f() { - const float2x4 t = transpose(tint_symbol(u, 0u)); + const float2x4 t = transpose(u_load(0u)); const float l = length(asfloat(u[0].zw)); const float a = abs(asfloat(u[0].xy).yx.x); return; diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x2_f32/to_builtin.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat4x2_f32/to_builtin.wgsl.expected.fxc.hlsl index 051e0934b1..d2d9b67720 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat4x2_f32/to_builtin.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat4x2_f32/to_builtin.wgsl.expected.fxc.hlsl @@ -2,21 +2,21 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[2]; }; -float4x2 tint_symbol(uint4 buffer[2], uint offset) { +float4x2 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = u[scalar_offset_2 / 4]; const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_3 = u[scalar_offset_3 / 4]; return float4x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy)), asfloat(((scalar_offset_3 & 2) ? ubo_load_3.zw : ubo_load_3.xy))); } [numthreads(1, 1, 1)] void f() { - const float2x4 t = transpose(tint_symbol(u, 0u)); + const float2x4 t = transpose(u_load(0u)); const float l = length(asfloat(u[0].zw)); const float a = abs(asfloat(u[0].xy).yx.x); return; diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x2_f32/to_fn.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat4x2_f32/to_fn.wgsl.expected.dxc.hlsl index 9629f1dfeb..c227887f35 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat4x2_f32/to_fn.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat4x2_f32/to_fn.wgsl.expected.dxc.hlsl @@ -11,21 +11,21 @@ void b(float2 v) { void c(float f_1) { } -float4x2 tint_symbol(uint4 buffer[2], uint offset) { +float4x2 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = u[scalar_offset_2 / 4]; const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_3 = u[scalar_offset_3 / 4]; return float4x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy)), asfloat(((scalar_offset_3 & 2) ? ubo_load_3.zw : ubo_load_3.xy))); } [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); + a(u_load(0u)); b(asfloat(u[0].zw)); b(asfloat(u[0].zw).yx); c(asfloat(u[0].z)); diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x2_f32/to_fn.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat4x2_f32/to_fn.wgsl.expected.fxc.hlsl index 9629f1dfeb..c227887f35 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat4x2_f32/to_fn.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat4x2_f32/to_fn.wgsl.expected.fxc.hlsl @@ -11,21 +11,21 @@ void b(float2 v) { void c(float f_1) { } -float4x2 tint_symbol(uint4 buffer[2], uint offset) { +float4x2 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = u[scalar_offset_2 / 4]; const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_3 = u[scalar_offset_3 / 4]; return float4x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy)), asfloat(((scalar_offset_3 & 2) ? ubo_load_3.zw : ubo_load_3.xy))); } [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); + a(u_load(0u)); b(asfloat(u[0].zw)); b(asfloat(u[0].zw).yx); c(asfloat(u[0].z)); diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x2_f32/to_private.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat4x2_f32/to_private.wgsl.expected.dxc.hlsl index 15f91ac3e6..baf2ecd20c 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat4x2_f32/to_private.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat4x2_f32/to_private.wgsl.expected.dxc.hlsl @@ -3,21 +3,21 @@ cbuffer cbuffer_u : register(b0, space0) { }; static float4x2 p = float4x2(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f); -float4x2 tint_symbol(uint4 buffer[2], uint offset) { +float4x2 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = u[scalar_offset_2 / 4]; const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_3 = u[scalar_offset_3 / 4]; return float4x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy)), asfloat(((scalar_offset_3 & 2) ? ubo_load_3.zw : ubo_load_3.xy))); } [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); + p = u_load(0u); p[1] = asfloat(u[0].xy); p[1] = asfloat(u[0].xy).yx; p[0][1] = asfloat(u[0].z); diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x2_f32/to_private.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat4x2_f32/to_private.wgsl.expected.fxc.hlsl index 15f91ac3e6..baf2ecd20c 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat4x2_f32/to_private.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat4x2_f32/to_private.wgsl.expected.fxc.hlsl @@ -3,21 +3,21 @@ cbuffer cbuffer_u : register(b0, space0) { }; static float4x2 p = float4x2(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f); -float4x2 tint_symbol(uint4 buffer[2], uint offset) { +float4x2 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = u[scalar_offset_2 / 4]; const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_3 = u[scalar_offset_3 / 4]; return float4x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy)), asfloat(((scalar_offset_3 & 2) ? ubo_load_3.zw : ubo_load_3.xy))); } [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); + p = u_load(0u); p[1] = asfloat(u[0].xy); p[1] = asfloat(u[0].xy).yx; p[0][1] = asfloat(u[0].z); diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x2_f32/to_storage.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat4x2_f32/to_storage.wgsl.expected.dxc.hlsl index 466fdc408a..27501dcf09 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat4x2_f32/to_storage.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat4x2_f32/to_storage.wgsl.expected.dxc.hlsl @@ -3,28 +3,28 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol(RWByteAddressBuffer buffer, uint offset, float4x2 value) { - buffer.Store2((offset + 0u), asuint(value[0u])); - buffer.Store2((offset + 8u), asuint(value[1u])); - buffer.Store2((offset + 16u), asuint(value[2u])); - buffer.Store2((offset + 24u), asuint(value[3u])); +void s_store(uint offset, float4x2 value) { + s.Store2((offset + 0u), asuint(value[0u])); + s.Store2((offset + 8u), asuint(value[1u])); + s.Store2((offset + 16u), asuint(value[2u])); + s.Store2((offset + 24u), asuint(value[3u])); } -float4x2 tint_symbol_2(uint4 buffer[2], uint offset) { +float4x2 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = u[scalar_offset_2 / 4]; const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_3 = u[scalar_offset_3 / 4]; return float4x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy)), asfloat(((scalar_offset_3 & 2) ? ubo_load_3.zw : ubo_load_3.xy))); } [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_2(u, 0u)); + s_store(0u, u_load(0u)); s.Store2(8u, asuint(asfloat(u[0].xy))); s.Store2(8u, asuint(asfloat(u[0].xy).yx)); s.Store(4u, asuint(asfloat(u[0].z))); diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x2_f32/to_storage.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat4x2_f32/to_storage.wgsl.expected.fxc.hlsl index 466fdc408a..27501dcf09 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat4x2_f32/to_storage.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat4x2_f32/to_storage.wgsl.expected.fxc.hlsl @@ -3,28 +3,28 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol(RWByteAddressBuffer buffer, uint offset, float4x2 value) { - buffer.Store2((offset + 0u), asuint(value[0u])); - buffer.Store2((offset + 8u), asuint(value[1u])); - buffer.Store2((offset + 16u), asuint(value[2u])); - buffer.Store2((offset + 24u), asuint(value[3u])); +void s_store(uint offset, float4x2 value) { + s.Store2((offset + 0u), asuint(value[0u])); + s.Store2((offset + 8u), asuint(value[1u])); + s.Store2((offset + 16u), asuint(value[2u])); + s.Store2((offset + 24u), asuint(value[3u])); } -float4x2 tint_symbol_2(uint4 buffer[2], uint offset) { +float4x2 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = u[scalar_offset_2 / 4]; const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_3 = u[scalar_offset_3 / 4]; return float4x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy)), asfloat(((scalar_offset_3 & 2) ? ubo_load_3.zw : ubo_load_3.xy))); } [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_2(u, 0u)); + s_store(0u, u_load(0u)); s.Store2(8u, asuint(asfloat(u[0].xy))); s.Store2(8u, asuint(asfloat(u[0].xy).yx)); s.Store(4u, asuint(asfloat(u[0].z))); diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x2_f32/to_workgroup.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat4x2_f32/to_workgroup.wgsl.expected.dxc.hlsl index f665fb4ac0..9bc064987b 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat4x2_f32/to_workgroup.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat4x2_f32/to_workgroup.wgsl.expected.dxc.hlsl @@ -7,15 +7,15 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -float4x2 tint_symbol_2(uint4 buffer[2], uint offset) { +float4x2 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = u[scalar_offset_2 / 4]; const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_3 = u[scalar_offset_3 / 4]; return float4x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy)), asfloat(((scalar_offset_3 & 2) ? ubo_load_3.zw : ubo_load_3.xy))); } @@ -24,7 +24,7 @@ void f_inner(uint local_invocation_index) { w = float4x2((0.0f).xx, (0.0f).xx, (0.0f).xx, (0.0f).xx); } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); + w = u_load(0u); w[1] = asfloat(u[0].xy); w[1] = asfloat(u[0].xy).yx; w[0][1] = asfloat(u[0].z); diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x2_f32/to_workgroup.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat4x2_f32/to_workgroup.wgsl.expected.fxc.hlsl index f665fb4ac0..9bc064987b 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat4x2_f32/to_workgroup.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat4x2_f32/to_workgroup.wgsl.expected.fxc.hlsl @@ -7,15 +7,15 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -float4x2 tint_symbol_2(uint4 buffer[2], uint offset) { +float4x2 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = u[scalar_offset_2 / 4]; const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_3 = u[scalar_offset_3 / 4]; return float4x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy)), asfloat(((scalar_offset_3 & 2) ? ubo_load_3.zw : ubo_load_3.xy))); } @@ -24,7 +24,7 @@ void f_inner(uint local_invocation_index) { w = float4x2((0.0f).xx, (0.0f).xx, (0.0f).xx, (0.0f).xx); } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); + w = u_load(0u); w[1] = asfloat(u[0].xy); w[1] = asfloat(u[0].xy).yx; w[0][1] = asfloat(u[0].z); diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x3_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat4x3_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl index d4f64e397f..6fe595e8e0 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat4x3_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat4x3_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl @@ -8,24 +8,24 @@ int i() { return counter; } -matrix tint_symbol(uint4 buffer[2], uint offset) { +matrix m_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = m[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = m[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = m[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); float16_t ubo_load_4_y = f16tof32(ubo_load_4[0] >> 16); const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_7 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_7 = m[scalar_offset_3 / 4]; uint2 ubo_load_6 = ((scalar_offset_3 & 2) ? ubo_load_7.zw : ubo_load_7.xy); vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); float16_t ubo_load_6_y = f16tof32(ubo_load_6[0] >> 16); @@ -35,7 +35,7 @@ matrix tint_symbol(uint4 buffer[2], uint offset) { [numthreads(1, 1, 1)] void f() { const int p_m_i_save = i(); - const matrix l_m = tint_symbol(m, 0u); + const matrix l_m = m_load(0u); const uint scalar_offset_4 = ((8u * uint(p_m_i_save))) / 4; uint4 ubo_load_9 = m[scalar_offset_4 / 4]; uint2 ubo_load_8 = ((scalar_offset_4 & 2) ? ubo_load_9.zw : ubo_load_9.xy); diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x3_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat4x3_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl index 46a10de3e0..82ea699a72 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat4x3_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat4x3_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl @@ -8,24 +8,24 @@ int i() { return counter; } -matrix tint_symbol(uint4 buffer[2], uint offset) { +matrix m_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = m[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = m[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = m[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); float16_t ubo_load_4_y = f16tof32(ubo_load_4[0] >> 16); const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_7 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_7 = m[scalar_offset_3 / 4]; uint2 ubo_load_6 = ((scalar_offset_3 & 2) ? ubo_load_7.zw : ubo_load_7.xy); vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); float16_t ubo_load_6_y = f16tof32(ubo_load_6[0] >> 16); @@ -34,7 +34,7 @@ matrix tint_symbol(uint4 buffer[2], uint offset) { [numthreads(1, 1, 1)] void f() { - const matrix l_m = tint_symbol(m, 0u); + const matrix l_m = m_load(0u); uint2 ubo_load_8 = m[0].zw; vector ubo_load_8_xz = vector(f16tof32(ubo_load_8 & 0xFFFF)); float16_t ubo_load_8_y = f16tof32(ubo_load_8[0] >> 16); diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x3_f16/to_builtin.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat4x3_f16/to_builtin.wgsl.expected.dxc.hlsl index 34e05980d6..22bca7940a 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat4x3_f16/to_builtin.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat4x3_f16/to_builtin.wgsl.expected.dxc.hlsl @@ -2,24 +2,24 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[2]; }; -matrix tint_symbol(uint4 buffer[2], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = u[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); float16_t ubo_load_4_y = f16tof32(ubo_load_4[0] >> 16); const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_7 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_7 = u[scalar_offset_3 / 4]; uint2 ubo_load_6 = ((scalar_offset_3 & 2) ? ubo_load_7.zw : ubo_load_7.xy); vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); float16_t ubo_load_6_y = f16tof32(ubo_load_6[0] >> 16); @@ -28,7 +28,7 @@ matrix tint_symbol(uint4 buffer[2], uint offset) { [numthreads(1, 1, 1)] void f() { - const matrix t = transpose(tint_symbol(u, 0u)); + const matrix t = transpose(u_load(0u)); uint2 ubo_load_8 = u[0].zw; vector ubo_load_8_xz = vector(f16tof32(ubo_load_8 & 0xFFFF)); float16_t ubo_load_8_y = f16tof32(ubo_load_8[0] >> 16); diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x3_f16/to_fn.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat4x3_f16/to_fn.wgsl.expected.dxc.hlsl index 778064aabb..6175c09a50 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat4x3_f16/to_fn.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat4x3_f16/to_fn.wgsl.expected.dxc.hlsl @@ -11,24 +11,24 @@ void b(vector v) { void c(float16_t f_1) { } -matrix tint_symbol(uint4 buffer[2], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = u[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); float16_t ubo_load_4_y = f16tof32(ubo_load_4[0] >> 16); const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_7 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_7 = u[scalar_offset_3 / 4]; uint2 ubo_load_6 = ((scalar_offset_3 & 2) ? ubo_load_7.zw : ubo_load_7.xy); vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); float16_t ubo_load_6_y = f16tof32(ubo_load_6[0] >> 16); @@ -37,7 +37,7 @@ matrix tint_symbol(uint4 buffer[2], uint offset) { [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); + a(u_load(0u)); uint2 ubo_load_8 = u[0].zw; vector ubo_load_8_xz = vector(f16tof32(ubo_load_8 & 0xFFFF)); float16_t ubo_load_8_y = f16tof32(ubo_load_8[0] >> 16); diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x3_f16/to_private.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat4x3_f16/to_private.wgsl.expected.dxc.hlsl index a448fe76f0..dd68d22fc6 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat4x3_f16/to_private.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat4x3_f16/to_private.wgsl.expected.dxc.hlsl @@ -3,24 +3,24 @@ cbuffer cbuffer_u : register(b0, space0) { }; static matrix p = matrix(float16_t(0.0h), float16_t(0.0h), float16_t(0.0h), float16_t(0.0h), float16_t(0.0h), float16_t(0.0h), float16_t(0.0h), float16_t(0.0h), float16_t(0.0h), float16_t(0.0h), float16_t(0.0h), float16_t(0.0h)); -matrix tint_symbol(uint4 buffer[2], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = u[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); float16_t ubo_load_4_y = f16tof32(ubo_load_4[0] >> 16); const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_7 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_7 = u[scalar_offset_3 / 4]; uint2 ubo_load_6 = ((scalar_offset_3 & 2) ? ubo_load_7.zw : ubo_load_7.xy); vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); float16_t ubo_load_6_y = f16tof32(ubo_load_6[0] >> 16); @@ -29,7 +29,7 @@ matrix tint_symbol(uint4 buffer[2], uint offset) { [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); + p = u_load(0u); uint2 ubo_load_8 = u[0].xy; vector ubo_load_8_xz = vector(f16tof32(ubo_load_8 & 0xFFFF)); float16_t ubo_load_8_y = f16tof32(ubo_load_8[0] >> 16); diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x3_f16/to_storage.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat4x3_f16/to_storage.wgsl.expected.dxc.hlsl index 7d09ac6f4b..4002ca7167 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat4x3_f16/to_storage.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat4x3_f16/to_storage.wgsl.expected.dxc.hlsl @@ -3,31 +3,31 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol(RWByteAddressBuffer buffer, uint offset, matrix value) { - buffer.Store >((offset + 0u), value[0u]); - buffer.Store >((offset + 8u), value[1u]); - buffer.Store >((offset + 16u), value[2u]); - buffer.Store >((offset + 24u), value[3u]); +void s_store(uint offset, matrix value) { + s.Store >((offset + 0u), value[0u]); + s.Store >((offset + 8u), value[1u]); + s.Store >((offset + 16u), value[2u]); + s.Store >((offset + 24u), value[3u]); } -matrix tint_symbol_2(uint4 buffer[2], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = u[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); float16_t ubo_load_4_y = f16tof32(ubo_load_4[0] >> 16); const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_7 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_7 = u[scalar_offset_3 / 4]; uint2 ubo_load_6 = ((scalar_offset_3 & 2) ? ubo_load_7.zw : ubo_load_7.xy); vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); float16_t ubo_load_6_y = f16tof32(ubo_load_6[0] >> 16); @@ -36,7 +36,7 @@ matrix tint_symbol_2(uint4 buffer[2], uint offset) { [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_2(u, 0u)); + s_store(0u, u_load(0u)); uint2 ubo_load_8 = u[0].xy; vector ubo_load_8_xz = vector(f16tof32(ubo_load_8 & 0xFFFF)); float16_t ubo_load_8_y = f16tof32(ubo_load_8[0] >> 16); diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x3_f16/to_workgroup.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat4x3_f16/to_workgroup.wgsl.expected.dxc.hlsl index d577f146ca..5d6a5bf550 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat4x3_f16/to_workgroup.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat4x3_f16/to_workgroup.wgsl.expected.dxc.hlsl @@ -7,24 +7,24 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -matrix tint_symbol_2(uint4 buffer[2], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = u[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); float16_t ubo_load_4_y = f16tof32(ubo_load_4[0] >> 16); const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_7 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_7 = u[scalar_offset_3 / 4]; uint2 ubo_load_6 = ((scalar_offset_3 & 2) ? ubo_load_7.zw : ubo_load_7.xy); vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); float16_t ubo_load_6_y = f16tof32(ubo_load_6[0] >> 16); @@ -36,7 +36,7 @@ void f_inner(uint local_invocation_index) { w = matrix((float16_t(0.0h)).xxx, (float16_t(0.0h)).xxx, (float16_t(0.0h)).xxx, (float16_t(0.0h)).xxx); } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); + w = u_load(0u); uint2 ubo_load_8 = u[0].xy; vector ubo_load_8_xz = vector(f16tof32(ubo_load_8 & 0xFFFF)); float16_t ubo_load_8_y = f16tof32(ubo_load_8[0] >> 16); diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl index 4816aa7d4d..2e25171fb9 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl @@ -8,18 +8,18 @@ int i() { return counter; } -float4x3 tint_symbol(uint4 buffer[4], uint offset) { +float4x3 m_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz)); + return float4x3(asfloat(m[scalar_offset / 4].xyz), asfloat(m[scalar_offset_1 / 4].xyz), asfloat(m[scalar_offset_2 / 4].xyz), asfloat(m[scalar_offset_3 / 4].xyz)); } [numthreads(1, 1, 1)] void f() { const int p_m_i_save = i(); - const float4x3 l_m = tint_symbol(m, 0u); + const float4x3 l_m = m_load(0u); const uint scalar_offset_4 = ((16u * uint(p_m_i_save))) / 4; const float3 l_m_i = asfloat(m[scalar_offset_4 / 4].xyz); return; diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl index 4816aa7d4d..2e25171fb9 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl @@ -8,18 +8,18 @@ int i() { return counter; } -float4x3 tint_symbol(uint4 buffer[4], uint offset) { +float4x3 m_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz)); + return float4x3(asfloat(m[scalar_offset / 4].xyz), asfloat(m[scalar_offset_1 / 4].xyz), asfloat(m[scalar_offset_2 / 4].xyz), asfloat(m[scalar_offset_3 / 4].xyz)); } [numthreads(1, 1, 1)] void f() { const int p_m_i_save = i(); - const float4x3 l_m = tint_symbol(m, 0u); + const float4x3 l_m = m_load(0u); const uint scalar_offset_4 = ((16u * uint(p_m_i_save))) / 4; const float3 l_m_i = asfloat(m[scalar_offset_4 / 4].xyz); return; diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl index 8492882e13..0d9c690780 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl @@ -8,17 +8,17 @@ int i() { return counter; } -float4x3 tint_symbol(uint4 buffer[4], uint offset) { +float4x3 m_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz)); + return float4x3(asfloat(m[scalar_offset / 4].xyz), asfloat(m[scalar_offset_1 / 4].xyz), asfloat(m[scalar_offset_2 / 4].xyz), asfloat(m[scalar_offset_3 / 4].xyz)); } [numthreads(1, 1, 1)] void f() { - const float4x3 l_m = tint_symbol(m, 0u); + const float4x3 l_m = m_load(0u); const float3 l_m_1 = asfloat(m[1].xyz); return; } diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl index 8492882e13..0d9c690780 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl @@ -8,17 +8,17 @@ int i() { return counter; } -float4x3 tint_symbol(uint4 buffer[4], uint offset) { +float4x3 m_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz)); + return float4x3(asfloat(m[scalar_offset / 4].xyz), asfloat(m[scalar_offset_1 / 4].xyz), asfloat(m[scalar_offset_2 / 4].xyz), asfloat(m[scalar_offset_3 / 4].xyz)); } [numthreads(1, 1, 1)] void f() { - const float4x3 l_m = tint_symbol(m, 0u); + const float4x3 l_m = m_load(0u); const float3 l_m_1 = asfloat(m[1].xyz); return; } diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/to_builtin.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/to_builtin.wgsl.expected.dxc.hlsl index 9e00a15494..60b08a28fe 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/to_builtin.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/to_builtin.wgsl.expected.dxc.hlsl @@ -2,17 +2,17 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[4]; }; -float4x3 tint_symbol(uint4 buffer[4], uint offset) { +float4x3 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz)); + return float4x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz), asfloat(u[scalar_offset_3 / 4].xyz)); } [numthreads(1, 1, 1)] void f() { - const float3x4 t = transpose(tint_symbol(u, 0u)); + const float3x4 t = transpose(u_load(0u)); const float l = length(asfloat(u[1].xyz)); const float a = abs(asfloat(u[0].xyz).zxy.x); return; diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/to_builtin.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/to_builtin.wgsl.expected.fxc.hlsl index 9e00a15494..60b08a28fe 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/to_builtin.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/to_builtin.wgsl.expected.fxc.hlsl @@ -2,17 +2,17 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[4]; }; -float4x3 tint_symbol(uint4 buffer[4], uint offset) { +float4x3 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz)); + return float4x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz), asfloat(u[scalar_offset_3 / 4].xyz)); } [numthreads(1, 1, 1)] void f() { - const float3x4 t = transpose(tint_symbol(u, 0u)); + const float3x4 t = transpose(u_load(0u)); const float l = length(asfloat(u[1].xyz)); const float a = abs(asfloat(u[0].xyz).zxy.x); return; diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/to_fn.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/to_fn.wgsl.expected.dxc.hlsl index 67c4557b8f..6011452a5c 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/to_fn.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/to_fn.wgsl.expected.dxc.hlsl @@ -11,17 +11,17 @@ void b(float3 v) { void c(float f_1) { } -float4x3 tint_symbol(uint4 buffer[4], uint offset) { +float4x3 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz)); + return float4x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz), asfloat(u[scalar_offset_3 / 4].xyz)); } [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); + a(u_load(0u)); b(asfloat(u[1].xyz)); b(asfloat(u[1].xyz).zxy); c(asfloat(u[1].x)); diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/to_fn.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/to_fn.wgsl.expected.fxc.hlsl index 67c4557b8f..6011452a5c 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/to_fn.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/to_fn.wgsl.expected.fxc.hlsl @@ -11,17 +11,17 @@ void b(float3 v) { void c(float f_1) { } -float4x3 tint_symbol(uint4 buffer[4], uint offset) { +float4x3 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz)); + return float4x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz), asfloat(u[scalar_offset_3 / 4].xyz)); } [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); + a(u_load(0u)); b(asfloat(u[1].xyz)); b(asfloat(u[1].xyz).zxy); c(asfloat(u[1].x)); diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/to_private.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/to_private.wgsl.expected.dxc.hlsl index e0bec97bb7..bce8be2b81 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/to_private.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/to_private.wgsl.expected.dxc.hlsl @@ -3,17 +3,17 @@ cbuffer cbuffer_u : register(b0, space0) { }; static float4x3 p = float4x3(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f); -float4x3 tint_symbol(uint4 buffer[4], uint offset) { +float4x3 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz)); + return float4x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz), asfloat(u[scalar_offset_3 / 4].xyz)); } [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); + p = u_load(0u); p[1] = asfloat(u[0].xyz); p[1] = asfloat(u[0].xyz).zxy; p[0][1] = asfloat(u[1].x); diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/to_private.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/to_private.wgsl.expected.fxc.hlsl index e0bec97bb7..bce8be2b81 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/to_private.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/to_private.wgsl.expected.fxc.hlsl @@ -3,17 +3,17 @@ cbuffer cbuffer_u : register(b0, space0) { }; static float4x3 p = float4x3(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f); -float4x3 tint_symbol(uint4 buffer[4], uint offset) { +float4x3 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz)); + return float4x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz), asfloat(u[scalar_offset_3 / 4].xyz)); } [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); + p = u_load(0u); p[1] = asfloat(u[0].xyz); p[1] = asfloat(u[0].xyz).zxy; p[0][1] = asfloat(u[1].x); diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/to_storage.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/to_storage.wgsl.expected.dxc.hlsl index 372d7c00e2..9e87f90a8e 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/to_storage.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/to_storage.wgsl.expected.dxc.hlsl @@ -3,24 +3,24 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol(RWByteAddressBuffer buffer, uint offset, float4x3 value) { - buffer.Store3((offset + 0u), asuint(value[0u])); - buffer.Store3((offset + 16u), asuint(value[1u])); - buffer.Store3((offset + 32u), asuint(value[2u])); - buffer.Store3((offset + 48u), asuint(value[3u])); +void s_store(uint offset, float4x3 value) { + s.Store3((offset + 0u), asuint(value[0u])); + s.Store3((offset + 16u), asuint(value[1u])); + s.Store3((offset + 32u), asuint(value[2u])); + s.Store3((offset + 48u), asuint(value[3u])); } -float4x3 tint_symbol_2(uint4 buffer[4], uint offset) { +float4x3 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz)); + return float4x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz), asfloat(u[scalar_offset_3 / 4].xyz)); } [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_2(u, 0u)); + s_store(0u, u_load(0u)); s.Store3(16u, asuint(asfloat(u[0].xyz))); s.Store3(16u, asuint(asfloat(u[0].xyz).zxy)); s.Store(4u, asuint(asfloat(u[1].x))); diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/to_storage.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/to_storage.wgsl.expected.fxc.hlsl index 372d7c00e2..9e87f90a8e 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/to_storage.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/to_storage.wgsl.expected.fxc.hlsl @@ -3,24 +3,24 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol(RWByteAddressBuffer buffer, uint offset, float4x3 value) { - buffer.Store3((offset + 0u), asuint(value[0u])); - buffer.Store3((offset + 16u), asuint(value[1u])); - buffer.Store3((offset + 32u), asuint(value[2u])); - buffer.Store3((offset + 48u), asuint(value[3u])); +void s_store(uint offset, float4x3 value) { + s.Store3((offset + 0u), asuint(value[0u])); + s.Store3((offset + 16u), asuint(value[1u])); + s.Store3((offset + 32u), asuint(value[2u])); + s.Store3((offset + 48u), asuint(value[3u])); } -float4x3 tint_symbol_2(uint4 buffer[4], uint offset) { +float4x3 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz)); + return float4x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz), asfloat(u[scalar_offset_3 / 4].xyz)); } [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_2(u, 0u)); + s_store(0u, u_load(0u)); s.Store3(16u, asuint(asfloat(u[0].xyz))); s.Store3(16u, asuint(asfloat(u[0].xyz).zxy)); s.Store(4u, asuint(asfloat(u[1].x))); diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/to_workgroup.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/to_workgroup.wgsl.expected.dxc.hlsl index fab699abe8..4116f83c03 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/to_workgroup.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/to_workgroup.wgsl.expected.dxc.hlsl @@ -7,12 +7,12 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -float4x3 tint_symbol_2(uint4 buffer[4], uint offset) { +float4x3 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz)); + return float4x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz), asfloat(u[scalar_offset_3 / 4].xyz)); } void f_inner(uint local_invocation_index) { @@ -20,7 +20,7 @@ void f_inner(uint local_invocation_index) { w = float4x3((0.0f).xxx, (0.0f).xxx, (0.0f).xxx, (0.0f).xxx); } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); + w = u_load(0u); w[1] = asfloat(u[0].xyz); w[1] = asfloat(u[0].xyz).zxy; w[0][1] = asfloat(u[1].x); diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/to_workgroup.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/to_workgroup.wgsl.expected.fxc.hlsl index fab699abe8..4116f83c03 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/to_workgroup.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat4x3_f32/to_workgroup.wgsl.expected.fxc.hlsl @@ -7,12 +7,12 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -float4x3 tint_symbol_2(uint4 buffer[4], uint offset) { +float4x3 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz)); + return float4x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz), asfloat(u[scalar_offset_3 / 4].xyz)); } void f_inner(uint local_invocation_index) { @@ -20,7 +20,7 @@ void f_inner(uint local_invocation_index) { w = float4x3((0.0f).xxx, (0.0f).xxx, (0.0f).xxx, (0.0f).xxx); } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); + w = u_load(0u); w[1] = asfloat(u[0].xyz); w[1] = asfloat(u[0].xyz).zxy; w[0][1] = asfloat(u[1].x); diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x4_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat4x4_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl index 16e4c4f947..bfbdeedfa4 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat4x4_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat4x4_f16/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl @@ -8,24 +8,24 @@ int i() { return counter; } -matrix tint_symbol(uint4 buffer[2], uint offset) { +matrix m_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = m[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = m[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); vector ubo_load_2_yw = vector(f16tof32(ubo_load_2 >> 16)); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = m[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); vector ubo_load_4_yw = vector(f16tof32(ubo_load_4 >> 16)); const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_7 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_7 = m[scalar_offset_3 / 4]; uint2 ubo_load_6 = ((scalar_offset_3 & 2) ? ubo_load_7.zw : ubo_load_7.xy); vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); vector ubo_load_6_yw = vector(f16tof32(ubo_load_6 >> 16)); @@ -35,7 +35,7 @@ matrix tint_symbol(uint4 buffer[2], uint offset) { [numthreads(1, 1, 1)] void f() { const int p_m_i_save = i(); - const matrix l_m = tint_symbol(m, 0u); + const matrix l_m = m_load(0u); const uint scalar_offset_4 = ((8u * uint(p_m_i_save))) / 4; uint4 ubo_load_9 = m[scalar_offset_4 / 4]; uint2 ubo_load_8 = ((scalar_offset_4 & 2) ? ubo_load_9.zw : ubo_load_9.xy); diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x4_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat4x4_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl index a8413110c8..0088668c47 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat4x4_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat4x4_f16/static_index_via_ptr.wgsl.expected.dxc.hlsl @@ -8,24 +8,24 @@ int i() { return counter; } -matrix tint_symbol(uint4 buffer[2], uint offset) { +matrix m_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = m[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = m[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); vector ubo_load_2_yw = vector(f16tof32(ubo_load_2 >> 16)); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = m[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); vector ubo_load_4_yw = vector(f16tof32(ubo_load_4 >> 16)); const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_7 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_7 = m[scalar_offset_3 / 4]; uint2 ubo_load_6 = ((scalar_offset_3 & 2) ? ubo_load_7.zw : ubo_load_7.xy); vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); vector ubo_load_6_yw = vector(f16tof32(ubo_load_6 >> 16)); @@ -34,7 +34,7 @@ matrix tint_symbol(uint4 buffer[2], uint offset) { [numthreads(1, 1, 1)] void f() { - const matrix l_m = tint_symbol(m, 0u); + const matrix l_m = m_load(0u); uint2 ubo_load_8 = m[0].zw; vector ubo_load_8_xz = vector(f16tof32(ubo_load_8 & 0xFFFF)); vector ubo_load_8_yw = vector(f16tof32(ubo_load_8 >> 16)); diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x4_f16/to_builtin.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat4x4_f16/to_builtin.wgsl.expected.dxc.hlsl index cd3f1356c5..c1ac9f070d 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat4x4_f16/to_builtin.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat4x4_f16/to_builtin.wgsl.expected.dxc.hlsl @@ -2,24 +2,24 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[2]; }; -matrix tint_symbol(uint4 buffer[2], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); vector ubo_load_2_yw = vector(f16tof32(ubo_load_2 >> 16)); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = u[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); vector ubo_load_4_yw = vector(f16tof32(ubo_load_4 >> 16)); const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_7 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_7 = u[scalar_offset_3 / 4]; uint2 ubo_load_6 = ((scalar_offset_3 & 2) ? ubo_load_7.zw : ubo_load_7.xy); vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); vector ubo_load_6_yw = vector(f16tof32(ubo_load_6 >> 16)); @@ -28,7 +28,7 @@ matrix tint_symbol(uint4 buffer[2], uint offset) { [numthreads(1, 1, 1)] void f() { - const matrix t = transpose(tint_symbol(u, 0u)); + const matrix t = transpose(u_load(0u)); uint2 ubo_load_8 = u[0].zw; vector ubo_load_8_xz = vector(f16tof32(ubo_load_8 & 0xFFFF)); vector ubo_load_8_yw = vector(f16tof32(ubo_load_8 >> 16)); diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x4_f16/to_fn.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat4x4_f16/to_fn.wgsl.expected.dxc.hlsl index 01d30aef69..18ee3e851c 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat4x4_f16/to_fn.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat4x4_f16/to_fn.wgsl.expected.dxc.hlsl @@ -11,24 +11,24 @@ void b(vector v) { void c(float16_t f_1) { } -matrix tint_symbol(uint4 buffer[2], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); vector ubo_load_2_yw = vector(f16tof32(ubo_load_2 >> 16)); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = u[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); vector ubo_load_4_yw = vector(f16tof32(ubo_load_4 >> 16)); const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_7 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_7 = u[scalar_offset_3 / 4]; uint2 ubo_load_6 = ((scalar_offset_3 & 2) ? ubo_load_7.zw : ubo_load_7.xy); vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); vector ubo_load_6_yw = vector(f16tof32(ubo_load_6 >> 16)); @@ -37,7 +37,7 @@ matrix tint_symbol(uint4 buffer[2], uint offset) { [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); + a(u_load(0u)); uint2 ubo_load_8 = u[0].zw; vector ubo_load_8_xz = vector(f16tof32(ubo_load_8 & 0xFFFF)); vector ubo_load_8_yw = vector(f16tof32(ubo_load_8 >> 16)); diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x4_f16/to_private.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat4x4_f16/to_private.wgsl.expected.dxc.hlsl index 686f794d90..b8ec6be123 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat4x4_f16/to_private.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat4x4_f16/to_private.wgsl.expected.dxc.hlsl @@ -3,24 +3,24 @@ cbuffer cbuffer_u : register(b0, space0) { }; static matrix p = matrix(float16_t(0.0h), float16_t(0.0h), float16_t(0.0h), float16_t(0.0h), float16_t(0.0h), float16_t(0.0h), float16_t(0.0h), float16_t(0.0h), float16_t(0.0h), float16_t(0.0h), float16_t(0.0h), float16_t(0.0h), float16_t(0.0h), float16_t(0.0h), float16_t(0.0h), float16_t(0.0h)); -matrix tint_symbol(uint4 buffer[2], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); vector ubo_load_2_yw = vector(f16tof32(ubo_load_2 >> 16)); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = u[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); vector ubo_load_4_yw = vector(f16tof32(ubo_load_4 >> 16)); const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_7 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_7 = u[scalar_offset_3 / 4]; uint2 ubo_load_6 = ((scalar_offset_3 & 2) ? ubo_load_7.zw : ubo_load_7.xy); vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); vector ubo_load_6_yw = vector(f16tof32(ubo_load_6 >> 16)); @@ -29,7 +29,7 @@ matrix tint_symbol(uint4 buffer[2], uint offset) { [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); + p = u_load(0u); uint2 ubo_load_8 = u[0].xy; vector ubo_load_8_xz = vector(f16tof32(ubo_load_8 & 0xFFFF)); vector ubo_load_8_yw = vector(f16tof32(ubo_load_8 >> 16)); diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x4_f16/to_storage.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat4x4_f16/to_storage.wgsl.expected.dxc.hlsl index ab84a62969..a7d77f5ee8 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat4x4_f16/to_storage.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat4x4_f16/to_storage.wgsl.expected.dxc.hlsl @@ -3,31 +3,31 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol(RWByteAddressBuffer buffer, uint offset, matrix value) { - buffer.Store >((offset + 0u), value[0u]); - buffer.Store >((offset + 8u), value[1u]); - buffer.Store >((offset + 16u), value[2u]); - buffer.Store >((offset + 24u), value[3u]); +void s_store(uint offset, matrix value) { + s.Store >((offset + 0u), value[0u]); + s.Store >((offset + 8u), value[1u]); + s.Store >((offset + 16u), value[2u]); + s.Store >((offset + 24u), value[3u]); } -matrix tint_symbol_2(uint4 buffer[2], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); vector ubo_load_2_yw = vector(f16tof32(ubo_load_2 >> 16)); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = u[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); vector ubo_load_4_yw = vector(f16tof32(ubo_load_4 >> 16)); const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_7 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_7 = u[scalar_offset_3 / 4]; uint2 ubo_load_6 = ((scalar_offset_3 & 2) ? ubo_load_7.zw : ubo_load_7.xy); vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); vector ubo_load_6_yw = vector(f16tof32(ubo_load_6 >> 16)); @@ -36,7 +36,7 @@ matrix tint_symbol_2(uint4 buffer[2], uint offset) { [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_2(u, 0u)); + s_store(0u, u_load(0u)); uint2 ubo_load_8 = u[0].xy; vector ubo_load_8_xz = vector(f16tof32(ubo_load_8 & 0xFFFF)); vector ubo_load_8_yw = vector(f16tof32(ubo_load_8 >> 16)); diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x4_f16/to_workgroup.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat4x4_f16/to_workgroup.wgsl.expected.dxc.hlsl index 3cf441e015..b800a3817c 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat4x4_f16/to_workgroup.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat4x4_f16/to_workgroup.wgsl.expected.dxc.hlsl @@ -7,24 +7,24 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -matrix tint_symbol_2(uint4 buffer[2], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); vector ubo_load_2_yw = vector(f16tof32(ubo_load_2 >> 16)); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = u[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); vector ubo_load_4_yw = vector(f16tof32(ubo_load_4 >> 16)); const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_7 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_7 = u[scalar_offset_3 / 4]; uint2 ubo_load_6 = ((scalar_offset_3 & 2) ? ubo_load_7.zw : ubo_load_7.xy); vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); vector ubo_load_6_yw = vector(f16tof32(ubo_load_6 >> 16)); @@ -36,7 +36,7 @@ void f_inner(uint local_invocation_index) { w = matrix((float16_t(0.0h)).xxxx, (float16_t(0.0h)).xxxx, (float16_t(0.0h)).xxxx, (float16_t(0.0h)).xxxx); } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); + w = u_load(0u); uint2 ubo_load_8 = u[0].xy; vector ubo_load_8_xz = vector(f16tof32(ubo_load_8 & 0xFFFF)); vector ubo_load_8_yw = vector(f16tof32(ubo_load_8 >> 16)); diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x4_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat4x4_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl index ea3e8b8999..9f7ce7824e 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat4x4_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat4x4_f32/dynamic_index_via_ptr.wgsl.expected.dxc.hlsl @@ -8,18 +8,18 @@ int i() { return counter; } -float4x4 tint_symbol(uint4 buffer[4], uint offset) { +float4x4 m_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]), asfloat(buffer[scalar_offset_3 / 4])); + return float4x4(asfloat(m[scalar_offset / 4]), asfloat(m[scalar_offset_1 / 4]), asfloat(m[scalar_offset_2 / 4]), asfloat(m[scalar_offset_3 / 4])); } [numthreads(1, 1, 1)] void f() { const int p_m_i_save = i(); - const float4x4 l_m = tint_symbol(m, 0u); + const float4x4 l_m = m_load(0u); const uint scalar_offset_4 = ((16u * uint(p_m_i_save))) / 4; const float4 l_m_i = asfloat(m[scalar_offset_4 / 4]); return; diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x4_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat4x4_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl index ea3e8b8999..9f7ce7824e 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat4x4_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat4x4_f32/dynamic_index_via_ptr.wgsl.expected.fxc.hlsl @@ -8,18 +8,18 @@ int i() { return counter; } -float4x4 tint_symbol(uint4 buffer[4], uint offset) { +float4x4 m_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]), asfloat(buffer[scalar_offset_3 / 4])); + return float4x4(asfloat(m[scalar_offset / 4]), asfloat(m[scalar_offset_1 / 4]), asfloat(m[scalar_offset_2 / 4]), asfloat(m[scalar_offset_3 / 4])); } [numthreads(1, 1, 1)] void f() { const int p_m_i_save = i(); - const float4x4 l_m = tint_symbol(m, 0u); + const float4x4 l_m = m_load(0u); const uint scalar_offset_4 = ((16u * uint(p_m_i_save))) / 4; const float4 l_m_i = asfloat(m[scalar_offset_4 / 4]); return; diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x4_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat4x4_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl index 8ae2c10b94..fc2d7b93e8 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat4x4_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat4x4_f32/static_index_via_ptr.wgsl.expected.dxc.hlsl @@ -8,17 +8,17 @@ int i() { return counter; } -float4x4 tint_symbol(uint4 buffer[4], uint offset) { +float4x4 m_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]), asfloat(buffer[scalar_offset_3 / 4])); + return float4x4(asfloat(m[scalar_offset / 4]), asfloat(m[scalar_offset_1 / 4]), asfloat(m[scalar_offset_2 / 4]), asfloat(m[scalar_offset_3 / 4])); } [numthreads(1, 1, 1)] void f() { - const float4x4 l_m = tint_symbol(m, 0u); + const float4x4 l_m = m_load(0u); const float4 l_m_1 = asfloat(m[1]); return; } diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x4_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat4x4_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl index 8ae2c10b94..fc2d7b93e8 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat4x4_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat4x4_f32/static_index_via_ptr.wgsl.expected.fxc.hlsl @@ -8,17 +8,17 @@ int i() { return counter; } -float4x4 tint_symbol(uint4 buffer[4], uint offset) { +float4x4 m_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]), asfloat(buffer[scalar_offset_3 / 4])); + return float4x4(asfloat(m[scalar_offset / 4]), asfloat(m[scalar_offset_1 / 4]), asfloat(m[scalar_offset_2 / 4]), asfloat(m[scalar_offset_3 / 4])); } [numthreads(1, 1, 1)] void f() { - const float4x4 l_m = tint_symbol(m, 0u); + const float4x4 l_m = m_load(0u); const float4 l_m_1 = asfloat(m[1]); return; } diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x4_f32/to_builtin.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat4x4_f32/to_builtin.wgsl.expected.dxc.hlsl index 7642211655..e095f4c78b 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat4x4_f32/to_builtin.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat4x4_f32/to_builtin.wgsl.expected.dxc.hlsl @@ -2,17 +2,17 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[4]; }; -float4x4 tint_symbol(uint4 buffer[4], uint offset) { +float4x4 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]), asfloat(buffer[scalar_offset_3 / 4])); + return float4x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4]), asfloat(u[scalar_offset_2 / 4]), asfloat(u[scalar_offset_3 / 4])); } [numthreads(1, 1, 1)] void f() { - const float4x4 t = transpose(tint_symbol(u, 0u)); + const float4x4 t = transpose(u_load(0u)); const float l = length(asfloat(u[1])); const float a = abs(asfloat(u[0]).ywxz.x); return; diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x4_f32/to_builtin.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat4x4_f32/to_builtin.wgsl.expected.fxc.hlsl index 7642211655..e095f4c78b 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat4x4_f32/to_builtin.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat4x4_f32/to_builtin.wgsl.expected.fxc.hlsl @@ -2,17 +2,17 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[4]; }; -float4x4 tint_symbol(uint4 buffer[4], uint offset) { +float4x4 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]), asfloat(buffer[scalar_offset_3 / 4])); + return float4x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4]), asfloat(u[scalar_offset_2 / 4]), asfloat(u[scalar_offset_3 / 4])); } [numthreads(1, 1, 1)] void f() { - const float4x4 t = transpose(tint_symbol(u, 0u)); + const float4x4 t = transpose(u_load(0u)); const float l = length(asfloat(u[1])); const float a = abs(asfloat(u[0]).ywxz.x); return; diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x4_f32/to_fn.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat4x4_f32/to_fn.wgsl.expected.dxc.hlsl index b70e101f0f..8191a583c6 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat4x4_f32/to_fn.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat4x4_f32/to_fn.wgsl.expected.dxc.hlsl @@ -11,17 +11,17 @@ void b(float4 v) { void c(float f_1) { } -float4x4 tint_symbol(uint4 buffer[4], uint offset) { +float4x4 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]), asfloat(buffer[scalar_offset_3 / 4])); + return float4x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4]), asfloat(u[scalar_offset_2 / 4]), asfloat(u[scalar_offset_3 / 4])); } [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); + a(u_load(0u)); b(asfloat(u[1])); b(asfloat(u[1]).ywxz); c(asfloat(u[1].x)); diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x4_f32/to_fn.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat4x4_f32/to_fn.wgsl.expected.fxc.hlsl index b70e101f0f..8191a583c6 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat4x4_f32/to_fn.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat4x4_f32/to_fn.wgsl.expected.fxc.hlsl @@ -11,17 +11,17 @@ void b(float4 v) { void c(float f_1) { } -float4x4 tint_symbol(uint4 buffer[4], uint offset) { +float4x4 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]), asfloat(buffer[scalar_offset_3 / 4])); + return float4x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4]), asfloat(u[scalar_offset_2 / 4]), asfloat(u[scalar_offset_3 / 4])); } [numthreads(1, 1, 1)] void f() { - a(tint_symbol(u, 0u)); + a(u_load(0u)); b(asfloat(u[1])); b(asfloat(u[1]).ywxz); c(asfloat(u[1].x)); diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x4_f32/to_private.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat4x4_f32/to_private.wgsl.expected.dxc.hlsl index 767968640b..bcfed6a447 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat4x4_f32/to_private.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat4x4_f32/to_private.wgsl.expected.dxc.hlsl @@ -3,17 +3,17 @@ cbuffer cbuffer_u : register(b0, space0) { }; static float4x4 p = float4x4(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f); -float4x4 tint_symbol(uint4 buffer[4], uint offset) { +float4x4 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]), asfloat(buffer[scalar_offset_3 / 4])); + return float4x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4]), asfloat(u[scalar_offset_2 / 4]), asfloat(u[scalar_offset_3 / 4])); } [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); + p = u_load(0u); p[1] = asfloat(u[0]); p[1] = asfloat(u[0]).ywxz; p[0][1] = asfloat(u[1].x); diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x4_f32/to_private.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat4x4_f32/to_private.wgsl.expected.fxc.hlsl index 767968640b..bcfed6a447 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat4x4_f32/to_private.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat4x4_f32/to_private.wgsl.expected.fxc.hlsl @@ -3,17 +3,17 @@ cbuffer cbuffer_u : register(b0, space0) { }; static float4x4 p = float4x4(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f); -float4x4 tint_symbol(uint4 buffer[4], uint offset) { +float4x4 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]), asfloat(buffer[scalar_offset_3 / 4])); + return float4x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4]), asfloat(u[scalar_offset_2 / 4]), asfloat(u[scalar_offset_3 / 4])); } [numthreads(1, 1, 1)] void f() { - p = tint_symbol(u, 0u); + p = u_load(0u); p[1] = asfloat(u[0]); p[1] = asfloat(u[0]).ywxz; p[0][1] = asfloat(u[1].x); diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x4_f32/to_storage.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat4x4_f32/to_storage.wgsl.expected.dxc.hlsl index cd27df0aa9..9ace4303a8 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat4x4_f32/to_storage.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat4x4_f32/to_storage.wgsl.expected.dxc.hlsl @@ -3,24 +3,24 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol(RWByteAddressBuffer buffer, uint offset, float4x4 value) { - buffer.Store4((offset + 0u), asuint(value[0u])); - buffer.Store4((offset + 16u), asuint(value[1u])); - buffer.Store4((offset + 32u), asuint(value[2u])); - buffer.Store4((offset + 48u), asuint(value[3u])); +void s_store(uint offset, float4x4 value) { + s.Store4((offset + 0u), asuint(value[0u])); + s.Store4((offset + 16u), asuint(value[1u])); + s.Store4((offset + 32u), asuint(value[2u])); + s.Store4((offset + 48u), asuint(value[3u])); } -float4x4 tint_symbol_2(uint4 buffer[4], uint offset) { +float4x4 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]), asfloat(buffer[scalar_offset_3 / 4])); + return float4x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4]), asfloat(u[scalar_offset_2 / 4]), asfloat(u[scalar_offset_3 / 4])); } [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_2(u, 0u)); + s_store(0u, u_load(0u)); s.Store4(16u, asuint(asfloat(u[0]))); s.Store4(16u, asuint(asfloat(u[0]).ywxz)); s.Store(4u, asuint(asfloat(u[1].x))); diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x4_f32/to_storage.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat4x4_f32/to_storage.wgsl.expected.fxc.hlsl index cd27df0aa9..9ace4303a8 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat4x4_f32/to_storage.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat4x4_f32/to_storage.wgsl.expected.fxc.hlsl @@ -3,24 +3,24 @@ cbuffer cbuffer_u : register(b0, space0) { }; RWByteAddressBuffer s : register(u1, space0); -void tint_symbol(RWByteAddressBuffer buffer, uint offset, float4x4 value) { - buffer.Store4((offset + 0u), asuint(value[0u])); - buffer.Store4((offset + 16u), asuint(value[1u])); - buffer.Store4((offset + 32u), asuint(value[2u])); - buffer.Store4((offset + 48u), asuint(value[3u])); +void s_store(uint offset, float4x4 value) { + s.Store4((offset + 0u), asuint(value[0u])); + s.Store4((offset + 16u), asuint(value[1u])); + s.Store4((offset + 32u), asuint(value[2u])); + s.Store4((offset + 48u), asuint(value[3u])); } -float4x4 tint_symbol_2(uint4 buffer[4], uint offset) { +float4x4 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]), asfloat(buffer[scalar_offset_3 / 4])); + return float4x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4]), asfloat(u[scalar_offset_2 / 4]), asfloat(u[scalar_offset_3 / 4])); } [numthreads(1, 1, 1)] void f() { - tint_symbol(s, 0u, tint_symbol_2(u, 0u)); + s_store(0u, u_load(0u)); s.Store4(16u, asuint(asfloat(u[0]))); s.Store4(16u, asuint(asfloat(u[0]).ywxz)); s.Store(4u, asuint(asfloat(u[1].x))); diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x4_f32/to_workgroup.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat4x4_f32/to_workgroup.wgsl.expected.dxc.hlsl index eb1a4f3b56..c7aa6a4fda 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat4x4_f32/to_workgroup.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat4x4_f32/to_workgroup.wgsl.expected.dxc.hlsl @@ -7,12 +7,12 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -float4x4 tint_symbol_2(uint4 buffer[4], uint offset) { +float4x4 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]), asfloat(buffer[scalar_offset_3 / 4])); + return float4x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4]), asfloat(u[scalar_offset_2 / 4]), asfloat(u[scalar_offset_3 / 4])); } void f_inner(uint local_invocation_index) { @@ -20,7 +20,7 @@ void f_inner(uint local_invocation_index) { w = float4x4((0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx); } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); + w = u_load(0u); w[1] = asfloat(u[0]); w[1] = asfloat(u[0]).ywxz; w[0][1] = asfloat(u[1].x); diff --git a/test/tint/buffer/uniform/std140/unnested/mat4x4_f32/to_workgroup.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/std140/unnested/mat4x4_f32/to_workgroup.wgsl.expected.fxc.hlsl index eb1a4f3b56..c7aa6a4fda 100644 --- a/test/tint/buffer/uniform/std140/unnested/mat4x4_f32/to_workgroup.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/std140/unnested/mat4x4_f32/to_workgroup.wgsl.expected.fxc.hlsl @@ -7,12 +7,12 @@ struct tint_symbol_1 { uint local_invocation_index : SV_GroupIndex; }; -float4x4 tint_symbol_2(uint4 buffer[4], uint offset) { +float4x4 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]), asfloat(buffer[scalar_offset_3 / 4])); + return float4x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4]), asfloat(u[scalar_offset_2 / 4]), asfloat(u[scalar_offset_3 / 4])); } void f_inner(uint local_invocation_index) { @@ -20,7 +20,7 @@ void f_inner(uint local_invocation_index) { w = float4x4((0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx); } GroupMemoryBarrierWithGroupSync(); - w = tint_symbol_2(u, 0u); + w = u_load(0u); w[1] = asfloat(u[0]); w[1] = asfloat(u[0]).ywxz; w[0][1] = asfloat(u[1].x); diff --git a/test/tint/buffer/uniform/types/mat2x2_f16.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/types/mat2x2_f16.wgsl.expected.dxc.hlsl index cb72d733c2..1631138c24 100644 --- a/test/tint/buffer/uniform/types/mat2x2_f16.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/types/mat2x2_f16.wgsl.expected.dxc.hlsl @@ -2,16 +2,16 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[1]; }; -matrix tint_symbol(uint4 buffer[1], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint ubo_load = buffer[scalar_offset / 4][scalar_offset % 4]; + uint ubo_load = u[scalar_offset / 4][scalar_offset % 4]; const uint scalar_offset_1 = ((offset + 4u)) / 4; - uint ubo_load_1 = buffer[scalar_offset_1 / 4][scalar_offset_1 % 4]; + uint ubo_load_1 = u[scalar_offset_1 / 4][scalar_offset_1 % 4]; return matrix(vector(float16_t(f16tof32(ubo_load & 0xFFFF)), float16_t(f16tof32(ubo_load >> 16))), vector(float16_t(f16tof32(ubo_load_1 & 0xFFFF)), float16_t(f16tof32(ubo_load_1 >> 16)))); } [numthreads(1, 1, 1)] void main() { - const matrix x = tint_symbol(u, 0u); + const matrix x = u_load(0u); return; } diff --git a/test/tint/buffer/uniform/types/mat2x2_f32.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/types/mat2x2_f32.wgsl.expected.dxc.hlsl index c34b4c53df..6c0817804d 100644 --- a/test/tint/buffer/uniform/types/mat2x2_f32.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/types/mat2x2_f32.wgsl.expected.dxc.hlsl @@ -2,16 +2,16 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[1]; }; -float2x2 tint_symbol(uint4 buffer[1], uint offset) { +float2x2 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; return float2x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy))); } [numthreads(1, 1, 1)] void main() { - const float2x2 x = tint_symbol(u, 0u); + const float2x2 x = u_load(0u); return; } diff --git a/test/tint/buffer/uniform/types/mat2x2_f32.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/types/mat2x2_f32.wgsl.expected.fxc.hlsl index c34b4c53df..6c0817804d 100644 --- a/test/tint/buffer/uniform/types/mat2x2_f32.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/types/mat2x2_f32.wgsl.expected.fxc.hlsl @@ -2,16 +2,16 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[1]; }; -float2x2 tint_symbol(uint4 buffer[1], uint offset) { +float2x2 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; return float2x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy))); } [numthreads(1, 1, 1)] void main() { - const float2x2 x = tint_symbol(u, 0u); + const float2x2 x = u_load(0u); return; } diff --git a/test/tint/buffer/uniform/types/mat2x3_f16.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/types/mat2x3_f16.wgsl.expected.dxc.hlsl index ee623a093c..45f4476bd9 100644 --- a/test/tint/buffer/uniform/types/mat2x3_f16.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/types/mat2x3_f16.wgsl.expected.dxc.hlsl @@ -2,14 +2,14 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[1]; }; -matrix tint_symbol(uint4 buffer[1], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); @@ -18,6 +18,6 @@ matrix tint_symbol(uint4 buffer[1], uint offset) { [numthreads(1, 1, 1)] void main() { - const matrix x = tint_symbol(u, 0u); + const matrix x = u_load(0u); return; } diff --git a/test/tint/buffer/uniform/types/mat2x3_f32.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/types/mat2x3_f32.wgsl.expected.dxc.hlsl index e92e916135..bf4719bdd9 100644 --- a/test/tint/buffer/uniform/types/mat2x3_f32.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/types/mat2x3_f32.wgsl.expected.dxc.hlsl @@ -2,14 +2,14 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[2]; }; -float2x3 tint_symbol(uint4 buffer[2], uint offset) { +float2x3 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz)); + return float2x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz)); } [numthreads(1, 1, 1)] void main() { - const float2x3 x = tint_symbol(u, 0u); + const float2x3 x = u_load(0u); return; } diff --git a/test/tint/buffer/uniform/types/mat2x3_f32.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/types/mat2x3_f32.wgsl.expected.fxc.hlsl index e92e916135..bf4719bdd9 100644 --- a/test/tint/buffer/uniform/types/mat2x3_f32.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/types/mat2x3_f32.wgsl.expected.fxc.hlsl @@ -2,14 +2,14 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[2]; }; -float2x3 tint_symbol(uint4 buffer[2], uint offset) { +float2x3 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz)); + return float2x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz)); } [numthreads(1, 1, 1)] void main() { - const float2x3 x = tint_symbol(u, 0u); + const float2x3 x = u_load(0u); return; } diff --git a/test/tint/buffer/uniform/types/mat2x4_f16.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/types/mat2x4_f16.wgsl.expected.dxc.hlsl index c891507958..8e16c69967 100644 --- a/test/tint/buffer/uniform/types/mat2x4_f16.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/types/mat2x4_f16.wgsl.expected.dxc.hlsl @@ -2,14 +2,14 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[1]; }; -matrix tint_symbol(uint4 buffer[1], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); vector ubo_load_2_yw = vector(f16tof32(ubo_load_2 >> 16)); @@ -18,6 +18,6 @@ matrix tint_symbol(uint4 buffer[1], uint offset) { [numthreads(1, 1, 1)] void main() { - const matrix x = tint_symbol(u, 0u); + const matrix x = u_load(0u); return; } diff --git a/test/tint/buffer/uniform/types/mat2x4_f32.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/types/mat2x4_f32.wgsl.expected.dxc.hlsl index cead0e2fd6..71fba3d394 100644 --- a/test/tint/buffer/uniform/types/mat2x4_f32.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/types/mat2x4_f32.wgsl.expected.dxc.hlsl @@ -2,14 +2,14 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[2]; }; -float2x4 tint_symbol(uint4 buffer[2], uint offset) { +float2x4 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4])); + return float2x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4])); } [numthreads(1, 1, 1)] void main() { - const float2x4 x = tint_symbol(u, 0u); + const float2x4 x = u_load(0u); return; } diff --git a/test/tint/buffer/uniform/types/mat2x4_f32.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/types/mat2x4_f32.wgsl.expected.fxc.hlsl index cead0e2fd6..71fba3d394 100644 --- a/test/tint/buffer/uniform/types/mat2x4_f32.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/types/mat2x4_f32.wgsl.expected.fxc.hlsl @@ -2,14 +2,14 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[2]; }; -float2x4 tint_symbol(uint4 buffer[2], uint offset) { +float2x4 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4])); + return float2x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4])); } [numthreads(1, 1, 1)] void main() { - const float2x4 x = tint_symbol(u, 0u); + const float2x4 x = u_load(0u); return; } diff --git a/test/tint/buffer/uniform/types/mat3x2_f16.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/types/mat3x2_f16.wgsl.expected.dxc.hlsl index 704945f443..aa80e186c6 100644 --- a/test/tint/buffer/uniform/types/mat3x2_f16.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/types/mat3x2_f16.wgsl.expected.dxc.hlsl @@ -2,18 +2,18 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[1]; }; -matrix tint_symbol(uint4 buffer[1], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint ubo_load = buffer[scalar_offset / 4][scalar_offset % 4]; + uint ubo_load = u[scalar_offset / 4][scalar_offset % 4]; const uint scalar_offset_1 = ((offset + 4u)) / 4; - uint ubo_load_1 = buffer[scalar_offset_1 / 4][scalar_offset_1 % 4]; + uint ubo_load_1 = u[scalar_offset_1 / 4][scalar_offset_1 % 4]; const uint scalar_offset_2 = ((offset + 8u)) / 4; - uint ubo_load_2 = buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]; + uint ubo_load_2 = u[scalar_offset_2 / 4][scalar_offset_2 % 4]; return matrix(vector(float16_t(f16tof32(ubo_load & 0xFFFF)), float16_t(f16tof32(ubo_load >> 16))), vector(float16_t(f16tof32(ubo_load_1 & 0xFFFF)), float16_t(f16tof32(ubo_load_1 >> 16))), vector(float16_t(f16tof32(ubo_load_2 & 0xFFFF)), float16_t(f16tof32(ubo_load_2 >> 16)))); } [numthreads(1, 1, 1)] void main() { - const matrix x = tint_symbol(u, 0u); + const matrix x = u_load(0u); return; } diff --git a/test/tint/buffer/uniform/types/mat3x2_f32.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/types/mat3x2_f32.wgsl.expected.dxc.hlsl index 44f2aa4431..989e9b02f8 100644 --- a/test/tint/buffer/uniform/types/mat3x2_f32.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/types/mat3x2_f32.wgsl.expected.dxc.hlsl @@ -2,18 +2,18 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[2]; }; -float3x2 tint_symbol(uint4 buffer[2], uint offset) { +float3x2 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = u[scalar_offset_2 / 4]; return float3x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy))); } [numthreads(1, 1, 1)] void main() { - const float3x2 x = tint_symbol(u, 0u); + const float3x2 x = u_load(0u); return; } diff --git a/test/tint/buffer/uniform/types/mat3x2_f32.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/types/mat3x2_f32.wgsl.expected.fxc.hlsl index 44f2aa4431..989e9b02f8 100644 --- a/test/tint/buffer/uniform/types/mat3x2_f32.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/types/mat3x2_f32.wgsl.expected.fxc.hlsl @@ -2,18 +2,18 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[2]; }; -float3x2 tint_symbol(uint4 buffer[2], uint offset) { +float3x2 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = u[scalar_offset_2 / 4]; return float3x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy))); } [numthreads(1, 1, 1)] void main() { - const float3x2 x = tint_symbol(u, 0u); + const float3x2 x = u_load(0u); return; } diff --git a/test/tint/buffer/uniform/types/mat3x3_f16.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/types/mat3x3_f16.wgsl.expected.dxc.hlsl index 04db7e6ff4..5d0fd8eab1 100644 --- a/test/tint/buffer/uniform/types/mat3x3_f16.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/types/mat3x3_f16.wgsl.expected.dxc.hlsl @@ -2,19 +2,19 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[2]; }; -matrix tint_symbol(uint4 buffer[2], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = u[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); float16_t ubo_load_4_y = f16tof32(ubo_load_4[0] >> 16); @@ -23,6 +23,6 @@ matrix tint_symbol(uint4 buffer[2], uint offset) { [numthreads(1, 1, 1)] void main() { - const matrix x = tint_symbol(u, 0u); + const matrix x = u_load(0u); return; } diff --git a/test/tint/buffer/uniform/types/mat3x3_f32.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/types/mat3x3_f32.wgsl.expected.dxc.hlsl index 310ff04e06..1a62cb3a0a 100644 --- a/test/tint/buffer/uniform/types/mat3x3_f32.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/types/mat3x3_f32.wgsl.expected.dxc.hlsl @@ -2,15 +2,15 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[3]; }; -float3x3 tint_symbol(uint4 buffer[3], uint offset) { +float3x3 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz)); + return float3x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz)); } [numthreads(1, 1, 1)] void main() { - const float3x3 x = tint_symbol(u, 0u); + const float3x3 x = u_load(0u); return; } diff --git a/test/tint/buffer/uniform/types/mat3x3_f32.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/types/mat3x3_f32.wgsl.expected.fxc.hlsl index 310ff04e06..1a62cb3a0a 100644 --- a/test/tint/buffer/uniform/types/mat3x3_f32.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/types/mat3x3_f32.wgsl.expected.fxc.hlsl @@ -2,15 +2,15 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[3]; }; -float3x3 tint_symbol(uint4 buffer[3], uint offset) { +float3x3 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz)); + return float3x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz)); } [numthreads(1, 1, 1)] void main() { - const float3x3 x = tint_symbol(u, 0u); + const float3x3 x = u_load(0u); return; } diff --git a/test/tint/buffer/uniform/types/mat3x4_f16.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/types/mat3x4_f16.wgsl.expected.dxc.hlsl index a13d6891b8..8ac7c6ce83 100644 --- a/test/tint/buffer/uniform/types/mat3x4_f16.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/types/mat3x4_f16.wgsl.expected.dxc.hlsl @@ -2,19 +2,19 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[2]; }; -matrix tint_symbol(uint4 buffer[2], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); vector ubo_load_2_yw = vector(f16tof32(ubo_load_2 >> 16)); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = u[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); vector ubo_load_4_yw = vector(f16tof32(ubo_load_4 >> 16)); @@ -23,6 +23,6 @@ matrix tint_symbol(uint4 buffer[2], uint offset) { [numthreads(1, 1, 1)] void main() { - const matrix x = tint_symbol(u, 0u); + const matrix x = u_load(0u); return; } diff --git a/test/tint/buffer/uniform/types/mat3x4_f32.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/types/mat3x4_f32.wgsl.expected.dxc.hlsl index 4a409e5e6d..326ed645c5 100644 --- a/test/tint/buffer/uniform/types/mat3x4_f32.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/types/mat3x4_f32.wgsl.expected.dxc.hlsl @@ -2,15 +2,15 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[3]; }; -float3x4 tint_symbol(uint4 buffer[3], uint offset) { +float3x4 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); + return float3x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4]), asfloat(u[scalar_offset_2 / 4])); } [numthreads(1, 1, 1)] void main() { - const float3x4 x = tint_symbol(u, 0u); + const float3x4 x = u_load(0u); return; } diff --git a/test/tint/buffer/uniform/types/mat3x4_f32.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/types/mat3x4_f32.wgsl.expected.fxc.hlsl index 4a409e5e6d..326ed645c5 100644 --- a/test/tint/buffer/uniform/types/mat3x4_f32.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/types/mat3x4_f32.wgsl.expected.fxc.hlsl @@ -2,15 +2,15 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[3]; }; -float3x4 tint_symbol(uint4 buffer[3], uint offset) { +float3x4 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); + return float3x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4]), asfloat(u[scalar_offset_2 / 4])); } [numthreads(1, 1, 1)] void main() { - const float3x4 x = tint_symbol(u, 0u); + const float3x4 x = u_load(0u); return; } diff --git a/test/tint/buffer/uniform/types/mat4x2_f16.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/types/mat4x2_f16.wgsl.expected.dxc.hlsl index 4f03c89001..4b3c780382 100644 --- a/test/tint/buffer/uniform/types/mat4x2_f16.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/types/mat4x2_f16.wgsl.expected.dxc.hlsl @@ -2,20 +2,20 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[1]; }; -matrix tint_symbol(uint4 buffer[1], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint ubo_load = buffer[scalar_offset / 4][scalar_offset % 4]; + uint ubo_load = u[scalar_offset / 4][scalar_offset % 4]; const uint scalar_offset_1 = ((offset + 4u)) / 4; - uint ubo_load_1 = buffer[scalar_offset_1 / 4][scalar_offset_1 % 4]; + uint ubo_load_1 = u[scalar_offset_1 / 4][scalar_offset_1 % 4]; const uint scalar_offset_2 = ((offset + 8u)) / 4; - uint ubo_load_2 = buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]; + uint ubo_load_2 = u[scalar_offset_2 / 4][scalar_offset_2 % 4]; const uint scalar_offset_3 = ((offset + 12u)) / 4; - uint ubo_load_3 = buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]; + uint ubo_load_3 = u[scalar_offset_3 / 4][scalar_offset_3 % 4]; return matrix(vector(float16_t(f16tof32(ubo_load & 0xFFFF)), float16_t(f16tof32(ubo_load >> 16))), vector(float16_t(f16tof32(ubo_load_1 & 0xFFFF)), float16_t(f16tof32(ubo_load_1 >> 16))), vector(float16_t(f16tof32(ubo_load_2 & 0xFFFF)), float16_t(f16tof32(ubo_load_2 >> 16))), vector(float16_t(f16tof32(ubo_load_3 & 0xFFFF)), float16_t(f16tof32(ubo_load_3 >> 16)))); } [numthreads(1, 1, 1)] void main() { - const matrix x = tint_symbol(u, 0u); + const matrix x = u_load(0u); return; } diff --git a/test/tint/buffer/uniform/types/mat4x2_f32.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/types/mat4x2_f32.wgsl.expected.dxc.hlsl index a6278e9ce8..1d094f3c96 100644 --- a/test/tint/buffer/uniform/types/mat4x2_f32.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/types/mat4x2_f32.wgsl.expected.dxc.hlsl @@ -2,20 +2,20 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[2]; }; -float4x2 tint_symbol(uint4 buffer[2], uint offset) { +float4x2 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = u[scalar_offset_2 / 4]; const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_3 = u[scalar_offset_3 / 4]; return float4x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy)), asfloat(((scalar_offset_3 & 2) ? ubo_load_3.zw : ubo_load_3.xy))); } [numthreads(1, 1, 1)] void main() { - const float4x2 x = tint_symbol(u, 0u); + const float4x2 x = u_load(0u); return; } diff --git a/test/tint/buffer/uniform/types/mat4x2_f32.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/types/mat4x2_f32.wgsl.expected.fxc.hlsl index a6278e9ce8..1d094f3c96 100644 --- a/test/tint/buffer/uniform/types/mat4x2_f32.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/types/mat4x2_f32.wgsl.expected.fxc.hlsl @@ -2,20 +2,20 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[2]; }; -float4x2 tint_symbol(uint4 buffer[2], uint offset) { +float4x2 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = u[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = u[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = u[scalar_offset_2 / 4]; const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_3 = u[scalar_offset_3 / 4]; return float4x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy)), asfloat(((scalar_offset_3 & 2) ? ubo_load_3.zw : ubo_load_3.xy))); } [numthreads(1, 1, 1)] void main() { - const float4x2 x = tint_symbol(u, 0u); + const float4x2 x = u_load(0u); return; } diff --git a/test/tint/buffer/uniform/types/mat4x3_f16.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/types/mat4x3_f16.wgsl.expected.dxc.hlsl index 5acbef9f0d..80b31cf979 100644 --- a/test/tint/buffer/uniform/types/mat4x3_f16.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/types/mat4x3_f16.wgsl.expected.dxc.hlsl @@ -2,24 +2,24 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[2]; }; -matrix tint_symbol(uint4 buffer[2], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = u[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); float16_t ubo_load_4_y = f16tof32(ubo_load_4[0] >> 16); const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_7 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_7 = u[scalar_offset_3 / 4]; uint2 ubo_load_6 = ((scalar_offset_3 & 2) ? ubo_load_7.zw : ubo_load_7.xy); vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); float16_t ubo_load_6_y = f16tof32(ubo_load_6[0] >> 16); @@ -28,6 +28,6 @@ matrix tint_symbol(uint4 buffer[2], uint offset) { [numthreads(1, 1, 1)] void main() { - const matrix x = tint_symbol(u, 0u); + const matrix x = u_load(0u); return; } diff --git a/test/tint/buffer/uniform/types/mat4x3_f32.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/types/mat4x3_f32.wgsl.expected.dxc.hlsl index 044877c4ee..449a55369f 100644 --- a/test/tint/buffer/uniform/types/mat4x3_f32.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/types/mat4x3_f32.wgsl.expected.dxc.hlsl @@ -2,16 +2,16 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[4]; }; -float4x3 tint_symbol(uint4 buffer[4], uint offset) { +float4x3 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz)); + return float4x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz), asfloat(u[scalar_offset_3 / 4].xyz)); } [numthreads(1, 1, 1)] void main() { - const float4x3 x = tint_symbol(u, 0u); + const float4x3 x = u_load(0u); return; } diff --git a/test/tint/buffer/uniform/types/mat4x3_f32.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/types/mat4x3_f32.wgsl.expected.fxc.hlsl index 044877c4ee..449a55369f 100644 --- a/test/tint/buffer/uniform/types/mat4x3_f32.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/types/mat4x3_f32.wgsl.expected.fxc.hlsl @@ -2,16 +2,16 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[4]; }; -float4x3 tint_symbol(uint4 buffer[4], uint offset) { +float4x3 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz)); + return float4x3(asfloat(u[scalar_offset / 4].xyz), asfloat(u[scalar_offset_1 / 4].xyz), asfloat(u[scalar_offset_2 / 4].xyz), asfloat(u[scalar_offset_3 / 4].xyz)); } [numthreads(1, 1, 1)] void main() { - const float4x3 x = tint_symbol(u, 0u); + const float4x3 x = u_load(0u); return; } diff --git a/test/tint/buffer/uniform/types/mat4x4_f16.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/types/mat4x4_f16.wgsl.expected.dxc.hlsl index a0e9f1b505..4739745c92 100644 --- a/test/tint/buffer/uniform/types/mat4x4_f16.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/types/mat4x4_f16.wgsl.expected.dxc.hlsl @@ -2,24 +2,24 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[2]; }; -matrix tint_symbol(uint4 buffer[2], uint offset) { +matrix u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); vector ubo_load_2_yw = vector(f16tof32(ubo_load_2 >> 16)); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = u[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); vector ubo_load_4_yw = vector(f16tof32(ubo_load_4 >> 16)); const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_7 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_7 = u[scalar_offset_3 / 4]; uint2 ubo_load_6 = ((scalar_offset_3 & 2) ? ubo_load_7.zw : ubo_load_7.xy); vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); vector ubo_load_6_yw = vector(f16tof32(ubo_load_6 >> 16)); @@ -28,6 +28,6 @@ matrix tint_symbol(uint4 buffer[2], uint offset) { [numthreads(1, 1, 1)] void main() { - const matrix x = tint_symbol(u, 0u); + const matrix x = u_load(0u); return; } diff --git a/test/tint/buffer/uniform/types/mat4x4_f32.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/types/mat4x4_f32.wgsl.expected.dxc.hlsl index 0b14de0372..7a4201f539 100644 --- a/test/tint/buffer/uniform/types/mat4x4_f32.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/types/mat4x4_f32.wgsl.expected.dxc.hlsl @@ -2,16 +2,16 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[4]; }; -float4x4 tint_symbol(uint4 buffer[4], uint offset) { +float4x4 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]), asfloat(buffer[scalar_offset_3 / 4])); + return float4x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4]), asfloat(u[scalar_offset_2 / 4]), asfloat(u[scalar_offset_3 / 4])); } [numthreads(1, 1, 1)] void main() { - const float4x4 x = tint_symbol(u, 0u); + const float4x4 x = u_load(0u); return; } diff --git a/test/tint/buffer/uniform/types/mat4x4_f32.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/types/mat4x4_f32.wgsl.expected.fxc.hlsl index 0b14de0372..7a4201f539 100644 --- a/test/tint/buffer/uniform/types/mat4x4_f32.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/types/mat4x4_f32.wgsl.expected.fxc.hlsl @@ -2,16 +2,16 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[4]; }; -float4x4 tint_symbol(uint4 buffer[4], uint offset) { +float4x4 u_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]), asfloat(buffer[scalar_offset_3 / 4])); + return float4x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4]), asfloat(u[scalar_offset_2 / 4]), asfloat(u[scalar_offset_3 / 4])); } [numthreads(1, 1, 1)] void main() { - const float4x4 x = tint_symbol(u, 0u); + const float4x4 x = u_load(0u); return; } diff --git a/test/tint/buffer/uniform/types/struct_f16.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/types/struct_f16.wgsl.expected.dxc.hlsl index 0ee746eba5..f6b094a8b9 100644 --- a/test/tint/buffer/uniform/types/struct_f16.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/types/struct_f16.wgsl.expected.dxc.hlsl @@ -11,39 +11,39 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[2]; }; -matrix tint_symbol_4(uint4 buffer[2], uint offset) { +matrix u_load_4(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = u[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); vector ubo_load_yw = vector(f16tof32(ubo_load >> 16)); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = u[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); vector ubo_load_2_yw = vector(f16tof32(ubo_load_2 >> 16)); return matrix(vector(ubo_load_xz[0], ubo_load_yw[0], ubo_load_xz[1], ubo_load_yw[1]), vector(ubo_load_2_xz[0], ubo_load_2_yw[0], ubo_load_2_xz[1], ubo_load_2_yw[1])); } -Inner tint_symbol_1(uint4 buffer[2], uint offset) { +Inner u_load_1(uint offset) { const uint scalar_offset_bytes = ((offset + 0u)); const uint scalar_offset_index = scalar_offset_bytes / 4; const uint scalar_offset_2 = ((offset + 8u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = u[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); float16_t ubo_load_4_y = f16tof32(ubo_load_4[0] >> 16); - const Inner tint_symbol_6 = {float16_t(f16tof32(((buffer[scalar_offset_index / 4][scalar_offset_index % 4] >> (scalar_offset_bytes % 4 == 0 ? 0 : 16)) & 0xFFFF))), vector(ubo_load_4_xz[0], ubo_load_4_y, ubo_load_4_xz[1]), tint_symbol_4(buffer, (offset + 16u))}; - return tint_symbol_6; + const Inner tint_symbol = {float16_t(f16tof32(((u[scalar_offset_index / 4][scalar_offset_index % 4] >> (scalar_offset_bytes % 4 == 0 ? 0 : 16)) & 0xFFFF))), vector(ubo_load_4_xz[0], ubo_load_4_y, ubo_load_4_xz[1]), u_load_4((offset + 16u))}; + return tint_symbol; } -S tint_symbol(uint4 buffer[2], uint offset) { - const S tint_symbol_7 = {tint_symbol_1(buffer, (offset + 0u))}; - return tint_symbol_7; +S u_load(uint offset) { + const S tint_symbol_1 = {u_load_1((offset + 0u))}; + return tint_symbol_1; } [numthreads(1, 1, 1)] void main() { - const S x = tint_symbol(u, 0u); + const S x = u_load(0u); return; } diff --git a/test/tint/buffer/uniform/types/struct_f32.wgsl.expected.dxc.hlsl b/test/tint/buffer/uniform/types/struct_f32.wgsl.expected.dxc.hlsl index c6a68916cb..ee09fc9ec7 100644 --- a/test/tint/buffer/uniform/types/struct_f32.wgsl.expected.dxc.hlsl +++ b/test/tint/buffer/uniform/types/struct_f32.wgsl.expected.dxc.hlsl @@ -11,26 +11,26 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[4]; }; -float2x4 tint_symbol_4(uint4 buffer[4], uint offset) { +float2x4 u_load_4(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4])); + return float2x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4])); } -Inner tint_symbol_1(uint4 buffer[4], uint offset) { +Inner u_load_1(uint offset) { const uint scalar_offset_2 = ((offset + 0u)) / 4; const uint scalar_offset_3 = ((offset + 16u)) / 4; - const Inner tint_symbol_6 = {asfloat(buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]), asfloat(buffer[scalar_offset_3 / 4].xyz), tint_symbol_4(buffer, (offset + 32u))}; - return tint_symbol_6; + const Inner tint_symbol = {asfloat(u[scalar_offset_2 / 4][scalar_offset_2 % 4]), asfloat(u[scalar_offset_3 / 4].xyz), u_load_4((offset + 32u))}; + return tint_symbol; } -S tint_symbol(uint4 buffer[4], uint offset) { - const S tint_symbol_7 = {tint_symbol_1(buffer, (offset + 0u))}; - return tint_symbol_7; +S u_load(uint offset) { + const S tint_symbol_1 = {u_load_1((offset + 0u))}; + return tint_symbol_1; } [numthreads(1, 1, 1)] void main() { - const S x = tint_symbol(u, 0u); + const S x = u_load(0u); return; } diff --git a/test/tint/buffer/uniform/types/struct_f32.wgsl.expected.fxc.hlsl b/test/tint/buffer/uniform/types/struct_f32.wgsl.expected.fxc.hlsl index c6a68916cb..ee09fc9ec7 100644 --- a/test/tint/buffer/uniform/types/struct_f32.wgsl.expected.fxc.hlsl +++ b/test/tint/buffer/uniform/types/struct_f32.wgsl.expected.fxc.hlsl @@ -11,26 +11,26 @@ cbuffer cbuffer_u : register(b0, space0) { uint4 u[4]; }; -float2x4 tint_symbol_4(uint4 buffer[4], uint offset) { +float2x4 u_load_4(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; - return float2x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4])); + return float2x4(asfloat(u[scalar_offset / 4]), asfloat(u[scalar_offset_1 / 4])); } -Inner tint_symbol_1(uint4 buffer[4], uint offset) { +Inner u_load_1(uint offset) { const uint scalar_offset_2 = ((offset + 0u)) / 4; const uint scalar_offset_3 = ((offset + 16u)) / 4; - const Inner tint_symbol_6 = {asfloat(buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]), asfloat(buffer[scalar_offset_3 / 4].xyz), tint_symbol_4(buffer, (offset + 32u))}; - return tint_symbol_6; + const Inner tint_symbol = {asfloat(u[scalar_offset_2 / 4][scalar_offset_2 % 4]), asfloat(u[scalar_offset_3 / 4].xyz), u_load_4((offset + 32u))}; + return tint_symbol; } -S tint_symbol(uint4 buffer[4], uint offset) { - const S tint_symbol_7 = {tint_symbol_1(buffer, (offset + 0u))}; - return tint_symbol_7; +S u_load(uint offset) { + const S tint_symbol_1 = {u_load_1((offset + 0u))}; + return tint_symbol_1; } [numthreads(1, 1, 1)] void main() { - const S x = tint_symbol(u, 0u); + const S x = u_load(0u); return; } diff --git a/test/tint/bug/chromium/1273230.wgsl.expected.dxc.hlsl b/test/tint/bug/chromium/1273230.wgsl.expected.dxc.hlsl index c29e7d69c2..a7e3f1a539 100644 --- a/test/tint/bug/chromium/1273230.wgsl.expected.dxc.hlsl +++ b/test/tint/bug/chromium/1273230.wgsl.expected.dxc.hlsl @@ -47,16 +47,16 @@ float3 loadPosition(uint vertexIndex) { return position; } -uint tint_atomicLoad(RWByteAddressBuffer buffer, uint offset) { +uint countersatomicLoad(uint offset) { uint value = 0; - buffer.InterlockedOr(offset, 0, value); + counters.InterlockedOr(offset, 0, value); return value; } -int tint_atomicLoad_1(RWByteAddressBuffer buffer, uint offset) { +int LUTatomicLoad(uint offset) { int value = 0; - buffer.InterlockedOr(offset, 0, value); + LUT.InterlockedOr(offset, 0, value); return value; } @@ -64,19 +64,19 @@ int tint_atomicLoad_1(RWByteAddressBuffer buffer, uint offset) { void doIgnore() { uint g43 = uniforms[0].x; uint kj6 = dbg.Load(20u); - uint b53 = tint_atomicLoad(counters, 0u); + uint b53 = countersatomicLoad(0u); uint rwg = indices.Load(0u); float rb5 = asfloat(positions.Load(0u)); - int g55 = tint_atomicLoad_1(LUT, 0u); + int g55 = LUTatomicLoad(0u); } struct tint_symbol_1 { uint3 GlobalInvocationID : SV_DispatchThreadID; }; -int tint_atomicAdd(RWByteAddressBuffer buffer, uint offset, int value) { +int LUTatomicAdd(uint offset, int value) { int original_value = 0; - buffer.InterlockedAdd(offset, value, original_value); + LUT.InterlockedAdd(offset, value, original_value); return original_value; } @@ -96,7 +96,7 @@ void main_count_inner(uint3 GlobalInvocationID) { float3 center = (((p0 + p2) + p1) / 3.0f); float3 voxelPos = toVoxelPos(p1); uint lIndex = toIndex1D(uniforms[0].y, p0); - int triangleOffset = tint_atomicAdd(LUT, (4u * i1), 1); + int triangleOffset = LUTatomicAdd((4u * i1), 1); } [numthreads(128, 1, 1)] diff --git a/test/tint/bug/chromium/1273230.wgsl.expected.fxc.hlsl b/test/tint/bug/chromium/1273230.wgsl.expected.fxc.hlsl index c29e7d69c2..a7e3f1a539 100644 --- a/test/tint/bug/chromium/1273230.wgsl.expected.fxc.hlsl +++ b/test/tint/bug/chromium/1273230.wgsl.expected.fxc.hlsl @@ -47,16 +47,16 @@ float3 loadPosition(uint vertexIndex) { return position; } -uint tint_atomicLoad(RWByteAddressBuffer buffer, uint offset) { +uint countersatomicLoad(uint offset) { uint value = 0; - buffer.InterlockedOr(offset, 0, value); + counters.InterlockedOr(offset, 0, value); return value; } -int tint_atomicLoad_1(RWByteAddressBuffer buffer, uint offset) { +int LUTatomicLoad(uint offset) { int value = 0; - buffer.InterlockedOr(offset, 0, value); + LUT.InterlockedOr(offset, 0, value); return value; } @@ -64,19 +64,19 @@ int tint_atomicLoad_1(RWByteAddressBuffer buffer, uint offset) { void doIgnore() { uint g43 = uniforms[0].x; uint kj6 = dbg.Load(20u); - uint b53 = tint_atomicLoad(counters, 0u); + uint b53 = countersatomicLoad(0u); uint rwg = indices.Load(0u); float rb5 = asfloat(positions.Load(0u)); - int g55 = tint_atomicLoad_1(LUT, 0u); + int g55 = LUTatomicLoad(0u); } struct tint_symbol_1 { uint3 GlobalInvocationID : SV_DispatchThreadID; }; -int tint_atomicAdd(RWByteAddressBuffer buffer, uint offset, int value) { +int LUTatomicAdd(uint offset, int value) { int original_value = 0; - buffer.InterlockedAdd(offset, value, original_value); + LUT.InterlockedAdd(offset, value, original_value); return original_value; } @@ -96,7 +96,7 @@ void main_count_inner(uint3 GlobalInvocationID) { float3 center = (((p0 + p2) + p1) / 3.0f); float3 voxelPos = toVoxelPos(p1); uint lIndex = toIndex1D(uniforms[0].y, p0); - int triangleOffset = tint_atomicAdd(LUT, (4u * i1), 1); + int triangleOffset = LUTatomicAdd((4u * i1), 1); } [numthreads(128, 1, 1)] diff --git a/test/tint/bug/fxc/indexed_assign_to_array_in_struct/1206.wgsl.expected.dxc.hlsl b/test/tint/bug/fxc/indexed_assign_to_array_in_struct/1206.wgsl.expected.dxc.hlsl index e76d9bdedf..a9c516744c 100644 --- a/test/tint/bug/fxc/indexed_assign_to_array_in_struct/1206.wgsl.expected.dxc.hlsl +++ b/test/tint/bug/fxc/indexed_assign_to_array_in_struct/1206.wgsl.expected.dxc.hlsl @@ -10,25 +10,25 @@ cbuffer cbuffer_sim : register(b4, space1) { uint4 sim[1]; }; -typedef float3 tint_symbol_3_ret[8]; -tint_symbol_3_ret tint_symbol_3(ByteAddressBuffer buffer, uint offset) { +typedef float3 particles_load_1_ret[8]; +particles_load_1_ret particles_load_1(uint offset) { float3 arr[8] = (float3[8])0; { for(uint i_1 = 0u; (i_1 < 8u); i_1 = (i_1 + 1u)) { - arr[i_1] = asfloat(buffer.Load3((offset + (i_1 * 16u)))); + arr[i_1] = asfloat(particles.Load3((offset + (i_1 * 16u)))); } } return arr; } -Particle tint_symbol_2(ByteAddressBuffer buffer, uint offset) { - const Particle tint_symbol_8 = {tint_symbol_3(buffer, (offset + 0u)), asfloat(buffer.Load((offset + 128u))), asfloat(buffer.Load4((offset + 144u))), asfloat(buffer.Load3((offset + 160u)))}; - return tint_symbol_8; +Particle particles_load(uint offset) { + const Particle tint_symbol_2 = {particles_load_1((offset + 0u)), asfloat(particles.Load((offset + 128u))), asfloat(particles.Load4((offset + 144u))), asfloat(particles.Load3((offset + 160u)))}; + return tint_symbol_2; } [numthreads(1, 1, 1)] void main() { - Particle particle = tint_symbol_2(particles, 0u); + Particle particle = particles_load(0u); { float3 tint_symbol_1[8] = particle.position; tint_symbol_1[sim[0].x] = particle.position[sim[0].x]; diff --git a/test/tint/bug/fxc/indexed_assign_to_array_in_struct/1206.wgsl.expected.fxc.hlsl b/test/tint/bug/fxc/indexed_assign_to_array_in_struct/1206.wgsl.expected.fxc.hlsl index e76d9bdedf..a9c516744c 100644 --- a/test/tint/bug/fxc/indexed_assign_to_array_in_struct/1206.wgsl.expected.fxc.hlsl +++ b/test/tint/bug/fxc/indexed_assign_to_array_in_struct/1206.wgsl.expected.fxc.hlsl @@ -10,25 +10,25 @@ cbuffer cbuffer_sim : register(b4, space1) { uint4 sim[1]; }; -typedef float3 tint_symbol_3_ret[8]; -tint_symbol_3_ret tint_symbol_3(ByteAddressBuffer buffer, uint offset) { +typedef float3 particles_load_1_ret[8]; +particles_load_1_ret particles_load_1(uint offset) { float3 arr[8] = (float3[8])0; { for(uint i_1 = 0u; (i_1 < 8u); i_1 = (i_1 + 1u)) { - arr[i_1] = asfloat(buffer.Load3((offset + (i_1 * 16u)))); + arr[i_1] = asfloat(particles.Load3((offset + (i_1 * 16u)))); } } return arr; } -Particle tint_symbol_2(ByteAddressBuffer buffer, uint offset) { - const Particle tint_symbol_8 = {tint_symbol_3(buffer, (offset + 0u)), asfloat(buffer.Load((offset + 128u))), asfloat(buffer.Load4((offset + 144u))), asfloat(buffer.Load3((offset + 160u)))}; - return tint_symbol_8; +Particle particles_load(uint offset) { + const Particle tint_symbol_2 = {particles_load_1((offset + 0u)), asfloat(particles.Load((offset + 128u))), asfloat(particles.Load4((offset + 144u))), asfloat(particles.Load3((offset + 160u)))}; + return tint_symbol_2; } [numthreads(1, 1, 1)] void main() { - Particle particle = tint_symbol_2(particles, 0u); + Particle particle = particles_load(0u); { float3 tint_symbol_1[8] = particle.position; tint_symbol_1[sim[0].x] = particle.position[sim[0].x]; diff --git a/test/tint/bug/tint/1046.wgsl.expected.dxc.hlsl b/test/tint/bug/tint/1046.wgsl.expected.dxc.hlsl index e3e72045ce..0938bccc99 100644 --- a/test/tint/bug/tint/1046.wgsl.expected.dxc.hlsl +++ b/test/tint/bug/tint/1046.wgsl.expected.dxc.hlsl @@ -55,8 +55,8 @@ FragmentOutput main_inner(FragmentInput fragment) { } tint_symbol_2 main(tint_symbol_1 tint_symbol) { - const FragmentInput tint_symbol_5 = {tint_symbol.position, tint_symbol.view_position, tint_symbol.normal, tint_symbol.uv, tint_symbol.color}; - const FragmentOutput inner_result = main_inner(tint_symbol_5); + const FragmentInput tint_symbol_3 = {tint_symbol.position, tint_symbol.view_position, tint_symbol.normal, tint_symbol.uv, tint_symbol.color}; + const FragmentOutput inner_result = main_inner(tint_symbol_3); tint_symbol_2 wrapper_result = (tint_symbol_2)0; wrapper_result.color = inner_result.color; return wrapper_result; diff --git a/test/tint/bug/tint/1046.wgsl.expected.fxc.hlsl b/test/tint/bug/tint/1046.wgsl.expected.fxc.hlsl index e3e72045ce..0938bccc99 100644 --- a/test/tint/bug/tint/1046.wgsl.expected.fxc.hlsl +++ b/test/tint/bug/tint/1046.wgsl.expected.fxc.hlsl @@ -55,8 +55,8 @@ FragmentOutput main_inner(FragmentInput fragment) { } tint_symbol_2 main(tint_symbol_1 tint_symbol) { - const FragmentInput tint_symbol_5 = {tint_symbol.position, tint_symbol.view_position, tint_symbol.normal, tint_symbol.uv, tint_symbol.color}; - const FragmentOutput inner_result = main_inner(tint_symbol_5); + const FragmentInput tint_symbol_3 = {tint_symbol.position, tint_symbol.view_position, tint_symbol.normal, tint_symbol.uv, tint_symbol.color}; + const FragmentOutput inner_result = main_inner(tint_symbol_3); tint_symbol_2 wrapper_result = (tint_symbol_2)0; wrapper_result.color = inner_result.color; return wrapper_result; diff --git a/test/tint/bug/tint/1061.spvasm.expected.dxc.hlsl b/test/tint/bug/tint/1061.spvasm.expected.dxc.hlsl index 319b7c3e92..e4d1fbd579 100644 --- a/test/tint/bug/tint/1061.spvasm.expected.dxc.hlsl +++ b/test/tint/bug/tint/1061.spvasm.expected.dxc.hlsl @@ -31,8 +31,8 @@ struct tint_symbol { main_out main_inner() { main_1(); - const main_out tint_symbol_2 = {x_GLF_color}; - return tint_symbol_2; + const main_out tint_symbol_1 = {x_GLF_color}; + return tint_symbol_1; } tint_symbol main() { diff --git a/test/tint/bug/tint/1061.spvasm.expected.fxc.hlsl b/test/tint/bug/tint/1061.spvasm.expected.fxc.hlsl index 319b7c3e92..e4d1fbd579 100644 --- a/test/tint/bug/tint/1061.spvasm.expected.fxc.hlsl +++ b/test/tint/bug/tint/1061.spvasm.expected.fxc.hlsl @@ -31,8 +31,8 @@ struct tint_symbol { main_out main_inner() { main_1(); - const main_out tint_symbol_2 = {x_GLF_color}; - return tint_symbol_2; + const main_out tint_symbol_1 = {x_GLF_color}; + return tint_symbol_1; } tint_symbol main() { diff --git a/test/tint/bug/tint/1088.spvasm.expected.dxc.hlsl b/test/tint/bug/tint/1088.spvasm.expected.dxc.hlsl index 1588b26de3..4884747c1a 100644 --- a/test/tint/bug/tint/1088.spvasm.expected.dxc.hlsl +++ b/test/tint/bug/tint/1088.spvasm.expected.dxc.hlsl @@ -7,12 +7,12 @@ static float2 uv = float2(0.0f, 0.0f); static float3 normal = float3(0.0f, 0.0f, 0.0f); static float4 gl_Position = float4(0.0f, 0.0f, 0.0f, 0.0f); -float4x4 tint_symbol_4(uint4 buffer[17], uint offset) { +float4x4 x_14_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]), asfloat(buffer[scalar_offset_3 / 4])); + return float4x4(asfloat(x_14[scalar_offset / 4]), asfloat(x_14[scalar_offset_1 / 4]), asfloat(x_14[scalar_offset_2 / 4]), asfloat(x_14[scalar_offset_3 / 4])); } void main_1() { @@ -30,7 +30,7 @@ void main_1() { const float x_55 = p.y; const float x_57 = asfloat(x_14[4].x); p.y = (x_55 + sin((x_57 + 4.0f))); - const float4x4 x_69 = tint_symbol_4(x_14, 0u); + const float4x4 x_69 = x_14_load_1(0u); const float3 x_70 = p; gl_Position = mul(float4(x_70.x, x_70.y, x_70.z, 1.0f), x_69); const float2 x_83 = uv; @@ -59,8 +59,8 @@ main_out main_inner(float3 position_1_param, float2 uv_param, float3 normal_para uv = uv_param; normal = normal_param; main_1(); - const main_out tint_symbol_6 = {gl_Position, vUV}; - return tint_symbol_6; + const main_out tint_symbol_3 = {gl_Position, vUV}; + return tint_symbol_3; } tint_symbol_2 main(tint_symbol_1 tint_symbol) { diff --git a/test/tint/bug/tint/1088.spvasm.expected.fxc.hlsl b/test/tint/bug/tint/1088.spvasm.expected.fxc.hlsl index 1588b26de3..4884747c1a 100644 --- a/test/tint/bug/tint/1088.spvasm.expected.fxc.hlsl +++ b/test/tint/bug/tint/1088.spvasm.expected.fxc.hlsl @@ -7,12 +7,12 @@ static float2 uv = float2(0.0f, 0.0f); static float3 normal = float3(0.0f, 0.0f, 0.0f); static float4 gl_Position = float4(0.0f, 0.0f, 0.0f, 0.0f); -float4x4 tint_symbol_4(uint4 buffer[17], uint offset) { +float4x4 x_14_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]), asfloat(buffer[scalar_offset_3 / 4])); + return float4x4(asfloat(x_14[scalar_offset / 4]), asfloat(x_14[scalar_offset_1 / 4]), asfloat(x_14[scalar_offset_2 / 4]), asfloat(x_14[scalar_offset_3 / 4])); } void main_1() { @@ -30,7 +30,7 @@ void main_1() { const float x_55 = p.y; const float x_57 = asfloat(x_14[4].x); p.y = (x_55 + sin((x_57 + 4.0f))); - const float4x4 x_69 = tint_symbol_4(x_14, 0u); + const float4x4 x_69 = x_14_load_1(0u); const float3 x_70 = p; gl_Position = mul(float4(x_70.x, x_70.y, x_70.z, 1.0f), x_69); const float2 x_83 = uv; @@ -59,8 +59,8 @@ main_out main_inner(float3 position_1_param, float2 uv_param, float3 normal_para uv = uv_param; normal = normal_param; main_1(); - const main_out tint_symbol_6 = {gl_Position, vUV}; - return tint_symbol_6; + const main_out tint_symbol_3 = {gl_Position, vUV}; + return tint_symbol_3; } tint_symbol_2 main(tint_symbol_1 tint_symbol) { diff --git a/test/tint/bug/tint/1113.wgsl.expected.dxc.hlsl b/test/tint/bug/tint/1113.wgsl.expected.dxc.hlsl index 25be8e4163..e6e0b7acc1 100644 --- a/test/tint/bug/tint/1113.wgsl.expected.dxc.hlsl +++ b/test/tint/bug/tint/1113.wgsl.expected.dxc.hlsl @@ -44,16 +44,16 @@ float3 loadPosition(uint vertexIndex) { return position; } -uint tint_atomicLoad(RWByteAddressBuffer buffer, uint offset) { +uint countersatomicLoad(uint offset) { uint value = 0; - buffer.InterlockedOr(offset, 0, value); + counters.InterlockedOr(offset, 0, value); return value; } -int tint_atomicLoad_1(RWByteAddressBuffer buffer, uint offset) { +int LUTatomicLoad(uint offset) { int value = 0; - buffer.InterlockedOr(offset, 0, value); + LUT.InterlockedOr(offset, 0, value); return value; } @@ -61,19 +61,19 @@ int tint_atomicLoad_1(RWByteAddressBuffer buffer, uint offset) { void doIgnore() { uint g42 = uniforms[0].x; uint kj6 = dbg.Load(20u); - uint b53 = tint_atomicLoad(counters, 0u); + uint b53 = countersatomicLoad(0u); uint rwg = indices.Load(0u); float rb5 = asfloat(positions.Load(0u)); - int g55 = tint_atomicLoad_1(LUT, 0u); + int g55 = LUTatomicLoad(0u); } struct tint_symbol_1 { uint3 GlobalInvocationID : SV_DispatchThreadID; }; -uint tint_atomicAdd(RWByteAddressBuffer buffer, uint offset, uint value) { +uint countersatomicAdd(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedAdd(offset, value, original_value); + counters.InterlockedAdd(offset, value, original_value); return original_value; } @@ -93,7 +93,7 @@ void main_count_inner(uint3 GlobalInvocationID) { float3 center = (((p0 + p1) + p2) / 3.0f); float3 voxelPos = toVoxelPos(center); uint voxelIndex = toIndex1D(uniforms[0].y, voxelPos); - uint acefg = tint_atomicAdd(counters, (4u * voxelIndex), 1u); + uint acefg = countersatomicAdd((4u * voxelIndex), 1u); if ((triangleIndex == 0u)) { dbg.Store(16u, asuint(uniforms[0].y)); dbg.Store(32u, asuint(center.x)); @@ -112,16 +112,16 @@ struct tint_symbol_3 { uint3 GlobalInvocationID : SV_DispatchThreadID; }; -uint tint_atomicAdd_1(RWByteAddressBuffer buffer, uint offset, uint value) { +uint dbgatomicAdd(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedAdd(offset, value, original_value); + dbg.InterlockedAdd(offset, value, original_value); return original_value; } -void tint_atomicStore(RWByteAddressBuffer buffer, uint offset, int value) { +void LUTatomicStore(uint offset, int value) { int ignored; - buffer.InterlockedExchange(offset, value, ignored); + LUT.InterlockedExchange(offset, value, ignored); } @@ -132,13 +132,13 @@ void main_create_lut_inner(uint3 GlobalInvocationID) { if ((voxelIndex >= maxVoxels)) { return; } - uint numTriangles = tint_atomicLoad(counters, (4u * voxelIndex)); + uint numTriangles = countersatomicLoad((4u * voxelIndex)); int offset = -1; if ((numTriangles > 0u)) { - const uint tint_symbol_6 = tint_atomicAdd_1(dbg, 0u, numTriangles); + const uint tint_symbol_6 = dbgatomicAdd(0u, numTriangles); offset = int(tint_symbol_6); } - tint_atomicStore(LUT, (4u * voxelIndex), offset); + LUTatomicStore((4u * voxelIndex), offset); } [numthreads(128, 1, 1)] @@ -151,9 +151,9 @@ struct tint_symbol_5 { uint3 GlobalInvocationID : SV_DispatchThreadID; }; -int tint_atomicAdd_2(RWByteAddressBuffer buffer, uint offset, int value) { +int LUTatomicAdd(uint offset, int value) { int original_value = 0; - buffer.InterlockedAdd(offset, value, original_value); + LUT.InterlockedAdd(offset, value, original_value); return original_value; } @@ -173,7 +173,7 @@ void main_sort_triangles_inner(uint3 GlobalInvocationID) { float3 center = (((p0 + p1) + p2) / 3.0f); float3 voxelPos = toVoxelPos(center); uint voxelIndex = toIndex1D(uniforms[0].y, voxelPos); - int triangleOffset = tint_atomicAdd_2(LUT, (4u * voxelIndex), 1); + int triangleOffset = LUTatomicAdd((4u * voxelIndex), 1); } [numthreads(128, 1, 1)] diff --git a/test/tint/bug/tint/1113.wgsl.expected.fxc.hlsl b/test/tint/bug/tint/1113.wgsl.expected.fxc.hlsl index 25be8e4163..e6e0b7acc1 100644 --- a/test/tint/bug/tint/1113.wgsl.expected.fxc.hlsl +++ b/test/tint/bug/tint/1113.wgsl.expected.fxc.hlsl @@ -44,16 +44,16 @@ float3 loadPosition(uint vertexIndex) { return position; } -uint tint_atomicLoad(RWByteAddressBuffer buffer, uint offset) { +uint countersatomicLoad(uint offset) { uint value = 0; - buffer.InterlockedOr(offset, 0, value); + counters.InterlockedOr(offset, 0, value); return value; } -int tint_atomicLoad_1(RWByteAddressBuffer buffer, uint offset) { +int LUTatomicLoad(uint offset) { int value = 0; - buffer.InterlockedOr(offset, 0, value); + LUT.InterlockedOr(offset, 0, value); return value; } @@ -61,19 +61,19 @@ int tint_atomicLoad_1(RWByteAddressBuffer buffer, uint offset) { void doIgnore() { uint g42 = uniforms[0].x; uint kj6 = dbg.Load(20u); - uint b53 = tint_atomicLoad(counters, 0u); + uint b53 = countersatomicLoad(0u); uint rwg = indices.Load(0u); float rb5 = asfloat(positions.Load(0u)); - int g55 = tint_atomicLoad_1(LUT, 0u); + int g55 = LUTatomicLoad(0u); } struct tint_symbol_1 { uint3 GlobalInvocationID : SV_DispatchThreadID; }; -uint tint_atomicAdd(RWByteAddressBuffer buffer, uint offset, uint value) { +uint countersatomicAdd(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedAdd(offset, value, original_value); + counters.InterlockedAdd(offset, value, original_value); return original_value; } @@ -93,7 +93,7 @@ void main_count_inner(uint3 GlobalInvocationID) { float3 center = (((p0 + p1) + p2) / 3.0f); float3 voxelPos = toVoxelPos(center); uint voxelIndex = toIndex1D(uniforms[0].y, voxelPos); - uint acefg = tint_atomicAdd(counters, (4u * voxelIndex), 1u); + uint acefg = countersatomicAdd((4u * voxelIndex), 1u); if ((triangleIndex == 0u)) { dbg.Store(16u, asuint(uniforms[0].y)); dbg.Store(32u, asuint(center.x)); @@ -112,16 +112,16 @@ struct tint_symbol_3 { uint3 GlobalInvocationID : SV_DispatchThreadID; }; -uint tint_atomicAdd_1(RWByteAddressBuffer buffer, uint offset, uint value) { +uint dbgatomicAdd(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedAdd(offset, value, original_value); + dbg.InterlockedAdd(offset, value, original_value); return original_value; } -void tint_atomicStore(RWByteAddressBuffer buffer, uint offset, int value) { +void LUTatomicStore(uint offset, int value) { int ignored; - buffer.InterlockedExchange(offset, value, ignored); + LUT.InterlockedExchange(offset, value, ignored); } @@ -132,13 +132,13 @@ void main_create_lut_inner(uint3 GlobalInvocationID) { if ((voxelIndex >= maxVoxels)) { return; } - uint numTriangles = tint_atomicLoad(counters, (4u * voxelIndex)); + uint numTriangles = countersatomicLoad((4u * voxelIndex)); int offset = -1; if ((numTriangles > 0u)) { - const uint tint_symbol_6 = tint_atomicAdd_1(dbg, 0u, numTriangles); + const uint tint_symbol_6 = dbgatomicAdd(0u, numTriangles); offset = int(tint_symbol_6); } - tint_atomicStore(LUT, (4u * voxelIndex), offset); + LUTatomicStore((4u * voxelIndex), offset); } [numthreads(128, 1, 1)] @@ -151,9 +151,9 @@ struct tint_symbol_5 { uint3 GlobalInvocationID : SV_DispatchThreadID; }; -int tint_atomicAdd_2(RWByteAddressBuffer buffer, uint offset, int value) { +int LUTatomicAdd(uint offset, int value) { int original_value = 0; - buffer.InterlockedAdd(offset, value, original_value); + LUT.InterlockedAdd(offset, value, original_value); return original_value; } @@ -173,7 +173,7 @@ void main_sort_triangles_inner(uint3 GlobalInvocationID) { float3 center = (((p0 + p1) + p2) / 3.0f); float3 voxelPos = toVoxelPos(center); uint voxelIndex = toIndex1D(uniforms[0].y, voxelPos); - int triangleOffset = tint_atomicAdd_2(LUT, (4u * voxelIndex), 1); + int triangleOffset = LUTatomicAdd((4u * voxelIndex), 1); } [numthreads(128, 1, 1)] diff --git a/test/tint/bug/tint/1118.wgsl.expected.dxc.hlsl b/test/tint/bug/tint/1118.wgsl.expected.dxc.hlsl index 9b18484b7c..66f08eb61c 100644 --- a/test/tint/bug/tint/1118.wgsl.expected.dxc.hlsl +++ b/test/tint/bug/tint/1118.wgsl.expected.dxc.hlsl @@ -104,8 +104,8 @@ main_out main_inner(float fClipDistance3_param, float fClipDistance4_param) { fClipDistance3 = fClipDistance3_param; fClipDistance4 = fClipDistance4_param; main_1(); - const main_out tint_symbol_8 = {glFragColor}; - return tint_symbol_8; + const main_out tint_symbol_3 = {glFragColor}; + return tint_symbol_3; } tint_symbol_2 main(tint_symbol_1 tint_symbol) { diff --git a/test/tint/bug/tint/1118.wgsl.expected.fxc.hlsl b/test/tint/bug/tint/1118.wgsl.expected.fxc.hlsl index 9b18484b7c..66f08eb61c 100644 --- a/test/tint/bug/tint/1118.wgsl.expected.fxc.hlsl +++ b/test/tint/bug/tint/1118.wgsl.expected.fxc.hlsl @@ -104,8 +104,8 @@ main_out main_inner(float fClipDistance3_param, float fClipDistance4_param) { fClipDistance3 = fClipDistance3_param; fClipDistance4 = fClipDistance4_param; main_1(); - const main_out tint_symbol_8 = {glFragColor}; - return tint_symbol_8; + const main_out tint_symbol_3 = {glFragColor}; + return tint_symbol_3; } tint_symbol_2 main(tint_symbol_1 tint_symbol) { diff --git a/test/tint/bug/tint/1121.wgsl.expected.dxc.hlsl b/test/tint/bug/tint/1121.wgsl.expected.dxc.hlsl index 5dee593c4e..db16cb08e4 100644 --- a/test/tint/bug/tint/1121.wgsl.expected.dxc.hlsl +++ b/test/tint/bug/tint/1121.wgsl.expected.dxc.hlsl @@ -14,17 +14,17 @@ struct tint_symbol_1 { uint3 GlobalInvocationID : SV_DispatchThreadID; }; -float4x4 tint_symbol_6(uint4 buffer[11], uint offset) { +float4x4 uniforms_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]), asfloat(buffer[scalar_offset_3 / 4])); + return float4x4(asfloat(uniforms[scalar_offset / 4]), asfloat(uniforms[scalar_offset_1 / 4]), asfloat(uniforms[scalar_offset_2 / 4]), asfloat(uniforms[scalar_offset_3 / 4])); } -uint tint_atomicAdd(RWByteAddressBuffer buffer, uint offset, uint value) { +uint tileLightIdatomicAdd(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedAdd(offset, value, original_value); + tileLightId.InterlockedAdd(offset, value, original_value); return original_value; } @@ -38,11 +38,11 @@ void main_inner(uint3 GlobalInvocationID) { if ((asfloat(lightsBuffer.Load(((32u * index) + 4u))) < asfloat(uniforms[0].y))) { lightsBuffer.Store(((32u * index) + 4u), asuint(asfloat(uniforms[1].y))); } - float4x4 M = tint_symbol_6(uniforms, 96u); + float4x4 M = uniforms_load_1(96u); float viewNear = (-(M[3][2]) / (-1.0f + M[2][2])); float viewFar = (-(M[3][2]) / (1.0f + M[2][2])); float4 lightPos = asfloat(lightsBuffer.Load4((32u * index))); - lightPos = mul(lightPos, tint_symbol_6(uniforms, 32u)); + lightPos = mul(lightPos, uniforms_load_1(32u)); lightPos = (lightPos / lightPos.w); float lightRadius = asfloat(lightsBuffer.Load(((32u * index) + 28u))); float4 boxMin = (lightPos - float4(float3((lightRadius).xxx), 0.0f)); @@ -98,7 +98,7 @@ void main_inner(uint3 GlobalInvocationID) { if ((tint_tmp)) { continue; } - uint offset = tint_atomicAdd(tileLightId, (260u * tileId), 1u); + uint offset = tileLightIdatomicAdd((260u * tileId), 1u); if ((offset >= config[1].x)) { continue; } diff --git a/test/tint/bug/tint/1121.wgsl.expected.fxc.hlsl b/test/tint/bug/tint/1121.wgsl.expected.fxc.hlsl index 5dee593c4e..db16cb08e4 100644 --- a/test/tint/bug/tint/1121.wgsl.expected.fxc.hlsl +++ b/test/tint/bug/tint/1121.wgsl.expected.fxc.hlsl @@ -14,17 +14,17 @@ struct tint_symbol_1 { uint3 GlobalInvocationID : SV_DispatchThreadID; }; -float4x4 tint_symbol_6(uint4 buffer[11], uint offset) { +float4x4 uniforms_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]), asfloat(buffer[scalar_offset_3 / 4])); + return float4x4(asfloat(uniforms[scalar_offset / 4]), asfloat(uniforms[scalar_offset_1 / 4]), asfloat(uniforms[scalar_offset_2 / 4]), asfloat(uniforms[scalar_offset_3 / 4])); } -uint tint_atomicAdd(RWByteAddressBuffer buffer, uint offset, uint value) { +uint tileLightIdatomicAdd(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedAdd(offset, value, original_value); + tileLightId.InterlockedAdd(offset, value, original_value); return original_value; } @@ -38,11 +38,11 @@ void main_inner(uint3 GlobalInvocationID) { if ((asfloat(lightsBuffer.Load(((32u * index) + 4u))) < asfloat(uniforms[0].y))) { lightsBuffer.Store(((32u * index) + 4u), asuint(asfloat(uniforms[1].y))); } - float4x4 M = tint_symbol_6(uniforms, 96u); + float4x4 M = uniforms_load_1(96u); float viewNear = (-(M[3][2]) / (-1.0f + M[2][2])); float viewFar = (-(M[3][2]) / (1.0f + M[2][2])); float4 lightPos = asfloat(lightsBuffer.Load4((32u * index))); - lightPos = mul(lightPos, tint_symbol_6(uniforms, 32u)); + lightPos = mul(lightPos, uniforms_load_1(32u)); lightPos = (lightPos / lightPos.w); float lightRadius = asfloat(lightsBuffer.Load(((32u * index) + 28u))); float4 boxMin = (lightPos - float4(float3((lightRadius).xxx), 0.0f)); @@ -98,7 +98,7 @@ void main_inner(uint3 GlobalInvocationID) { if ((tint_tmp)) { continue; } - uint offset = tint_atomicAdd(tileLightId, (260u * tileId), 1u); + uint offset = tileLightIdatomicAdd((260u * tileId), 1u); if ((offset >= config[1].x)) { continue; } diff --git a/test/tint/bug/tint/1520.spvasm.expected.dxc.hlsl b/test/tint/bug/tint/1520.spvasm.expected.dxc.hlsl index 06255d05cb..fbfa52cedb 100644 --- a/test/tint/bug/tint/1520.spvasm.expected.dxc.hlsl +++ b/test/tint/bug/tint/1520.spvasm.expected.dxc.hlsl @@ -152,8 +152,8 @@ main_out main_inner(bool sk_Clockwise_param, float4 vcolor_S0_param) { sk_Clockwise = sk_Clockwise_param; vcolor_S0 = vcolor_S0_param; main_1(); - const main_out tint_symbol_6 = {sk_FragColor}; - return tint_symbol_6; + const main_out tint_symbol_4 = {sk_FragColor}; + return tint_symbol_4; } tint_symbol_2 main(tint_symbol_1 tint_symbol) { diff --git a/test/tint/bug/tint/1520.spvasm.expected.fxc.hlsl b/test/tint/bug/tint/1520.spvasm.expected.fxc.hlsl index 06255d05cb..fbfa52cedb 100644 --- a/test/tint/bug/tint/1520.spvasm.expected.fxc.hlsl +++ b/test/tint/bug/tint/1520.spvasm.expected.fxc.hlsl @@ -152,8 +152,8 @@ main_out main_inner(bool sk_Clockwise_param, float4 vcolor_S0_param) { sk_Clockwise = sk_Clockwise_param; vcolor_S0 = vcolor_S0_param; main_1(); - const main_out tint_symbol_6 = {sk_FragColor}; - return tint_symbol_6; + const main_out tint_symbol_4 = {sk_FragColor}; + return tint_symbol_4; } tint_symbol_2 main(tint_symbol_1 tint_symbol) { diff --git a/test/tint/bug/tint/1573.wgsl.expected.dxc.hlsl b/test/tint/bug/tint/1573.wgsl.expected.dxc.hlsl index a19a5806e1..3cb873c2d9 100644 --- a/test/tint/bug/tint/1573.wgsl.expected.dxc.hlsl +++ b/test/tint/bug/tint/1573.wgsl.expected.dxc.hlsl @@ -5,9 +5,9 @@ struct atomic_compare_exchange_weak_ret_type { bool exchanged; }; -atomic_compare_exchange_weak_ret_type tint_atomicCompareExchangeWeak(RWByteAddressBuffer buffer, uint offset, uint compare, uint value) { +atomic_compare_exchange_weak_ret_type aatomicCompareExchangeWeak(uint offset, uint compare, uint value) { atomic_compare_exchange_weak_ret_type result=(atomic_compare_exchange_weak_ret_type)0; - buffer.InterlockedCompareExchange(offset, compare, value, result.old_value); + a.InterlockedCompareExchange(offset, compare, value, result.old_value); result.exchanged = result.old_value == compare; return result; } @@ -16,6 +16,6 @@ atomic_compare_exchange_weak_ret_type tint_atomicCompareExchangeWeak(RWByteAddre [numthreads(16, 1, 1)] void main() { uint value = 42u; - const atomic_compare_exchange_weak_ret_type result = tint_atomicCompareExchangeWeak(a, 0u, 0u, value); + const atomic_compare_exchange_weak_ret_type result = aatomicCompareExchangeWeak(0u, 0u, value); return; } diff --git a/test/tint/bug/tint/1573.wgsl.expected.fxc.hlsl b/test/tint/bug/tint/1573.wgsl.expected.fxc.hlsl index a19a5806e1..3cb873c2d9 100644 --- a/test/tint/bug/tint/1573.wgsl.expected.fxc.hlsl +++ b/test/tint/bug/tint/1573.wgsl.expected.fxc.hlsl @@ -5,9 +5,9 @@ struct atomic_compare_exchange_weak_ret_type { bool exchanged; }; -atomic_compare_exchange_weak_ret_type tint_atomicCompareExchangeWeak(RWByteAddressBuffer buffer, uint offset, uint compare, uint value) { +atomic_compare_exchange_weak_ret_type aatomicCompareExchangeWeak(uint offset, uint compare, uint value) { atomic_compare_exchange_weak_ret_type result=(atomic_compare_exchange_weak_ret_type)0; - buffer.InterlockedCompareExchange(offset, compare, value, result.old_value); + a.InterlockedCompareExchange(offset, compare, value, result.old_value); result.exchanged = result.old_value == compare; return result; } @@ -16,6 +16,6 @@ atomic_compare_exchange_weak_ret_type tint_atomicCompareExchangeWeak(RWByteAddre [numthreads(16, 1, 1)] void main() { uint value = 42u; - const atomic_compare_exchange_weak_ret_type result = tint_atomicCompareExchangeWeak(a, 0u, 0u, value); + const atomic_compare_exchange_weak_ret_type result = aatomicCompareExchangeWeak(0u, 0u, value); return; } diff --git a/test/tint/bug/tint/1574.wgsl.expected.dxc.hlsl b/test/tint/bug/tint/1574.wgsl.expected.dxc.hlsl index aad4961f4a..3e0f55a83b 100644 --- a/test/tint/bug/tint/1574.wgsl.expected.dxc.hlsl +++ b/test/tint/bug/tint/1574.wgsl.expected.dxc.hlsl @@ -19,9 +19,9 @@ struct atomic_compare_exchange_weak_ret_type { bool exchanged; }; -atomic_compare_exchange_weak_ret_type tint_atomicCompareExchangeWeak(RWByteAddressBuffer buffer, uint offset, uint compare, uint value) { +atomic_compare_exchange_weak_ret_type a_u32atomicCompareExchangeWeak(uint offset, uint compare, uint value) { atomic_compare_exchange_weak_ret_type result=(atomic_compare_exchange_weak_ret_type)0; - buffer.InterlockedCompareExchange(offset, compare, value, result.old_value); + a_u32.InterlockedCompareExchange(offset, compare, value, result.old_value); result.exchanged = result.old_value == compare; return result; } @@ -32,9 +32,9 @@ struct atomic_compare_exchange_weak_ret_type_1 { bool exchanged; }; -atomic_compare_exchange_weak_ret_type_1 tint_atomicCompareExchangeWeak_1(RWByteAddressBuffer buffer, uint offset, int compare, int value) { +atomic_compare_exchange_weak_ret_type_1 a_i32atomicCompareExchangeWeak(uint offset, int compare, int value) { atomic_compare_exchange_weak_ret_type_1 result=(atomic_compare_exchange_weak_ret_type_1)0; - buffer.InterlockedCompareExchange(offset, compare, value, result.old_value); + a_i32.InterlockedCompareExchange(offset, compare, value, result.old_value); result.exchanged = result.old_value == compare; return result; } @@ -50,15 +50,15 @@ void main_inner(uint local_invocation_index) { GroupMemoryBarrierWithGroupSync(); { uint value = 42u; - const atomic_compare_exchange_weak_ret_type r1 = tint_atomicCompareExchangeWeak(a_u32, 0u, 0u, value); - const atomic_compare_exchange_weak_ret_type r2 = tint_atomicCompareExchangeWeak(a_u32, 0u, 0u, value); - const atomic_compare_exchange_weak_ret_type r3 = tint_atomicCompareExchangeWeak(a_u32, 0u, 0u, value); + const atomic_compare_exchange_weak_ret_type r1 = a_u32atomicCompareExchangeWeak(0u, 0u, value); + const atomic_compare_exchange_weak_ret_type r2 = a_u32atomicCompareExchangeWeak(0u, 0u, value); + const atomic_compare_exchange_weak_ret_type r3 = a_u32atomicCompareExchangeWeak(0u, 0u, value); } { int value = 42; - const atomic_compare_exchange_weak_ret_type_1 r1 = tint_atomicCompareExchangeWeak_1(a_i32, 0u, 0, value); - const atomic_compare_exchange_weak_ret_type_1 r2 = tint_atomicCompareExchangeWeak_1(a_i32, 0u, 0, value); - const atomic_compare_exchange_weak_ret_type_1 r3 = tint_atomicCompareExchangeWeak_1(a_i32, 0u, 0, value); + const atomic_compare_exchange_weak_ret_type_1 r1 = a_i32atomicCompareExchangeWeak(0u, 0, value); + const atomic_compare_exchange_weak_ret_type_1 r2 = a_i32atomicCompareExchangeWeak(0u, 0, value); + const atomic_compare_exchange_weak_ret_type_1 r3 = a_i32atomicCompareExchangeWeak(0u, 0, value); } { uint value = 42u; diff --git a/test/tint/bug/tint/1574.wgsl.expected.fxc.hlsl b/test/tint/bug/tint/1574.wgsl.expected.fxc.hlsl index aad4961f4a..3e0f55a83b 100644 --- a/test/tint/bug/tint/1574.wgsl.expected.fxc.hlsl +++ b/test/tint/bug/tint/1574.wgsl.expected.fxc.hlsl @@ -19,9 +19,9 @@ struct atomic_compare_exchange_weak_ret_type { bool exchanged; }; -atomic_compare_exchange_weak_ret_type tint_atomicCompareExchangeWeak(RWByteAddressBuffer buffer, uint offset, uint compare, uint value) { +atomic_compare_exchange_weak_ret_type a_u32atomicCompareExchangeWeak(uint offset, uint compare, uint value) { atomic_compare_exchange_weak_ret_type result=(atomic_compare_exchange_weak_ret_type)0; - buffer.InterlockedCompareExchange(offset, compare, value, result.old_value); + a_u32.InterlockedCompareExchange(offset, compare, value, result.old_value); result.exchanged = result.old_value == compare; return result; } @@ -32,9 +32,9 @@ struct atomic_compare_exchange_weak_ret_type_1 { bool exchanged; }; -atomic_compare_exchange_weak_ret_type_1 tint_atomicCompareExchangeWeak_1(RWByteAddressBuffer buffer, uint offset, int compare, int value) { +atomic_compare_exchange_weak_ret_type_1 a_i32atomicCompareExchangeWeak(uint offset, int compare, int value) { atomic_compare_exchange_weak_ret_type_1 result=(atomic_compare_exchange_weak_ret_type_1)0; - buffer.InterlockedCompareExchange(offset, compare, value, result.old_value); + a_i32.InterlockedCompareExchange(offset, compare, value, result.old_value); result.exchanged = result.old_value == compare; return result; } @@ -50,15 +50,15 @@ void main_inner(uint local_invocation_index) { GroupMemoryBarrierWithGroupSync(); { uint value = 42u; - const atomic_compare_exchange_weak_ret_type r1 = tint_atomicCompareExchangeWeak(a_u32, 0u, 0u, value); - const atomic_compare_exchange_weak_ret_type r2 = tint_atomicCompareExchangeWeak(a_u32, 0u, 0u, value); - const atomic_compare_exchange_weak_ret_type r3 = tint_atomicCompareExchangeWeak(a_u32, 0u, 0u, value); + const atomic_compare_exchange_weak_ret_type r1 = a_u32atomicCompareExchangeWeak(0u, 0u, value); + const atomic_compare_exchange_weak_ret_type r2 = a_u32atomicCompareExchangeWeak(0u, 0u, value); + const atomic_compare_exchange_weak_ret_type r3 = a_u32atomicCompareExchangeWeak(0u, 0u, value); } { int value = 42; - const atomic_compare_exchange_weak_ret_type_1 r1 = tint_atomicCompareExchangeWeak_1(a_i32, 0u, 0, value); - const atomic_compare_exchange_weak_ret_type_1 r2 = tint_atomicCompareExchangeWeak_1(a_i32, 0u, 0, value); - const atomic_compare_exchange_weak_ret_type_1 r3 = tint_atomicCompareExchangeWeak_1(a_i32, 0u, 0, value); + const atomic_compare_exchange_weak_ret_type_1 r1 = a_i32atomicCompareExchangeWeak(0u, 0, value); + const atomic_compare_exchange_weak_ret_type_1 r2 = a_i32atomicCompareExchangeWeak(0u, 0, value); + const atomic_compare_exchange_weak_ret_type_1 r3 = a_i32atomicCompareExchangeWeak(0u, 0, value); } { uint value = 42u; diff --git a/test/tint/bug/tint/1725.wgsl.expected.dxc.hlsl b/test/tint/bug/tint/1725.wgsl.expected.dxc.hlsl index cea26ec246..d35f698d39 100644 --- a/test/tint/bug/tint/1725.wgsl.expected.dxc.hlsl +++ b/test/tint/bug/tint/1725.wgsl.expected.dxc.hlsl @@ -5,13 +5,13 @@ struct tint_symbol_8 { }; void tint_symbol_1_inner(uint tint_symbol_2) { - uint tint_symbol_11 = 0u; - tint_symbol.GetDimensions(tint_symbol_11); - const uint tint_symbol_12 = (tint_symbol_11 / 4u); + uint tint_symbol_10 = 0u; + tint_symbol.GetDimensions(tint_symbol_10); + const uint tint_symbol_11 = (tint_symbol_10 / 4u); const int tint_symbol_3 = 0; const int tint_symbol_4 = 0; const int tint_symbol_5 = 0; - const uint tint_symbol_6 = tint_symbol.Load((4u * min(tint_symbol_2, (tint_symbol_12 - 1u)))); + const uint tint_symbol_6 = tint_symbol.Load((4u * min(tint_symbol_2, (tint_symbol_11 - 1u)))); } [numthreads(1, 1, 1)] diff --git a/test/tint/bug/tint/1725.wgsl.expected.fxc.hlsl b/test/tint/bug/tint/1725.wgsl.expected.fxc.hlsl index cea26ec246..d35f698d39 100644 --- a/test/tint/bug/tint/1725.wgsl.expected.fxc.hlsl +++ b/test/tint/bug/tint/1725.wgsl.expected.fxc.hlsl @@ -5,13 +5,13 @@ struct tint_symbol_8 { }; void tint_symbol_1_inner(uint tint_symbol_2) { - uint tint_symbol_11 = 0u; - tint_symbol.GetDimensions(tint_symbol_11); - const uint tint_symbol_12 = (tint_symbol_11 / 4u); + uint tint_symbol_10 = 0u; + tint_symbol.GetDimensions(tint_symbol_10); + const uint tint_symbol_11 = (tint_symbol_10 / 4u); const int tint_symbol_3 = 0; const int tint_symbol_4 = 0; const int tint_symbol_5 = 0; - const uint tint_symbol_6 = tint_symbol.Load((4u * min(tint_symbol_2, (tint_symbol_12 - 1u)))); + const uint tint_symbol_6 = tint_symbol.Load((4u * min(tint_symbol_2, (tint_symbol_11 - 1u)))); } [numthreads(1, 1, 1)] diff --git a/test/tint/bug/tint/1735.wgsl.expected.dxc.hlsl b/test/tint/bug/tint/1735.wgsl.expected.dxc.hlsl index 084353983b..6bc13773cb 100644 --- a/test/tint/bug/tint/1735.wgsl.expected.dxc.hlsl +++ b/test/tint/bug/tint/1735.wgsl.expected.dxc.hlsl @@ -5,17 +5,17 @@ struct S { ByteAddressBuffer tint_symbol : register(t0, space0); RWByteAddressBuffer tint_symbol_1 : register(u1, space0); -void tint_symbol_2(RWByteAddressBuffer buffer, uint offset, S value) { - buffer.Store((offset + 0u), asuint(value.f)); +void tint_symbol_1_store(uint offset, S value) { + tint_symbol_1.Store((offset + 0u), asuint(value.f)); } -S tint_symbol_4(ByteAddressBuffer buffer, uint offset) { - const S tint_symbol_6 = {asfloat(buffer.Load((offset + 0u)))}; - return tint_symbol_6; +S tint_symbol_load(uint offset) { + const S tint_symbol_2 = {asfloat(tint_symbol.Load((offset + 0u)))}; + return tint_symbol_2; } [numthreads(1, 1, 1)] void main() { - tint_symbol_2(tint_symbol_1, 0u, tint_symbol_4(tint_symbol, 0u)); + tint_symbol_1_store(0u, tint_symbol_load(0u)); return; } diff --git a/test/tint/bug/tint/1735.wgsl.expected.fxc.hlsl b/test/tint/bug/tint/1735.wgsl.expected.fxc.hlsl index 084353983b..6bc13773cb 100644 --- a/test/tint/bug/tint/1735.wgsl.expected.fxc.hlsl +++ b/test/tint/bug/tint/1735.wgsl.expected.fxc.hlsl @@ -5,17 +5,17 @@ struct S { ByteAddressBuffer tint_symbol : register(t0, space0); RWByteAddressBuffer tint_symbol_1 : register(u1, space0); -void tint_symbol_2(RWByteAddressBuffer buffer, uint offset, S value) { - buffer.Store((offset + 0u), asuint(value.f)); +void tint_symbol_1_store(uint offset, S value) { + tint_symbol_1.Store((offset + 0u), asuint(value.f)); } -S tint_symbol_4(ByteAddressBuffer buffer, uint offset) { - const S tint_symbol_6 = {asfloat(buffer.Load((offset + 0u)))}; - return tint_symbol_6; +S tint_symbol_load(uint offset) { + const S tint_symbol_2 = {asfloat(tint_symbol.Load((offset + 0u)))}; + return tint_symbol_2; } [numthreads(1, 1, 1)] void main() { - tint_symbol_2(tint_symbol_1, 0u, tint_symbol_4(tint_symbol, 0u)); + tint_symbol_1_store(0u, tint_symbol_load(0u)); return; } diff --git a/test/tint/bug/tint/1739.wgsl.expected.dxc.hlsl b/test/tint/bug/tint/1739.wgsl.expected.dxc.hlsl index d403968f93..1d22d68df1 100644 --- a/test/tint/bug/tint/1739.wgsl.expected.dxc.hlsl +++ b/test/tint/bug/tint/1739.wgsl.expected.dxc.hlsl @@ -52,14 +52,14 @@ float4 textureLoadExternal(Texture2D plane0, Texture2D plane1, i return float4(color, 1.0f); } -float3x4 tint_symbol_6(uint4 buffer[13], uint offset) { +float3x4 ext_tex_params_load_2(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); + return float3x4(asfloat(ext_tex_params[scalar_offset / 4]), asfloat(ext_tex_params[scalar_offset_1 / 4]), asfloat(ext_tex_params[scalar_offset_2 / 4])); } -GammaTransferParams tint_symbol_8(uint4 buffer[13], uint offset) { +GammaTransferParams ext_tex_params_load_4(uint offset) { const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_4 = ((offset + 4u)) / 4; const uint scalar_offset_5 = ((offset + 8u)) / 4; @@ -68,32 +68,32 @@ GammaTransferParams tint_symbol_8(uint4 buffer[13], uint offset) { const uint scalar_offset_8 = ((offset + 20u)) / 4; const uint scalar_offset_9 = ((offset + 24u)) / 4; const uint scalar_offset_10 = ((offset + 28u)) / 4; - const GammaTransferParams tint_symbol_14 = {asfloat(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(buffer[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(buffer[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(buffer[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(buffer[scalar_offset_9 / 4][scalar_offset_9 % 4]), buffer[scalar_offset_10 / 4][scalar_offset_10 % 4]}; - return tint_symbol_14; + const GammaTransferParams tint_symbol_4 = {asfloat(ext_tex_params[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(ext_tex_params[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(ext_tex_params[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(ext_tex_params[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(ext_tex_params[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(ext_tex_params[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(ext_tex_params[scalar_offset_9 / 4][scalar_offset_9 % 4]), ext_tex_params[scalar_offset_10 / 4][scalar_offset_10 % 4]}; + return tint_symbol_4; } -float3x3 tint_symbol_10(uint4 buffer[13], uint offset) { +float3x3 ext_tex_params_load_6(uint offset) { const uint scalar_offset_11 = ((offset + 0u)) / 4; const uint scalar_offset_12 = ((offset + 16u)) / 4; const uint scalar_offset_13 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset_11 / 4].xyz), asfloat(buffer[scalar_offset_12 / 4].xyz), asfloat(buffer[scalar_offset_13 / 4].xyz)); + return float3x3(asfloat(ext_tex_params[scalar_offset_11 / 4].xyz), asfloat(ext_tex_params[scalar_offset_12 / 4].xyz), asfloat(ext_tex_params[scalar_offset_13 / 4].xyz)); } -float3x2 tint_symbol_12(uint4 buffer[13], uint offset) { +float3x2 ext_tex_params_load_8(uint offset) { const uint scalar_offset_14 = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset_14 / 4]; + uint4 ubo_load = ext_tex_params[scalar_offset_14 / 4]; const uint scalar_offset_15 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_15 / 4]; + uint4 ubo_load_1 = ext_tex_params[scalar_offset_15 / 4]; const uint scalar_offset_16 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_16 / 4]; + uint4 ubo_load_2 = ext_tex_params[scalar_offset_16 / 4]; return float3x2(asfloat(((scalar_offset_14 & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_15 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_16 & 2) ? ubo_load_2.zw : ubo_load_2.xy))); } -ExternalTextureParams tint_symbol_4(uint4 buffer[13], uint offset) { +ExternalTextureParams ext_tex_params_load(uint offset) { const uint scalar_offset_17 = ((offset + 0u)) / 4; const uint scalar_offset_18 = ((offset + 4u)) / 4; - const ExternalTextureParams tint_symbol_15 = {buffer[scalar_offset_17 / 4][scalar_offset_17 % 4], buffer[scalar_offset_18 / 4][scalar_offset_18 % 4], tint_symbol_6(buffer, (offset + 16u)), tint_symbol_8(buffer, (offset + 64u)), tint_symbol_8(buffer, (offset + 96u)), tint_symbol_10(buffer, (offset + 128u)), tint_symbol_12(buffer, (offset + 176u))}; - return tint_symbol_15; + const ExternalTextureParams tint_symbol_5 = {ext_tex_params[scalar_offset_17 / 4][scalar_offset_17 % 4], ext_tex_params[scalar_offset_18 / 4][scalar_offset_18 % 4], ext_tex_params_load_2((offset + 16u)), ext_tex_params_load_4((offset + 64u)), ext_tex_params_load_4((offset + 96u)), ext_tex_params_load_6((offset + 128u)), ext_tex_params_load_8((offset + 176u))}; + return tint_symbol_5; } [numthreads(1, 1, 1)] @@ -101,7 +101,7 @@ void main() { int2 tint_tmp; t.GetDimensions(tint_tmp.x, tint_tmp.y); const int2 tint_symbol = tint_clamp((10).xx, (0).xx, int2((uint2(tint_tmp) - (1u).xx))); - float4 red = textureLoadExternal(t, ext_tex_plane_1, tint_symbol, tint_symbol_4(ext_tex_params, 0u)); + float4 red = textureLoadExternal(t, ext_tex_plane_1, tint_symbol, ext_tex_params_load(0u)); int2 tint_tmp_1; outImage.GetDimensions(tint_tmp_1.x, tint_tmp_1.y); const int2 tint_symbol_1 = tint_clamp((0).xx, (0).xx, int2((uint2(tint_tmp_1) - (1u).xx))); @@ -109,7 +109,7 @@ void main() { int2 tint_tmp_2; t.GetDimensions(tint_tmp_2.x, tint_tmp_2.y); const int2 tint_symbol_2 = tint_clamp(int2(70, 118), (0).xx, int2((uint2(tint_tmp_2) - (1u).xx))); - float4 green = textureLoadExternal(t, ext_tex_plane_1, tint_symbol_2, tint_symbol_4(ext_tex_params, 0u)); + float4 green = textureLoadExternal(t, ext_tex_plane_1, tint_symbol_2, ext_tex_params_load(0u)); int2 tint_tmp_3; outImage.GetDimensions(tint_tmp_3.x, tint_tmp_3.y); const int2 tint_symbol_3 = tint_clamp(int2(1, 0), (0).xx, int2((uint2(tint_tmp_3) - (1u).xx))); diff --git a/test/tint/bug/tint/1739.wgsl.expected.fxc.hlsl b/test/tint/bug/tint/1739.wgsl.expected.fxc.hlsl index d403968f93..1d22d68df1 100644 --- a/test/tint/bug/tint/1739.wgsl.expected.fxc.hlsl +++ b/test/tint/bug/tint/1739.wgsl.expected.fxc.hlsl @@ -52,14 +52,14 @@ float4 textureLoadExternal(Texture2D plane0, Texture2D plane1, i return float4(color, 1.0f); } -float3x4 tint_symbol_6(uint4 buffer[13], uint offset) { +float3x4 ext_tex_params_load_2(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); + return float3x4(asfloat(ext_tex_params[scalar_offset / 4]), asfloat(ext_tex_params[scalar_offset_1 / 4]), asfloat(ext_tex_params[scalar_offset_2 / 4])); } -GammaTransferParams tint_symbol_8(uint4 buffer[13], uint offset) { +GammaTransferParams ext_tex_params_load_4(uint offset) { const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_4 = ((offset + 4u)) / 4; const uint scalar_offset_5 = ((offset + 8u)) / 4; @@ -68,32 +68,32 @@ GammaTransferParams tint_symbol_8(uint4 buffer[13], uint offset) { const uint scalar_offset_8 = ((offset + 20u)) / 4; const uint scalar_offset_9 = ((offset + 24u)) / 4; const uint scalar_offset_10 = ((offset + 28u)) / 4; - const GammaTransferParams tint_symbol_14 = {asfloat(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(buffer[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(buffer[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(buffer[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(buffer[scalar_offset_9 / 4][scalar_offset_9 % 4]), buffer[scalar_offset_10 / 4][scalar_offset_10 % 4]}; - return tint_symbol_14; + const GammaTransferParams tint_symbol_4 = {asfloat(ext_tex_params[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(ext_tex_params[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(ext_tex_params[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(ext_tex_params[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(ext_tex_params[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(ext_tex_params[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(ext_tex_params[scalar_offset_9 / 4][scalar_offset_9 % 4]), ext_tex_params[scalar_offset_10 / 4][scalar_offset_10 % 4]}; + return tint_symbol_4; } -float3x3 tint_symbol_10(uint4 buffer[13], uint offset) { +float3x3 ext_tex_params_load_6(uint offset) { const uint scalar_offset_11 = ((offset + 0u)) / 4; const uint scalar_offset_12 = ((offset + 16u)) / 4; const uint scalar_offset_13 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset_11 / 4].xyz), asfloat(buffer[scalar_offset_12 / 4].xyz), asfloat(buffer[scalar_offset_13 / 4].xyz)); + return float3x3(asfloat(ext_tex_params[scalar_offset_11 / 4].xyz), asfloat(ext_tex_params[scalar_offset_12 / 4].xyz), asfloat(ext_tex_params[scalar_offset_13 / 4].xyz)); } -float3x2 tint_symbol_12(uint4 buffer[13], uint offset) { +float3x2 ext_tex_params_load_8(uint offset) { const uint scalar_offset_14 = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset_14 / 4]; + uint4 ubo_load = ext_tex_params[scalar_offset_14 / 4]; const uint scalar_offset_15 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_15 / 4]; + uint4 ubo_load_1 = ext_tex_params[scalar_offset_15 / 4]; const uint scalar_offset_16 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_16 / 4]; + uint4 ubo_load_2 = ext_tex_params[scalar_offset_16 / 4]; return float3x2(asfloat(((scalar_offset_14 & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_15 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_16 & 2) ? ubo_load_2.zw : ubo_load_2.xy))); } -ExternalTextureParams tint_symbol_4(uint4 buffer[13], uint offset) { +ExternalTextureParams ext_tex_params_load(uint offset) { const uint scalar_offset_17 = ((offset + 0u)) / 4; const uint scalar_offset_18 = ((offset + 4u)) / 4; - const ExternalTextureParams tint_symbol_15 = {buffer[scalar_offset_17 / 4][scalar_offset_17 % 4], buffer[scalar_offset_18 / 4][scalar_offset_18 % 4], tint_symbol_6(buffer, (offset + 16u)), tint_symbol_8(buffer, (offset + 64u)), tint_symbol_8(buffer, (offset + 96u)), tint_symbol_10(buffer, (offset + 128u)), tint_symbol_12(buffer, (offset + 176u))}; - return tint_symbol_15; + const ExternalTextureParams tint_symbol_5 = {ext_tex_params[scalar_offset_17 / 4][scalar_offset_17 % 4], ext_tex_params[scalar_offset_18 / 4][scalar_offset_18 % 4], ext_tex_params_load_2((offset + 16u)), ext_tex_params_load_4((offset + 64u)), ext_tex_params_load_4((offset + 96u)), ext_tex_params_load_6((offset + 128u)), ext_tex_params_load_8((offset + 176u))}; + return tint_symbol_5; } [numthreads(1, 1, 1)] @@ -101,7 +101,7 @@ void main() { int2 tint_tmp; t.GetDimensions(tint_tmp.x, tint_tmp.y); const int2 tint_symbol = tint_clamp((10).xx, (0).xx, int2((uint2(tint_tmp) - (1u).xx))); - float4 red = textureLoadExternal(t, ext_tex_plane_1, tint_symbol, tint_symbol_4(ext_tex_params, 0u)); + float4 red = textureLoadExternal(t, ext_tex_plane_1, tint_symbol, ext_tex_params_load(0u)); int2 tint_tmp_1; outImage.GetDimensions(tint_tmp_1.x, tint_tmp_1.y); const int2 tint_symbol_1 = tint_clamp((0).xx, (0).xx, int2((uint2(tint_tmp_1) - (1u).xx))); @@ -109,7 +109,7 @@ void main() { int2 tint_tmp_2; t.GetDimensions(tint_tmp_2.x, tint_tmp_2.y); const int2 tint_symbol_2 = tint_clamp(int2(70, 118), (0).xx, int2((uint2(tint_tmp_2) - (1u).xx))); - float4 green = textureLoadExternal(t, ext_tex_plane_1, tint_symbol_2, tint_symbol_4(ext_tex_params, 0u)); + float4 green = textureLoadExternal(t, ext_tex_plane_1, tint_symbol_2, ext_tex_params_load(0u)); int2 tint_tmp_3; outImage.GetDimensions(tint_tmp_3.x, tint_tmp_3.y); const int2 tint_symbol_3 = tint_clamp(int2(1, 0), (0).xx, int2((uint2(tint_tmp_3) - (1u).xx))); diff --git a/test/tint/bug/tint/1776.spvasm.expected.dxc.hlsl b/test/tint/bug/tint/1776.spvasm.expected.dxc.hlsl index 1cd2986edb..f0a9375e83 100644 --- a/test/tint/bug/tint/1776.spvasm.expected.dxc.hlsl +++ b/test/tint/bug/tint/1776.spvasm.expected.dxc.hlsl @@ -5,13 +5,13 @@ struct S { RWByteAddressBuffer sb : register(u0, space0); -S tint_symbol(RWByteAddressBuffer buffer, uint offset) { - const S tint_symbol_3 = {asfloat(buffer.Load4((offset + 0u))), asint(buffer.Load((offset + 16u)))}; - return tint_symbol_3; +S sb_load(uint offset) { + const S tint_symbol = {asfloat(sb.Load4((offset + 0u))), asint(sb.Load((offset + 16u)))}; + return tint_symbol; } void main_1() { - const S x_18 = tint_symbol(sb, 32u); + const S x_18 = sb_load(32u); return; } diff --git a/test/tint/bug/tint/1776.spvasm.expected.fxc.hlsl b/test/tint/bug/tint/1776.spvasm.expected.fxc.hlsl index 1cd2986edb..f0a9375e83 100644 --- a/test/tint/bug/tint/1776.spvasm.expected.fxc.hlsl +++ b/test/tint/bug/tint/1776.spvasm.expected.fxc.hlsl @@ -5,13 +5,13 @@ struct S { RWByteAddressBuffer sb : register(u0, space0); -S tint_symbol(RWByteAddressBuffer buffer, uint offset) { - const S tint_symbol_3 = {asfloat(buffer.Load4((offset + 0u))), asint(buffer.Load((offset + 16u)))}; - return tint_symbol_3; +S sb_load(uint offset) { + const S tint_symbol = {asfloat(sb.Load4((offset + 0u))), asint(sb.Load((offset + 16u)))}; + return tint_symbol; } void main_1() { - const S x_18 = tint_symbol(sb, 32u); + const S x_18 = sb_load(32u); return; } diff --git a/test/tint/bug/tint/1776.wgsl.expected.dxc.hlsl b/test/tint/bug/tint/1776.wgsl.expected.dxc.hlsl index 36f87a7804..7251bee8aa 100644 --- a/test/tint/bug/tint/1776.wgsl.expected.dxc.hlsl +++ b/test/tint/bug/tint/1776.wgsl.expected.dxc.hlsl @@ -5,13 +5,13 @@ struct S { ByteAddressBuffer sb : register(t0, space0); -S tint_symbol(ByteAddressBuffer buffer, uint offset) { - const S tint_symbol_3 = {asfloat(buffer.Load4((offset + 0u))), asint(buffer.Load((offset + 16u)))}; - return tint_symbol_3; +S sb_load(uint offset) { + const S tint_symbol = {asfloat(sb.Load4((offset + 0u))), asint(sb.Load((offset + 16u)))}; + return tint_symbol; } [numthreads(1, 1, 1)] void main() { - const S x = tint_symbol(sb, 32u); + const S x = sb_load(32u); return; } diff --git a/test/tint/bug/tint/1776.wgsl.expected.fxc.hlsl b/test/tint/bug/tint/1776.wgsl.expected.fxc.hlsl index 36f87a7804..7251bee8aa 100644 --- a/test/tint/bug/tint/1776.wgsl.expected.fxc.hlsl +++ b/test/tint/bug/tint/1776.wgsl.expected.fxc.hlsl @@ -5,13 +5,13 @@ struct S { ByteAddressBuffer sb : register(t0, space0); -S tint_symbol(ByteAddressBuffer buffer, uint offset) { - const S tint_symbol_3 = {asfloat(buffer.Load4((offset + 0u))), asint(buffer.Load((offset + 16u)))}; - return tint_symbol_3; +S sb_load(uint offset) { + const S tint_symbol = {asfloat(sb.Load4((offset + 0u))), asint(sb.Load((offset + 16u)))}; + return tint_symbol; } [numthreads(1, 1, 1)] void main() { - const S x = tint_symbol(sb, 32u); + const S x = sb_load(32u); return; } diff --git a/test/tint/bug/tint/403.wgsl.expected.dxc.hlsl b/test/tint/bug/tint/403.wgsl.expected.dxc.hlsl index de76d9e16a..dc91d1f55c 100644 --- a/test/tint/bug/tint/403.wgsl.expected.dxc.hlsl +++ b/test/tint/bug/tint/403.wgsl.expected.dxc.hlsl @@ -12,29 +12,29 @@ struct tint_symbol_2 { float4 value : SV_Position; }; -float2x2 tint_symbol_3(uint4 buffer[1], uint offset) { +float2x2 x_20_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = x_20[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = x_20[scalar_offset_1 / 4]; return float2x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy))); } -float2x2 tint_symbol_5(uint4 buffer[1], uint offset) { +float2x2 x_26_load(uint offset) { const uint scalar_offset_2 = ((offset + 0u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = x_26[scalar_offset_2 / 4]; const uint scalar_offset_3 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_3 = x_26[scalar_offset_3 / 4]; return float2x2(asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy)), asfloat(((scalar_offset_3 & 2) ? ubo_load_3.zw : ubo_load_3.xy))); } float4 main_inner(uint gl_VertexIndex) { float2 indexable[3] = (float2[3])0; - const float2x2 x_23 = tint_symbol_3(x_20, 0u); - const float2x2 x_28 = tint_symbol_5(x_26, 0u); + const float2x2 x_23 = x_20_load(0u); + const float2x2 x_28 = x_26_load(0u); const uint x_46 = gl_VertexIndex; - const float2 tint_symbol_7[3] = {float2(-1.0f, 1.0f), (1.0f).xx, (-1.0f).xx}; - indexable = tint_symbol_7; + const float2 tint_symbol_3[3] = {float2(-1.0f, 1.0f), (1.0f).xx, (-1.0f).xx}; + indexable = tint_symbol_3; const float2 x_51 = indexable[x_46]; const float2 x_52 = mul(x_51, float2x2((x_23[0u] + x_28[0u]), (x_23[1u] + x_28[1u]))); return float4(x_52.x, x_52.y, 0.0f, 1.0f); diff --git a/test/tint/bug/tint/403.wgsl.expected.fxc.hlsl b/test/tint/bug/tint/403.wgsl.expected.fxc.hlsl index de76d9e16a..dc91d1f55c 100644 --- a/test/tint/bug/tint/403.wgsl.expected.fxc.hlsl +++ b/test/tint/bug/tint/403.wgsl.expected.fxc.hlsl @@ -12,29 +12,29 @@ struct tint_symbol_2 { float4 value : SV_Position; }; -float2x2 tint_symbol_3(uint4 buffer[1], uint offset) { +float2x2 x_20_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = x_20[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = x_20[scalar_offset_1 / 4]; return float2x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy))); } -float2x2 tint_symbol_5(uint4 buffer[1], uint offset) { +float2x2 x_26_load(uint offset) { const uint scalar_offset_2 = ((offset + 0u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = x_26[scalar_offset_2 / 4]; const uint scalar_offset_3 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_3 = x_26[scalar_offset_3 / 4]; return float2x2(asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy)), asfloat(((scalar_offset_3 & 2) ? ubo_load_3.zw : ubo_load_3.xy))); } float4 main_inner(uint gl_VertexIndex) { float2 indexable[3] = (float2[3])0; - const float2x2 x_23 = tint_symbol_3(x_20, 0u); - const float2x2 x_28 = tint_symbol_5(x_26, 0u); + const float2x2 x_23 = x_20_load(0u); + const float2x2 x_28 = x_26_load(0u); const uint x_46 = gl_VertexIndex; - const float2 tint_symbol_7[3] = {float2(-1.0f, 1.0f), (1.0f).xx, (-1.0f).xx}; - indexable = tint_symbol_7; + const float2 tint_symbol_3[3] = {float2(-1.0f, 1.0f), (1.0f).xx, (-1.0f).xx}; + indexable = tint_symbol_3; const float2 x_51 = indexable[x_46]; const float2 x_52 = mul(x_51, float2x2((x_23[0u] + x_28[0u]), (x_23[1u] + x_28[1u]))); return float4(x_52.x, x_52.y, 0.0f, 1.0f); diff --git a/test/tint/bug/tint/870.spvasm.expected.dxc.hlsl b/test/tint/bug/tint/870.spvasm.expected.dxc.hlsl index db19a18586..413725e9d8 100644 --- a/test/tint/bug/tint/870.spvasm.expected.dxc.hlsl +++ b/test/tint/bug/tint/870.spvasm.expected.dxc.hlsl @@ -1,11 +1,11 @@ ByteAddressBuffer sspp962805860buildInformation : register(t2, space0); -typedef int tint_symbol_ret[6]; -tint_symbol_ret tint_symbol(ByteAddressBuffer buffer, uint offset) { +typedef int sspp962805860buildInformation_load_ret[6]; +sspp962805860buildInformation_load_ret sspp962805860buildInformation_load(uint offset) { int arr[6] = (int[6])0; { for(uint i = 0u; (i < 6u); i = (i + 1u)) { - arr[i] = asint(buffer.Load((offset + (i * 4u)))); + arr[i] = asint(sspp962805860buildInformation.Load((offset + (i * 4u)))); } } return arr; @@ -13,7 +13,7 @@ tint_symbol_ret tint_symbol(ByteAddressBuffer buffer, uint offset) { void main_1() { int orientation[6] = (int[6])0; - const int x_23[6] = tint_symbol(sspp962805860buildInformation, 36u); + const int x_23[6] = sspp962805860buildInformation_load(36u); orientation[0] = x_23[0u]; orientation[1] = x_23[1u]; orientation[2] = x_23[2u]; diff --git a/test/tint/bug/tint/870.spvasm.expected.fxc.hlsl b/test/tint/bug/tint/870.spvasm.expected.fxc.hlsl index db19a18586..413725e9d8 100644 --- a/test/tint/bug/tint/870.spvasm.expected.fxc.hlsl +++ b/test/tint/bug/tint/870.spvasm.expected.fxc.hlsl @@ -1,11 +1,11 @@ ByteAddressBuffer sspp962805860buildInformation : register(t2, space0); -typedef int tint_symbol_ret[6]; -tint_symbol_ret tint_symbol(ByteAddressBuffer buffer, uint offset) { +typedef int sspp962805860buildInformation_load_ret[6]; +sspp962805860buildInformation_load_ret sspp962805860buildInformation_load(uint offset) { int arr[6] = (int[6])0; { for(uint i = 0u; (i < 6u); i = (i + 1u)) { - arr[i] = asint(buffer.Load((offset + (i * 4u)))); + arr[i] = asint(sspp962805860buildInformation.Load((offset + (i * 4u)))); } } return arr; @@ -13,7 +13,7 @@ tint_symbol_ret tint_symbol(ByteAddressBuffer buffer, uint offset) { void main_1() { int orientation[6] = (int[6])0; - const int x_23[6] = tint_symbol(sspp962805860buildInformation, 36u); + const int x_23[6] = sspp962805860buildInformation_load(36u); orientation[0] = x_23[0u]; orientation[1] = x_23[1u]; orientation[2] = x_23[2u]; diff --git a/test/tint/bug/tint/922.wgsl.expected.dxc.hlsl b/test/tint/bug/tint/922.wgsl.expected.dxc.hlsl index c57e9159cc..ff0591fa0e 100644 --- a/test/tint/bug/tint/922.wgsl.expected.dxc.hlsl +++ b/test/tint/bug/tint/922.wgsl.expected.dxc.hlsl @@ -209,35 +209,35 @@ Mat4x3_ x_Mat4x3_1(Mat4x4_ m20) { return x_e12; } -Mat4x3_ tint_symbol_3(uint4 buffer[96], uint offset) { +Mat4x3_ global2_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - const Mat4x3_ tint_symbol_9 = {asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])}; - return tint_symbol_9; + const Mat4x3_ tint_symbol_3 = {asfloat(global2[scalar_offset / 4]), asfloat(global2[scalar_offset_1 / 4]), asfloat(global2[scalar_offset_2 / 4])}; + return tint_symbol_3; } -Mat4x4_ tint_symbol_5(uint4 buffer[4], uint offset) { +Mat4x4_ global_load(uint offset) { const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_4 = ((offset + 16u)) / 4; const uint scalar_offset_5 = ((offset + 32u)) / 4; const uint scalar_offset_6 = ((offset + 48u)) / 4; - const Mat4x4_ tint_symbol_10 = {asfloat(buffer[scalar_offset_3 / 4]), asfloat(buffer[scalar_offset_4 / 4]), asfloat(buffer[scalar_offset_5 / 4]), asfloat(buffer[scalar_offset_6 / 4])}; - return tint_symbol_10; + const Mat4x4_ tint_symbol_4 = {asfloat(global[scalar_offset_3 / 4]), asfloat(global[scalar_offset_4 / 4]), asfloat(global[scalar_offset_5 / 4]), asfloat(global[scalar_offset_6 / 4])}; + return tint_symbol_4; } -Mat4x2_ tint_symbol_8(uint4 buffer[3], uint offset) { +Mat4x2_ global1_load_1(uint offset) { const uint scalar_offset_7 = ((offset + 0u)) / 4; const uint scalar_offset_8 = ((offset + 16u)) / 4; - const Mat4x2_ tint_symbol_11 = {asfloat(buffer[scalar_offset_7 / 4]), asfloat(buffer[scalar_offset_8 / 4])}; - return tint_symbol_11; + const Mat4x2_ tint_symbol_5 = {asfloat(global1[scalar_offset_7 / 4]), asfloat(global1[scalar_offset_8 / 4])}; + return tint_symbol_5; } void main1() { Mat4x3_ t_PosMtx = (Mat4x3_)0; float2 t_TexSpaceCoord = float2(0.0f, 0.0f); const float x_e15 = a_PosMtxIdx1; - const Mat4x3_ x_e18 = tint_symbol_3(global2, (48u * uint(int(x_e15)))); + const Mat4x3_ x_e18 = global2_load((48u * uint(int(x_e15)))); t_PosMtx = x_e18; const Mat4x3_ x_e23 = t_PosMtx; const Mat4x4_ x_e24 = x_Mat4x4_1(x_e23); @@ -246,7 +246,7 @@ void main1() { const Mat4x4_ x_e30 = x_Mat4x4_1(x_e29); const float3 x_e31 = a_Position1; const float4 x_e34 = Mul(x_e30, float4(x_e31, 1.0f)); - const Mat4x4_ x_e35 = tint_symbol_5(global, 0u); + const Mat4x4_ x_e35 = global_load(0u); const Mat4x3_ x_e37 = t_PosMtx; const Mat4x4_ x_e38 = x_Mat4x4_1(x_e37); const float3 x_e39 = a_Position1; @@ -262,7 +262,7 @@ void main1() { if ((x_e52.x == 2.0f)) { { const float3 x_e59 = a_Normal1; - const Mat4x2_ x_e64 = tint_symbol_8(global1, 0u); + const Mat4x2_ x_e64 = global1_load_1(0u); const float3 x_e65 = a_Normal1; const float2 x_e68 = Mul2(x_e64, float4(x_e65, 1.0f)); v_TexCoord = x_e68.xy; @@ -271,7 +271,7 @@ void main1() { } else { { const float2 x_e73 = a_UV1; - const Mat4x2_ x_e79 = tint_symbol_8(global1, 0u); + const Mat4x2_ x_e79 = global1_load_1(0u); const float2 x_e80 = a_UV1; const float2 x_e84 = Mul2(x_e79, float4(x_e80, 1.0f, 1.0f)); v_TexCoord = x_e84.xy; @@ -303,8 +303,8 @@ VertexOutput main_inner(float3 a_Position, float2 a_UV, float4 a_Color, float3 a const float4 x_e11 = v_Color; const float2 x_e13 = v_TexCoord; const float4 x_e15 = gl_Position; - const VertexOutput tint_symbol_12 = {x_e11, x_e13, x_e15}; - return tint_symbol_12; + const VertexOutput tint_symbol_6 = {x_e11, x_e13, x_e15}; + return tint_symbol_6; } tint_symbol_2 main(tint_symbol_1 tint_symbol) { diff --git a/test/tint/bug/tint/922.wgsl.expected.fxc.hlsl b/test/tint/bug/tint/922.wgsl.expected.fxc.hlsl index c57e9159cc..ff0591fa0e 100644 --- a/test/tint/bug/tint/922.wgsl.expected.fxc.hlsl +++ b/test/tint/bug/tint/922.wgsl.expected.fxc.hlsl @@ -209,35 +209,35 @@ Mat4x3_ x_Mat4x3_1(Mat4x4_ m20) { return x_e12; } -Mat4x3_ tint_symbol_3(uint4 buffer[96], uint offset) { +Mat4x3_ global2_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - const Mat4x3_ tint_symbol_9 = {asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])}; - return tint_symbol_9; + const Mat4x3_ tint_symbol_3 = {asfloat(global2[scalar_offset / 4]), asfloat(global2[scalar_offset_1 / 4]), asfloat(global2[scalar_offset_2 / 4])}; + return tint_symbol_3; } -Mat4x4_ tint_symbol_5(uint4 buffer[4], uint offset) { +Mat4x4_ global_load(uint offset) { const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_4 = ((offset + 16u)) / 4; const uint scalar_offset_5 = ((offset + 32u)) / 4; const uint scalar_offset_6 = ((offset + 48u)) / 4; - const Mat4x4_ tint_symbol_10 = {asfloat(buffer[scalar_offset_3 / 4]), asfloat(buffer[scalar_offset_4 / 4]), asfloat(buffer[scalar_offset_5 / 4]), asfloat(buffer[scalar_offset_6 / 4])}; - return tint_symbol_10; + const Mat4x4_ tint_symbol_4 = {asfloat(global[scalar_offset_3 / 4]), asfloat(global[scalar_offset_4 / 4]), asfloat(global[scalar_offset_5 / 4]), asfloat(global[scalar_offset_6 / 4])}; + return tint_symbol_4; } -Mat4x2_ tint_symbol_8(uint4 buffer[3], uint offset) { +Mat4x2_ global1_load_1(uint offset) { const uint scalar_offset_7 = ((offset + 0u)) / 4; const uint scalar_offset_8 = ((offset + 16u)) / 4; - const Mat4x2_ tint_symbol_11 = {asfloat(buffer[scalar_offset_7 / 4]), asfloat(buffer[scalar_offset_8 / 4])}; - return tint_symbol_11; + const Mat4x2_ tint_symbol_5 = {asfloat(global1[scalar_offset_7 / 4]), asfloat(global1[scalar_offset_8 / 4])}; + return tint_symbol_5; } void main1() { Mat4x3_ t_PosMtx = (Mat4x3_)0; float2 t_TexSpaceCoord = float2(0.0f, 0.0f); const float x_e15 = a_PosMtxIdx1; - const Mat4x3_ x_e18 = tint_symbol_3(global2, (48u * uint(int(x_e15)))); + const Mat4x3_ x_e18 = global2_load((48u * uint(int(x_e15)))); t_PosMtx = x_e18; const Mat4x3_ x_e23 = t_PosMtx; const Mat4x4_ x_e24 = x_Mat4x4_1(x_e23); @@ -246,7 +246,7 @@ void main1() { const Mat4x4_ x_e30 = x_Mat4x4_1(x_e29); const float3 x_e31 = a_Position1; const float4 x_e34 = Mul(x_e30, float4(x_e31, 1.0f)); - const Mat4x4_ x_e35 = tint_symbol_5(global, 0u); + const Mat4x4_ x_e35 = global_load(0u); const Mat4x3_ x_e37 = t_PosMtx; const Mat4x4_ x_e38 = x_Mat4x4_1(x_e37); const float3 x_e39 = a_Position1; @@ -262,7 +262,7 @@ void main1() { if ((x_e52.x == 2.0f)) { { const float3 x_e59 = a_Normal1; - const Mat4x2_ x_e64 = tint_symbol_8(global1, 0u); + const Mat4x2_ x_e64 = global1_load_1(0u); const float3 x_e65 = a_Normal1; const float2 x_e68 = Mul2(x_e64, float4(x_e65, 1.0f)); v_TexCoord = x_e68.xy; @@ -271,7 +271,7 @@ void main1() { } else { { const float2 x_e73 = a_UV1; - const Mat4x2_ x_e79 = tint_symbol_8(global1, 0u); + const Mat4x2_ x_e79 = global1_load_1(0u); const float2 x_e80 = a_UV1; const float2 x_e84 = Mul2(x_e79, float4(x_e80, 1.0f, 1.0f)); v_TexCoord = x_e84.xy; @@ -303,8 +303,8 @@ VertexOutput main_inner(float3 a_Position, float2 a_UV, float4 a_Color, float3 a const float4 x_e11 = v_Color; const float2 x_e13 = v_TexCoord; const float4 x_e15 = gl_Position; - const VertexOutput tint_symbol_12 = {x_e11, x_e13, x_e15}; - return tint_symbol_12; + const VertexOutput tint_symbol_6 = {x_e11, x_e13, x_e15}; + return tint_symbol_6; } tint_symbol_2 main(tint_symbol_1 tint_symbol) { diff --git a/test/tint/bug/tint/926.wgsl.expected.dxc.hlsl b/test/tint/bug/tint/926.wgsl.expected.dxc.hlsl index f5ed4b6d4a..fc0cd0f3bd 100644 --- a/test/tint/bug/tint/926.wgsl.expected.dxc.hlsl +++ b/test/tint/bug/tint/926.wgsl.expected.dxc.hlsl @@ -5,15 +5,15 @@ struct tint_symbol_1 { uint3 global_id : SV_DispatchThreadID; }; -uint tint_atomicAdd(RWByteAddressBuffer buffer, uint offset, uint value) { +uint drawOutatomicAdd(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedAdd(offset, value, original_value); + drawOut.InterlockedAdd(offset, value, original_value); return original_value; } void computeMain_inner(uint3 global_id) { - const uint firstVertex = tint_atomicAdd(drawOut, 0u, cubeVerts); + const uint firstVertex = drawOutatomicAdd(0u, cubeVerts); } [numthreads(1, 1, 1)] diff --git a/test/tint/bug/tint/926.wgsl.expected.fxc.hlsl b/test/tint/bug/tint/926.wgsl.expected.fxc.hlsl index f5ed4b6d4a..fc0cd0f3bd 100644 --- a/test/tint/bug/tint/926.wgsl.expected.fxc.hlsl +++ b/test/tint/bug/tint/926.wgsl.expected.fxc.hlsl @@ -5,15 +5,15 @@ struct tint_symbol_1 { uint3 global_id : SV_DispatchThreadID; }; -uint tint_atomicAdd(RWByteAddressBuffer buffer, uint offset, uint value) { +uint drawOutatomicAdd(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedAdd(offset, value, original_value); + drawOut.InterlockedAdd(offset, value, original_value); return original_value; } void computeMain_inner(uint3 global_id) { - const uint firstVertex = tint_atomicAdd(drawOut, 0u, cubeVerts); + const uint firstVertex = drawOutatomicAdd(0u, cubeVerts); } [numthreads(1, 1, 1)] diff --git a/test/tint/bug/tint/948.wgsl.expected.dxc.hlsl b/test/tint/bug/tint/948.wgsl.expected.dxc.hlsl index 306658ca8e..22b7bcf46d 100644 --- a/test/tint/bug/tint/948.wgsl.expected.dxc.hlsl +++ b/test/tint/bug/tint/948.wgsl.expected.dxc.hlsl @@ -210,8 +210,8 @@ main_out main_inner(float2 tUV_param, float2 tileID_1_param, float2 levelUnits_p vPosition = vPosition_param; vUV = vUV_param; main_1(); - const main_out tint_symbol_6 = {glFragColor}; - return tint_symbol_6; + const main_out tint_symbol_3 = {glFragColor}; + return tint_symbol_3; } tint_symbol_2 main(tint_symbol_1 tint_symbol) { diff --git a/test/tint/bug/tint/948.wgsl.expected.fxc.hlsl b/test/tint/bug/tint/948.wgsl.expected.fxc.hlsl index 306658ca8e..22b7bcf46d 100644 --- a/test/tint/bug/tint/948.wgsl.expected.fxc.hlsl +++ b/test/tint/bug/tint/948.wgsl.expected.fxc.hlsl @@ -210,8 +210,8 @@ main_out main_inner(float2 tUV_param, float2 tileID_1_param, float2 levelUnits_p vPosition = vPosition_param; vUV = vUV_param; main_1(); - const main_out tint_symbol_6 = {glFragColor}; - return tint_symbol_6; + const main_out tint_symbol_3 = {glFragColor}; + return tint_symbol_3; } tint_symbol_2 main(tint_symbol_1 tint_symbol) { diff --git a/test/tint/bug/tint/949.wgsl.expected.dxc.hlsl b/test/tint/bug/tint/949.wgsl.expected.dxc.hlsl index 6a0b48d88f..fc77310c0c 100644 --- a/test/tint/bug/tint/949.wgsl.expected.dxc.hlsl +++ b/test/tint/bug/tint/949.wgsl.expected.dxc.hlsl @@ -419,8 +419,8 @@ main_out main_inner(float2 vMainuv_param, float4 v_output1_param, bool gl_FrontF v_uv = v_uv_param; v_output2 = v_output2_param; main_1(); - const main_out tint_symbol_8 = {glFragColor}; - return tint_symbol_8; + const main_out tint_symbol_3 = {glFragColor}; + return tint_symbol_3; } tint_symbol_2 main(tint_symbol_1 tint_symbol) { diff --git a/test/tint/bug/tint/949.wgsl.expected.fxc.hlsl b/test/tint/bug/tint/949.wgsl.expected.fxc.hlsl index 6a0b48d88f..fc77310c0c 100644 --- a/test/tint/bug/tint/949.wgsl.expected.fxc.hlsl +++ b/test/tint/bug/tint/949.wgsl.expected.fxc.hlsl @@ -419,8 +419,8 @@ main_out main_inner(float2 vMainuv_param, float4 v_output1_param, bool gl_FrontF v_uv = v_uv_param; v_output2 = v_output2_param; main_1(); - const main_out tint_symbol_8 = {glFragColor}; - return tint_symbol_8; + const main_out tint_symbol_3 = {glFragColor}; + return tint_symbol_3; } tint_symbol_2 main(tint_symbol_1 tint_symbol) { diff --git a/test/tint/bug/tint/993.wgsl.expected.dxc.hlsl b/test/tint/bug/tint/993.wgsl.expected.dxc.hlsl index 6ec8aed1a5..b08eb3fd1a 100644 --- a/test/tint/bug/tint/993.wgsl.expected.dxc.hlsl +++ b/test/tint/bug/tint/993.wgsl.expected.dxc.hlsl @@ -6,15 +6,15 @@ RWByteAddressBuffer result : register(u1, space1); RWByteAddressBuffer s : register(u0, space0); -int tint_atomicLoad(RWByteAddressBuffer buffer, uint offset) { +int satomicLoad(uint offset) { int value = 0; - buffer.InterlockedOr(offset, 0, value); + s.InterlockedOr(offset, 0, value); return value; } int runTest() { - return tint_atomicLoad(s, (4u * (0u + uint(constants[0].x)))); + return satomicLoad((4u * (0u + uint(constants[0].x)))); } [numthreads(1, 1, 1)] diff --git a/test/tint/bug/tint/993.wgsl.expected.fxc.hlsl b/test/tint/bug/tint/993.wgsl.expected.fxc.hlsl index 6ec8aed1a5..b08eb3fd1a 100644 --- a/test/tint/bug/tint/993.wgsl.expected.fxc.hlsl +++ b/test/tint/bug/tint/993.wgsl.expected.fxc.hlsl @@ -6,15 +6,15 @@ RWByteAddressBuffer result : register(u1, space1); RWByteAddressBuffer s : register(u0, space0); -int tint_atomicLoad(RWByteAddressBuffer buffer, uint offset) { +int satomicLoad(uint offset) { int value = 0; - buffer.InterlockedOr(offset, 0, value); + s.InterlockedOr(offset, 0, value); return value; } int runTest() { - return tint_atomicLoad(s, (4u * (0u + uint(constants[0].x)))); + return satomicLoad((4u * (0u + uint(constants[0].x)))); } [numthreads(1, 1, 1)] diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicAdd/storage_i32.spvasm.expected.dxc.hlsl b/test/tint/builtins/atomics/from_gen/literal/atomicAdd/storage_i32.spvasm.expected.dxc.hlsl index 358487bedc..b367bec0e2 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicAdd/storage_i32.spvasm.expected.dxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicAdd/storage_i32.spvasm.expected.dxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicAdd(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicAdd(uint offset, int value) { int original_value = 0; - buffer.InterlockedAdd(offset, value, original_value); + sb_rw.InterlockedAdd(offset, value, original_value); return original_value; } void atomicAdd_d32fe4() { int res = 0; - const int x_9 = tint_atomicAdd(sb_rw, 0u, 1); + const int x_9 = sb_rwatomicAdd(0u, 1); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicAdd/storage_i32.spvasm.expected.fxc.hlsl b/test/tint/builtins/atomics/from_gen/literal/atomicAdd/storage_i32.spvasm.expected.fxc.hlsl index 358487bedc..b367bec0e2 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicAdd/storage_i32.spvasm.expected.fxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicAdd/storage_i32.spvasm.expected.fxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicAdd(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicAdd(uint offset, int value) { int original_value = 0; - buffer.InterlockedAdd(offset, value, original_value); + sb_rw.InterlockedAdd(offset, value, original_value); return original_value; } void atomicAdd_d32fe4() { int res = 0; - const int x_9 = tint_atomicAdd(sb_rw, 0u, 1); + const int x_9 = sb_rwatomicAdd(0u, 1); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicAdd/storage_u32.spvasm.expected.dxc.hlsl b/test/tint/builtins/atomics/from_gen/literal/atomicAdd/storage_u32.spvasm.expected.dxc.hlsl index bdc43b0733..bc6bf1a48e 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicAdd/storage_u32.spvasm.expected.dxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicAdd/storage_u32.spvasm.expected.dxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicAdd(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicAdd(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedAdd(offset, value, original_value); + sb_rw.InterlockedAdd(offset, value, original_value); return original_value; } void atomicAdd_8a199a() { uint res = 0u; - const uint x_9 = tint_atomicAdd(sb_rw, 0u, 1u); + const uint x_9 = sb_rwatomicAdd(0u, 1u); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicAdd/storage_u32.spvasm.expected.fxc.hlsl b/test/tint/builtins/atomics/from_gen/literal/atomicAdd/storage_u32.spvasm.expected.fxc.hlsl index bdc43b0733..bc6bf1a48e 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicAdd/storage_u32.spvasm.expected.fxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicAdd/storage_u32.spvasm.expected.fxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicAdd(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicAdd(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedAdd(offset, value, original_value); + sb_rw.InterlockedAdd(offset, value, original_value); return original_value; } void atomicAdd_8a199a() { uint res = 0u; - const uint x_9 = tint_atomicAdd(sb_rw, 0u, 1u); + const uint x_9 = sb_rwatomicAdd(0u, 1u); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicAnd/storage_i32.spvasm.expected.dxc.hlsl b/test/tint/builtins/atomics/from_gen/literal/atomicAnd/storage_i32.spvasm.expected.dxc.hlsl index 0cc23ee686..aa78a4e47b 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicAnd/storage_i32.spvasm.expected.dxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicAnd/storage_i32.spvasm.expected.dxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicAnd(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicAnd(uint offset, int value) { int original_value = 0; - buffer.InterlockedAnd(offset, value, original_value); + sb_rw.InterlockedAnd(offset, value, original_value); return original_value; } void atomicAnd_152966() { int res = 0; - const int x_9 = tint_atomicAnd(sb_rw, 0u, 1); + const int x_9 = sb_rwatomicAnd(0u, 1); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicAnd/storage_i32.spvasm.expected.fxc.hlsl b/test/tint/builtins/atomics/from_gen/literal/atomicAnd/storage_i32.spvasm.expected.fxc.hlsl index 0cc23ee686..aa78a4e47b 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicAnd/storage_i32.spvasm.expected.fxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicAnd/storage_i32.spvasm.expected.fxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicAnd(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicAnd(uint offset, int value) { int original_value = 0; - buffer.InterlockedAnd(offset, value, original_value); + sb_rw.InterlockedAnd(offset, value, original_value); return original_value; } void atomicAnd_152966() { int res = 0; - const int x_9 = tint_atomicAnd(sb_rw, 0u, 1); + const int x_9 = sb_rwatomicAnd(0u, 1); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicAnd/storage_u32.spvasm.expected.dxc.hlsl b/test/tint/builtins/atomics/from_gen/literal/atomicAnd/storage_u32.spvasm.expected.dxc.hlsl index 897165d2a2..4c19fe579f 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicAnd/storage_u32.spvasm.expected.dxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicAnd/storage_u32.spvasm.expected.dxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicAnd(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicAnd(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedAnd(offset, value, original_value); + sb_rw.InterlockedAnd(offset, value, original_value); return original_value; } void atomicAnd_85a8d9() { uint res = 0u; - const uint x_9 = tint_atomicAnd(sb_rw, 0u, 1u); + const uint x_9 = sb_rwatomicAnd(0u, 1u); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicAnd/storage_u32.spvasm.expected.fxc.hlsl b/test/tint/builtins/atomics/from_gen/literal/atomicAnd/storage_u32.spvasm.expected.fxc.hlsl index 897165d2a2..4c19fe579f 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicAnd/storage_u32.spvasm.expected.fxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicAnd/storage_u32.spvasm.expected.fxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicAnd(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicAnd(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedAnd(offset, value, original_value); + sb_rw.InterlockedAnd(offset, value, original_value); return original_value; } void atomicAnd_85a8d9() { uint res = 0u; - const uint x_9 = tint_atomicAnd(sb_rw, 0u, 1u); + const uint x_9 = sb_rwatomicAnd(0u, 1u); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/storage_i32.spvasm.expected.dxc.hlsl b/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/storage_i32.spvasm.expected.dxc.hlsl index d818bce03f..39e134ca2d 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/storage_i32.spvasm.expected.dxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/storage_i32.spvasm.expected.dxc.hlsl @@ -10,9 +10,9 @@ struct atomic_compare_exchange_weak_ret_type { bool exchanged; }; -atomic_compare_exchange_weak_ret_type tint_atomicCompareExchangeWeak(RWByteAddressBuffer buffer, uint offset, int compare, int value) { +atomic_compare_exchange_weak_ret_type sb_rwatomicCompareExchangeWeak(uint offset, int compare, int value) { atomic_compare_exchange_weak_ret_type result=(atomic_compare_exchange_weak_ret_type)0; - buffer.InterlockedCompareExchange(offset, compare, value, result.old_value); + sb_rw.InterlockedCompareExchange(offset, compare, value, result.old_value); result.exchanged = result.old_value == compare; return result; } @@ -20,7 +20,7 @@ atomic_compare_exchange_weak_ret_type tint_atomicCompareExchangeWeak(RWByteAddre void atomicCompareExchangeWeak_1bd40a() { x__atomic_compare_exchange_resulti32 res = (x__atomic_compare_exchange_resulti32)0; - const atomic_compare_exchange_weak_ret_type tint_symbol = tint_atomicCompareExchangeWeak(sb_rw, 0u, 1, 1); + const atomic_compare_exchange_weak_ret_type tint_symbol = sb_rwatomicCompareExchangeWeak(0u, 1, 1); const int old_value_1 = tint_symbol.old_value; const int x_19 = old_value_1; const x__atomic_compare_exchange_resulti32 tint_symbol_1 = {x_19, (x_19 == 1)}; diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/storage_i32.spvasm.expected.fxc.hlsl b/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/storage_i32.spvasm.expected.fxc.hlsl index d818bce03f..39e134ca2d 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/storage_i32.spvasm.expected.fxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/storage_i32.spvasm.expected.fxc.hlsl @@ -10,9 +10,9 @@ struct atomic_compare_exchange_weak_ret_type { bool exchanged; }; -atomic_compare_exchange_weak_ret_type tint_atomicCompareExchangeWeak(RWByteAddressBuffer buffer, uint offset, int compare, int value) { +atomic_compare_exchange_weak_ret_type sb_rwatomicCompareExchangeWeak(uint offset, int compare, int value) { atomic_compare_exchange_weak_ret_type result=(atomic_compare_exchange_weak_ret_type)0; - buffer.InterlockedCompareExchange(offset, compare, value, result.old_value); + sb_rw.InterlockedCompareExchange(offset, compare, value, result.old_value); result.exchanged = result.old_value == compare; return result; } @@ -20,7 +20,7 @@ atomic_compare_exchange_weak_ret_type tint_atomicCompareExchangeWeak(RWByteAddre void atomicCompareExchangeWeak_1bd40a() { x__atomic_compare_exchange_resulti32 res = (x__atomic_compare_exchange_resulti32)0; - const atomic_compare_exchange_weak_ret_type tint_symbol = tint_atomicCompareExchangeWeak(sb_rw, 0u, 1, 1); + const atomic_compare_exchange_weak_ret_type tint_symbol = sb_rwatomicCompareExchangeWeak(0u, 1, 1); const int old_value_1 = tint_symbol.old_value; const int x_19 = old_value_1; const x__atomic_compare_exchange_resulti32 tint_symbol_1 = {x_19, (x_19 == 1)}; diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/storage_u32.spvasm.expected.dxc.hlsl b/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/storage_u32.spvasm.expected.dxc.hlsl index 5d1bfd65dd..227361b813 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/storage_u32.spvasm.expected.dxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/storage_u32.spvasm.expected.dxc.hlsl @@ -10,9 +10,9 @@ struct atomic_compare_exchange_weak_ret_type { bool exchanged; }; -atomic_compare_exchange_weak_ret_type tint_atomicCompareExchangeWeak(RWByteAddressBuffer buffer, uint offset, uint compare, uint value) { +atomic_compare_exchange_weak_ret_type sb_rwatomicCompareExchangeWeak(uint offset, uint compare, uint value) { atomic_compare_exchange_weak_ret_type result=(atomic_compare_exchange_weak_ret_type)0; - buffer.InterlockedCompareExchange(offset, compare, value, result.old_value); + sb_rw.InterlockedCompareExchange(offset, compare, value, result.old_value); result.exchanged = result.old_value == compare; return result; } @@ -20,7 +20,7 @@ atomic_compare_exchange_weak_ret_type tint_atomicCompareExchangeWeak(RWByteAddre void atomicCompareExchangeWeak_63d8e6() { x__atomic_compare_exchange_resultu32 res = (x__atomic_compare_exchange_resultu32)0; - const atomic_compare_exchange_weak_ret_type tint_symbol = tint_atomicCompareExchangeWeak(sb_rw, 0u, 1u, 1u); + const atomic_compare_exchange_weak_ret_type tint_symbol = sb_rwatomicCompareExchangeWeak(0u, 1u, 1u); const uint old_value_1 = tint_symbol.old_value; const uint x_17 = old_value_1; const x__atomic_compare_exchange_resultu32 tint_symbol_1 = {x_17, (x_17 == 1u)}; diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/storage_u32.spvasm.expected.fxc.hlsl b/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/storage_u32.spvasm.expected.fxc.hlsl index 5d1bfd65dd..227361b813 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/storage_u32.spvasm.expected.fxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicCompareExchangeWeak/storage_u32.spvasm.expected.fxc.hlsl @@ -10,9 +10,9 @@ struct atomic_compare_exchange_weak_ret_type { bool exchanged; }; -atomic_compare_exchange_weak_ret_type tint_atomicCompareExchangeWeak(RWByteAddressBuffer buffer, uint offset, uint compare, uint value) { +atomic_compare_exchange_weak_ret_type sb_rwatomicCompareExchangeWeak(uint offset, uint compare, uint value) { atomic_compare_exchange_weak_ret_type result=(atomic_compare_exchange_weak_ret_type)0; - buffer.InterlockedCompareExchange(offset, compare, value, result.old_value); + sb_rw.InterlockedCompareExchange(offset, compare, value, result.old_value); result.exchanged = result.old_value == compare; return result; } @@ -20,7 +20,7 @@ atomic_compare_exchange_weak_ret_type tint_atomicCompareExchangeWeak(RWByteAddre void atomicCompareExchangeWeak_63d8e6() { x__atomic_compare_exchange_resultu32 res = (x__atomic_compare_exchange_resultu32)0; - const atomic_compare_exchange_weak_ret_type tint_symbol = tint_atomicCompareExchangeWeak(sb_rw, 0u, 1u, 1u); + const atomic_compare_exchange_weak_ret_type tint_symbol = sb_rwatomicCompareExchangeWeak(0u, 1u, 1u); const uint old_value_1 = tint_symbol.old_value; const uint x_17 = old_value_1; const x__atomic_compare_exchange_resultu32 tint_symbol_1 = {x_17, (x_17 == 1u)}; diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicExchange/storage_i32.spvasm.expected.dxc.hlsl b/test/tint/builtins/atomics/from_gen/literal/atomicExchange/storage_i32.spvasm.expected.dxc.hlsl index deffe11da8..8bfa8d9eeb 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicExchange/storage_i32.spvasm.expected.dxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicExchange/storage_i32.spvasm.expected.dxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicExchange(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicExchange(uint offset, int value) { int original_value = 0; - buffer.InterlockedExchange(offset, value, original_value); + sb_rw.InterlockedExchange(offset, value, original_value); return original_value; } void atomicExchange_f2e22f() { int res = 0; - const int x_9 = tint_atomicExchange(sb_rw, 0u, 1); + const int x_9 = sb_rwatomicExchange(0u, 1); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicExchange/storage_i32.spvasm.expected.fxc.hlsl b/test/tint/builtins/atomics/from_gen/literal/atomicExchange/storage_i32.spvasm.expected.fxc.hlsl index deffe11da8..8bfa8d9eeb 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicExchange/storage_i32.spvasm.expected.fxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicExchange/storage_i32.spvasm.expected.fxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicExchange(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicExchange(uint offset, int value) { int original_value = 0; - buffer.InterlockedExchange(offset, value, original_value); + sb_rw.InterlockedExchange(offset, value, original_value); return original_value; } void atomicExchange_f2e22f() { int res = 0; - const int x_9 = tint_atomicExchange(sb_rw, 0u, 1); + const int x_9 = sb_rwatomicExchange(0u, 1); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicExchange/storage_u32.spvasm.expected.dxc.hlsl b/test/tint/builtins/atomics/from_gen/literal/atomicExchange/storage_u32.spvasm.expected.dxc.hlsl index 7b20c963fd..e5ff0d0a30 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicExchange/storage_u32.spvasm.expected.dxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicExchange/storage_u32.spvasm.expected.dxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicExchange(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicExchange(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedExchange(offset, value, original_value); + sb_rw.InterlockedExchange(offset, value, original_value); return original_value; } void atomicExchange_d59712() { uint res = 0u; - const uint x_9 = tint_atomicExchange(sb_rw, 0u, 1u); + const uint x_9 = sb_rwatomicExchange(0u, 1u); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicExchange/storage_u32.spvasm.expected.fxc.hlsl b/test/tint/builtins/atomics/from_gen/literal/atomicExchange/storage_u32.spvasm.expected.fxc.hlsl index 7b20c963fd..e5ff0d0a30 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicExchange/storage_u32.spvasm.expected.fxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicExchange/storage_u32.spvasm.expected.fxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicExchange(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicExchange(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedExchange(offset, value, original_value); + sb_rw.InterlockedExchange(offset, value, original_value); return original_value; } void atomicExchange_d59712() { uint res = 0u; - const uint x_9 = tint_atomicExchange(sb_rw, 0u, 1u); + const uint x_9 = sb_rwatomicExchange(0u, 1u); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicLoad/storage_i32.spvasm.expected.dxc.hlsl b/test/tint/builtins/atomics/from_gen/literal/atomicLoad/storage_i32.spvasm.expected.dxc.hlsl index 8ce9cf2f39..e26e9e6ee5 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicLoad/storage_i32.spvasm.expected.dxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicLoad/storage_i32.spvasm.expected.dxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicLoad(RWByteAddressBuffer buffer, uint offset) { +int sb_rwatomicLoad(uint offset) { int value = 0; - buffer.InterlockedOr(offset, 0, value); + sb_rw.InterlockedOr(offset, 0, value); return value; } void atomicLoad_0806ad() { int res = 0; - const int x_9 = tint_atomicLoad(sb_rw, 0u); + const int x_9 = sb_rwatomicLoad(0u); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicLoad/storage_i32.spvasm.expected.fxc.hlsl b/test/tint/builtins/atomics/from_gen/literal/atomicLoad/storage_i32.spvasm.expected.fxc.hlsl index 8ce9cf2f39..e26e9e6ee5 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicLoad/storage_i32.spvasm.expected.fxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicLoad/storage_i32.spvasm.expected.fxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicLoad(RWByteAddressBuffer buffer, uint offset) { +int sb_rwatomicLoad(uint offset) { int value = 0; - buffer.InterlockedOr(offset, 0, value); + sb_rw.InterlockedOr(offset, 0, value); return value; } void atomicLoad_0806ad() { int res = 0; - const int x_9 = tint_atomicLoad(sb_rw, 0u); + const int x_9 = sb_rwatomicLoad(0u); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicLoad/storage_u32.spvasm.expected.dxc.hlsl b/test/tint/builtins/atomics/from_gen/literal/atomicLoad/storage_u32.spvasm.expected.dxc.hlsl index 454ed3cf18..dd3bbf5a76 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicLoad/storage_u32.spvasm.expected.dxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicLoad/storage_u32.spvasm.expected.dxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicLoad(RWByteAddressBuffer buffer, uint offset) { +uint sb_rwatomicLoad(uint offset) { uint value = 0; - buffer.InterlockedOr(offset, 0, value); + sb_rw.InterlockedOr(offset, 0, value); return value; } void atomicLoad_fe6cc3() { uint res = 0u; - const uint x_9 = tint_atomicLoad(sb_rw, 0u); + const uint x_9 = sb_rwatomicLoad(0u); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicLoad/storage_u32.spvasm.expected.fxc.hlsl b/test/tint/builtins/atomics/from_gen/literal/atomicLoad/storage_u32.spvasm.expected.fxc.hlsl index 454ed3cf18..dd3bbf5a76 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicLoad/storage_u32.spvasm.expected.fxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicLoad/storage_u32.spvasm.expected.fxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicLoad(RWByteAddressBuffer buffer, uint offset) { +uint sb_rwatomicLoad(uint offset) { uint value = 0; - buffer.InterlockedOr(offset, 0, value); + sb_rw.InterlockedOr(offset, 0, value); return value; } void atomicLoad_fe6cc3() { uint res = 0u; - const uint x_9 = tint_atomicLoad(sb_rw, 0u); + const uint x_9 = sb_rwatomicLoad(0u); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicMax/storage_i32.spvasm.expected.dxc.hlsl b/test/tint/builtins/atomics/from_gen/literal/atomicMax/storage_i32.spvasm.expected.dxc.hlsl index 4fd3948e88..2fd2f17bd0 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicMax/storage_i32.spvasm.expected.dxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicMax/storage_i32.spvasm.expected.dxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicMax(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicMax(uint offset, int value) { int original_value = 0; - buffer.InterlockedMax(offset, value, original_value); + sb_rw.InterlockedMax(offset, value, original_value); return original_value; } void atomicMax_92aa72() { int res = 0; - const int x_9 = tint_atomicMax(sb_rw, 0u, 1); + const int x_9 = sb_rwatomicMax(0u, 1); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicMax/storage_i32.spvasm.expected.fxc.hlsl b/test/tint/builtins/atomics/from_gen/literal/atomicMax/storage_i32.spvasm.expected.fxc.hlsl index 4fd3948e88..2fd2f17bd0 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicMax/storage_i32.spvasm.expected.fxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicMax/storage_i32.spvasm.expected.fxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicMax(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicMax(uint offset, int value) { int original_value = 0; - buffer.InterlockedMax(offset, value, original_value); + sb_rw.InterlockedMax(offset, value, original_value); return original_value; } void atomicMax_92aa72() { int res = 0; - const int x_9 = tint_atomicMax(sb_rw, 0u, 1); + const int x_9 = sb_rwatomicMax(0u, 1); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicMax/storage_u32.spvasm.expected.dxc.hlsl b/test/tint/builtins/atomics/from_gen/literal/atomicMax/storage_u32.spvasm.expected.dxc.hlsl index 9934904856..b9fb452651 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicMax/storage_u32.spvasm.expected.dxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicMax/storage_u32.spvasm.expected.dxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicMax(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicMax(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedMax(offset, value, original_value); + sb_rw.InterlockedMax(offset, value, original_value); return original_value; } void atomicMax_51b9be() { uint res = 0u; - const uint x_9 = tint_atomicMax(sb_rw, 0u, 1u); + const uint x_9 = sb_rwatomicMax(0u, 1u); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicMax/storage_u32.spvasm.expected.fxc.hlsl b/test/tint/builtins/atomics/from_gen/literal/atomicMax/storage_u32.spvasm.expected.fxc.hlsl index 9934904856..b9fb452651 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicMax/storage_u32.spvasm.expected.fxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicMax/storage_u32.spvasm.expected.fxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicMax(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicMax(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedMax(offset, value, original_value); + sb_rw.InterlockedMax(offset, value, original_value); return original_value; } void atomicMax_51b9be() { uint res = 0u; - const uint x_9 = tint_atomicMax(sb_rw, 0u, 1u); + const uint x_9 = sb_rwatomicMax(0u, 1u); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicMin/storage_i32.spvasm.expected.dxc.hlsl b/test/tint/builtins/atomics/from_gen/literal/atomicMin/storage_i32.spvasm.expected.dxc.hlsl index efe6471b38..d749f2142b 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicMin/storage_i32.spvasm.expected.dxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicMin/storage_i32.spvasm.expected.dxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicMin(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicMin(uint offset, int value) { int original_value = 0; - buffer.InterlockedMin(offset, value, original_value); + sb_rw.InterlockedMin(offset, value, original_value); return original_value; } void atomicMin_8e38dc() { int res = 0; - const int x_9 = tint_atomicMin(sb_rw, 0u, 1); + const int x_9 = sb_rwatomicMin(0u, 1); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicMin/storage_i32.spvasm.expected.fxc.hlsl b/test/tint/builtins/atomics/from_gen/literal/atomicMin/storage_i32.spvasm.expected.fxc.hlsl index efe6471b38..d749f2142b 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicMin/storage_i32.spvasm.expected.fxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicMin/storage_i32.spvasm.expected.fxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicMin(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicMin(uint offset, int value) { int original_value = 0; - buffer.InterlockedMin(offset, value, original_value); + sb_rw.InterlockedMin(offset, value, original_value); return original_value; } void atomicMin_8e38dc() { int res = 0; - const int x_9 = tint_atomicMin(sb_rw, 0u, 1); + const int x_9 = sb_rwatomicMin(0u, 1); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicMin/storage_u32.spvasm.expected.dxc.hlsl b/test/tint/builtins/atomics/from_gen/literal/atomicMin/storage_u32.spvasm.expected.dxc.hlsl index 1bb4ca033e..03d2e511bc 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicMin/storage_u32.spvasm.expected.dxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicMin/storage_u32.spvasm.expected.dxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicMin(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicMin(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedMin(offset, value, original_value); + sb_rw.InterlockedMin(offset, value, original_value); return original_value; } void atomicMin_c67a74() { uint res = 0u; - const uint x_9 = tint_atomicMin(sb_rw, 0u, 1u); + const uint x_9 = sb_rwatomicMin(0u, 1u); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicMin/storage_u32.spvasm.expected.fxc.hlsl b/test/tint/builtins/atomics/from_gen/literal/atomicMin/storage_u32.spvasm.expected.fxc.hlsl index 1bb4ca033e..03d2e511bc 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicMin/storage_u32.spvasm.expected.fxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicMin/storage_u32.spvasm.expected.fxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicMin(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicMin(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedMin(offset, value, original_value); + sb_rw.InterlockedMin(offset, value, original_value); return original_value; } void atomicMin_c67a74() { uint res = 0u; - const uint x_9 = tint_atomicMin(sb_rw, 0u, 1u); + const uint x_9 = sb_rwatomicMin(0u, 1u); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicOr/storage_i32.spvasm.expected.dxc.hlsl b/test/tint/builtins/atomics/from_gen/literal/atomicOr/storage_i32.spvasm.expected.dxc.hlsl index f9e84d9887..b99451d774 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicOr/storage_i32.spvasm.expected.dxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicOr/storage_i32.spvasm.expected.dxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicOr(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicOr(uint offset, int value) { int original_value = 0; - buffer.InterlockedOr(offset, value, original_value); + sb_rw.InterlockedOr(offset, value, original_value); return original_value; } void atomicOr_8d96a0() { int res = 0; - const int x_9 = tint_atomicOr(sb_rw, 0u, 1); + const int x_9 = sb_rwatomicOr(0u, 1); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicOr/storage_i32.spvasm.expected.fxc.hlsl b/test/tint/builtins/atomics/from_gen/literal/atomicOr/storage_i32.spvasm.expected.fxc.hlsl index f9e84d9887..b99451d774 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicOr/storage_i32.spvasm.expected.fxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicOr/storage_i32.spvasm.expected.fxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicOr(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicOr(uint offset, int value) { int original_value = 0; - buffer.InterlockedOr(offset, value, original_value); + sb_rw.InterlockedOr(offset, value, original_value); return original_value; } void atomicOr_8d96a0() { int res = 0; - const int x_9 = tint_atomicOr(sb_rw, 0u, 1); + const int x_9 = sb_rwatomicOr(0u, 1); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicOr/storage_u32.spvasm.expected.dxc.hlsl b/test/tint/builtins/atomics/from_gen/literal/atomicOr/storage_u32.spvasm.expected.dxc.hlsl index b0ac7e6e1c..53d57fae04 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicOr/storage_u32.spvasm.expected.dxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicOr/storage_u32.spvasm.expected.dxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicOr(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicOr(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedOr(offset, value, original_value); + sb_rw.InterlockedOr(offset, value, original_value); return original_value; } void atomicOr_5e95d4() { uint res = 0u; - const uint x_9 = tint_atomicOr(sb_rw, 0u, 1u); + const uint x_9 = sb_rwatomicOr(0u, 1u); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicOr/storage_u32.spvasm.expected.fxc.hlsl b/test/tint/builtins/atomics/from_gen/literal/atomicOr/storage_u32.spvasm.expected.fxc.hlsl index b0ac7e6e1c..53d57fae04 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicOr/storage_u32.spvasm.expected.fxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicOr/storage_u32.spvasm.expected.fxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicOr(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicOr(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedOr(offset, value, original_value); + sb_rw.InterlockedOr(offset, value, original_value); return original_value; } void atomicOr_5e95d4() { uint res = 0u; - const uint x_9 = tint_atomicOr(sb_rw, 0u, 1u); + const uint x_9 = sb_rwatomicOr(0u, 1u); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicStore/storage_i32.spvasm.expected.dxc.hlsl b/test/tint/builtins/atomics/from_gen/literal/atomicStore/storage_i32.spvasm.expected.dxc.hlsl index 5ef62c96de..5e9f5ec715 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicStore/storage_i32.spvasm.expected.dxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicStore/storage_i32.spvasm.expected.dxc.hlsl @@ -1,13 +1,13 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -void tint_atomicStore(RWByteAddressBuffer buffer, uint offset, int value) { +void sb_rwatomicStore(uint offset, int value) { int ignored; - buffer.InterlockedExchange(offset, value, ignored); + sb_rw.InterlockedExchange(offset, value, ignored); } void atomicStore_d1e9a6() { - tint_atomicStore(sb_rw, 0u, 1); + sb_rwatomicStore(0u, 1); return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicStore/storage_i32.spvasm.expected.fxc.hlsl b/test/tint/builtins/atomics/from_gen/literal/atomicStore/storage_i32.spvasm.expected.fxc.hlsl index 5ef62c96de..5e9f5ec715 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicStore/storage_i32.spvasm.expected.fxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicStore/storage_i32.spvasm.expected.fxc.hlsl @@ -1,13 +1,13 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -void tint_atomicStore(RWByteAddressBuffer buffer, uint offset, int value) { +void sb_rwatomicStore(uint offset, int value) { int ignored; - buffer.InterlockedExchange(offset, value, ignored); + sb_rw.InterlockedExchange(offset, value, ignored); } void atomicStore_d1e9a6() { - tint_atomicStore(sb_rw, 0u, 1); + sb_rwatomicStore(0u, 1); return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicStore/storage_u32.spvasm.expected.dxc.hlsl b/test/tint/builtins/atomics/from_gen/literal/atomicStore/storage_u32.spvasm.expected.dxc.hlsl index 259c472a39..3b823de52a 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicStore/storage_u32.spvasm.expected.dxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicStore/storage_u32.spvasm.expected.dxc.hlsl @@ -1,13 +1,13 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -void tint_atomicStore(RWByteAddressBuffer buffer, uint offset, uint value) { +void sb_rwatomicStore(uint offset, uint value) { uint ignored; - buffer.InterlockedExchange(offset, value, ignored); + sb_rw.InterlockedExchange(offset, value, ignored); } void atomicStore_cdc29e() { - tint_atomicStore(sb_rw, 0u, 1u); + sb_rwatomicStore(0u, 1u); return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicStore/storage_u32.spvasm.expected.fxc.hlsl b/test/tint/builtins/atomics/from_gen/literal/atomicStore/storage_u32.spvasm.expected.fxc.hlsl index 259c472a39..3b823de52a 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicStore/storage_u32.spvasm.expected.fxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicStore/storage_u32.spvasm.expected.fxc.hlsl @@ -1,13 +1,13 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -void tint_atomicStore(RWByteAddressBuffer buffer, uint offset, uint value) { +void sb_rwatomicStore(uint offset, uint value) { uint ignored; - buffer.InterlockedExchange(offset, value, ignored); + sb_rw.InterlockedExchange(offset, value, ignored); } void atomicStore_cdc29e() { - tint_atomicStore(sb_rw, 0u, 1u); + sb_rwatomicStore(0u, 1u); return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicSub/storage_i32.spvasm.expected.dxc.hlsl b/test/tint/builtins/atomics/from_gen/literal/atomicSub/storage_i32.spvasm.expected.dxc.hlsl index 3624845ca0..7bc33bffa1 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicSub/storage_i32.spvasm.expected.dxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicSub/storage_i32.spvasm.expected.dxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicSub(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicSub(uint offset, int value) { int original_value = 0; - buffer.InterlockedAdd(offset, -value, original_value); + sb_rw.InterlockedAdd(offset, -value, original_value); return original_value; } void atomicSub_051100() { int res = 0; - const int x_9 = tint_atomicSub(sb_rw, 0u, 1); + const int x_9 = sb_rwatomicSub(0u, 1); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicSub/storage_i32.spvasm.expected.fxc.hlsl b/test/tint/builtins/atomics/from_gen/literal/atomicSub/storage_i32.spvasm.expected.fxc.hlsl index 3624845ca0..7bc33bffa1 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicSub/storage_i32.spvasm.expected.fxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicSub/storage_i32.spvasm.expected.fxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicSub(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicSub(uint offset, int value) { int original_value = 0; - buffer.InterlockedAdd(offset, -value, original_value); + sb_rw.InterlockedAdd(offset, -value, original_value); return original_value; } void atomicSub_051100() { int res = 0; - const int x_9 = tint_atomicSub(sb_rw, 0u, 1); + const int x_9 = sb_rwatomicSub(0u, 1); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicSub/storage_u32.spvasm.expected.dxc.hlsl b/test/tint/builtins/atomics/from_gen/literal/atomicSub/storage_u32.spvasm.expected.dxc.hlsl index 1bcbe098b8..0bcd89275a 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicSub/storage_u32.spvasm.expected.dxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicSub/storage_u32.spvasm.expected.dxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicSub(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicSub(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedAdd(offset, -value, original_value); + sb_rw.InterlockedAdd(offset, -value, original_value); return original_value; } void atomicSub_15bfc9() { uint res = 0u; - const uint x_9 = tint_atomicSub(sb_rw, 0u, 1u); + const uint x_9 = sb_rwatomicSub(0u, 1u); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicSub/storage_u32.spvasm.expected.fxc.hlsl b/test/tint/builtins/atomics/from_gen/literal/atomicSub/storage_u32.spvasm.expected.fxc.hlsl index 1bcbe098b8..0bcd89275a 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicSub/storage_u32.spvasm.expected.fxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicSub/storage_u32.spvasm.expected.fxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicSub(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicSub(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedAdd(offset, -value, original_value); + sb_rw.InterlockedAdd(offset, -value, original_value); return original_value; } void atomicSub_15bfc9() { uint res = 0u; - const uint x_9 = tint_atomicSub(sb_rw, 0u, 1u); + const uint x_9 = sb_rwatomicSub(0u, 1u); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicXor/storage_i32.spvasm.expected.dxc.hlsl b/test/tint/builtins/atomics/from_gen/literal/atomicXor/storage_i32.spvasm.expected.dxc.hlsl index 605a4d7cdb..d9c6d9bd03 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicXor/storage_i32.spvasm.expected.dxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicXor/storage_i32.spvasm.expected.dxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicXor(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicXor(uint offset, int value) { int original_value = 0; - buffer.InterlockedXor(offset, value, original_value); + sb_rw.InterlockedXor(offset, value, original_value); return original_value; } void atomicXor_c1b78c() { int res = 0; - const int x_9 = tint_atomicXor(sb_rw, 0u, 1); + const int x_9 = sb_rwatomicXor(0u, 1); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicXor/storage_i32.spvasm.expected.fxc.hlsl b/test/tint/builtins/atomics/from_gen/literal/atomicXor/storage_i32.spvasm.expected.fxc.hlsl index 605a4d7cdb..d9c6d9bd03 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicXor/storage_i32.spvasm.expected.fxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicXor/storage_i32.spvasm.expected.fxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicXor(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicXor(uint offset, int value) { int original_value = 0; - buffer.InterlockedXor(offset, value, original_value); + sb_rw.InterlockedXor(offset, value, original_value); return original_value; } void atomicXor_c1b78c() { int res = 0; - const int x_9 = tint_atomicXor(sb_rw, 0u, 1); + const int x_9 = sb_rwatomicXor(0u, 1); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicXor/storage_u32.spvasm.expected.dxc.hlsl b/test/tint/builtins/atomics/from_gen/literal/atomicXor/storage_u32.spvasm.expected.dxc.hlsl index 3c2aad77ac..36e2a3782a 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicXor/storage_u32.spvasm.expected.dxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicXor/storage_u32.spvasm.expected.dxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicXor(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicXor(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedXor(offset, value, original_value); + sb_rw.InterlockedXor(offset, value, original_value); return original_value; } void atomicXor_54510e() { uint res = 0u; - const uint x_9 = tint_atomicXor(sb_rw, 0u, 1u); + const uint x_9 = sb_rwatomicXor(0u, 1u); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/atomicXor/storage_u32.spvasm.expected.fxc.hlsl b/test/tint/builtins/atomics/from_gen/literal/atomicXor/storage_u32.spvasm.expected.fxc.hlsl index 3c2aad77ac..36e2a3782a 100644 --- a/test/tint/builtins/atomics/from_gen/literal/atomicXor/storage_u32.spvasm.expected.fxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/literal/atomicXor/storage_u32.spvasm.expected.fxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicXor(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicXor(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedXor(offset, value, original_value); + sb_rw.InterlockedXor(offset, value, original_value); return original_value; } void atomicXor_54510e() { uint res = 0u; - const uint x_9 = tint_atomicXor(sb_rw, 0u, 1u); + const uint x_9 = sb_rwatomicXor(0u, 1u); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/spvAtomicDecrement/storage_i32.spvasm.expected.dxc.hlsl b/test/tint/builtins/atomics/from_gen/literal/spvAtomicDecrement/storage_i32.spvasm.expected.dxc.hlsl index ab2b1ee161..a53e9e767f 100644 --- a/test/tint/builtins/atomics/from_gen/literal/spvAtomicDecrement/storage_i32.spvasm.expected.dxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/literal/spvAtomicDecrement/storage_i32.spvasm.expected.dxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicSub(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicSub(uint offset, int value) { int original_value = 0; - buffer.InterlockedAdd(offset, -value, original_value); + sb_rw.InterlockedAdd(offset, -value, original_value); return original_value; } void atomicAdd_d32fe4() { int res = 0; - const int x_9 = tint_atomicSub(sb_rw, 0u, 1); + const int x_9 = sb_rwatomicSub(0u, 1); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/spvAtomicDecrement/storage_i32.spvasm.expected.fxc.hlsl b/test/tint/builtins/atomics/from_gen/literal/spvAtomicDecrement/storage_i32.spvasm.expected.fxc.hlsl index ab2b1ee161..a53e9e767f 100644 --- a/test/tint/builtins/atomics/from_gen/literal/spvAtomicDecrement/storage_i32.spvasm.expected.fxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/literal/spvAtomicDecrement/storage_i32.spvasm.expected.fxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicSub(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicSub(uint offset, int value) { int original_value = 0; - buffer.InterlockedAdd(offset, -value, original_value); + sb_rw.InterlockedAdd(offset, -value, original_value); return original_value; } void atomicAdd_d32fe4() { int res = 0; - const int x_9 = tint_atomicSub(sb_rw, 0u, 1); + const int x_9 = sb_rwatomicSub(0u, 1); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/spvAtomicDecrement/storage_u32.spvasm.expected.dxc.hlsl b/test/tint/builtins/atomics/from_gen/literal/spvAtomicDecrement/storage_u32.spvasm.expected.dxc.hlsl index 6f0bb19b4c..208f0372f7 100644 --- a/test/tint/builtins/atomics/from_gen/literal/spvAtomicDecrement/storage_u32.spvasm.expected.dxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/literal/spvAtomicDecrement/storage_u32.spvasm.expected.dxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicSub(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicSub(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedAdd(offset, -value, original_value); + sb_rw.InterlockedAdd(offset, -value, original_value); return original_value; } void atomicAdd_8a199a() { uint res = 0u; - const uint x_9 = tint_atomicSub(sb_rw, 0u, 1u); + const uint x_9 = sb_rwatomicSub(0u, 1u); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/spvAtomicDecrement/storage_u32.spvasm.expected.fxc.hlsl b/test/tint/builtins/atomics/from_gen/literal/spvAtomicDecrement/storage_u32.spvasm.expected.fxc.hlsl index 6f0bb19b4c..208f0372f7 100644 --- a/test/tint/builtins/atomics/from_gen/literal/spvAtomicDecrement/storage_u32.spvasm.expected.fxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/literal/spvAtomicDecrement/storage_u32.spvasm.expected.fxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicSub(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicSub(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedAdd(offset, -value, original_value); + sb_rw.InterlockedAdd(offset, -value, original_value); return original_value; } void atomicAdd_8a199a() { uint res = 0u; - const uint x_9 = tint_atomicSub(sb_rw, 0u, 1u); + const uint x_9 = sb_rwatomicSub(0u, 1u); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/spvAtomicIncrement/storage_i32.spvasm.expected.dxc.hlsl b/test/tint/builtins/atomics/from_gen/literal/spvAtomicIncrement/storage_i32.spvasm.expected.dxc.hlsl index 358487bedc..b367bec0e2 100644 --- a/test/tint/builtins/atomics/from_gen/literal/spvAtomicIncrement/storage_i32.spvasm.expected.dxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/literal/spvAtomicIncrement/storage_i32.spvasm.expected.dxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicAdd(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicAdd(uint offset, int value) { int original_value = 0; - buffer.InterlockedAdd(offset, value, original_value); + sb_rw.InterlockedAdd(offset, value, original_value); return original_value; } void atomicAdd_d32fe4() { int res = 0; - const int x_9 = tint_atomicAdd(sb_rw, 0u, 1); + const int x_9 = sb_rwatomicAdd(0u, 1); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/spvAtomicIncrement/storage_i32.spvasm.expected.fxc.hlsl b/test/tint/builtins/atomics/from_gen/literal/spvAtomicIncrement/storage_i32.spvasm.expected.fxc.hlsl index 358487bedc..b367bec0e2 100644 --- a/test/tint/builtins/atomics/from_gen/literal/spvAtomicIncrement/storage_i32.spvasm.expected.fxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/literal/spvAtomicIncrement/storage_i32.spvasm.expected.fxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicAdd(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicAdd(uint offset, int value) { int original_value = 0; - buffer.InterlockedAdd(offset, value, original_value); + sb_rw.InterlockedAdd(offset, value, original_value); return original_value; } void atomicAdd_d32fe4() { int res = 0; - const int x_9 = tint_atomicAdd(sb_rw, 0u, 1); + const int x_9 = sb_rwatomicAdd(0u, 1); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/spvAtomicIncrement/storage_u32.spvasm.expected.dxc.hlsl b/test/tint/builtins/atomics/from_gen/literal/spvAtomicIncrement/storage_u32.spvasm.expected.dxc.hlsl index bdc43b0733..bc6bf1a48e 100644 --- a/test/tint/builtins/atomics/from_gen/literal/spvAtomicIncrement/storage_u32.spvasm.expected.dxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/literal/spvAtomicIncrement/storage_u32.spvasm.expected.dxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicAdd(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicAdd(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedAdd(offset, value, original_value); + sb_rw.InterlockedAdd(offset, value, original_value); return original_value; } void atomicAdd_8a199a() { uint res = 0u; - const uint x_9 = tint_atomicAdd(sb_rw, 0u, 1u); + const uint x_9 = sb_rwatomicAdd(0u, 1u); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/literal/spvAtomicIncrement/storage_u32.spvasm.expected.fxc.hlsl b/test/tint/builtins/atomics/from_gen/literal/spvAtomicIncrement/storage_u32.spvasm.expected.fxc.hlsl index bdc43b0733..bc6bf1a48e 100644 --- a/test/tint/builtins/atomics/from_gen/literal/spvAtomicIncrement/storage_u32.spvasm.expected.fxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/literal/spvAtomicIncrement/storage_u32.spvasm.expected.fxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicAdd(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicAdd(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedAdd(offset, value, original_value); + sb_rw.InterlockedAdd(offset, value, original_value); return original_value; } void atomicAdd_8a199a() { uint res = 0u; - const uint x_9 = tint_atomicAdd(sb_rw, 0u, 1u); + const uint x_9 = sb_rwatomicAdd(0u, 1u); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicAdd/storage_i32.spvasm.expected.dxc.hlsl b/test/tint/builtins/atomics/from_gen/var/atomicAdd/storage_i32.spvasm.expected.dxc.hlsl index c8e31aeb76..f36214509d 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicAdd/storage_i32.spvasm.expected.dxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicAdd/storage_i32.spvasm.expected.dxc.hlsl @@ -1,8 +1,8 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicAdd(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicAdd(uint offset, int value) { int original_value = 0; - buffer.InterlockedAdd(offset, value, original_value); + sb_rw.InterlockedAdd(offset, value, original_value); return original_value; } @@ -12,7 +12,7 @@ void atomicAdd_d32fe4() { int res = 0; arg_1 = 1; const int x_20 = arg_1; - const int x_13 = tint_atomicAdd(sb_rw, 0u, x_20); + const int x_13 = sb_rwatomicAdd(0u, x_20); res = x_13; return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicAdd/storage_i32.spvasm.expected.fxc.hlsl b/test/tint/builtins/atomics/from_gen/var/atomicAdd/storage_i32.spvasm.expected.fxc.hlsl index c8e31aeb76..f36214509d 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicAdd/storage_i32.spvasm.expected.fxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicAdd/storage_i32.spvasm.expected.fxc.hlsl @@ -1,8 +1,8 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicAdd(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicAdd(uint offset, int value) { int original_value = 0; - buffer.InterlockedAdd(offset, value, original_value); + sb_rw.InterlockedAdd(offset, value, original_value); return original_value; } @@ -12,7 +12,7 @@ void atomicAdd_d32fe4() { int res = 0; arg_1 = 1; const int x_20 = arg_1; - const int x_13 = tint_atomicAdd(sb_rw, 0u, x_20); + const int x_13 = sb_rwatomicAdd(0u, x_20); res = x_13; return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicAdd/storage_u32.spvasm.expected.dxc.hlsl b/test/tint/builtins/atomics/from_gen/var/atomicAdd/storage_u32.spvasm.expected.dxc.hlsl index e655ec0f41..ae4f759de7 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicAdd/storage_u32.spvasm.expected.dxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicAdd/storage_u32.spvasm.expected.dxc.hlsl @@ -1,8 +1,8 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicAdd(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicAdd(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedAdd(offset, value, original_value); + sb_rw.InterlockedAdd(offset, value, original_value); return original_value; } @@ -12,7 +12,7 @@ void atomicAdd_8a199a() { uint res = 0u; arg_1 = 1u; const uint x_18 = arg_1; - const uint x_13 = tint_atomicAdd(sb_rw, 0u, x_18); + const uint x_13 = sb_rwatomicAdd(0u, x_18); res = x_13; return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicAdd/storage_u32.spvasm.expected.fxc.hlsl b/test/tint/builtins/atomics/from_gen/var/atomicAdd/storage_u32.spvasm.expected.fxc.hlsl index e655ec0f41..ae4f759de7 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicAdd/storage_u32.spvasm.expected.fxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicAdd/storage_u32.spvasm.expected.fxc.hlsl @@ -1,8 +1,8 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicAdd(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicAdd(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedAdd(offset, value, original_value); + sb_rw.InterlockedAdd(offset, value, original_value); return original_value; } @@ -12,7 +12,7 @@ void atomicAdd_8a199a() { uint res = 0u; arg_1 = 1u; const uint x_18 = arg_1; - const uint x_13 = tint_atomicAdd(sb_rw, 0u, x_18); + const uint x_13 = sb_rwatomicAdd(0u, x_18); res = x_13; return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicAnd/storage_i32.spvasm.expected.dxc.hlsl b/test/tint/builtins/atomics/from_gen/var/atomicAnd/storage_i32.spvasm.expected.dxc.hlsl index fc213fb31e..c72e4ed353 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicAnd/storage_i32.spvasm.expected.dxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicAnd/storage_i32.spvasm.expected.dxc.hlsl @@ -1,8 +1,8 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicAnd(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicAnd(uint offset, int value) { int original_value = 0; - buffer.InterlockedAnd(offset, value, original_value); + sb_rw.InterlockedAnd(offset, value, original_value); return original_value; } @@ -12,7 +12,7 @@ void atomicAnd_152966() { int res = 0; arg_1 = 1; const int x_20 = arg_1; - const int x_13 = tint_atomicAnd(sb_rw, 0u, x_20); + const int x_13 = sb_rwatomicAnd(0u, x_20); res = x_13; return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicAnd/storage_i32.spvasm.expected.fxc.hlsl b/test/tint/builtins/atomics/from_gen/var/atomicAnd/storage_i32.spvasm.expected.fxc.hlsl index fc213fb31e..c72e4ed353 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicAnd/storage_i32.spvasm.expected.fxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicAnd/storage_i32.spvasm.expected.fxc.hlsl @@ -1,8 +1,8 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicAnd(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicAnd(uint offset, int value) { int original_value = 0; - buffer.InterlockedAnd(offset, value, original_value); + sb_rw.InterlockedAnd(offset, value, original_value); return original_value; } @@ -12,7 +12,7 @@ void atomicAnd_152966() { int res = 0; arg_1 = 1; const int x_20 = arg_1; - const int x_13 = tint_atomicAnd(sb_rw, 0u, x_20); + const int x_13 = sb_rwatomicAnd(0u, x_20); res = x_13; return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicAnd/storage_u32.spvasm.expected.dxc.hlsl b/test/tint/builtins/atomics/from_gen/var/atomicAnd/storage_u32.spvasm.expected.dxc.hlsl index e8e9bef4d3..07d19f6cc2 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicAnd/storage_u32.spvasm.expected.dxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicAnd/storage_u32.spvasm.expected.dxc.hlsl @@ -1,8 +1,8 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicAnd(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicAnd(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedAnd(offset, value, original_value); + sb_rw.InterlockedAnd(offset, value, original_value); return original_value; } @@ -12,7 +12,7 @@ void atomicAnd_85a8d9() { uint res = 0u; arg_1 = 1u; const uint x_18 = arg_1; - const uint x_13 = tint_atomicAnd(sb_rw, 0u, x_18); + const uint x_13 = sb_rwatomicAnd(0u, x_18); res = x_13; return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicAnd/storage_u32.spvasm.expected.fxc.hlsl b/test/tint/builtins/atomics/from_gen/var/atomicAnd/storage_u32.spvasm.expected.fxc.hlsl index e8e9bef4d3..07d19f6cc2 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicAnd/storage_u32.spvasm.expected.fxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicAnd/storage_u32.spvasm.expected.fxc.hlsl @@ -1,8 +1,8 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicAnd(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicAnd(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedAnd(offset, value, original_value); + sb_rw.InterlockedAnd(offset, value, original_value); return original_value; } @@ -12,7 +12,7 @@ void atomicAnd_85a8d9() { uint res = 0u; arg_1 = 1u; const uint x_18 = arg_1; - const uint x_13 = tint_atomicAnd(sb_rw, 0u, x_18); + const uint x_13 = sb_rwatomicAnd(0u, x_18); res = x_13; return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/storage_i32.spvasm.expected.dxc.hlsl b/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/storage_i32.spvasm.expected.dxc.hlsl index 43cd8a8491..b1a5ec8743 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/storage_i32.spvasm.expected.dxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/storage_i32.spvasm.expected.dxc.hlsl @@ -10,9 +10,9 @@ struct atomic_compare_exchange_weak_ret_type { bool exchanged; }; -atomic_compare_exchange_weak_ret_type tint_atomicCompareExchangeWeak(RWByteAddressBuffer buffer, uint offset, int compare, int value) { +atomic_compare_exchange_weak_ret_type sb_rwatomicCompareExchangeWeak(uint offset, int compare, int value) { atomic_compare_exchange_weak_ret_type result=(atomic_compare_exchange_weak_ret_type)0; - buffer.InterlockedCompareExchange(offset, compare, value, result.old_value); + sb_rw.InterlockedCompareExchange(offset, compare, value, result.old_value); result.exchanged = result.old_value == compare; return result; } @@ -26,7 +26,7 @@ void atomicCompareExchangeWeak_1bd40a() { arg_2 = 1; const int x_23 = arg_2; const int x_24 = arg_1; - const atomic_compare_exchange_weak_ret_type tint_symbol = tint_atomicCompareExchangeWeak(sb_rw, 0u, x_24, x_23); + const atomic_compare_exchange_weak_ret_type tint_symbol = sb_rwatomicCompareExchangeWeak(0u, x_24, x_23); const int old_value_1 = tint_symbol.old_value; const int x_25 = old_value_1; const x__atomic_compare_exchange_resulti32 tint_symbol_1 = {x_25, (x_25 == x_23)}; diff --git a/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/storage_i32.spvasm.expected.fxc.hlsl b/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/storage_i32.spvasm.expected.fxc.hlsl index 43cd8a8491..b1a5ec8743 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/storage_i32.spvasm.expected.fxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/storage_i32.spvasm.expected.fxc.hlsl @@ -10,9 +10,9 @@ struct atomic_compare_exchange_weak_ret_type { bool exchanged; }; -atomic_compare_exchange_weak_ret_type tint_atomicCompareExchangeWeak(RWByteAddressBuffer buffer, uint offset, int compare, int value) { +atomic_compare_exchange_weak_ret_type sb_rwatomicCompareExchangeWeak(uint offset, int compare, int value) { atomic_compare_exchange_weak_ret_type result=(atomic_compare_exchange_weak_ret_type)0; - buffer.InterlockedCompareExchange(offset, compare, value, result.old_value); + sb_rw.InterlockedCompareExchange(offset, compare, value, result.old_value); result.exchanged = result.old_value == compare; return result; } @@ -26,7 +26,7 @@ void atomicCompareExchangeWeak_1bd40a() { arg_2 = 1; const int x_23 = arg_2; const int x_24 = arg_1; - const atomic_compare_exchange_weak_ret_type tint_symbol = tint_atomicCompareExchangeWeak(sb_rw, 0u, x_24, x_23); + const atomic_compare_exchange_weak_ret_type tint_symbol = sb_rwatomicCompareExchangeWeak(0u, x_24, x_23); const int old_value_1 = tint_symbol.old_value; const int x_25 = old_value_1; const x__atomic_compare_exchange_resulti32 tint_symbol_1 = {x_25, (x_25 == x_23)}; diff --git a/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/storage_u32.spvasm.expected.dxc.hlsl b/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/storage_u32.spvasm.expected.dxc.hlsl index c273046cc9..d9703fa503 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/storage_u32.spvasm.expected.dxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/storage_u32.spvasm.expected.dxc.hlsl @@ -10,9 +10,9 @@ struct atomic_compare_exchange_weak_ret_type { bool exchanged; }; -atomic_compare_exchange_weak_ret_type tint_atomicCompareExchangeWeak(RWByteAddressBuffer buffer, uint offset, uint compare, uint value) { +atomic_compare_exchange_weak_ret_type sb_rwatomicCompareExchangeWeak(uint offset, uint compare, uint value) { atomic_compare_exchange_weak_ret_type result=(atomic_compare_exchange_weak_ret_type)0; - buffer.InterlockedCompareExchange(offset, compare, value, result.old_value); + sb_rw.InterlockedCompareExchange(offset, compare, value, result.old_value); result.exchanged = result.old_value == compare; return result; } @@ -26,7 +26,7 @@ void atomicCompareExchangeWeak_63d8e6() { arg_2 = 1u; const uint x_21 = arg_2; const uint x_22 = arg_1; - const atomic_compare_exchange_weak_ret_type tint_symbol = tint_atomicCompareExchangeWeak(sb_rw, 0u, x_22, x_21); + const atomic_compare_exchange_weak_ret_type tint_symbol = sb_rwatomicCompareExchangeWeak(0u, x_22, x_21); const uint old_value_1 = tint_symbol.old_value; const uint x_23 = old_value_1; const x__atomic_compare_exchange_resultu32 tint_symbol_1 = {x_23, (x_23 == x_21)}; diff --git a/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/storage_u32.spvasm.expected.fxc.hlsl b/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/storage_u32.spvasm.expected.fxc.hlsl index c273046cc9..d9703fa503 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/storage_u32.spvasm.expected.fxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicCompareExchangeWeak/storage_u32.spvasm.expected.fxc.hlsl @@ -10,9 +10,9 @@ struct atomic_compare_exchange_weak_ret_type { bool exchanged; }; -atomic_compare_exchange_weak_ret_type tint_atomicCompareExchangeWeak(RWByteAddressBuffer buffer, uint offset, uint compare, uint value) { +atomic_compare_exchange_weak_ret_type sb_rwatomicCompareExchangeWeak(uint offset, uint compare, uint value) { atomic_compare_exchange_weak_ret_type result=(atomic_compare_exchange_weak_ret_type)0; - buffer.InterlockedCompareExchange(offset, compare, value, result.old_value); + sb_rw.InterlockedCompareExchange(offset, compare, value, result.old_value); result.exchanged = result.old_value == compare; return result; } @@ -26,7 +26,7 @@ void atomicCompareExchangeWeak_63d8e6() { arg_2 = 1u; const uint x_21 = arg_2; const uint x_22 = arg_1; - const atomic_compare_exchange_weak_ret_type tint_symbol = tint_atomicCompareExchangeWeak(sb_rw, 0u, x_22, x_21); + const atomic_compare_exchange_weak_ret_type tint_symbol = sb_rwatomicCompareExchangeWeak(0u, x_22, x_21); const uint old_value_1 = tint_symbol.old_value; const uint x_23 = old_value_1; const x__atomic_compare_exchange_resultu32 tint_symbol_1 = {x_23, (x_23 == x_21)}; diff --git a/test/tint/builtins/atomics/from_gen/var/atomicExchange/storage_i32.spvasm.expected.dxc.hlsl b/test/tint/builtins/atomics/from_gen/var/atomicExchange/storage_i32.spvasm.expected.dxc.hlsl index 2ad41c1b3c..07bf6754e7 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicExchange/storage_i32.spvasm.expected.dxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicExchange/storage_i32.spvasm.expected.dxc.hlsl @@ -1,8 +1,8 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicExchange(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicExchange(uint offset, int value) { int original_value = 0; - buffer.InterlockedExchange(offset, value, original_value); + sb_rw.InterlockedExchange(offset, value, original_value); return original_value; } @@ -12,7 +12,7 @@ void atomicExchange_f2e22f() { int res = 0; arg_1 = 1; const int x_20 = arg_1; - const int x_13 = tint_atomicExchange(sb_rw, 0u, x_20); + const int x_13 = sb_rwatomicExchange(0u, x_20); res = x_13; return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicExchange/storage_i32.spvasm.expected.fxc.hlsl b/test/tint/builtins/atomics/from_gen/var/atomicExchange/storage_i32.spvasm.expected.fxc.hlsl index 2ad41c1b3c..07bf6754e7 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicExchange/storage_i32.spvasm.expected.fxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicExchange/storage_i32.spvasm.expected.fxc.hlsl @@ -1,8 +1,8 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicExchange(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicExchange(uint offset, int value) { int original_value = 0; - buffer.InterlockedExchange(offset, value, original_value); + sb_rw.InterlockedExchange(offset, value, original_value); return original_value; } @@ -12,7 +12,7 @@ void atomicExchange_f2e22f() { int res = 0; arg_1 = 1; const int x_20 = arg_1; - const int x_13 = tint_atomicExchange(sb_rw, 0u, x_20); + const int x_13 = sb_rwatomicExchange(0u, x_20); res = x_13; return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicExchange/storage_u32.spvasm.expected.dxc.hlsl b/test/tint/builtins/atomics/from_gen/var/atomicExchange/storage_u32.spvasm.expected.dxc.hlsl index aa54a99f43..873c4ee039 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicExchange/storage_u32.spvasm.expected.dxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicExchange/storage_u32.spvasm.expected.dxc.hlsl @@ -1,8 +1,8 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicExchange(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicExchange(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedExchange(offset, value, original_value); + sb_rw.InterlockedExchange(offset, value, original_value); return original_value; } @@ -12,7 +12,7 @@ void atomicExchange_d59712() { uint res = 0u; arg_1 = 1u; const uint x_18 = arg_1; - const uint x_13 = tint_atomicExchange(sb_rw, 0u, x_18); + const uint x_13 = sb_rwatomicExchange(0u, x_18); res = x_13; return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicExchange/storage_u32.spvasm.expected.fxc.hlsl b/test/tint/builtins/atomics/from_gen/var/atomicExchange/storage_u32.spvasm.expected.fxc.hlsl index aa54a99f43..873c4ee039 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicExchange/storage_u32.spvasm.expected.fxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicExchange/storage_u32.spvasm.expected.fxc.hlsl @@ -1,8 +1,8 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicExchange(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicExchange(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedExchange(offset, value, original_value); + sb_rw.InterlockedExchange(offset, value, original_value); return original_value; } @@ -12,7 +12,7 @@ void atomicExchange_d59712() { uint res = 0u; arg_1 = 1u; const uint x_18 = arg_1; - const uint x_13 = tint_atomicExchange(sb_rw, 0u, x_18); + const uint x_13 = sb_rwatomicExchange(0u, x_18); res = x_13; return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicLoad/storage_i32.spvasm.expected.dxc.hlsl b/test/tint/builtins/atomics/from_gen/var/atomicLoad/storage_i32.spvasm.expected.dxc.hlsl index 8ce9cf2f39..e26e9e6ee5 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicLoad/storage_i32.spvasm.expected.dxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicLoad/storage_i32.spvasm.expected.dxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicLoad(RWByteAddressBuffer buffer, uint offset) { +int sb_rwatomicLoad(uint offset) { int value = 0; - buffer.InterlockedOr(offset, 0, value); + sb_rw.InterlockedOr(offset, 0, value); return value; } void atomicLoad_0806ad() { int res = 0; - const int x_9 = tint_atomicLoad(sb_rw, 0u); + const int x_9 = sb_rwatomicLoad(0u); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicLoad/storage_i32.spvasm.expected.fxc.hlsl b/test/tint/builtins/atomics/from_gen/var/atomicLoad/storage_i32.spvasm.expected.fxc.hlsl index 8ce9cf2f39..e26e9e6ee5 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicLoad/storage_i32.spvasm.expected.fxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicLoad/storage_i32.spvasm.expected.fxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicLoad(RWByteAddressBuffer buffer, uint offset) { +int sb_rwatomicLoad(uint offset) { int value = 0; - buffer.InterlockedOr(offset, 0, value); + sb_rw.InterlockedOr(offset, 0, value); return value; } void atomicLoad_0806ad() { int res = 0; - const int x_9 = tint_atomicLoad(sb_rw, 0u); + const int x_9 = sb_rwatomicLoad(0u); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicLoad/storage_u32.spvasm.expected.dxc.hlsl b/test/tint/builtins/atomics/from_gen/var/atomicLoad/storage_u32.spvasm.expected.dxc.hlsl index 454ed3cf18..dd3bbf5a76 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicLoad/storage_u32.spvasm.expected.dxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicLoad/storage_u32.spvasm.expected.dxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicLoad(RWByteAddressBuffer buffer, uint offset) { +uint sb_rwatomicLoad(uint offset) { uint value = 0; - buffer.InterlockedOr(offset, 0, value); + sb_rw.InterlockedOr(offset, 0, value); return value; } void atomicLoad_fe6cc3() { uint res = 0u; - const uint x_9 = tint_atomicLoad(sb_rw, 0u); + const uint x_9 = sb_rwatomicLoad(0u); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicLoad/storage_u32.spvasm.expected.fxc.hlsl b/test/tint/builtins/atomics/from_gen/var/atomicLoad/storage_u32.spvasm.expected.fxc.hlsl index 454ed3cf18..dd3bbf5a76 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicLoad/storage_u32.spvasm.expected.fxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicLoad/storage_u32.spvasm.expected.fxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicLoad(RWByteAddressBuffer buffer, uint offset) { +uint sb_rwatomicLoad(uint offset) { uint value = 0; - buffer.InterlockedOr(offset, 0, value); + sb_rw.InterlockedOr(offset, 0, value); return value; } void atomicLoad_fe6cc3() { uint res = 0u; - const uint x_9 = tint_atomicLoad(sb_rw, 0u); + const uint x_9 = sb_rwatomicLoad(0u); res = x_9; return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicMax/storage_i32.spvasm.expected.dxc.hlsl b/test/tint/builtins/atomics/from_gen/var/atomicMax/storage_i32.spvasm.expected.dxc.hlsl index 6ae98c522b..7b5018164f 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicMax/storage_i32.spvasm.expected.dxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicMax/storage_i32.spvasm.expected.dxc.hlsl @@ -1,8 +1,8 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicMax(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicMax(uint offset, int value) { int original_value = 0; - buffer.InterlockedMax(offset, value, original_value); + sb_rw.InterlockedMax(offset, value, original_value); return original_value; } @@ -12,7 +12,7 @@ void atomicMax_92aa72() { int res = 0; arg_1 = 1; const int x_20 = arg_1; - const int x_13 = tint_atomicMax(sb_rw, 0u, x_20); + const int x_13 = sb_rwatomicMax(0u, x_20); res = x_13; return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicMax/storage_i32.spvasm.expected.fxc.hlsl b/test/tint/builtins/atomics/from_gen/var/atomicMax/storage_i32.spvasm.expected.fxc.hlsl index 6ae98c522b..7b5018164f 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicMax/storage_i32.spvasm.expected.fxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicMax/storage_i32.spvasm.expected.fxc.hlsl @@ -1,8 +1,8 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicMax(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicMax(uint offset, int value) { int original_value = 0; - buffer.InterlockedMax(offset, value, original_value); + sb_rw.InterlockedMax(offset, value, original_value); return original_value; } @@ -12,7 +12,7 @@ void atomicMax_92aa72() { int res = 0; arg_1 = 1; const int x_20 = arg_1; - const int x_13 = tint_atomicMax(sb_rw, 0u, x_20); + const int x_13 = sb_rwatomicMax(0u, x_20); res = x_13; return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicMax/storage_u32.spvasm.expected.dxc.hlsl b/test/tint/builtins/atomics/from_gen/var/atomicMax/storage_u32.spvasm.expected.dxc.hlsl index 209772ae54..9a493f244a 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicMax/storage_u32.spvasm.expected.dxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicMax/storage_u32.spvasm.expected.dxc.hlsl @@ -1,8 +1,8 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicMax(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicMax(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedMax(offset, value, original_value); + sb_rw.InterlockedMax(offset, value, original_value); return original_value; } @@ -12,7 +12,7 @@ void atomicMax_51b9be() { uint res = 0u; arg_1 = 1u; const uint x_18 = arg_1; - const uint x_13 = tint_atomicMax(sb_rw, 0u, x_18); + const uint x_13 = sb_rwatomicMax(0u, x_18); res = x_13; return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicMax/storage_u32.spvasm.expected.fxc.hlsl b/test/tint/builtins/atomics/from_gen/var/atomicMax/storage_u32.spvasm.expected.fxc.hlsl index 209772ae54..9a493f244a 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicMax/storage_u32.spvasm.expected.fxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicMax/storage_u32.spvasm.expected.fxc.hlsl @@ -1,8 +1,8 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicMax(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicMax(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedMax(offset, value, original_value); + sb_rw.InterlockedMax(offset, value, original_value); return original_value; } @@ -12,7 +12,7 @@ void atomicMax_51b9be() { uint res = 0u; arg_1 = 1u; const uint x_18 = arg_1; - const uint x_13 = tint_atomicMax(sb_rw, 0u, x_18); + const uint x_13 = sb_rwatomicMax(0u, x_18); res = x_13; return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicMin/storage_i32.spvasm.expected.dxc.hlsl b/test/tint/builtins/atomics/from_gen/var/atomicMin/storage_i32.spvasm.expected.dxc.hlsl index b28650b8ed..1c0f0a48d7 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicMin/storage_i32.spvasm.expected.dxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicMin/storage_i32.spvasm.expected.dxc.hlsl @@ -1,8 +1,8 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicMin(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicMin(uint offset, int value) { int original_value = 0; - buffer.InterlockedMin(offset, value, original_value); + sb_rw.InterlockedMin(offset, value, original_value); return original_value; } @@ -12,7 +12,7 @@ void atomicMin_8e38dc() { int res = 0; arg_1 = 1; const int x_20 = arg_1; - const int x_13 = tint_atomicMin(sb_rw, 0u, x_20); + const int x_13 = sb_rwatomicMin(0u, x_20); res = x_13; return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicMin/storage_i32.spvasm.expected.fxc.hlsl b/test/tint/builtins/atomics/from_gen/var/atomicMin/storage_i32.spvasm.expected.fxc.hlsl index b28650b8ed..1c0f0a48d7 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicMin/storage_i32.spvasm.expected.fxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicMin/storage_i32.spvasm.expected.fxc.hlsl @@ -1,8 +1,8 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicMin(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicMin(uint offset, int value) { int original_value = 0; - buffer.InterlockedMin(offset, value, original_value); + sb_rw.InterlockedMin(offset, value, original_value); return original_value; } @@ -12,7 +12,7 @@ void atomicMin_8e38dc() { int res = 0; arg_1 = 1; const int x_20 = arg_1; - const int x_13 = tint_atomicMin(sb_rw, 0u, x_20); + const int x_13 = sb_rwatomicMin(0u, x_20); res = x_13; return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicMin/storage_u32.spvasm.expected.dxc.hlsl b/test/tint/builtins/atomics/from_gen/var/atomicMin/storage_u32.spvasm.expected.dxc.hlsl index d46a572a96..a59f8fc264 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicMin/storage_u32.spvasm.expected.dxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicMin/storage_u32.spvasm.expected.dxc.hlsl @@ -1,8 +1,8 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicMin(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicMin(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedMin(offset, value, original_value); + sb_rw.InterlockedMin(offset, value, original_value); return original_value; } @@ -12,7 +12,7 @@ void atomicMin_c67a74() { uint res = 0u; arg_1 = 1u; const uint x_18 = arg_1; - const uint x_13 = tint_atomicMin(sb_rw, 0u, x_18); + const uint x_13 = sb_rwatomicMin(0u, x_18); res = x_13; return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicMin/storage_u32.spvasm.expected.fxc.hlsl b/test/tint/builtins/atomics/from_gen/var/atomicMin/storage_u32.spvasm.expected.fxc.hlsl index d46a572a96..a59f8fc264 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicMin/storage_u32.spvasm.expected.fxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicMin/storage_u32.spvasm.expected.fxc.hlsl @@ -1,8 +1,8 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicMin(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicMin(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedMin(offset, value, original_value); + sb_rw.InterlockedMin(offset, value, original_value); return original_value; } @@ -12,7 +12,7 @@ void atomicMin_c67a74() { uint res = 0u; arg_1 = 1u; const uint x_18 = arg_1; - const uint x_13 = tint_atomicMin(sb_rw, 0u, x_18); + const uint x_13 = sb_rwatomicMin(0u, x_18); res = x_13; return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicOr/storage_i32.spvasm.expected.dxc.hlsl b/test/tint/builtins/atomics/from_gen/var/atomicOr/storage_i32.spvasm.expected.dxc.hlsl index a9379785ba..168488e2ed 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicOr/storage_i32.spvasm.expected.dxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicOr/storage_i32.spvasm.expected.dxc.hlsl @@ -1,8 +1,8 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicOr(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicOr(uint offset, int value) { int original_value = 0; - buffer.InterlockedOr(offset, value, original_value); + sb_rw.InterlockedOr(offset, value, original_value); return original_value; } @@ -12,7 +12,7 @@ void atomicOr_8d96a0() { int res = 0; arg_1 = 1; const int x_20 = arg_1; - const int x_13 = tint_atomicOr(sb_rw, 0u, x_20); + const int x_13 = sb_rwatomicOr(0u, x_20); res = x_13; return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicOr/storage_i32.spvasm.expected.fxc.hlsl b/test/tint/builtins/atomics/from_gen/var/atomicOr/storage_i32.spvasm.expected.fxc.hlsl index a9379785ba..168488e2ed 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicOr/storage_i32.spvasm.expected.fxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicOr/storage_i32.spvasm.expected.fxc.hlsl @@ -1,8 +1,8 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicOr(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicOr(uint offset, int value) { int original_value = 0; - buffer.InterlockedOr(offset, value, original_value); + sb_rw.InterlockedOr(offset, value, original_value); return original_value; } @@ -12,7 +12,7 @@ void atomicOr_8d96a0() { int res = 0; arg_1 = 1; const int x_20 = arg_1; - const int x_13 = tint_atomicOr(sb_rw, 0u, x_20); + const int x_13 = sb_rwatomicOr(0u, x_20); res = x_13; return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicOr/storage_u32.spvasm.expected.dxc.hlsl b/test/tint/builtins/atomics/from_gen/var/atomicOr/storage_u32.spvasm.expected.dxc.hlsl index 781fb34764..46c211f34a 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicOr/storage_u32.spvasm.expected.dxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicOr/storage_u32.spvasm.expected.dxc.hlsl @@ -1,8 +1,8 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicOr(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicOr(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedOr(offset, value, original_value); + sb_rw.InterlockedOr(offset, value, original_value); return original_value; } @@ -12,7 +12,7 @@ void atomicOr_5e95d4() { uint res = 0u; arg_1 = 1u; const uint x_18 = arg_1; - const uint x_13 = tint_atomicOr(sb_rw, 0u, x_18); + const uint x_13 = sb_rwatomicOr(0u, x_18); res = x_13; return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicOr/storage_u32.spvasm.expected.fxc.hlsl b/test/tint/builtins/atomics/from_gen/var/atomicOr/storage_u32.spvasm.expected.fxc.hlsl index 781fb34764..46c211f34a 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicOr/storage_u32.spvasm.expected.fxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicOr/storage_u32.spvasm.expected.fxc.hlsl @@ -1,8 +1,8 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicOr(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicOr(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedOr(offset, value, original_value); + sb_rw.InterlockedOr(offset, value, original_value); return original_value; } @@ -12,7 +12,7 @@ void atomicOr_5e95d4() { uint res = 0u; arg_1 = 1u; const uint x_18 = arg_1; - const uint x_13 = tint_atomicOr(sb_rw, 0u, x_18); + const uint x_13 = sb_rwatomicOr(0u, x_18); res = x_13; return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicStore/storage_i32.spvasm.expected.dxc.hlsl b/test/tint/builtins/atomics/from_gen/var/atomicStore/storage_i32.spvasm.expected.dxc.hlsl index 4cd4ba707e..97fa7c1676 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicStore/storage_i32.spvasm.expected.dxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicStore/storage_i32.spvasm.expected.dxc.hlsl @@ -1,8 +1,8 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -void tint_atomicStore(RWByteAddressBuffer buffer, uint offset, int value) { +void sb_rwatomicStore(uint offset, int value) { int ignored; - buffer.InterlockedExchange(offset, value, ignored); + sb_rw.InterlockedExchange(offset, value, ignored); } @@ -10,7 +10,7 @@ void atomicStore_d1e9a6() { int arg_1 = 0; arg_1 = 1; const int x_20 = arg_1; - tint_atomicStore(sb_rw, 0u, x_20); + sb_rwatomicStore(0u, x_20); return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicStore/storage_i32.spvasm.expected.fxc.hlsl b/test/tint/builtins/atomics/from_gen/var/atomicStore/storage_i32.spvasm.expected.fxc.hlsl index 4cd4ba707e..97fa7c1676 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicStore/storage_i32.spvasm.expected.fxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicStore/storage_i32.spvasm.expected.fxc.hlsl @@ -1,8 +1,8 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -void tint_atomicStore(RWByteAddressBuffer buffer, uint offset, int value) { +void sb_rwatomicStore(uint offset, int value) { int ignored; - buffer.InterlockedExchange(offset, value, ignored); + sb_rw.InterlockedExchange(offset, value, ignored); } @@ -10,7 +10,7 @@ void atomicStore_d1e9a6() { int arg_1 = 0; arg_1 = 1; const int x_20 = arg_1; - tint_atomicStore(sb_rw, 0u, x_20); + sb_rwatomicStore(0u, x_20); return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicStore/storage_u32.spvasm.expected.dxc.hlsl b/test/tint/builtins/atomics/from_gen/var/atomicStore/storage_u32.spvasm.expected.dxc.hlsl index f8b4de815b..a015fd55ad 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicStore/storage_u32.spvasm.expected.dxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicStore/storage_u32.spvasm.expected.dxc.hlsl @@ -1,8 +1,8 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -void tint_atomicStore(RWByteAddressBuffer buffer, uint offset, uint value) { +void sb_rwatomicStore(uint offset, uint value) { uint ignored; - buffer.InterlockedExchange(offset, value, ignored); + sb_rw.InterlockedExchange(offset, value, ignored); } @@ -10,7 +10,7 @@ void atomicStore_cdc29e() { uint arg_1 = 0u; arg_1 = 1u; const uint x_18 = arg_1; - tint_atomicStore(sb_rw, 0u, x_18); + sb_rwatomicStore(0u, x_18); return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicStore/storage_u32.spvasm.expected.fxc.hlsl b/test/tint/builtins/atomics/from_gen/var/atomicStore/storage_u32.spvasm.expected.fxc.hlsl index f8b4de815b..a015fd55ad 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicStore/storage_u32.spvasm.expected.fxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicStore/storage_u32.spvasm.expected.fxc.hlsl @@ -1,8 +1,8 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -void tint_atomicStore(RWByteAddressBuffer buffer, uint offset, uint value) { +void sb_rwatomicStore(uint offset, uint value) { uint ignored; - buffer.InterlockedExchange(offset, value, ignored); + sb_rw.InterlockedExchange(offset, value, ignored); } @@ -10,7 +10,7 @@ void atomicStore_cdc29e() { uint arg_1 = 0u; arg_1 = 1u; const uint x_18 = arg_1; - tint_atomicStore(sb_rw, 0u, x_18); + sb_rwatomicStore(0u, x_18); return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicSub/storage_i32.spvasm.expected.dxc.hlsl b/test/tint/builtins/atomics/from_gen/var/atomicSub/storage_i32.spvasm.expected.dxc.hlsl index 791ca18391..03fc19aff8 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicSub/storage_i32.spvasm.expected.dxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicSub/storage_i32.spvasm.expected.dxc.hlsl @@ -1,8 +1,8 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicSub(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicSub(uint offset, int value) { int original_value = 0; - buffer.InterlockedAdd(offset, -value, original_value); + sb_rw.InterlockedAdd(offset, -value, original_value); return original_value; } @@ -12,7 +12,7 @@ void atomicSub_051100() { int res = 0; arg_1 = 1; const int x_20 = arg_1; - const int x_13 = tint_atomicSub(sb_rw, 0u, x_20); + const int x_13 = sb_rwatomicSub(0u, x_20); res = x_13; return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicSub/storage_i32.spvasm.expected.fxc.hlsl b/test/tint/builtins/atomics/from_gen/var/atomicSub/storage_i32.spvasm.expected.fxc.hlsl index 791ca18391..03fc19aff8 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicSub/storage_i32.spvasm.expected.fxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicSub/storage_i32.spvasm.expected.fxc.hlsl @@ -1,8 +1,8 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicSub(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicSub(uint offset, int value) { int original_value = 0; - buffer.InterlockedAdd(offset, -value, original_value); + sb_rw.InterlockedAdd(offset, -value, original_value); return original_value; } @@ -12,7 +12,7 @@ void atomicSub_051100() { int res = 0; arg_1 = 1; const int x_20 = arg_1; - const int x_13 = tint_atomicSub(sb_rw, 0u, x_20); + const int x_13 = sb_rwatomicSub(0u, x_20); res = x_13; return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicSub/storage_u32.spvasm.expected.dxc.hlsl b/test/tint/builtins/atomics/from_gen/var/atomicSub/storage_u32.spvasm.expected.dxc.hlsl index daceb1f612..87d5286bb7 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicSub/storage_u32.spvasm.expected.dxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicSub/storage_u32.spvasm.expected.dxc.hlsl @@ -1,8 +1,8 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicSub(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicSub(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedAdd(offset, -value, original_value); + sb_rw.InterlockedAdd(offset, -value, original_value); return original_value; } @@ -12,7 +12,7 @@ void atomicSub_15bfc9() { uint res = 0u; arg_1 = 1u; const uint x_18 = arg_1; - const uint x_13 = tint_atomicSub(sb_rw, 0u, x_18); + const uint x_13 = sb_rwatomicSub(0u, x_18); res = x_13; return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicSub/storage_u32.spvasm.expected.fxc.hlsl b/test/tint/builtins/atomics/from_gen/var/atomicSub/storage_u32.spvasm.expected.fxc.hlsl index daceb1f612..87d5286bb7 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicSub/storage_u32.spvasm.expected.fxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicSub/storage_u32.spvasm.expected.fxc.hlsl @@ -1,8 +1,8 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicSub(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicSub(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedAdd(offset, -value, original_value); + sb_rw.InterlockedAdd(offset, -value, original_value); return original_value; } @@ -12,7 +12,7 @@ void atomicSub_15bfc9() { uint res = 0u; arg_1 = 1u; const uint x_18 = arg_1; - const uint x_13 = tint_atomicSub(sb_rw, 0u, x_18); + const uint x_13 = sb_rwatomicSub(0u, x_18); res = x_13; return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicXor/storage_i32.spvasm.expected.dxc.hlsl b/test/tint/builtins/atomics/from_gen/var/atomicXor/storage_i32.spvasm.expected.dxc.hlsl index 5560d57a2d..f6a233da3b 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicXor/storage_i32.spvasm.expected.dxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicXor/storage_i32.spvasm.expected.dxc.hlsl @@ -1,8 +1,8 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicXor(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicXor(uint offset, int value) { int original_value = 0; - buffer.InterlockedXor(offset, value, original_value); + sb_rw.InterlockedXor(offset, value, original_value); return original_value; } @@ -12,7 +12,7 @@ void atomicXor_c1b78c() { int res = 0; arg_1 = 1; const int x_20 = arg_1; - const int x_13 = tint_atomicXor(sb_rw, 0u, x_20); + const int x_13 = sb_rwatomicXor(0u, x_20); res = x_13; return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicXor/storage_i32.spvasm.expected.fxc.hlsl b/test/tint/builtins/atomics/from_gen/var/atomicXor/storage_i32.spvasm.expected.fxc.hlsl index 5560d57a2d..f6a233da3b 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicXor/storage_i32.spvasm.expected.fxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicXor/storage_i32.spvasm.expected.fxc.hlsl @@ -1,8 +1,8 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicXor(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicXor(uint offset, int value) { int original_value = 0; - buffer.InterlockedXor(offset, value, original_value); + sb_rw.InterlockedXor(offset, value, original_value); return original_value; } @@ -12,7 +12,7 @@ void atomicXor_c1b78c() { int res = 0; arg_1 = 1; const int x_20 = arg_1; - const int x_13 = tint_atomicXor(sb_rw, 0u, x_20); + const int x_13 = sb_rwatomicXor(0u, x_20); res = x_13; return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicXor/storage_u32.spvasm.expected.dxc.hlsl b/test/tint/builtins/atomics/from_gen/var/atomicXor/storage_u32.spvasm.expected.dxc.hlsl index 664d5ba503..c39b3efc3e 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicXor/storage_u32.spvasm.expected.dxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicXor/storage_u32.spvasm.expected.dxc.hlsl @@ -1,8 +1,8 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicXor(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicXor(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedXor(offset, value, original_value); + sb_rw.InterlockedXor(offset, value, original_value); return original_value; } @@ -12,7 +12,7 @@ void atomicXor_54510e() { uint res = 0u; arg_1 = 1u; const uint x_18 = arg_1; - const uint x_13 = tint_atomicXor(sb_rw, 0u, x_18); + const uint x_13 = sb_rwatomicXor(0u, x_18); res = x_13; return; } diff --git a/test/tint/builtins/atomics/from_gen/var/atomicXor/storage_u32.spvasm.expected.fxc.hlsl b/test/tint/builtins/atomics/from_gen/var/atomicXor/storage_u32.spvasm.expected.fxc.hlsl index 664d5ba503..c39b3efc3e 100644 --- a/test/tint/builtins/atomics/from_gen/var/atomicXor/storage_u32.spvasm.expected.fxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/var/atomicXor/storage_u32.spvasm.expected.fxc.hlsl @@ -1,8 +1,8 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicXor(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicXor(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedXor(offset, value, original_value); + sb_rw.InterlockedXor(offset, value, original_value); return original_value; } @@ -12,7 +12,7 @@ void atomicXor_54510e() { uint res = 0u; arg_1 = 1u; const uint x_18 = arg_1; - const uint x_13 = tint_atomicXor(sb_rw, 0u, x_18); + const uint x_13 = sb_rwatomicXor(0u, x_18); res = x_13; return; } diff --git a/test/tint/builtins/atomics/from_gen/var/spvAtomicDecrement/storage_i32.spvasm.expected.dxc.hlsl b/test/tint/builtins/atomics/from_gen/var/spvAtomicDecrement/storage_i32.spvasm.expected.dxc.hlsl index abf10b505d..5b7ded4b92 100644 --- a/test/tint/builtins/atomics/from_gen/var/spvAtomicDecrement/storage_i32.spvasm.expected.dxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/var/spvAtomicDecrement/storage_i32.spvasm.expected.dxc.hlsl @@ -1,8 +1,8 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicSub(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicSub(uint offset, int value) { int original_value = 0; - buffer.InterlockedAdd(offset, -value, original_value); + sb_rw.InterlockedAdd(offset, -value, original_value); return original_value; } @@ -11,7 +11,7 @@ void atomicAdd_d32fe4() { int arg_1 = 0; int res = 0; arg_1 = 1; - const int x_13 = tint_atomicSub(sb_rw, 0u, 1); + const int x_13 = sb_rwatomicSub(0u, 1); res = x_13; return; } diff --git a/test/tint/builtins/atomics/from_gen/var/spvAtomicDecrement/storage_i32.spvasm.expected.fxc.hlsl b/test/tint/builtins/atomics/from_gen/var/spvAtomicDecrement/storage_i32.spvasm.expected.fxc.hlsl index abf10b505d..5b7ded4b92 100644 --- a/test/tint/builtins/atomics/from_gen/var/spvAtomicDecrement/storage_i32.spvasm.expected.fxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/var/spvAtomicDecrement/storage_i32.spvasm.expected.fxc.hlsl @@ -1,8 +1,8 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicSub(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicSub(uint offset, int value) { int original_value = 0; - buffer.InterlockedAdd(offset, -value, original_value); + sb_rw.InterlockedAdd(offset, -value, original_value); return original_value; } @@ -11,7 +11,7 @@ void atomicAdd_d32fe4() { int arg_1 = 0; int res = 0; arg_1 = 1; - const int x_13 = tint_atomicSub(sb_rw, 0u, 1); + const int x_13 = sb_rwatomicSub(0u, 1); res = x_13; return; } diff --git a/test/tint/builtins/atomics/from_gen/var/spvAtomicDecrement/storage_u32.spvasm.expected.dxc.hlsl b/test/tint/builtins/atomics/from_gen/var/spvAtomicDecrement/storage_u32.spvasm.expected.dxc.hlsl index 4e6bb866ec..2c31dff633 100644 --- a/test/tint/builtins/atomics/from_gen/var/spvAtomicDecrement/storage_u32.spvasm.expected.dxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/var/spvAtomicDecrement/storage_u32.spvasm.expected.dxc.hlsl @@ -1,8 +1,8 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicSub(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicSub(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedAdd(offset, -value, original_value); + sb_rw.InterlockedAdd(offset, -value, original_value); return original_value; } @@ -11,7 +11,7 @@ void atomicAdd_8a199a() { uint arg_1 = 0u; uint res = 0u; arg_1 = 1u; - const uint x_13 = tint_atomicSub(sb_rw, 0u, 1u); + const uint x_13 = sb_rwatomicSub(0u, 1u); res = x_13; return; } diff --git a/test/tint/builtins/atomics/from_gen/var/spvAtomicDecrement/storage_u32.spvasm.expected.fxc.hlsl b/test/tint/builtins/atomics/from_gen/var/spvAtomicDecrement/storage_u32.spvasm.expected.fxc.hlsl index 4e6bb866ec..2c31dff633 100644 --- a/test/tint/builtins/atomics/from_gen/var/spvAtomicDecrement/storage_u32.spvasm.expected.fxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/var/spvAtomicDecrement/storage_u32.spvasm.expected.fxc.hlsl @@ -1,8 +1,8 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicSub(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicSub(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedAdd(offset, -value, original_value); + sb_rw.InterlockedAdd(offset, -value, original_value); return original_value; } @@ -11,7 +11,7 @@ void atomicAdd_8a199a() { uint arg_1 = 0u; uint res = 0u; arg_1 = 1u; - const uint x_13 = tint_atomicSub(sb_rw, 0u, 1u); + const uint x_13 = sb_rwatomicSub(0u, 1u); res = x_13; return; } diff --git a/test/tint/builtins/atomics/from_gen/var/spvAtomicIncrement/storage_i32.spvasm.expected.dxc.hlsl b/test/tint/builtins/atomics/from_gen/var/spvAtomicIncrement/storage_i32.spvasm.expected.dxc.hlsl index 9be7a9ef69..0d6d3d8201 100644 --- a/test/tint/builtins/atomics/from_gen/var/spvAtomicIncrement/storage_i32.spvasm.expected.dxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/var/spvAtomicIncrement/storage_i32.spvasm.expected.dxc.hlsl @@ -1,8 +1,8 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicAdd(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicAdd(uint offset, int value) { int original_value = 0; - buffer.InterlockedAdd(offset, value, original_value); + sb_rw.InterlockedAdd(offset, value, original_value); return original_value; } @@ -11,7 +11,7 @@ void atomicAdd_d32fe4() { int arg_1 = 0; int res = 0; arg_1 = 1; - const int x_13 = tint_atomicAdd(sb_rw, 0u, 1); + const int x_13 = sb_rwatomicAdd(0u, 1); res = x_13; return; } diff --git a/test/tint/builtins/atomics/from_gen/var/spvAtomicIncrement/storage_i32.spvasm.expected.fxc.hlsl b/test/tint/builtins/atomics/from_gen/var/spvAtomicIncrement/storage_i32.spvasm.expected.fxc.hlsl index 9be7a9ef69..0d6d3d8201 100644 --- a/test/tint/builtins/atomics/from_gen/var/spvAtomicIncrement/storage_i32.spvasm.expected.fxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/var/spvAtomicIncrement/storage_i32.spvasm.expected.fxc.hlsl @@ -1,8 +1,8 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicAdd(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicAdd(uint offset, int value) { int original_value = 0; - buffer.InterlockedAdd(offset, value, original_value); + sb_rw.InterlockedAdd(offset, value, original_value); return original_value; } @@ -11,7 +11,7 @@ void atomicAdd_d32fe4() { int arg_1 = 0; int res = 0; arg_1 = 1; - const int x_13 = tint_atomicAdd(sb_rw, 0u, 1); + const int x_13 = sb_rwatomicAdd(0u, 1); res = x_13; return; } diff --git a/test/tint/builtins/atomics/from_gen/var/spvAtomicIncrement/storage_u32.spvasm.expected.dxc.hlsl b/test/tint/builtins/atomics/from_gen/var/spvAtomicIncrement/storage_u32.spvasm.expected.dxc.hlsl index 442a1ffc24..c6369a0c14 100644 --- a/test/tint/builtins/atomics/from_gen/var/spvAtomicIncrement/storage_u32.spvasm.expected.dxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/var/spvAtomicIncrement/storage_u32.spvasm.expected.dxc.hlsl @@ -1,8 +1,8 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicAdd(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicAdd(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedAdd(offset, value, original_value); + sb_rw.InterlockedAdd(offset, value, original_value); return original_value; } @@ -11,7 +11,7 @@ void atomicAdd_8a199a() { uint arg_1 = 0u; uint res = 0u; arg_1 = 1u; - const uint x_13 = tint_atomicAdd(sb_rw, 0u, 1u); + const uint x_13 = sb_rwatomicAdd(0u, 1u); res = x_13; return; } diff --git a/test/tint/builtins/atomics/from_gen/var/spvAtomicIncrement/storage_u32.spvasm.expected.fxc.hlsl b/test/tint/builtins/atomics/from_gen/var/spvAtomicIncrement/storage_u32.spvasm.expected.fxc.hlsl index 442a1ffc24..c6369a0c14 100644 --- a/test/tint/builtins/atomics/from_gen/var/spvAtomicIncrement/storage_u32.spvasm.expected.fxc.hlsl +++ b/test/tint/builtins/atomics/from_gen/var/spvAtomicIncrement/storage_u32.spvasm.expected.fxc.hlsl @@ -1,8 +1,8 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicAdd(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicAdd(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedAdd(offset, value, original_value); + sb_rw.InterlockedAdd(offset, value, original_value); return original_value; } @@ -11,7 +11,7 @@ void atomicAdd_8a199a() { uint arg_1 = 0u; uint res = 0u; arg_1 = 1u; - const uint x_13 = tint_atomicAdd(sb_rw, 0u, 1u); + const uint x_13 = sb_rwatomicAdd(0u, 1u); res = x_13; return; } diff --git a/test/tint/builtins/gen/literal/atomicAdd/8a199a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atomicAdd/8a199a.wgsl.expected.dxc.hlsl index f31fb5cf7f..21cb96384a 100644 --- a/test/tint/builtins/gen/literal/atomicAdd/8a199a.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/gen/literal/atomicAdd/8a199a.wgsl.expected.dxc.hlsl @@ -1,14 +1,14 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicAdd(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicAdd(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedAdd(offset, value, original_value); + sb_rw.InterlockedAdd(offset, value, original_value); return original_value; } void atomicAdd_8a199a() { - uint res = tint_atomicAdd(sb_rw, 0u, 1u); + uint res = sb_rwatomicAdd(0u, 1u); } void fragment_main() { diff --git a/test/tint/builtins/gen/literal/atomicAdd/8a199a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atomicAdd/8a199a.wgsl.expected.fxc.hlsl index f31fb5cf7f..21cb96384a 100644 --- a/test/tint/builtins/gen/literal/atomicAdd/8a199a.wgsl.expected.fxc.hlsl +++ b/test/tint/builtins/gen/literal/atomicAdd/8a199a.wgsl.expected.fxc.hlsl @@ -1,14 +1,14 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicAdd(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicAdd(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedAdd(offset, value, original_value); + sb_rw.InterlockedAdd(offset, value, original_value); return original_value; } void atomicAdd_8a199a() { - uint res = tint_atomicAdd(sb_rw, 0u, 1u); + uint res = sb_rwatomicAdd(0u, 1u); } void fragment_main() { diff --git a/test/tint/builtins/gen/literal/atomicAdd/d32fe4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atomicAdd/d32fe4.wgsl.expected.dxc.hlsl index 62ae701abd..9ce9c6552f 100644 --- a/test/tint/builtins/gen/literal/atomicAdd/d32fe4.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/gen/literal/atomicAdd/d32fe4.wgsl.expected.dxc.hlsl @@ -1,14 +1,14 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicAdd(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicAdd(uint offset, int value) { int original_value = 0; - buffer.InterlockedAdd(offset, value, original_value); + sb_rw.InterlockedAdd(offset, value, original_value); return original_value; } void atomicAdd_d32fe4() { - int res = tint_atomicAdd(sb_rw, 0u, 1); + int res = sb_rwatomicAdd(0u, 1); } void fragment_main() { diff --git a/test/tint/builtins/gen/literal/atomicAdd/d32fe4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atomicAdd/d32fe4.wgsl.expected.fxc.hlsl index 62ae701abd..9ce9c6552f 100644 --- a/test/tint/builtins/gen/literal/atomicAdd/d32fe4.wgsl.expected.fxc.hlsl +++ b/test/tint/builtins/gen/literal/atomicAdd/d32fe4.wgsl.expected.fxc.hlsl @@ -1,14 +1,14 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicAdd(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicAdd(uint offset, int value) { int original_value = 0; - buffer.InterlockedAdd(offset, value, original_value); + sb_rw.InterlockedAdd(offset, value, original_value); return original_value; } void atomicAdd_d32fe4() { - int res = tint_atomicAdd(sb_rw, 0u, 1); + int res = sb_rwatomicAdd(0u, 1); } void fragment_main() { diff --git a/test/tint/builtins/gen/literal/atomicAnd/152966.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atomicAnd/152966.wgsl.expected.dxc.hlsl index 281ec13b3d..c56fa0460b 100644 --- a/test/tint/builtins/gen/literal/atomicAnd/152966.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/gen/literal/atomicAnd/152966.wgsl.expected.dxc.hlsl @@ -1,14 +1,14 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicAnd(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicAnd(uint offset, int value) { int original_value = 0; - buffer.InterlockedAnd(offset, value, original_value); + sb_rw.InterlockedAnd(offset, value, original_value); return original_value; } void atomicAnd_152966() { - int res = tint_atomicAnd(sb_rw, 0u, 1); + int res = sb_rwatomicAnd(0u, 1); } void fragment_main() { diff --git a/test/tint/builtins/gen/literal/atomicAnd/152966.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atomicAnd/152966.wgsl.expected.fxc.hlsl index 281ec13b3d..c56fa0460b 100644 --- a/test/tint/builtins/gen/literal/atomicAnd/152966.wgsl.expected.fxc.hlsl +++ b/test/tint/builtins/gen/literal/atomicAnd/152966.wgsl.expected.fxc.hlsl @@ -1,14 +1,14 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicAnd(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicAnd(uint offset, int value) { int original_value = 0; - buffer.InterlockedAnd(offset, value, original_value); + sb_rw.InterlockedAnd(offset, value, original_value); return original_value; } void atomicAnd_152966() { - int res = tint_atomicAnd(sb_rw, 0u, 1); + int res = sb_rwatomicAnd(0u, 1); } void fragment_main() { diff --git a/test/tint/builtins/gen/literal/atomicAnd/85a8d9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atomicAnd/85a8d9.wgsl.expected.dxc.hlsl index 1c89d149e9..b1e36ec7ca 100644 --- a/test/tint/builtins/gen/literal/atomicAnd/85a8d9.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/gen/literal/atomicAnd/85a8d9.wgsl.expected.dxc.hlsl @@ -1,14 +1,14 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicAnd(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicAnd(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedAnd(offset, value, original_value); + sb_rw.InterlockedAnd(offset, value, original_value); return original_value; } void atomicAnd_85a8d9() { - uint res = tint_atomicAnd(sb_rw, 0u, 1u); + uint res = sb_rwatomicAnd(0u, 1u); } void fragment_main() { diff --git a/test/tint/builtins/gen/literal/atomicAnd/85a8d9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atomicAnd/85a8d9.wgsl.expected.fxc.hlsl index 1c89d149e9..b1e36ec7ca 100644 --- a/test/tint/builtins/gen/literal/atomicAnd/85a8d9.wgsl.expected.fxc.hlsl +++ b/test/tint/builtins/gen/literal/atomicAnd/85a8d9.wgsl.expected.fxc.hlsl @@ -1,14 +1,14 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicAnd(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicAnd(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedAnd(offset, value, original_value); + sb_rw.InterlockedAnd(offset, value, original_value); return original_value; } void atomicAnd_85a8d9() { - uint res = tint_atomicAnd(sb_rw, 0u, 1u); + uint res = sb_rwatomicAnd(0u, 1u); } void fragment_main() { diff --git a/test/tint/builtins/gen/literal/atomicCompareExchangeWeak/1bd40a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atomicCompareExchangeWeak/1bd40a.wgsl.expected.dxc.hlsl index b1e30e0e79..b0e68a9a20 100644 --- a/test/tint/builtins/gen/literal/atomicCompareExchangeWeak/1bd40a.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/gen/literal/atomicCompareExchangeWeak/1bd40a.wgsl.expected.dxc.hlsl @@ -5,16 +5,16 @@ struct atomic_compare_exchange_weak_ret_type { bool exchanged; }; -atomic_compare_exchange_weak_ret_type tint_atomicCompareExchangeWeak(RWByteAddressBuffer buffer, uint offset, int compare, int value) { +atomic_compare_exchange_weak_ret_type sb_rwatomicCompareExchangeWeak(uint offset, int compare, int value) { atomic_compare_exchange_weak_ret_type result=(atomic_compare_exchange_weak_ret_type)0; - buffer.InterlockedCompareExchange(offset, compare, value, result.old_value); + sb_rw.InterlockedCompareExchange(offset, compare, value, result.old_value); result.exchanged = result.old_value == compare; return result; } void atomicCompareExchangeWeak_1bd40a() { - atomic_compare_exchange_weak_ret_type res = tint_atomicCompareExchangeWeak(sb_rw, 0u, 1, 1); + atomic_compare_exchange_weak_ret_type res = sb_rwatomicCompareExchangeWeak(0u, 1, 1); } void fragment_main() { diff --git a/test/tint/builtins/gen/literal/atomicCompareExchangeWeak/1bd40a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atomicCompareExchangeWeak/1bd40a.wgsl.expected.fxc.hlsl index b1e30e0e79..b0e68a9a20 100644 --- a/test/tint/builtins/gen/literal/atomicCompareExchangeWeak/1bd40a.wgsl.expected.fxc.hlsl +++ b/test/tint/builtins/gen/literal/atomicCompareExchangeWeak/1bd40a.wgsl.expected.fxc.hlsl @@ -5,16 +5,16 @@ struct atomic_compare_exchange_weak_ret_type { bool exchanged; }; -atomic_compare_exchange_weak_ret_type tint_atomicCompareExchangeWeak(RWByteAddressBuffer buffer, uint offset, int compare, int value) { +atomic_compare_exchange_weak_ret_type sb_rwatomicCompareExchangeWeak(uint offset, int compare, int value) { atomic_compare_exchange_weak_ret_type result=(atomic_compare_exchange_weak_ret_type)0; - buffer.InterlockedCompareExchange(offset, compare, value, result.old_value); + sb_rw.InterlockedCompareExchange(offset, compare, value, result.old_value); result.exchanged = result.old_value == compare; return result; } void atomicCompareExchangeWeak_1bd40a() { - atomic_compare_exchange_weak_ret_type res = tint_atomicCompareExchangeWeak(sb_rw, 0u, 1, 1); + atomic_compare_exchange_weak_ret_type res = sb_rwatomicCompareExchangeWeak(0u, 1, 1); } void fragment_main() { diff --git a/test/tint/builtins/gen/literal/atomicCompareExchangeWeak/63d8e6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atomicCompareExchangeWeak/63d8e6.wgsl.expected.dxc.hlsl index 9dc72b3c46..ac69105603 100644 --- a/test/tint/builtins/gen/literal/atomicCompareExchangeWeak/63d8e6.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/gen/literal/atomicCompareExchangeWeak/63d8e6.wgsl.expected.dxc.hlsl @@ -5,16 +5,16 @@ struct atomic_compare_exchange_weak_ret_type { bool exchanged; }; -atomic_compare_exchange_weak_ret_type tint_atomicCompareExchangeWeak(RWByteAddressBuffer buffer, uint offset, uint compare, uint value) { +atomic_compare_exchange_weak_ret_type sb_rwatomicCompareExchangeWeak(uint offset, uint compare, uint value) { atomic_compare_exchange_weak_ret_type result=(atomic_compare_exchange_weak_ret_type)0; - buffer.InterlockedCompareExchange(offset, compare, value, result.old_value); + sb_rw.InterlockedCompareExchange(offset, compare, value, result.old_value); result.exchanged = result.old_value == compare; return result; } void atomicCompareExchangeWeak_63d8e6() { - atomic_compare_exchange_weak_ret_type res = tint_atomicCompareExchangeWeak(sb_rw, 0u, 1u, 1u); + atomic_compare_exchange_weak_ret_type res = sb_rwatomicCompareExchangeWeak(0u, 1u, 1u); } void fragment_main() { diff --git a/test/tint/builtins/gen/literal/atomicCompareExchangeWeak/63d8e6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atomicCompareExchangeWeak/63d8e6.wgsl.expected.fxc.hlsl index 9dc72b3c46..ac69105603 100644 --- a/test/tint/builtins/gen/literal/atomicCompareExchangeWeak/63d8e6.wgsl.expected.fxc.hlsl +++ b/test/tint/builtins/gen/literal/atomicCompareExchangeWeak/63d8e6.wgsl.expected.fxc.hlsl @@ -5,16 +5,16 @@ struct atomic_compare_exchange_weak_ret_type { bool exchanged; }; -atomic_compare_exchange_weak_ret_type tint_atomicCompareExchangeWeak(RWByteAddressBuffer buffer, uint offset, uint compare, uint value) { +atomic_compare_exchange_weak_ret_type sb_rwatomicCompareExchangeWeak(uint offset, uint compare, uint value) { atomic_compare_exchange_weak_ret_type result=(atomic_compare_exchange_weak_ret_type)0; - buffer.InterlockedCompareExchange(offset, compare, value, result.old_value); + sb_rw.InterlockedCompareExchange(offset, compare, value, result.old_value); result.exchanged = result.old_value == compare; return result; } void atomicCompareExchangeWeak_63d8e6() { - atomic_compare_exchange_weak_ret_type res = tint_atomicCompareExchangeWeak(sb_rw, 0u, 1u, 1u); + atomic_compare_exchange_weak_ret_type res = sb_rwatomicCompareExchangeWeak(0u, 1u, 1u); } void fragment_main() { diff --git a/test/tint/builtins/gen/literal/atomicExchange/d59712.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atomicExchange/d59712.wgsl.expected.dxc.hlsl index b40e1463d9..59e08f0f9b 100644 --- a/test/tint/builtins/gen/literal/atomicExchange/d59712.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/gen/literal/atomicExchange/d59712.wgsl.expected.dxc.hlsl @@ -1,14 +1,14 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicExchange(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicExchange(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedExchange(offset, value, original_value); + sb_rw.InterlockedExchange(offset, value, original_value); return original_value; } void atomicExchange_d59712() { - uint res = tint_atomicExchange(sb_rw, 0u, 1u); + uint res = sb_rwatomicExchange(0u, 1u); } void fragment_main() { diff --git a/test/tint/builtins/gen/literal/atomicExchange/d59712.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atomicExchange/d59712.wgsl.expected.fxc.hlsl index b40e1463d9..59e08f0f9b 100644 --- a/test/tint/builtins/gen/literal/atomicExchange/d59712.wgsl.expected.fxc.hlsl +++ b/test/tint/builtins/gen/literal/atomicExchange/d59712.wgsl.expected.fxc.hlsl @@ -1,14 +1,14 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicExchange(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicExchange(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedExchange(offset, value, original_value); + sb_rw.InterlockedExchange(offset, value, original_value); return original_value; } void atomicExchange_d59712() { - uint res = tint_atomicExchange(sb_rw, 0u, 1u); + uint res = sb_rwatomicExchange(0u, 1u); } void fragment_main() { diff --git a/test/tint/builtins/gen/literal/atomicExchange/f2e22f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atomicExchange/f2e22f.wgsl.expected.dxc.hlsl index ea1abc5d03..f2492f01b2 100644 --- a/test/tint/builtins/gen/literal/atomicExchange/f2e22f.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/gen/literal/atomicExchange/f2e22f.wgsl.expected.dxc.hlsl @@ -1,14 +1,14 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicExchange(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicExchange(uint offset, int value) { int original_value = 0; - buffer.InterlockedExchange(offset, value, original_value); + sb_rw.InterlockedExchange(offset, value, original_value); return original_value; } void atomicExchange_f2e22f() { - int res = tint_atomicExchange(sb_rw, 0u, 1); + int res = sb_rwatomicExchange(0u, 1); } void fragment_main() { diff --git a/test/tint/builtins/gen/literal/atomicExchange/f2e22f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atomicExchange/f2e22f.wgsl.expected.fxc.hlsl index ea1abc5d03..f2492f01b2 100644 --- a/test/tint/builtins/gen/literal/atomicExchange/f2e22f.wgsl.expected.fxc.hlsl +++ b/test/tint/builtins/gen/literal/atomicExchange/f2e22f.wgsl.expected.fxc.hlsl @@ -1,14 +1,14 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicExchange(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicExchange(uint offset, int value) { int original_value = 0; - buffer.InterlockedExchange(offset, value, original_value); + sb_rw.InterlockedExchange(offset, value, original_value); return original_value; } void atomicExchange_f2e22f() { - int res = tint_atomicExchange(sb_rw, 0u, 1); + int res = sb_rwatomicExchange(0u, 1); } void fragment_main() { diff --git a/test/tint/builtins/gen/literal/atomicLoad/0806ad.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atomicLoad/0806ad.wgsl.expected.dxc.hlsl index a278b2c16c..413dcf086a 100644 --- a/test/tint/builtins/gen/literal/atomicLoad/0806ad.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/gen/literal/atomicLoad/0806ad.wgsl.expected.dxc.hlsl @@ -1,14 +1,14 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicLoad(RWByteAddressBuffer buffer, uint offset) { +int sb_rwatomicLoad(uint offset) { int value = 0; - buffer.InterlockedOr(offset, 0, value); + sb_rw.InterlockedOr(offset, 0, value); return value; } void atomicLoad_0806ad() { - int res = tint_atomicLoad(sb_rw, 0u); + int res = sb_rwatomicLoad(0u); } void fragment_main() { diff --git a/test/tint/builtins/gen/literal/atomicLoad/0806ad.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atomicLoad/0806ad.wgsl.expected.fxc.hlsl index a278b2c16c..413dcf086a 100644 --- a/test/tint/builtins/gen/literal/atomicLoad/0806ad.wgsl.expected.fxc.hlsl +++ b/test/tint/builtins/gen/literal/atomicLoad/0806ad.wgsl.expected.fxc.hlsl @@ -1,14 +1,14 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicLoad(RWByteAddressBuffer buffer, uint offset) { +int sb_rwatomicLoad(uint offset) { int value = 0; - buffer.InterlockedOr(offset, 0, value); + sb_rw.InterlockedOr(offset, 0, value); return value; } void atomicLoad_0806ad() { - int res = tint_atomicLoad(sb_rw, 0u); + int res = sb_rwatomicLoad(0u); } void fragment_main() { diff --git a/test/tint/builtins/gen/literal/atomicLoad/fe6cc3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atomicLoad/fe6cc3.wgsl.expected.dxc.hlsl index 77edab3db2..d8fda750bf 100644 --- a/test/tint/builtins/gen/literal/atomicLoad/fe6cc3.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/gen/literal/atomicLoad/fe6cc3.wgsl.expected.dxc.hlsl @@ -1,14 +1,14 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicLoad(RWByteAddressBuffer buffer, uint offset) { +uint sb_rwatomicLoad(uint offset) { uint value = 0; - buffer.InterlockedOr(offset, 0, value); + sb_rw.InterlockedOr(offset, 0, value); return value; } void atomicLoad_fe6cc3() { - uint res = tint_atomicLoad(sb_rw, 0u); + uint res = sb_rwatomicLoad(0u); } void fragment_main() { diff --git a/test/tint/builtins/gen/literal/atomicLoad/fe6cc3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atomicLoad/fe6cc3.wgsl.expected.fxc.hlsl index 77edab3db2..d8fda750bf 100644 --- a/test/tint/builtins/gen/literal/atomicLoad/fe6cc3.wgsl.expected.fxc.hlsl +++ b/test/tint/builtins/gen/literal/atomicLoad/fe6cc3.wgsl.expected.fxc.hlsl @@ -1,14 +1,14 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicLoad(RWByteAddressBuffer buffer, uint offset) { +uint sb_rwatomicLoad(uint offset) { uint value = 0; - buffer.InterlockedOr(offset, 0, value); + sb_rw.InterlockedOr(offset, 0, value); return value; } void atomicLoad_fe6cc3() { - uint res = tint_atomicLoad(sb_rw, 0u); + uint res = sb_rwatomicLoad(0u); } void fragment_main() { diff --git a/test/tint/builtins/gen/literal/atomicMax/51b9be.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atomicMax/51b9be.wgsl.expected.dxc.hlsl index c8f0893154..0c397965a1 100644 --- a/test/tint/builtins/gen/literal/atomicMax/51b9be.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/gen/literal/atomicMax/51b9be.wgsl.expected.dxc.hlsl @@ -1,14 +1,14 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicMax(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicMax(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedMax(offset, value, original_value); + sb_rw.InterlockedMax(offset, value, original_value); return original_value; } void atomicMax_51b9be() { - uint res = tint_atomicMax(sb_rw, 0u, 1u); + uint res = sb_rwatomicMax(0u, 1u); } void fragment_main() { diff --git a/test/tint/builtins/gen/literal/atomicMax/51b9be.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atomicMax/51b9be.wgsl.expected.fxc.hlsl index c8f0893154..0c397965a1 100644 --- a/test/tint/builtins/gen/literal/atomicMax/51b9be.wgsl.expected.fxc.hlsl +++ b/test/tint/builtins/gen/literal/atomicMax/51b9be.wgsl.expected.fxc.hlsl @@ -1,14 +1,14 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicMax(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicMax(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedMax(offset, value, original_value); + sb_rw.InterlockedMax(offset, value, original_value); return original_value; } void atomicMax_51b9be() { - uint res = tint_atomicMax(sb_rw, 0u, 1u); + uint res = sb_rwatomicMax(0u, 1u); } void fragment_main() { diff --git a/test/tint/builtins/gen/literal/atomicMax/92aa72.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atomicMax/92aa72.wgsl.expected.dxc.hlsl index f3d398cc33..4f7dc69d3e 100644 --- a/test/tint/builtins/gen/literal/atomicMax/92aa72.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/gen/literal/atomicMax/92aa72.wgsl.expected.dxc.hlsl @@ -1,14 +1,14 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicMax(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicMax(uint offset, int value) { int original_value = 0; - buffer.InterlockedMax(offset, value, original_value); + sb_rw.InterlockedMax(offset, value, original_value); return original_value; } void atomicMax_92aa72() { - int res = tint_atomicMax(sb_rw, 0u, 1); + int res = sb_rwatomicMax(0u, 1); } void fragment_main() { diff --git a/test/tint/builtins/gen/literal/atomicMax/92aa72.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atomicMax/92aa72.wgsl.expected.fxc.hlsl index f3d398cc33..4f7dc69d3e 100644 --- a/test/tint/builtins/gen/literal/atomicMax/92aa72.wgsl.expected.fxc.hlsl +++ b/test/tint/builtins/gen/literal/atomicMax/92aa72.wgsl.expected.fxc.hlsl @@ -1,14 +1,14 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicMax(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicMax(uint offset, int value) { int original_value = 0; - buffer.InterlockedMax(offset, value, original_value); + sb_rw.InterlockedMax(offset, value, original_value); return original_value; } void atomicMax_92aa72() { - int res = tint_atomicMax(sb_rw, 0u, 1); + int res = sb_rwatomicMax(0u, 1); } void fragment_main() { diff --git a/test/tint/builtins/gen/literal/atomicMin/8e38dc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atomicMin/8e38dc.wgsl.expected.dxc.hlsl index b8d48b8247..69689934e3 100644 --- a/test/tint/builtins/gen/literal/atomicMin/8e38dc.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/gen/literal/atomicMin/8e38dc.wgsl.expected.dxc.hlsl @@ -1,14 +1,14 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicMin(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicMin(uint offset, int value) { int original_value = 0; - buffer.InterlockedMin(offset, value, original_value); + sb_rw.InterlockedMin(offset, value, original_value); return original_value; } void atomicMin_8e38dc() { - int res = tint_atomicMin(sb_rw, 0u, 1); + int res = sb_rwatomicMin(0u, 1); } void fragment_main() { diff --git a/test/tint/builtins/gen/literal/atomicMin/8e38dc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atomicMin/8e38dc.wgsl.expected.fxc.hlsl index b8d48b8247..69689934e3 100644 --- a/test/tint/builtins/gen/literal/atomicMin/8e38dc.wgsl.expected.fxc.hlsl +++ b/test/tint/builtins/gen/literal/atomicMin/8e38dc.wgsl.expected.fxc.hlsl @@ -1,14 +1,14 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicMin(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicMin(uint offset, int value) { int original_value = 0; - buffer.InterlockedMin(offset, value, original_value); + sb_rw.InterlockedMin(offset, value, original_value); return original_value; } void atomicMin_8e38dc() { - int res = tint_atomicMin(sb_rw, 0u, 1); + int res = sb_rwatomicMin(0u, 1); } void fragment_main() { diff --git a/test/tint/builtins/gen/literal/atomicMin/c67a74.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atomicMin/c67a74.wgsl.expected.dxc.hlsl index 3ae5176288..6f7cc8f95f 100644 --- a/test/tint/builtins/gen/literal/atomicMin/c67a74.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/gen/literal/atomicMin/c67a74.wgsl.expected.dxc.hlsl @@ -1,14 +1,14 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicMin(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicMin(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedMin(offset, value, original_value); + sb_rw.InterlockedMin(offset, value, original_value); return original_value; } void atomicMin_c67a74() { - uint res = tint_atomicMin(sb_rw, 0u, 1u); + uint res = sb_rwatomicMin(0u, 1u); } void fragment_main() { diff --git a/test/tint/builtins/gen/literal/atomicMin/c67a74.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atomicMin/c67a74.wgsl.expected.fxc.hlsl index 3ae5176288..6f7cc8f95f 100644 --- a/test/tint/builtins/gen/literal/atomicMin/c67a74.wgsl.expected.fxc.hlsl +++ b/test/tint/builtins/gen/literal/atomicMin/c67a74.wgsl.expected.fxc.hlsl @@ -1,14 +1,14 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicMin(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicMin(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedMin(offset, value, original_value); + sb_rw.InterlockedMin(offset, value, original_value); return original_value; } void atomicMin_c67a74() { - uint res = tint_atomicMin(sb_rw, 0u, 1u); + uint res = sb_rwatomicMin(0u, 1u); } void fragment_main() { diff --git a/test/tint/builtins/gen/literal/atomicOr/5e95d4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atomicOr/5e95d4.wgsl.expected.dxc.hlsl index 97883cbd8c..457c4aac55 100644 --- a/test/tint/builtins/gen/literal/atomicOr/5e95d4.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/gen/literal/atomicOr/5e95d4.wgsl.expected.dxc.hlsl @@ -1,14 +1,14 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicOr(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicOr(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedOr(offset, value, original_value); + sb_rw.InterlockedOr(offset, value, original_value); return original_value; } void atomicOr_5e95d4() { - uint res = tint_atomicOr(sb_rw, 0u, 1u); + uint res = sb_rwatomicOr(0u, 1u); } void fragment_main() { diff --git a/test/tint/builtins/gen/literal/atomicOr/5e95d4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atomicOr/5e95d4.wgsl.expected.fxc.hlsl index 97883cbd8c..457c4aac55 100644 --- a/test/tint/builtins/gen/literal/atomicOr/5e95d4.wgsl.expected.fxc.hlsl +++ b/test/tint/builtins/gen/literal/atomicOr/5e95d4.wgsl.expected.fxc.hlsl @@ -1,14 +1,14 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicOr(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicOr(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedOr(offset, value, original_value); + sb_rw.InterlockedOr(offset, value, original_value); return original_value; } void atomicOr_5e95d4() { - uint res = tint_atomicOr(sb_rw, 0u, 1u); + uint res = sb_rwatomicOr(0u, 1u); } void fragment_main() { diff --git a/test/tint/builtins/gen/literal/atomicOr/8d96a0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atomicOr/8d96a0.wgsl.expected.dxc.hlsl index 04be9d7304..cdd96dca5b 100644 --- a/test/tint/builtins/gen/literal/atomicOr/8d96a0.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/gen/literal/atomicOr/8d96a0.wgsl.expected.dxc.hlsl @@ -1,14 +1,14 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicOr(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicOr(uint offset, int value) { int original_value = 0; - buffer.InterlockedOr(offset, value, original_value); + sb_rw.InterlockedOr(offset, value, original_value); return original_value; } void atomicOr_8d96a0() { - int res = tint_atomicOr(sb_rw, 0u, 1); + int res = sb_rwatomicOr(0u, 1); } void fragment_main() { diff --git a/test/tint/builtins/gen/literal/atomicOr/8d96a0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atomicOr/8d96a0.wgsl.expected.fxc.hlsl index 04be9d7304..cdd96dca5b 100644 --- a/test/tint/builtins/gen/literal/atomicOr/8d96a0.wgsl.expected.fxc.hlsl +++ b/test/tint/builtins/gen/literal/atomicOr/8d96a0.wgsl.expected.fxc.hlsl @@ -1,14 +1,14 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicOr(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicOr(uint offset, int value) { int original_value = 0; - buffer.InterlockedOr(offset, value, original_value); + sb_rw.InterlockedOr(offset, value, original_value); return original_value; } void atomicOr_8d96a0() { - int res = tint_atomicOr(sb_rw, 0u, 1); + int res = sb_rwatomicOr(0u, 1); } void fragment_main() { diff --git a/test/tint/builtins/gen/literal/atomicStore/cdc29e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atomicStore/cdc29e.wgsl.expected.dxc.hlsl index cb8cfddaab..ba0181798a 100644 --- a/test/tint/builtins/gen/literal/atomicStore/cdc29e.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/gen/literal/atomicStore/cdc29e.wgsl.expected.dxc.hlsl @@ -1,13 +1,13 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -void tint_atomicStore(RWByteAddressBuffer buffer, uint offset, uint value) { +void sb_rwatomicStore(uint offset, uint value) { uint ignored; - buffer.InterlockedExchange(offset, value, ignored); + sb_rw.InterlockedExchange(offset, value, ignored); } void atomicStore_cdc29e() { - tint_atomicStore(sb_rw, 0u, 1u); + sb_rwatomicStore(0u, 1u); } void fragment_main() { diff --git a/test/tint/builtins/gen/literal/atomicStore/cdc29e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atomicStore/cdc29e.wgsl.expected.fxc.hlsl index cb8cfddaab..ba0181798a 100644 --- a/test/tint/builtins/gen/literal/atomicStore/cdc29e.wgsl.expected.fxc.hlsl +++ b/test/tint/builtins/gen/literal/atomicStore/cdc29e.wgsl.expected.fxc.hlsl @@ -1,13 +1,13 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -void tint_atomicStore(RWByteAddressBuffer buffer, uint offset, uint value) { +void sb_rwatomicStore(uint offset, uint value) { uint ignored; - buffer.InterlockedExchange(offset, value, ignored); + sb_rw.InterlockedExchange(offset, value, ignored); } void atomicStore_cdc29e() { - tint_atomicStore(sb_rw, 0u, 1u); + sb_rwatomicStore(0u, 1u); } void fragment_main() { diff --git a/test/tint/builtins/gen/literal/atomicStore/d1e9a6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atomicStore/d1e9a6.wgsl.expected.dxc.hlsl index 599f575c7f..37b3119ad5 100644 --- a/test/tint/builtins/gen/literal/atomicStore/d1e9a6.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/gen/literal/atomicStore/d1e9a6.wgsl.expected.dxc.hlsl @@ -1,13 +1,13 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -void tint_atomicStore(RWByteAddressBuffer buffer, uint offset, int value) { +void sb_rwatomicStore(uint offset, int value) { int ignored; - buffer.InterlockedExchange(offset, value, ignored); + sb_rw.InterlockedExchange(offset, value, ignored); } void atomicStore_d1e9a6() { - tint_atomicStore(sb_rw, 0u, 1); + sb_rwatomicStore(0u, 1); } void fragment_main() { diff --git a/test/tint/builtins/gen/literal/atomicStore/d1e9a6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atomicStore/d1e9a6.wgsl.expected.fxc.hlsl index 599f575c7f..37b3119ad5 100644 --- a/test/tint/builtins/gen/literal/atomicStore/d1e9a6.wgsl.expected.fxc.hlsl +++ b/test/tint/builtins/gen/literal/atomicStore/d1e9a6.wgsl.expected.fxc.hlsl @@ -1,13 +1,13 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -void tint_atomicStore(RWByteAddressBuffer buffer, uint offset, int value) { +void sb_rwatomicStore(uint offset, int value) { int ignored; - buffer.InterlockedExchange(offset, value, ignored); + sb_rw.InterlockedExchange(offset, value, ignored); } void atomicStore_d1e9a6() { - tint_atomicStore(sb_rw, 0u, 1); + sb_rwatomicStore(0u, 1); } void fragment_main() { diff --git a/test/tint/builtins/gen/literal/atomicSub/051100.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atomicSub/051100.wgsl.expected.dxc.hlsl index 29d8e0413c..88284ade33 100644 --- a/test/tint/builtins/gen/literal/atomicSub/051100.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/gen/literal/atomicSub/051100.wgsl.expected.dxc.hlsl @@ -1,14 +1,14 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicSub(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicSub(uint offset, int value) { int original_value = 0; - buffer.InterlockedAdd(offset, -value, original_value); + sb_rw.InterlockedAdd(offset, -value, original_value); return original_value; } void atomicSub_051100() { - int res = tint_atomicSub(sb_rw, 0u, 1); + int res = sb_rwatomicSub(0u, 1); } void fragment_main() { diff --git a/test/tint/builtins/gen/literal/atomicSub/051100.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atomicSub/051100.wgsl.expected.fxc.hlsl index 29d8e0413c..88284ade33 100644 --- a/test/tint/builtins/gen/literal/atomicSub/051100.wgsl.expected.fxc.hlsl +++ b/test/tint/builtins/gen/literal/atomicSub/051100.wgsl.expected.fxc.hlsl @@ -1,14 +1,14 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicSub(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicSub(uint offset, int value) { int original_value = 0; - buffer.InterlockedAdd(offset, -value, original_value); + sb_rw.InterlockedAdd(offset, -value, original_value); return original_value; } void atomicSub_051100() { - int res = tint_atomicSub(sb_rw, 0u, 1); + int res = sb_rwatomicSub(0u, 1); } void fragment_main() { diff --git a/test/tint/builtins/gen/literal/atomicSub/15bfc9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atomicSub/15bfc9.wgsl.expected.dxc.hlsl index e5d0027b60..e343eecdd5 100644 --- a/test/tint/builtins/gen/literal/atomicSub/15bfc9.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/gen/literal/atomicSub/15bfc9.wgsl.expected.dxc.hlsl @@ -1,14 +1,14 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicSub(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicSub(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedAdd(offset, -value, original_value); + sb_rw.InterlockedAdd(offset, -value, original_value); return original_value; } void atomicSub_15bfc9() { - uint res = tint_atomicSub(sb_rw, 0u, 1u); + uint res = sb_rwatomicSub(0u, 1u); } void fragment_main() { diff --git a/test/tint/builtins/gen/literal/atomicSub/15bfc9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atomicSub/15bfc9.wgsl.expected.fxc.hlsl index e5d0027b60..e343eecdd5 100644 --- a/test/tint/builtins/gen/literal/atomicSub/15bfc9.wgsl.expected.fxc.hlsl +++ b/test/tint/builtins/gen/literal/atomicSub/15bfc9.wgsl.expected.fxc.hlsl @@ -1,14 +1,14 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicSub(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicSub(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedAdd(offset, -value, original_value); + sb_rw.InterlockedAdd(offset, -value, original_value); return original_value; } void atomicSub_15bfc9() { - uint res = tint_atomicSub(sb_rw, 0u, 1u); + uint res = sb_rwatomicSub(0u, 1u); } void fragment_main() { diff --git a/test/tint/builtins/gen/literal/atomicXor/54510e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atomicXor/54510e.wgsl.expected.dxc.hlsl index 9ed582e64e..3bf3e8dcba 100644 --- a/test/tint/builtins/gen/literal/atomicXor/54510e.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/gen/literal/atomicXor/54510e.wgsl.expected.dxc.hlsl @@ -1,14 +1,14 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicXor(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicXor(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedXor(offset, value, original_value); + sb_rw.InterlockedXor(offset, value, original_value); return original_value; } void atomicXor_54510e() { - uint res = tint_atomicXor(sb_rw, 0u, 1u); + uint res = sb_rwatomicXor(0u, 1u); } void fragment_main() { diff --git a/test/tint/builtins/gen/literal/atomicXor/54510e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atomicXor/54510e.wgsl.expected.fxc.hlsl index 9ed582e64e..3bf3e8dcba 100644 --- a/test/tint/builtins/gen/literal/atomicXor/54510e.wgsl.expected.fxc.hlsl +++ b/test/tint/builtins/gen/literal/atomicXor/54510e.wgsl.expected.fxc.hlsl @@ -1,14 +1,14 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicXor(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicXor(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedXor(offset, value, original_value); + sb_rw.InterlockedXor(offset, value, original_value); return original_value; } void atomicXor_54510e() { - uint res = tint_atomicXor(sb_rw, 0u, 1u); + uint res = sb_rwatomicXor(0u, 1u); } void fragment_main() { diff --git a/test/tint/builtins/gen/literal/atomicXor/c1b78c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/atomicXor/c1b78c.wgsl.expected.dxc.hlsl index bb38f4211e..43929d78f3 100644 --- a/test/tint/builtins/gen/literal/atomicXor/c1b78c.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/gen/literal/atomicXor/c1b78c.wgsl.expected.dxc.hlsl @@ -1,14 +1,14 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicXor(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicXor(uint offset, int value) { int original_value = 0; - buffer.InterlockedXor(offset, value, original_value); + sb_rw.InterlockedXor(offset, value, original_value); return original_value; } void atomicXor_c1b78c() { - int res = tint_atomicXor(sb_rw, 0u, 1); + int res = sb_rwatomicXor(0u, 1); } void fragment_main() { diff --git a/test/tint/builtins/gen/literal/atomicXor/c1b78c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/atomicXor/c1b78c.wgsl.expected.fxc.hlsl index bb38f4211e..43929d78f3 100644 --- a/test/tint/builtins/gen/literal/atomicXor/c1b78c.wgsl.expected.fxc.hlsl +++ b/test/tint/builtins/gen/literal/atomicXor/c1b78c.wgsl.expected.fxc.hlsl @@ -1,14 +1,14 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicXor(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicXor(uint offset, int value) { int original_value = 0; - buffer.InterlockedXor(offset, value, original_value); + sb_rw.InterlockedXor(offset, value, original_value); return original_value; } void atomicXor_c1b78c() { - int res = tint_atomicXor(sb_rw, 0u, 1); + int res = sb_rwatomicXor(0u, 1); } void fragment_main() { diff --git a/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.dxc.hlsl index 1d6c1c10ca..17a7cd274e 100644 --- a/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.dxc.hlsl @@ -47,14 +47,14 @@ float4 textureLoadExternal(Texture2D plane0, Texture2D plane1, u return float4(color, 1.0f); } -float3x4 tint_symbol_3(uint4 buffer[13], uint offset) { +float3x4 ext_tex_params_load_2(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); + return float3x4(asfloat(ext_tex_params[scalar_offset / 4]), asfloat(ext_tex_params[scalar_offset_1 / 4]), asfloat(ext_tex_params[scalar_offset_2 / 4])); } -GammaTransferParams tint_symbol_5(uint4 buffer[13], uint offset) { +GammaTransferParams ext_tex_params_load_4(uint offset) { const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_4 = ((offset + 4u)) / 4; const uint scalar_offset_5 = ((offset + 8u)) / 4; @@ -63,36 +63,36 @@ GammaTransferParams tint_symbol_5(uint4 buffer[13], uint offset) { const uint scalar_offset_8 = ((offset + 20u)) / 4; const uint scalar_offset_9 = ((offset + 24u)) / 4; const uint scalar_offset_10 = ((offset + 28u)) / 4; - const GammaTransferParams tint_symbol_11 = {asfloat(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(buffer[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(buffer[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(buffer[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(buffer[scalar_offset_9 / 4][scalar_offset_9 % 4]), buffer[scalar_offset_10 / 4][scalar_offset_10 % 4]}; - return tint_symbol_11; + const GammaTransferParams tint_symbol_1 = {asfloat(ext_tex_params[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(ext_tex_params[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(ext_tex_params[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(ext_tex_params[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(ext_tex_params[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(ext_tex_params[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(ext_tex_params[scalar_offset_9 / 4][scalar_offset_9 % 4]), ext_tex_params[scalar_offset_10 / 4][scalar_offset_10 % 4]}; + return tint_symbol_1; } -float3x3 tint_symbol_7(uint4 buffer[13], uint offset) { +float3x3 ext_tex_params_load_6(uint offset) { const uint scalar_offset_11 = ((offset + 0u)) / 4; const uint scalar_offset_12 = ((offset + 16u)) / 4; const uint scalar_offset_13 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset_11 / 4].xyz), asfloat(buffer[scalar_offset_12 / 4].xyz), asfloat(buffer[scalar_offset_13 / 4].xyz)); + return float3x3(asfloat(ext_tex_params[scalar_offset_11 / 4].xyz), asfloat(ext_tex_params[scalar_offset_12 / 4].xyz), asfloat(ext_tex_params[scalar_offset_13 / 4].xyz)); } -float3x2 tint_symbol_9(uint4 buffer[13], uint offset) { +float3x2 ext_tex_params_load_8(uint offset) { const uint scalar_offset_14 = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset_14 / 4]; + uint4 ubo_load = ext_tex_params[scalar_offset_14 / 4]; const uint scalar_offset_15 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_15 / 4]; + uint4 ubo_load_1 = ext_tex_params[scalar_offset_15 / 4]; const uint scalar_offset_16 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_16 / 4]; + uint4 ubo_load_2 = ext_tex_params[scalar_offset_16 / 4]; return float3x2(asfloat(((scalar_offset_14 & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_15 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_16 & 2) ? ubo_load_2.zw : ubo_load_2.xy))); } -ExternalTextureParams tint_symbol_1(uint4 buffer[13], uint offset) { +ExternalTextureParams ext_tex_params_load(uint offset) { const uint scalar_offset_17 = ((offset + 0u)) / 4; const uint scalar_offset_18 = ((offset + 4u)) / 4; - const ExternalTextureParams tint_symbol_12 = {buffer[scalar_offset_17 / 4][scalar_offset_17 % 4], buffer[scalar_offset_18 / 4][scalar_offset_18 % 4], tint_symbol_3(buffer, (offset + 16u)), tint_symbol_5(buffer, (offset + 64u)), tint_symbol_5(buffer, (offset + 96u)), tint_symbol_7(buffer, (offset + 128u)), tint_symbol_9(buffer, (offset + 176u))}; - return tint_symbol_12; + const ExternalTextureParams tint_symbol_2 = {ext_tex_params[scalar_offset_17 / 4][scalar_offset_17 % 4], ext_tex_params[scalar_offset_18 / 4][scalar_offset_18 % 4], ext_tex_params_load_2((offset + 16u)), ext_tex_params_load_4((offset + 64u)), ext_tex_params_load_4((offset + 96u)), ext_tex_params_load_6((offset + 128u)), ext_tex_params_load_8((offset + 176u))}; + return tint_symbol_2; } void textureLoad_1bfdfb() { - float4 res = textureLoadExternal(arg_0, ext_tex_plane_1, (1u).xx, tint_symbol_1(ext_tex_params, 0u)); + float4 res = textureLoadExternal(arg_0, ext_tex_plane_1, (1u).xx, ext_tex_params_load(0u)); } struct tint_symbol { diff --git a/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.fxc.hlsl index 1d6c1c10ca..17a7cd274e 100644 --- a/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.fxc.hlsl +++ b/test/tint/builtins/gen/literal/textureLoad/1bfdfb.wgsl.expected.fxc.hlsl @@ -47,14 +47,14 @@ float4 textureLoadExternal(Texture2D plane0, Texture2D plane1, u return float4(color, 1.0f); } -float3x4 tint_symbol_3(uint4 buffer[13], uint offset) { +float3x4 ext_tex_params_load_2(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); + return float3x4(asfloat(ext_tex_params[scalar_offset / 4]), asfloat(ext_tex_params[scalar_offset_1 / 4]), asfloat(ext_tex_params[scalar_offset_2 / 4])); } -GammaTransferParams tint_symbol_5(uint4 buffer[13], uint offset) { +GammaTransferParams ext_tex_params_load_4(uint offset) { const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_4 = ((offset + 4u)) / 4; const uint scalar_offset_5 = ((offset + 8u)) / 4; @@ -63,36 +63,36 @@ GammaTransferParams tint_symbol_5(uint4 buffer[13], uint offset) { const uint scalar_offset_8 = ((offset + 20u)) / 4; const uint scalar_offset_9 = ((offset + 24u)) / 4; const uint scalar_offset_10 = ((offset + 28u)) / 4; - const GammaTransferParams tint_symbol_11 = {asfloat(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(buffer[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(buffer[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(buffer[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(buffer[scalar_offset_9 / 4][scalar_offset_9 % 4]), buffer[scalar_offset_10 / 4][scalar_offset_10 % 4]}; - return tint_symbol_11; + const GammaTransferParams tint_symbol_1 = {asfloat(ext_tex_params[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(ext_tex_params[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(ext_tex_params[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(ext_tex_params[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(ext_tex_params[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(ext_tex_params[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(ext_tex_params[scalar_offset_9 / 4][scalar_offset_9 % 4]), ext_tex_params[scalar_offset_10 / 4][scalar_offset_10 % 4]}; + return tint_symbol_1; } -float3x3 tint_symbol_7(uint4 buffer[13], uint offset) { +float3x3 ext_tex_params_load_6(uint offset) { const uint scalar_offset_11 = ((offset + 0u)) / 4; const uint scalar_offset_12 = ((offset + 16u)) / 4; const uint scalar_offset_13 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset_11 / 4].xyz), asfloat(buffer[scalar_offset_12 / 4].xyz), asfloat(buffer[scalar_offset_13 / 4].xyz)); + return float3x3(asfloat(ext_tex_params[scalar_offset_11 / 4].xyz), asfloat(ext_tex_params[scalar_offset_12 / 4].xyz), asfloat(ext_tex_params[scalar_offset_13 / 4].xyz)); } -float3x2 tint_symbol_9(uint4 buffer[13], uint offset) { +float3x2 ext_tex_params_load_8(uint offset) { const uint scalar_offset_14 = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset_14 / 4]; + uint4 ubo_load = ext_tex_params[scalar_offset_14 / 4]; const uint scalar_offset_15 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_15 / 4]; + uint4 ubo_load_1 = ext_tex_params[scalar_offset_15 / 4]; const uint scalar_offset_16 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_16 / 4]; + uint4 ubo_load_2 = ext_tex_params[scalar_offset_16 / 4]; return float3x2(asfloat(((scalar_offset_14 & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_15 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_16 & 2) ? ubo_load_2.zw : ubo_load_2.xy))); } -ExternalTextureParams tint_symbol_1(uint4 buffer[13], uint offset) { +ExternalTextureParams ext_tex_params_load(uint offset) { const uint scalar_offset_17 = ((offset + 0u)) / 4; const uint scalar_offset_18 = ((offset + 4u)) / 4; - const ExternalTextureParams tint_symbol_12 = {buffer[scalar_offset_17 / 4][scalar_offset_17 % 4], buffer[scalar_offset_18 / 4][scalar_offset_18 % 4], tint_symbol_3(buffer, (offset + 16u)), tint_symbol_5(buffer, (offset + 64u)), tint_symbol_5(buffer, (offset + 96u)), tint_symbol_7(buffer, (offset + 128u)), tint_symbol_9(buffer, (offset + 176u))}; - return tint_symbol_12; + const ExternalTextureParams tint_symbol_2 = {ext_tex_params[scalar_offset_17 / 4][scalar_offset_17 % 4], ext_tex_params[scalar_offset_18 / 4][scalar_offset_18 % 4], ext_tex_params_load_2((offset + 16u)), ext_tex_params_load_4((offset + 64u)), ext_tex_params_load_4((offset + 96u)), ext_tex_params_load_6((offset + 128u)), ext_tex_params_load_8((offset + 176u))}; + return tint_symbol_2; } void textureLoad_1bfdfb() { - float4 res = textureLoadExternal(arg_0, ext_tex_plane_1, (1u).xx, tint_symbol_1(ext_tex_params, 0u)); + float4 res = textureLoadExternal(arg_0, ext_tex_plane_1, (1u).xx, ext_tex_params_load(0u)); } struct tint_symbol { diff --git a/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.dxc.hlsl index c7f820632e..7356d4e70b 100644 --- a/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.dxc.hlsl @@ -47,14 +47,14 @@ float4 textureLoadExternal(Texture2D plane0, Texture2D plane1, i return float4(color, 1.0f); } -float3x4 tint_symbol_3(uint4 buffer[13], uint offset) { +float3x4 ext_tex_params_load_2(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); + return float3x4(asfloat(ext_tex_params[scalar_offset / 4]), asfloat(ext_tex_params[scalar_offset_1 / 4]), asfloat(ext_tex_params[scalar_offset_2 / 4])); } -GammaTransferParams tint_symbol_5(uint4 buffer[13], uint offset) { +GammaTransferParams ext_tex_params_load_4(uint offset) { const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_4 = ((offset + 4u)) / 4; const uint scalar_offset_5 = ((offset + 8u)) / 4; @@ -63,36 +63,36 @@ GammaTransferParams tint_symbol_5(uint4 buffer[13], uint offset) { const uint scalar_offset_8 = ((offset + 20u)) / 4; const uint scalar_offset_9 = ((offset + 24u)) / 4; const uint scalar_offset_10 = ((offset + 28u)) / 4; - const GammaTransferParams tint_symbol_11 = {asfloat(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(buffer[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(buffer[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(buffer[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(buffer[scalar_offset_9 / 4][scalar_offset_9 % 4]), buffer[scalar_offset_10 / 4][scalar_offset_10 % 4]}; - return tint_symbol_11; + const GammaTransferParams tint_symbol_1 = {asfloat(ext_tex_params[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(ext_tex_params[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(ext_tex_params[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(ext_tex_params[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(ext_tex_params[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(ext_tex_params[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(ext_tex_params[scalar_offset_9 / 4][scalar_offset_9 % 4]), ext_tex_params[scalar_offset_10 / 4][scalar_offset_10 % 4]}; + return tint_symbol_1; } -float3x3 tint_symbol_7(uint4 buffer[13], uint offset) { +float3x3 ext_tex_params_load_6(uint offset) { const uint scalar_offset_11 = ((offset + 0u)) / 4; const uint scalar_offset_12 = ((offset + 16u)) / 4; const uint scalar_offset_13 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset_11 / 4].xyz), asfloat(buffer[scalar_offset_12 / 4].xyz), asfloat(buffer[scalar_offset_13 / 4].xyz)); + return float3x3(asfloat(ext_tex_params[scalar_offset_11 / 4].xyz), asfloat(ext_tex_params[scalar_offset_12 / 4].xyz), asfloat(ext_tex_params[scalar_offset_13 / 4].xyz)); } -float3x2 tint_symbol_9(uint4 buffer[13], uint offset) { +float3x2 ext_tex_params_load_8(uint offset) { const uint scalar_offset_14 = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset_14 / 4]; + uint4 ubo_load = ext_tex_params[scalar_offset_14 / 4]; const uint scalar_offset_15 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_15 / 4]; + uint4 ubo_load_1 = ext_tex_params[scalar_offset_15 / 4]; const uint scalar_offset_16 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_16 / 4]; + uint4 ubo_load_2 = ext_tex_params[scalar_offset_16 / 4]; return float3x2(asfloat(((scalar_offset_14 & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_15 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_16 & 2) ? ubo_load_2.zw : ubo_load_2.xy))); } -ExternalTextureParams tint_symbol_1(uint4 buffer[13], uint offset) { +ExternalTextureParams ext_tex_params_load(uint offset) { const uint scalar_offset_17 = ((offset + 0u)) / 4; const uint scalar_offset_18 = ((offset + 4u)) / 4; - const ExternalTextureParams tint_symbol_12 = {buffer[scalar_offset_17 / 4][scalar_offset_17 % 4], buffer[scalar_offset_18 / 4][scalar_offset_18 % 4], tint_symbol_3(buffer, (offset + 16u)), tint_symbol_5(buffer, (offset + 64u)), tint_symbol_5(buffer, (offset + 96u)), tint_symbol_7(buffer, (offset + 128u)), tint_symbol_9(buffer, (offset + 176u))}; - return tint_symbol_12; + const ExternalTextureParams tint_symbol_2 = {ext_tex_params[scalar_offset_17 / 4][scalar_offset_17 % 4], ext_tex_params[scalar_offset_18 / 4][scalar_offset_18 % 4], ext_tex_params_load_2((offset + 16u)), ext_tex_params_load_4((offset + 64u)), ext_tex_params_load_4((offset + 96u)), ext_tex_params_load_6((offset + 128u)), ext_tex_params_load_8((offset + 176u))}; + return tint_symbol_2; } void textureLoad_8acf41() { - float4 res = textureLoadExternal(arg_0, ext_tex_plane_1, (1).xx, tint_symbol_1(ext_tex_params, 0u)); + float4 res = textureLoadExternal(arg_0, ext_tex_plane_1, (1).xx, ext_tex_params_load(0u)); } struct tint_symbol { diff --git a/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.fxc.hlsl index c7f820632e..7356d4e70b 100644 --- a/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.fxc.hlsl +++ b/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl.expected.fxc.hlsl @@ -47,14 +47,14 @@ float4 textureLoadExternal(Texture2D plane0, Texture2D plane1, i return float4(color, 1.0f); } -float3x4 tint_symbol_3(uint4 buffer[13], uint offset) { +float3x4 ext_tex_params_load_2(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); + return float3x4(asfloat(ext_tex_params[scalar_offset / 4]), asfloat(ext_tex_params[scalar_offset_1 / 4]), asfloat(ext_tex_params[scalar_offset_2 / 4])); } -GammaTransferParams tint_symbol_5(uint4 buffer[13], uint offset) { +GammaTransferParams ext_tex_params_load_4(uint offset) { const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_4 = ((offset + 4u)) / 4; const uint scalar_offset_5 = ((offset + 8u)) / 4; @@ -63,36 +63,36 @@ GammaTransferParams tint_symbol_5(uint4 buffer[13], uint offset) { const uint scalar_offset_8 = ((offset + 20u)) / 4; const uint scalar_offset_9 = ((offset + 24u)) / 4; const uint scalar_offset_10 = ((offset + 28u)) / 4; - const GammaTransferParams tint_symbol_11 = {asfloat(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(buffer[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(buffer[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(buffer[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(buffer[scalar_offset_9 / 4][scalar_offset_9 % 4]), buffer[scalar_offset_10 / 4][scalar_offset_10 % 4]}; - return tint_symbol_11; + const GammaTransferParams tint_symbol_1 = {asfloat(ext_tex_params[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(ext_tex_params[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(ext_tex_params[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(ext_tex_params[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(ext_tex_params[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(ext_tex_params[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(ext_tex_params[scalar_offset_9 / 4][scalar_offset_9 % 4]), ext_tex_params[scalar_offset_10 / 4][scalar_offset_10 % 4]}; + return tint_symbol_1; } -float3x3 tint_symbol_7(uint4 buffer[13], uint offset) { +float3x3 ext_tex_params_load_6(uint offset) { const uint scalar_offset_11 = ((offset + 0u)) / 4; const uint scalar_offset_12 = ((offset + 16u)) / 4; const uint scalar_offset_13 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset_11 / 4].xyz), asfloat(buffer[scalar_offset_12 / 4].xyz), asfloat(buffer[scalar_offset_13 / 4].xyz)); + return float3x3(asfloat(ext_tex_params[scalar_offset_11 / 4].xyz), asfloat(ext_tex_params[scalar_offset_12 / 4].xyz), asfloat(ext_tex_params[scalar_offset_13 / 4].xyz)); } -float3x2 tint_symbol_9(uint4 buffer[13], uint offset) { +float3x2 ext_tex_params_load_8(uint offset) { const uint scalar_offset_14 = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset_14 / 4]; + uint4 ubo_load = ext_tex_params[scalar_offset_14 / 4]; const uint scalar_offset_15 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_15 / 4]; + uint4 ubo_load_1 = ext_tex_params[scalar_offset_15 / 4]; const uint scalar_offset_16 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_16 / 4]; + uint4 ubo_load_2 = ext_tex_params[scalar_offset_16 / 4]; return float3x2(asfloat(((scalar_offset_14 & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_15 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_16 & 2) ? ubo_load_2.zw : ubo_load_2.xy))); } -ExternalTextureParams tint_symbol_1(uint4 buffer[13], uint offset) { +ExternalTextureParams ext_tex_params_load(uint offset) { const uint scalar_offset_17 = ((offset + 0u)) / 4; const uint scalar_offset_18 = ((offset + 4u)) / 4; - const ExternalTextureParams tint_symbol_12 = {buffer[scalar_offset_17 / 4][scalar_offset_17 % 4], buffer[scalar_offset_18 / 4][scalar_offset_18 % 4], tint_symbol_3(buffer, (offset + 16u)), tint_symbol_5(buffer, (offset + 64u)), tint_symbol_5(buffer, (offset + 96u)), tint_symbol_7(buffer, (offset + 128u)), tint_symbol_9(buffer, (offset + 176u))}; - return tint_symbol_12; + const ExternalTextureParams tint_symbol_2 = {ext_tex_params[scalar_offset_17 / 4][scalar_offset_17 % 4], ext_tex_params[scalar_offset_18 / 4][scalar_offset_18 % 4], ext_tex_params_load_2((offset + 16u)), ext_tex_params_load_4((offset + 64u)), ext_tex_params_load_4((offset + 96u)), ext_tex_params_load_6((offset + 128u)), ext_tex_params_load_8((offset + 176u))}; + return tint_symbol_2; } void textureLoad_8acf41() { - float4 res = textureLoadExternal(arg_0, ext_tex_plane_1, (1).xx, tint_symbol_1(ext_tex_params, 0u)); + float4 res = textureLoadExternal(arg_0, ext_tex_plane_1, (1).xx, ext_tex_params_load(0u)); } struct tint_symbol { diff --git a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.dxc.hlsl index 6a15bfbcf1..66a62367f6 100644 --- a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.dxc.hlsl @@ -58,14 +58,14 @@ float4 textureSampleExternal(Texture2D plane0, Texture2D plane1, return float4(color, 1.0f); } -float3x4 tint_symbol_3(uint4 buffer[13], uint offset) { +float3x4 ext_tex_params_load_2(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); + return float3x4(asfloat(ext_tex_params[scalar_offset / 4]), asfloat(ext_tex_params[scalar_offset_1 / 4]), asfloat(ext_tex_params[scalar_offset_2 / 4])); } -GammaTransferParams tint_symbol_5(uint4 buffer[13], uint offset) { +GammaTransferParams ext_tex_params_load_4(uint offset) { const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_4 = ((offset + 4u)) / 4; const uint scalar_offset_5 = ((offset + 8u)) / 4; @@ -74,36 +74,36 @@ GammaTransferParams tint_symbol_5(uint4 buffer[13], uint offset) { const uint scalar_offset_8 = ((offset + 20u)) / 4; const uint scalar_offset_9 = ((offset + 24u)) / 4; const uint scalar_offset_10 = ((offset + 28u)) / 4; - const GammaTransferParams tint_symbol_11 = {asfloat(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(buffer[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(buffer[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(buffer[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(buffer[scalar_offset_9 / 4][scalar_offset_9 % 4]), buffer[scalar_offset_10 / 4][scalar_offset_10 % 4]}; - return tint_symbol_11; + const GammaTransferParams tint_symbol_1 = {asfloat(ext_tex_params[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(ext_tex_params[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(ext_tex_params[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(ext_tex_params[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(ext_tex_params[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(ext_tex_params[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(ext_tex_params[scalar_offset_9 / 4][scalar_offset_9 % 4]), ext_tex_params[scalar_offset_10 / 4][scalar_offset_10 % 4]}; + return tint_symbol_1; } -float3x3 tint_symbol_7(uint4 buffer[13], uint offset) { +float3x3 ext_tex_params_load_6(uint offset) { const uint scalar_offset_11 = ((offset + 0u)) / 4; const uint scalar_offset_12 = ((offset + 16u)) / 4; const uint scalar_offset_13 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset_11 / 4].xyz), asfloat(buffer[scalar_offset_12 / 4].xyz), asfloat(buffer[scalar_offset_13 / 4].xyz)); + return float3x3(asfloat(ext_tex_params[scalar_offset_11 / 4].xyz), asfloat(ext_tex_params[scalar_offset_12 / 4].xyz), asfloat(ext_tex_params[scalar_offset_13 / 4].xyz)); } -float3x2 tint_symbol_9(uint4 buffer[13], uint offset) { +float3x2 ext_tex_params_load_8(uint offset) { const uint scalar_offset_14 = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset_14 / 4]; + uint4 ubo_load = ext_tex_params[scalar_offset_14 / 4]; const uint scalar_offset_15 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_15 / 4]; + uint4 ubo_load_1 = ext_tex_params[scalar_offset_15 / 4]; const uint scalar_offset_16 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_16 / 4]; + uint4 ubo_load_2 = ext_tex_params[scalar_offset_16 / 4]; return float3x2(asfloat(((scalar_offset_14 & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_15 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_16 & 2) ? ubo_load_2.zw : ubo_load_2.xy))); } -ExternalTextureParams tint_symbol_1(uint4 buffer[13], uint offset) { +ExternalTextureParams ext_tex_params_load(uint offset) { const uint scalar_offset_17 = ((offset + 0u)) / 4; const uint scalar_offset_18 = ((offset + 4u)) / 4; - const ExternalTextureParams tint_symbol_12 = {buffer[scalar_offset_17 / 4][scalar_offset_17 % 4], buffer[scalar_offset_18 / 4][scalar_offset_18 % 4], tint_symbol_3(buffer, (offset + 16u)), tint_symbol_5(buffer, (offset + 64u)), tint_symbol_5(buffer, (offset + 96u)), tint_symbol_7(buffer, (offset + 128u)), tint_symbol_9(buffer, (offset + 176u))}; - return tint_symbol_12; + const ExternalTextureParams tint_symbol_2 = {ext_tex_params[scalar_offset_17 / 4][scalar_offset_17 % 4], ext_tex_params[scalar_offset_18 / 4][scalar_offset_18 % 4], ext_tex_params_load_2((offset + 16u)), ext_tex_params_load_4((offset + 64u)), ext_tex_params_load_4((offset + 96u)), ext_tex_params_load_6((offset + 128u)), ext_tex_params_load_8((offset + 176u))}; + return tint_symbol_2; } void textureSampleBaseClampToEdge_7c04e6() { - float4 res = textureSampleExternal(arg_0, ext_tex_plane_1, arg_1, (1.0f).xx, tint_symbol_1(ext_tex_params, 0u)); + float4 res = textureSampleExternal(arg_0, ext_tex_plane_1, arg_1, (1.0f).xx, ext_tex_params_load(0u)); } struct tint_symbol { diff --git a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.fxc.hlsl index 6a15bfbcf1..66a62367f6 100644 --- a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.fxc.hlsl +++ b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.fxc.hlsl @@ -58,14 +58,14 @@ float4 textureSampleExternal(Texture2D plane0, Texture2D plane1, return float4(color, 1.0f); } -float3x4 tint_symbol_3(uint4 buffer[13], uint offset) { +float3x4 ext_tex_params_load_2(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); + return float3x4(asfloat(ext_tex_params[scalar_offset / 4]), asfloat(ext_tex_params[scalar_offset_1 / 4]), asfloat(ext_tex_params[scalar_offset_2 / 4])); } -GammaTransferParams tint_symbol_5(uint4 buffer[13], uint offset) { +GammaTransferParams ext_tex_params_load_4(uint offset) { const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_4 = ((offset + 4u)) / 4; const uint scalar_offset_5 = ((offset + 8u)) / 4; @@ -74,36 +74,36 @@ GammaTransferParams tint_symbol_5(uint4 buffer[13], uint offset) { const uint scalar_offset_8 = ((offset + 20u)) / 4; const uint scalar_offset_9 = ((offset + 24u)) / 4; const uint scalar_offset_10 = ((offset + 28u)) / 4; - const GammaTransferParams tint_symbol_11 = {asfloat(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(buffer[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(buffer[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(buffer[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(buffer[scalar_offset_9 / 4][scalar_offset_9 % 4]), buffer[scalar_offset_10 / 4][scalar_offset_10 % 4]}; - return tint_symbol_11; + const GammaTransferParams tint_symbol_1 = {asfloat(ext_tex_params[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(ext_tex_params[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(ext_tex_params[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(ext_tex_params[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(ext_tex_params[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(ext_tex_params[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(ext_tex_params[scalar_offset_9 / 4][scalar_offset_9 % 4]), ext_tex_params[scalar_offset_10 / 4][scalar_offset_10 % 4]}; + return tint_symbol_1; } -float3x3 tint_symbol_7(uint4 buffer[13], uint offset) { +float3x3 ext_tex_params_load_6(uint offset) { const uint scalar_offset_11 = ((offset + 0u)) / 4; const uint scalar_offset_12 = ((offset + 16u)) / 4; const uint scalar_offset_13 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset_11 / 4].xyz), asfloat(buffer[scalar_offset_12 / 4].xyz), asfloat(buffer[scalar_offset_13 / 4].xyz)); + return float3x3(asfloat(ext_tex_params[scalar_offset_11 / 4].xyz), asfloat(ext_tex_params[scalar_offset_12 / 4].xyz), asfloat(ext_tex_params[scalar_offset_13 / 4].xyz)); } -float3x2 tint_symbol_9(uint4 buffer[13], uint offset) { +float3x2 ext_tex_params_load_8(uint offset) { const uint scalar_offset_14 = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset_14 / 4]; + uint4 ubo_load = ext_tex_params[scalar_offset_14 / 4]; const uint scalar_offset_15 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_15 / 4]; + uint4 ubo_load_1 = ext_tex_params[scalar_offset_15 / 4]; const uint scalar_offset_16 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_16 / 4]; + uint4 ubo_load_2 = ext_tex_params[scalar_offset_16 / 4]; return float3x2(asfloat(((scalar_offset_14 & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_15 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_16 & 2) ? ubo_load_2.zw : ubo_load_2.xy))); } -ExternalTextureParams tint_symbol_1(uint4 buffer[13], uint offset) { +ExternalTextureParams ext_tex_params_load(uint offset) { const uint scalar_offset_17 = ((offset + 0u)) / 4; const uint scalar_offset_18 = ((offset + 4u)) / 4; - const ExternalTextureParams tint_symbol_12 = {buffer[scalar_offset_17 / 4][scalar_offset_17 % 4], buffer[scalar_offset_18 / 4][scalar_offset_18 % 4], tint_symbol_3(buffer, (offset + 16u)), tint_symbol_5(buffer, (offset + 64u)), tint_symbol_5(buffer, (offset + 96u)), tint_symbol_7(buffer, (offset + 128u)), tint_symbol_9(buffer, (offset + 176u))}; - return tint_symbol_12; + const ExternalTextureParams tint_symbol_2 = {ext_tex_params[scalar_offset_17 / 4][scalar_offset_17 % 4], ext_tex_params[scalar_offset_18 / 4][scalar_offset_18 % 4], ext_tex_params_load_2((offset + 16u)), ext_tex_params_load_4((offset + 64u)), ext_tex_params_load_4((offset + 96u)), ext_tex_params_load_6((offset + 128u)), ext_tex_params_load_8((offset + 176u))}; + return tint_symbol_2; } void textureSampleBaseClampToEdge_7c04e6() { - float4 res = textureSampleExternal(arg_0, ext_tex_plane_1, arg_1, (1.0f).xx, tint_symbol_1(ext_tex_params, 0u)); + float4 res = textureSampleExternal(arg_0, ext_tex_plane_1, arg_1, (1.0f).xx, ext_tex_params_load(0u)); } struct tint_symbol { diff --git a/test/tint/builtins/gen/var/atomicAdd/8a199a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atomicAdd/8a199a.wgsl.expected.dxc.hlsl index 1bf7c3ef82..d42be7130e 100644 --- a/test/tint/builtins/gen/var/atomicAdd/8a199a.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/gen/var/atomicAdd/8a199a.wgsl.expected.dxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicAdd(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicAdd(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedAdd(offset, value, original_value); + sb_rw.InterlockedAdd(offset, value, original_value); return original_value; } void atomicAdd_8a199a() { uint arg_1 = 1u; - uint res = tint_atomicAdd(sb_rw, 0u, arg_1); + uint res = sb_rwatomicAdd(0u, arg_1); } void fragment_main() { diff --git a/test/tint/builtins/gen/var/atomicAdd/8a199a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atomicAdd/8a199a.wgsl.expected.fxc.hlsl index 1bf7c3ef82..d42be7130e 100644 --- a/test/tint/builtins/gen/var/atomicAdd/8a199a.wgsl.expected.fxc.hlsl +++ b/test/tint/builtins/gen/var/atomicAdd/8a199a.wgsl.expected.fxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicAdd(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicAdd(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedAdd(offset, value, original_value); + sb_rw.InterlockedAdd(offset, value, original_value); return original_value; } void atomicAdd_8a199a() { uint arg_1 = 1u; - uint res = tint_atomicAdd(sb_rw, 0u, arg_1); + uint res = sb_rwatomicAdd(0u, arg_1); } void fragment_main() { diff --git a/test/tint/builtins/gen/var/atomicAdd/d32fe4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atomicAdd/d32fe4.wgsl.expected.dxc.hlsl index 213221ba82..dd5ded7420 100644 --- a/test/tint/builtins/gen/var/atomicAdd/d32fe4.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/gen/var/atomicAdd/d32fe4.wgsl.expected.dxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicAdd(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicAdd(uint offset, int value) { int original_value = 0; - buffer.InterlockedAdd(offset, value, original_value); + sb_rw.InterlockedAdd(offset, value, original_value); return original_value; } void atomicAdd_d32fe4() { int arg_1 = 1; - int res = tint_atomicAdd(sb_rw, 0u, arg_1); + int res = sb_rwatomicAdd(0u, arg_1); } void fragment_main() { diff --git a/test/tint/builtins/gen/var/atomicAdd/d32fe4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atomicAdd/d32fe4.wgsl.expected.fxc.hlsl index 213221ba82..dd5ded7420 100644 --- a/test/tint/builtins/gen/var/atomicAdd/d32fe4.wgsl.expected.fxc.hlsl +++ b/test/tint/builtins/gen/var/atomicAdd/d32fe4.wgsl.expected.fxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicAdd(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicAdd(uint offset, int value) { int original_value = 0; - buffer.InterlockedAdd(offset, value, original_value); + sb_rw.InterlockedAdd(offset, value, original_value); return original_value; } void atomicAdd_d32fe4() { int arg_1 = 1; - int res = tint_atomicAdd(sb_rw, 0u, arg_1); + int res = sb_rwatomicAdd(0u, arg_1); } void fragment_main() { diff --git a/test/tint/builtins/gen/var/atomicAnd/152966.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atomicAnd/152966.wgsl.expected.dxc.hlsl index 4562edbdc2..b7847a3c21 100644 --- a/test/tint/builtins/gen/var/atomicAnd/152966.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/gen/var/atomicAnd/152966.wgsl.expected.dxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicAnd(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicAnd(uint offset, int value) { int original_value = 0; - buffer.InterlockedAnd(offset, value, original_value); + sb_rw.InterlockedAnd(offset, value, original_value); return original_value; } void atomicAnd_152966() { int arg_1 = 1; - int res = tint_atomicAnd(sb_rw, 0u, arg_1); + int res = sb_rwatomicAnd(0u, arg_1); } void fragment_main() { diff --git a/test/tint/builtins/gen/var/atomicAnd/152966.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atomicAnd/152966.wgsl.expected.fxc.hlsl index 4562edbdc2..b7847a3c21 100644 --- a/test/tint/builtins/gen/var/atomicAnd/152966.wgsl.expected.fxc.hlsl +++ b/test/tint/builtins/gen/var/atomicAnd/152966.wgsl.expected.fxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicAnd(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicAnd(uint offset, int value) { int original_value = 0; - buffer.InterlockedAnd(offset, value, original_value); + sb_rw.InterlockedAnd(offset, value, original_value); return original_value; } void atomicAnd_152966() { int arg_1 = 1; - int res = tint_atomicAnd(sb_rw, 0u, arg_1); + int res = sb_rwatomicAnd(0u, arg_1); } void fragment_main() { diff --git a/test/tint/builtins/gen/var/atomicAnd/85a8d9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atomicAnd/85a8d9.wgsl.expected.dxc.hlsl index f2099cfe1a..cab948c0fb 100644 --- a/test/tint/builtins/gen/var/atomicAnd/85a8d9.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/gen/var/atomicAnd/85a8d9.wgsl.expected.dxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicAnd(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicAnd(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedAnd(offset, value, original_value); + sb_rw.InterlockedAnd(offset, value, original_value); return original_value; } void atomicAnd_85a8d9() { uint arg_1 = 1u; - uint res = tint_atomicAnd(sb_rw, 0u, arg_1); + uint res = sb_rwatomicAnd(0u, arg_1); } void fragment_main() { diff --git a/test/tint/builtins/gen/var/atomicAnd/85a8d9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atomicAnd/85a8d9.wgsl.expected.fxc.hlsl index f2099cfe1a..cab948c0fb 100644 --- a/test/tint/builtins/gen/var/atomicAnd/85a8d9.wgsl.expected.fxc.hlsl +++ b/test/tint/builtins/gen/var/atomicAnd/85a8d9.wgsl.expected.fxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicAnd(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicAnd(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedAnd(offset, value, original_value); + sb_rw.InterlockedAnd(offset, value, original_value); return original_value; } void atomicAnd_85a8d9() { uint arg_1 = 1u; - uint res = tint_atomicAnd(sb_rw, 0u, arg_1); + uint res = sb_rwatomicAnd(0u, arg_1); } void fragment_main() { diff --git a/test/tint/builtins/gen/var/atomicCompareExchangeWeak/1bd40a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atomicCompareExchangeWeak/1bd40a.wgsl.expected.dxc.hlsl index 53a01c6f54..7261e5b2ac 100644 --- a/test/tint/builtins/gen/var/atomicCompareExchangeWeak/1bd40a.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/gen/var/atomicCompareExchangeWeak/1bd40a.wgsl.expected.dxc.hlsl @@ -5,9 +5,9 @@ struct atomic_compare_exchange_weak_ret_type { bool exchanged; }; -atomic_compare_exchange_weak_ret_type tint_atomicCompareExchangeWeak(RWByteAddressBuffer buffer, uint offset, int compare, int value) { +atomic_compare_exchange_weak_ret_type sb_rwatomicCompareExchangeWeak(uint offset, int compare, int value) { atomic_compare_exchange_weak_ret_type result=(atomic_compare_exchange_weak_ret_type)0; - buffer.InterlockedCompareExchange(offset, compare, value, result.old_value); + sb_rw.InterlockedCompareExchange(offset, compare, value, result.old_value); result.exchanged = result.old_value == compare; return result; } @@ -16,7 +16,7 @@ atomic_compare_exchange_weak_ret_type tint_atomicCompareExchangeWeak(RWByteAddre void atomicCompareExchangeWeak_1bd40a() { int arg_1 = 1; int arg_2 = 1; - atomic_compare_exchange_weak_ret_type res = tint_atomicCompareExchangeWeak(sb_rw, 0u, arg_1, arg_2); + atomic_compare_exchange_weak_ret_type res = sb_rwatomicCompareExchangeWeak(0u, arg_1, arg_2); } void fragment_main() { diff --git a/test/tint/builtins/gen/var/atomicCompareExchangeWeak/1bd40a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atomicCompareExchangeWeak/1bd40a.wgsl.expected.fxc.hlsl index 53a01c6f54..7261e5b2ac 100644 --- a/test/tint/builtins/gen/var/atomicCompareExchangeWeak/1bd40a.wgsl.expected.fxc.hlsl +++ b/test/tint/builtins/gen/var/atomicCompareExchangeWeak/1bd40a.wgsl.expected.fxc.hlsl @@ -5,9 +5,9 @@ struct atomic_compare_exchange_weak_ret_type { bool exchanged; }; -atomic_compare_exchange_weak_ret_type tint_atomicCompareExchangeWeak(RWByteAddressBuffer buffer, uint offset, int compare, int value) { +atomic_compare_exchange_weak_ret_type sb_rwatomicCompareExchangeWeak(uint offset, int compare, int value) { atomic_compare_exchange_weak_ret_type result=(atomic_compare_exchange_weak_ret_type)0; - buffer.InterlockedCompareExchange(offset, compare, value, result.old_value); + sb_rw.InterlockedCompareExchange(offset, compare, value, result.old_value); result.exchanged = result.old_value == compare; return result; } @@ -16,7 +16,7 @@ atomic_compare_exchange_weak_ret_type tint_atomicCompareExchangeWeak(RWByteAddre void atomicCompareExchangeWeak_1bd40a() { int arg_1 = 1; int arg_2 = 1; - atomic_compare_exchange_weak_ret_type res = tint_atomicCompareExchangeWeak(sb_rw, 0u, arg_1, arg_2); + atomic_compare_exchange_weak_ret_type res = sb_rwatomicCompareExchangeWeak(0u, arg_1, arg_2); } void fragment_main() { diff --git a/test/tint/builtins/gen/var/atomicCompareExchangeWeak/63d8e6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atomicCompareExchangeWeak/63d8e6.wgsl.expected.dxc.hlsl index 3c22dc7ece..82836fce16 100644 --- a/test/tint/builtins/gen/var/atomicCompareExchangeWeak/63d8e6.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/gen/var/atomicCompareExchangeWeak/63d8e6.wgsl.expected.dxc.hlsl @@ -5,9 +5,9 @@ struct atomic_compare_exchange_weak_ret_type { bool exchanged; }; -atomic_compare_exchange_weak_ret_type tint_atomicCompareExchangeWeak(RWByteAddressBuffer buffer, uint offset, uint compare, uint value) { +atomic_compare_exchange_weak_ret_type sb_rwatomicCompareExchangeWeak(uint offset, uint compare, uint value) { atomic_compare_exchange_weak_ret_type result=(atomic_compare_exchange_weak_ret_type)0; - buffer.InterlockedCompareExchange(offset, compare, value, result.old_value); + sb_rw.InterlockedCompareExchange(offset, compare, value, result.old_value); result.exchanged = result.old_value == compare; return result; } @@ -16,7 +16,7 @@ atomic_compare_exchange_weak_ret_type tint_atomicCompareExchangeWeak(RWByteAddre void atomicCompareExchangeWeak_63d8e6() { uint arg_1 = 1u; uint arg_2 = 1u; - atomic_compare_exchange_weak_ret_type res = tint_atomicCompareExchangeWeak(sb_rw, 0u, arg_1, arg_2); + atomic_compare_exchange_weak_ret_type res = sb_rwatomicCompareExchangeWeak(0u, arg_1, arg_2); } void fragment_main() { diff --git a/test/tint/builtins/gen/var/atomicCompareExchangeWeak/63d8e6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atomicCompareExchangeWeak/63d8e6.wgsl.expected.fxc.hlsl index 3c22dc7ece..82836fce16 100644 --- a/test/tint/builtins/gen/var/atomicCompareExchangeWeak/63d8e6.wgsl.expected.fxc.hlsl +++ b/test/tint/builtins/gen/var/atomicCompareExchangeWeak/63d8e6.wgsl.expected.fxc.hlsl @@ -5,9 +5,9 @@ struct atomic_compare_exchange_weak_ret_type { bool exchanged; }; -atomic_compare_exchange_weak_ret_type tint_atomicCompareExchangeWeak(RWByteAddressBuffer buffer, uint offset, uint compare, uint value) { +atomic_compare_exchange_weak_ret_type sb_rwatomicCompareExchangeWeak(uint offset, uint compare, uint value) { atomic_compare_exchange_weak_ret_type result=(atomic_compare_exchange_weak_ret_type)0; - buffer.InterlockedCompareExchange(offset, compare, value, result.old_value); + sb_rw.InterlockedCompareExchange(offset, compare, value, result.old_value); result.exchanged = result.old_value == compare; return result; } @@ -16,7 +16,7 @@ atomic_compare_exchange_weak_ret_type tint_atomicCompareExchangeWeak(RWByteAddre void atomicCompareExchangeWeak_63d8e6() { uint arg_1 = 1u; uint arg_2 = 1u; - atomic_compare_exchange_weak_ret_type res = tint_atomicCompareExchangeWeak(sb_rw, 0u, arg_1, arg_2); + atomic_compare_exchange_weak_ret_type res = sb_rwatomicCompareExchangeWeak(0u, arg_1, arg_2); } void fragment_main() { diff --git a/test/tint/builtins/gen/var/atomicExchange/d59712.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atomicExchange/d59712.wgsl.expected.dxc.hlsl index cec9984aab..d31825d577 100644 --- a/test/tint/builtins/gen/var/atomicExchange/d59712.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/gen/var/atomicExchange/d59712.wgsl.expected.dxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicExchange(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicExchange(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedExchange(offset, value, original_value); + sb_rw.InterlockedExchange(offset, value, original_value); return original_value; } void atomicExchange_d59712() { uint arg_1 = 1u; - uint res = tint_atomicExchange(sb_rw, 0u, arg_1); + uint res = sb_rwatomicExchange(0u, arg_1); } void fragment_main() { diff --git a/test/tint/builtins/gen/var/atomicExchange/d59712.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atomicExchange/d59712.wgsl.expected.fxc.hlsl index cec9984aab..d31825d577 100644 --- a/test/tint/builtins/gen/var/atomicExchange/d59712.wgsl.expected.fxc.hlsl +++ b/test/tint/builtins/gen/var/atomicExchange/d59712.wgsl.expected.fxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicExchange(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicExchange(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedExchange(offset, value, original_value); + sb_rw.InterlockedExchange(offset, value, original_value); return original_value; } void atomicExchange_d59712() { uint arg_1 = 1u; - uint res = tint_atomicExchange(sb_rw, 0u, arg_1); + uint res = sb_rwatomicExchange(0u, arg_1); } void fragment_main() { diff --git a/test/tint/builtins/gen/var/atomicExchange/f2e22f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atomicExchange/f2e22f.wgsl.expected.dxc.hlsl index 8c0fe233c1..d934c72780 100644 --- a/test/tint/builtins/gen/var/atomicExchange/f2e22f.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/gen/var/atomicExchange/f2e22f.wgsl.expected.dxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicExchange(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicExchange(uint offset, int value) { int original_value = 0; - buffer.InterlockedExchange(offset, value, original_value); + sb_rw.InterlockedExchange(offset, value, original_value); return original_value; } void atomicExchange_f2e22f() { int arg_1 = 1; - int res = tint_atomicExchange(sb_rw, 0u, arg_1); + int res = sb_rwatomicExchange(0u, arg_1); } void fragment_main() { diff --git a/test/tint/builtins/gen/var/atomicExchange/f2e22f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atomicExchange/f2e22f.wgsl.expected.fxc.hlsl index 8c0fe233c1..d934c72780 100644 --- a/test/tint/builtins/gen/var/atomicExchange/f2e22f.wgsl.expected.fxc.hlsl +++ b/test/tint/builtins/gen/var/atomicExchange/f2e22f.wgsl.expected.fxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicExchange(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicExchange(uint offset, int value) { int original_value = 0; - buffer.InterlockedExchange(offset, value, original_value); + sb_rw.InterlockedExchange(offset, value, original_value); return original_value; } void atomicExchange_f2e22f() { int arg_1 = 1; - int res = tint_atomicExchange(sb_rw, 0u, arg_1); + int res = sb_rwatomicExchange(0u, arg_1); } void fragment_main() { diff --git a/test/tint/builtins/gen/var/atomicLoad/0806ad.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atomicLoad/0806ad.wgsl.expected.dxc.hlsl index a278b2c16c..413dcf086a 100644 --- a/test/tint/builtins/gen/var/atomicLoad/0806ad.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/gen/var/atomicLoad/0806ad.wgsl.expected.dxc.hlsl @@ -1,14 +1,14 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicLoad(RWByteAddressBuffer buffer, uint offset) { +int sb_rwatomicLoad(uint offset) { int value = 0; - buffer.InterlockedOr(offset, 0, value); + sb_rw.InterlockedOr(offset, 0, value); return value; } void atomicLoad_0806ad() { - int res = tint_atomicLoad(sb_rw, 0u); + int res = sb_rwatomicLoad(0u); } void fragment_main() { diff --git a/test/tint/builtins/gen/var/atomicLoad/0806ad.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atomicLoad/0806ad.wgsl.expected.fxc.hlsl index a278b2c16c..413dcf086a 100644 --- a/test/tint/builtins/gen/var/atomicLoad/0806ad.wgsl.expected.fxc.hlsl +++ b/test/tint/builtins/gen/var/atomicLoad/0806ad.wgsl.expected.fxc.hlsl @@ -1,14 +1,14 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicLoad(RWByteAddressBuffer buffer, uint offset) { +int sb_rwatomicLoad(uint offset) { int value = 0; - buffer.InterlockedOr(offset, 0, value); + sb_rw.InterlockedOr(offset, 0, value); return value; } void atomicLoad_0806ad() { - int res = tint_atomicLoad(sb_rw, 0u); + int res = sb_rwatomicLoad(0u); } void fragment_main() { diff --git a/test/tint/builtins/gen/var/atomicLoad/fe6cc3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atomicLoad/fe6cc3.wgsl.expected.dxc.hlsl index 77edab3db2..d8fda750bf 100644 --- a/test/tint/builtins/gen/var/atomicLoad/fe6cc3.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/gen/var/atomicLoad/fe6cc3.wgsl.expected.dxc.hlsl @@ -1,14 +1,14 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicLoad(RWByteAddressBuffer buffer, uint offset) { +uint sb_rwatomicLoad(uint offset) { uint value = 0; - buffer.InterlockedOr(offset, 0, value); + sb_rw.InterlockedOr(offset, 0, value); return value; } void atomicLoad_fe6cc3() { - uint res = tint_atomicLoad(sb_rw, 0u); + uint res = sb_rwatomicLoad(0u); } void fragment_main() { diff --git a/test/tint/builtins/gen/var/atomicLoad/fe6cc3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atomicLoad/fe6cc3.wgsl.expected.fxc.hlsl index 77edab3db2..d8fda750bf 100644 --- a/test/tint/builtins/gen/var/atomicLoad/fe6cc3.wgsl.expected.fxc.hlsl +++ b/test/tint/builtins/gen/var/atomicLoad/fe6cc3.wgsl.expected.fxc.hlsl @@ -1,14 +1,14 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicLoad(RWByteAddressBuffer buffer, uint offset) { +uint sb_rwatomicLoad(uint offset) { uint value = 0; - buffer.InterlockedOr(offset, 0, value); + sb_rw.InterlockedOr(offset, 0, value); return value; } void atomicLoad_fe6cc3() { - uint res = tint_atomicLoad(sb_rw, 0u); + uint res = sb_rwatomicLoad(0u); } void fragment_main() { diff --git a/test/tint/builtins/gen/var/atomicMax/51b9be.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atomicMax/51b9be.wgsl.expected.dxc.hlsl index 174521d4e0..4b961bfbf4 100644 --- a/test/tint/builtins/gen/var/atomicMax/51b9be.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/gen/var/atomicMax/51b9be.wgsl.expected.dxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicMax(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicMax(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedMax(offset, value, original_value); + sb_rw.InterlockedMax(offset, value, original_value); return original_value; } void atomicMax_51b9be() { uint arg_1 = 1u; - uint res = tint_atomicMax(sb_rw, 0u, arg_1); + uint res = sb_rwatomicMax(0u, arg_1); } void fragment_main() { diff --git a/test/tint/builtins/gen/var/atomicMax/51b9be.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atomicMax/51b9be.wgsl.expected.fxc.hlsl index 174521d4e0..4b961bfbf4 100644 --- a/test/tint/builtins/gen/var/atomicMax/51b9be.wgsl.expected.fxc.hlsl +++ b/test/tint/builtins/gen/var/atomicMax/51b9be.wgsl.expected.fxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicMax(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicMax(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedMax(offset, value, original_value); + sb_rw.InterlockedMax(offset, value, original_value); return original_value; } void atomicMax_51b9be() { uint arg_1 = 1u; - uint res = tint_atomicMax(sb_rw, 0u, arg_1); + uint res = sb_rwatomicMax(0u, arg_1); } void fragment_main() { diff --git a/test/tint/builtins/gen/var/atomicMax/92aa72.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atomicMax/92aa72.wgsl.expected.dxc.hlsl index a649f98afb..5284265936 100644 --- a/test/tint/builtins/gen/var/atomicMax/92aa72.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/gen/var/atomicMax/92aa72.wgsl.expected.dxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicMax(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicMax(uint offset, int value) { int original_value = 0; - buffer.InterlockedMax(offset, value, original_value); + sb_rw.InterlockedMax(offset, value, original_value); return original_value; } void atomicMax_92aa72() { int arg_1 = 1; - int res = tint_atomicMax(sb_rw, 0u, arg_1); + int res = sb_rwatomicMax(0u, arg_1); } void fragment_main() { diff --git a/test/tint/builtins/gen/var/atomicMax/92aa72.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atomicMax/92aa72.wgsl.expected.fxc.hlsl index a649f98afb..5284265936 100644 --- a/test/tint/builtins/gen/var/atomicMax/92aa72.wgsl.expected.fxc.hlsl +++ b/test/tint/builtins/gen/var/atomicMax/92aa72.wgsl.expected.fxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicMax(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicMax(uint offset, int value) { int original_value = 0; - buffer.InterlockedMax(offset, value, original_value); + sb_rw.InterlockedMax(offset, value, original_value); return original_value; } void atomicMax_92aa72() { int arg_1 = 1; - int res = tint_atomicMax(sb_rw, 0u, arg_1); + int res = sb_rwatomicMax(0u, arg_1); } void fragment_main() { diff --git a/test/tint/builtins/gen/var/atomicMin/8e38dc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atomicMin/8e38dc.wgsl.expected.dxc.hlsl index ff4793b2c5..daf622dcca 100644 --- a/test/tint/builtins/gen/var/atomicMin/8e38dc.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/gen/var/atomicMin/8e38dc.wgsl.expected.dxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicMin(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicMin(uint offset, int value) { int original_value = 0; - buffer.InterlockedMin(offset, value, original_value); + sb_rw.InterlockedMin(offset, value, original_value); return original_value; } void atomicMin_8e38dc() { int arg_1 = 1; - int res = tint_atomicMin(sb_rw, 0u, arg_1); + int res = sb_rwatomicMin(0u, arg_1); } void fragment_main() { diff --git a/test/tint/builtins/gen/var/atomicMin/8e38dc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atomicMin/8e38dc.wgsl.expected.fxc.hlsl index ff4793b2c5..daf622dcca 100644 --- a/test/tint/builtins/gen/var/atomicMin/8e38dc.wgsl.expected.fxc.hlsl +++ b/test/tint/builtins/gen/var/atomicMin/8e38dc.wgsl.expected.fxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicMin(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicMin(uint offset, int value) { int original_value = 0; - buffer.InterlockedMin(offset, value, original_value); + sb_rw.InterlockedMin(offset, value, original_value); return original_value; } void atomicMin_8e38dc() { int arg_1 = 1; - int res = tint_atomicMin(sb_rw, 0u, arg_1); + int res = sb_rwatomicMin(0u, arg_1); } void fragment_main() { diff --git a/test/tint/builtins/gen/var/atomicMin/c67a74.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atomicMin/c67a74.wgsl.expected.dxc.hlsl index ae974e3f7a..f5ba0d9461 100644 --- a/test/tint/builtins/gen/var/atomicMin/c67a74.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/gen/var/atomicMin/c67a74.wgsl.expected.dxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicMin(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicMin(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedMin(offset, value, original_value); + sb_rw.InterlockedMin(offset, value, original_value); return original_value; } void atomicMin_c67a74() { uint arg_1 = 1u; - uint res = tint_atomicMin(sb_rw, 0u, arg_1); + uint res = sb_rwatomicMin(0u, arg_1); } void fragment_main() { diff --git a/test/tint/builtins/gen/var/atomicMin/c67a74.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atomicMin/c67a74.wgsl.expected.fxc.hlsl index ae974e3f7a..f5ba0d9461 100644 --- a/test/tint/builtins/gen/var/atomicMin/c67a74.wgsl.expected.fxc.hlsl +++ b/test/tint/builtins/gen/var/atomicMin/c67a74.wgsl.expected.fxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicMin(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicMin(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedMin(offset, value, original_value); + sb_rw.InterlockedMin(offset, value, original_value); return original_value; } void atomicMin_c67a74() { uint arg_1 = 1u; - uint res = tint_atomicMin(sb_rw, 0u, arg_1); + uint res = sb_rwatomicMin(0u, arg_1); } void fragment_main() { diff --git a/test/tint/builtins/gen/var/atomicOr/5e95d4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atomicOr/5e95d4.wgsl.expected.dxc.hlsl index 2df87d268b..5945dea7c3 100644 --- a/test/tint/builtins/gen/var/atomicOr/5e95d4.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/gen/var/atomicOr/5e95d4.wgsl.expected.dxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicOr(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicOr(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedOr(offset, value, original_value); + sb_rw.InterlockedOr(offset, value, original_value); return original_value; } void atomicOr_5e95d4() { uint arg_1 = 1u; - uint res = tint_atomicOr(sb_rw, 0u, arg_1); + uint res = sb_rwatomicOr(0u, arg_1); } void fragment_main() { diff --git a/test/tint/builtins/gen/var/atomicOr/5e95d4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atomicOr/5e95d4.wgsl.expected.fxc.hlsl index 2df87d268b..5945dea7c3 100644 --- a/test/tint/builtins/gen/var/atomicOr/5e95d4.wgsl.expected.fxc.hlsl +++ b/test/tint/builtins/gen/var/atomicOr/5e95d4.wgsl.expected.fxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicOr(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicOr(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedOr(offset, value, original_value); + sb_rw.InterlockedOr(offset, value, original_value); return original_value; } void atomicOr_5e95d4() { uint arg_1 = 1u; - uint res = tint_atomicOr(sb_rw, 0u, arg_1); + uint res = sb_rwatomicOr(0u, arg_1); } void fragment_main() { diff --git a/test/tint/builtins/gen/var/atomicOr/8d96a0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atomicOr/8d96a0.wgsl.expected.dxc.hlsl index b3d4bb9f5d..9e1b10cc89 100644 --- a/test/tint/builtins/gen/var/atomicOr/8d96a0.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/gen/var/atomicOr/8d96a0.wgsl.expected.dxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicOr(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicOr(uint offset, int value) { int original_value = 0; - buffer.InterlockedOr(offset, value, original_value); + sb_rw.InterlockedOr(offset, value, original_value); return original_value; } void atomicOr_8d96a0() { int arg_1 = 1; - int res = tint_atomicOr(sb_rw, 0u, arg_1); + int res = sb_rwatomicOr(0u, arg_1); } void fragment_main() { diff --git a/test/tint/builtins/gen/var/atomicOr/8d96a0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atomicOr/8d96a0.wgsl.expected.fxc.hlsl index b3d4bb9f5d..9e1b10cc89 100644 --- a/test/tint/builtins/gen/var/atomicOr/8d96a0.wgsl.expected.fxc.hlsl +++ b/test/tint/builtins/gen/var/atomicOr/8d96a0.wgsl.expected.fxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicOr(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicOr(uint offset, int value) { int original_value = 0; - buffer.InterlockedOr(offset, value, original_value); + sb_rw.InterlockedOr(offset, value, original_value); return original_value; } void atomicOr_8d96a0() { int arg_1 = 1; - int res = tint_atomicOr(sb_rw, 0u, arg_1); + int res = sb_rwatomicOr(0u, arg_1); } void fragment_main() { diff --git a/test/tint/builtins/gen/var/atomicStore/cdc29e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atomicStore/cdc29e.wgsl.expected.dxc.hlsl index 253ad312c0..53d16c6208 100644 --- a/test/tint/builtins/gen/var/atomicStore/cdc29e.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/gen/var/atomicStore/cdc29e.wgsl.expected.dxc.hlsl @@ -1,14 +1,14 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -void tint_atomicStore(RWByteAddressBuffer buffer, uint offset, uint value) { +void sb_rwatomicStore(uint offset, uint value) { uint ignored; - buffer.InterlockedExchange(offset, value, ignored); + sb_rw.InterlockedExchange(offset, value, ignored); } void atomicStore_cdc29e() { uint arg_1 = 1u; - tint_atomicStore(sb_rw, 0u, arg_1); + sb_rwatomicStore(0u, arg_1); } void fragment_main() { diff --git a/test/tint/builtins/gen/var/atomicStore/cdc29e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atomicStore/cdc29e.wgsl.expected.fxc.hlsl index 253ad312c0..53d16c6208 100644 --- a/test/tint/builtins/gen/var/atomicStore/cdc29e.wgsl.expected.fxc.hlsl +++ b/test/tint/builtins/gen/var/atomicStore/cdc29e.wgsl.expected.fxc.hlsl @@ -1,14 +1,14 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -void tint_atomicStore(RWByteAddressBuffer buffer, uint offset, uint value) { +void sb_rwatomicStore(uint offset, uint value) { uint ignored; - buffer.InterlockedExchange(offset, value, ignored); + sb_rw.InterlockedExchange(offset, value, ignored); } void atomicStore_cdc29e() { uint arg_1 = 1u; - tint_atomicStore(sb_rw, 0u, arg_1); + sb_rwatomicStore(0u, arg_1); } void fragment_main() { diff --git a/test/tint/builtins/gen/var/atomicStore/d1e9a6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atomicStore/d1e9a6.wgsl.expected.dxc.hlsl index bb02128e2d..75b9e39feb 100644 --- a/test/tint/builtins/gen/var/atomicStore/d1e9a6.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/gen/var/atomicStore/d1e9a6.wgsl.expected.dxc.hlsl @@ -1,14 +1,14 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -void tint_atomicStore(RWByteAddressBuffer buffer, uint offset, int value) { +void sb_rwatomicStore(uint offset, int value) { int ignored; - buffer.InterlockedExchange(offset, value, ignored); + sb_rw.InterlockedExchange(offset, value, ignored); } void atomicStore_d1e9a6() { int arg_1 = 1; - tint_atomicStore(sb_rw, 0u, arg_1); + sb_rwatomicStore(0u, arg_1); } void fragment_main() { diff --git a/test/tint/builtins/gen/var/atomicStore/d1e9a6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atomicStore/d1e9a6.wgsl.expected.fxc.hlsl index bb02128e2d..75b9e39feb 100644 --- a/test/tint/builtins/gen/var/atomicStore/d1e9a6.wgsl.expected.fxc.hlsl +++ b/test/tint/builtins/gen/var/atomicStore/d1e9a6.wgsl.expected.fxc.hlsl @@ -1,14 +1,14 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -void tint_atomicStore(RWByteAddressBuffer buffer, uint offset, int value) { +void sb_rwatomicStore(uint offset, int value) { int ignored; - buffer.InterlockedExchange(offset, value, ignored); + sb_rw.InterlockedExchange(offset, value, ignored); } void atomicStore_d1e9a6() { int arg_1 = 1; - tint_atomicStore(sb_rw, 0u, arg_1); + sb_rwatomicStore(0u, arg_1); } void fragment_main() { diff --git a/test/tint/builtins/gen/var/atomicSub/051100.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atomicSub/051100.wgsl.expected.dxc.hlsl index eac50d325c..3e493400f1 100644 --- a/test/tint/builtins/gen/var/atomicSub/051100.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/gen/var/atomicSub/051100.wgsl.expected.dxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicSub(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicSub(uint offset, int value) { int original_value = 0; - buffer.InterlockedAdd(offset, -value, original_value); + sb_rw.InterlockedAdd(offset, -value, original_value); return original_value; } void atomicSub_051100() { int arg_1 = 1; - int res = tint_atomicSub(sb_rw, 0u, arg_1); + int res = sb_rwatomicSub(0u, arg_1); } void fragment_main() { diff --git a/test/tint/builtins/gen/var/atomicSub/051100.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atomicSub/051100.wgsl.expected.fxc.hlsl index eac50d325c..3e493400f1 100644 --- a/test/tint/builtins/gen/var/atomicSub/051100.wgsl.expected.fxc.hlsl +++ b/test/tint/builtins/gen/var/atomicSub/051100.wgsl.expected.fxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicSub(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicSub(uint offset, int value) { int original_value = 0; - buffer.InterlockedAdd(offset, -value, original_value); + sb_rw.InterlockedAdd(offset, -value, original_value); return original_value; } void atomicSub_051100() { int arg_1 = 1; - int res = tint_atomicSub(sb_rw, 0u, arg_1); + int res = sb_rwatomicSub(0u, arg_1); } void fragment_main() { diff --git a/test/tint/builtins/gen/var/atomicSub/15bfc9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atomicSub/15bfc9.wgsl.expected.dxc.hlsl index 166f709699..374add55ea 100644 --- a/test/tint/builtins/gen/var/atomicSub/15bfc9.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/gen/var/atomicSub/15bfc9.wgsl.expected.dxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicSub(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicSub(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedAdd(offset, -value, original_value); + sb_rw.InterlockedAdd(offset, -value, original_value); return original_value; } void atomicSub_15bfc9() { uint arg_1 = 1u; - uint res = tint_atomicSub(sb_rw, 0u, arg_1); + uint res = sb_rwatomicSub(0u, arg_1); } void fragment_main() { diff --git a/test/tint/builtins/gen/var/atomicSub/15bfc9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atomicSub/15bfc9.wgsl.expected.fxc.hlsl index 166f709699..374add55ea 100644 --- a/test/tint/builtins/gen/var/atomicSub/15bfc9.wgsl.expected.fxc.hlsl +++ b/test/tint/builtins/gen/var/atomicSub/15bfc9.wgsl.expected.fxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicSub(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicSub(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedAdd(offset, -value, original_value); + sb_rw.InterlockedAdd(offset, -value, original_value); return original_value; } void atomicSub_15bfc9() { uint arg_1 = 1u; - uint res = tint_atomicSub(sb_rw, 0u, arg_1); + uint res = sb_rwatomicSub(0u, arg_1); } void fragment_main() { diff --git a/test/tint/builtins/gen/var/atomicXor/54510e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atomicXor/54510e.wgsl.expected.dxc.hlsl index d745f1232c..6294ed386e 100644 --- a/test/tint/builtins/gen/var/atomicXor/54510e.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/gen/var/atomicXor/54510e.wgsl.expected.dxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicXor(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicXor(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedXor(offset, value, original_value); + sb_rw.InterlockedXor(offset, value, original_value); return original_value; } void atomicXor_54510e() { uint arg_1 = 1u; - uint res = tint_atomicXor(sb_rw, 0u, arg_1); + uint res = sb_rwatomicXor(0u, arg_1); } void fragment_main() { diff --git a/test/tint/builtins/gen/var/atomicXor/54510e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atomicXor/54510e.wgsl.expected.fxc.hlsl index d745f1232c..6294ed386e 100644 --- a/test/tint/builtins/gen/var/atomicXor/54510e.wgsl.expected.fxc.hlsl +++ b/test/tint/builtins/gen/var/atomicXor/54510e.wgsl.expected.fxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -uint tint_atomicXor(RWByteAddressBuffer buffer, uint offset, uint value) { +uint sb_rwatomicXor(uint offset, uint value) { uint original_value = 0; - buffer.InterlockedXor(offset, value, original_value); + sb_rw.InterlockedXor(offset, value, original_value); return original_value; } void atomicXor_54510e() { uint arg_1 = 1u; - uint res = tint_atomicXor(sb_rw, 0u, arg_1); + uint res = sb_rwatomicXor(0u, arg_1); } void fragment_main() { diff --git a/test/tint/builtins/gen/var/atomicXor/c1b78c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/atomicXor/c1b78c.wgsl.expected.dxc.hlsl index df83cd93d1..168a8a0702 100644 --- a/test/tint/builtins/gen/var/atomicXor/c1b78c.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/gen/var/atomicXor/c1b78c.wgsl.expected.dxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicXor(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicXor(uint offset, int value) { int original_value = 0; - buffer.InterlockedXor(offset, value, original_value); + sb_rw.InterlockedXor(offset, value, original_value); return original_value; } void atomicXor_c1b78c() { int arg_1 = 1; - int res = tint_atomicXor(sb_rw, 0u, arg_1); + int res = sb_rwatomicXor(0u, arg_1); } void fragment_main() { diff --git a/test/tint/builtins/gen/var/atomicXor/c1b78c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/atomicXor/c1b78c.wgsl.expected.fxc.hlsl index df83cd93d1..168a8a0702 100644 --- a/test/tint/builtins/gen/var/atomicXor/c1b78c.wgsl.expected.fxc.hlsl +++ b/test/tint/builtins/gen/var/atomicXor/c1b78c.wgsl.expected.fxc.hlsl @@ -1,15 +1,15 @@ RWByteAddressBuffer sb_rw : register(u0, space0); -int tint_atomicXor(RWByteAddressBuffer buffer, uint offset, int value) { +int sb_rwatomicXor(uint offset, int value) { int original_value = 0; - buffer.InterlockedXor(offset, value, original_value); + sb_rw.InterlockedXor(offset, value, original_value); return original_value; } void atomicXor_c1b78c() { int arg_1 = 1; - int res = tint_atomicXor(sb_rw, 0u, arg_1); + int res = sb_rwatomicXor(0u, arg_1); } void fragment_main() { diff --git a/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.dxc.hlsl index 4bd893fab1..4b7b50e321 100644 --- a/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.dxc.hlsl @@ -47,14 +47,14 @@ float4 textureLoadExternal(Texture2D plane0, Texture2D plane1, u return float4(color, 1.0f); } -float3x4 tint_symbol_3(uint4 buffer[13], uint offset) { +float3x4 ext_tex_params_load_2(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); + return float3x4(asfloat(ext_tex_params[scalar_offset / 4]), asfloat(ext_tex_params[scalar_offset_1 / 4]), asfloat(ext_tex_params[scalar_offset_2 / 4])); } -GammaTransferParams tint_symbol_5(uint4 buffer[13], uint offset) { +GammaTransferParams ext_tex_params_load_4(uint offset) { const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_4 = ((offset + 4u)) / 4; const uint scalar_offset_5 = ((offset + 8u)) / 4; @@ -63,37 +63,37 @@ GammaTransferParams tint_symbol_5(uint4 buffer[13], uint offset) { const uint scalar_offset_8 = ((offset + 20u)) / 4; const uint scalar_offset_9 = ((offset + 24u)) / 4; const uint scalar_offset_10 = ((offset + 28u)) / 4; - const GammaTransferParams tint_symbol_11 = {asfloat(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(buffer[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(buffer[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(buffer[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(buffer[scalar_offset_9 / 4][scalar_offset_9 % 4]), buffer[scalar_offset_10 / 4][scalar_offset_10 % 4]}; - return tint_symbol_11; + const GammaTransferParams tint_symbol_1 = {asfloat(ext_tex_params[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(ext_tex_params[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(ext_tex_params[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(ext_tex_params[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(ext_tex_params[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(ext_tex_params[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(ext_tex_params[scalar_offset_9 / 4][scalar_offset_9 % 4]), ext_tex_params[scalar_offset_10 / 4][scalar_offset_10 % 4]}; + return tint_symbol_1; } -float3x3 tint_symbol_7(uint4 buffer[13], uint offset) { +float3x3 ext_tex_params_load_6(uint offset) { const uint scalar_offset_11 = ((offset + 0u)) / 4; const uint scalar_offset_12 = ((offset + 16u)) / 4; const uint scalar_offset_13 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset_11 / 4].xyz), asfloat(buffer[scalar_offset_12 / 4].xyz), asfloat(buffer[scalar_offset_13 / 4].xyz)); + return float3x3(asfloat(ext_tex_params[scalar_offset_11 / 4].xyz), asfloat(ext_tex_params[scalar_offset_12 / 4].xyz), asfloat(ext_tex_params[scalar_offset_13 / 4].xyz)); } -float3x2 tint_symbol_9(uint4 buffer[13], uint offset) { +float3x2 ext_tex_params_load_8(uint offset) { const uint scalar_offset_14 = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset_14 / 4]; + uint4 ubo_load = ext_tex_params[scalar_offset_14 / 4]; const uint scalar_offset_15 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_15 / 4]; + uint4 ubo_load_1 = ext_tex_params[scalar_offset_15 / 4]; const uint scalar_offset_16 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_16 / 4]; + uint4 ubo_load_2 = ext_tex_params[scalar_offset_16 / 4]; return float3x2(asfloat(((scalar_offset_14 & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_15 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_16 & 2) ? ubo_load_2.zw : ubo_load_2.xy))); } -ExternalTextureParams tint_symbol_1(uint4 buffer[13], uint offset) { +ExternalTextureParams ext_tex_params_load(uint offset) { const uint scalar_offset_17 = ((offset + 0u)) / 4; const uint scalar_offset_18 = ((offset + 4u)) / 4; - const ExternalTextureParams tint_symbol_12 = {buffer[scalar_offset_17 / 4][scalar_offset_17 % 4], buffer[scalar_offset_18 / 4][scalar_offset_18 % 4], tint_symbol_3(buffer, (offset + 16u)), tint_symbol_5(buffer, (offset + 64u)), tint_symbol_5(buffer, (offset + 96u)), tint_symbol_7(buffer, (offset + 128u)), tint_symbol_9(buffer, (offset + 176u))}; - return tint_symbol_12; + const ExternalTextureParams tint_symbol_2 = {ext_tex_params[scalar_offset_17 / 4][scalar_offset_17 % 4], ext_tex_params[scalar_offset_18 / 4][scalar_offset_18 % 4], ext_tex_params_load_2((offset + 16u)), ext_tex_params_load_4((offset + 64u)), ext_tex_params_load_4((offset + 96u)), ext_tex_params_load_6((offset + 128u)), ext_tex_params_load_8((offset + 176u))}; + return tint_symbol_2; } void textureLoad_1bfdfb() { uint2 arg_1 = (1u).xx; - float4 res = textureLoadExternal(arg_0, ext_tex_plane_1, arg_1, tint_symbol_1(ext_tex_params, 0u)); + float4 res = textureLoadExternal(arg_0, ext_tex_plane_1, arg_1, ext_tex_params_load(0u)); } struct tint_symbol { diff --git a/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.fxc.hlsl index 4bd893fab1..4b7b50e321 100644 --- a/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.fxc.hlsl +++ b/test/tint/builtins/gen/var/textureLoad/1bfdfb.wgsl.expected.fxc.hlsl @@ -47,14 +47,14 @@ float4 textureLoadExternal(Texture2D plane0, Texture2D plane1, u return float4(color, 1.0f); } -float3x4 tint_symbol_3(uint4 buffer[13], uint offset) { +float3x4 ext_tex_params_load_2(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); + return float3x4(asfloat(ext_tex_params[scalar_offset / 4]), asfloat(ext_tex_params[scalar_offset_1 / 4]), asfloat(ext_tex_params[scalar_offset_2 / 4])); } -GammaTransferParams tint_symbol_5(uint4 buffer[13], uint offset) { +GammaTransferParams ext_tex_params_load_4(uint offset) { const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_4 = ((offset + 4u)) / 4; const uint scalar_offset_5 = ((offset + 8u)) / 4; @@ -63,37 +63,37 @@ GammaTransferParams tint_symbol_5(uint4 buffer[13], uint offset) { const uint scalar_offset_8 = ((offset + 20u)) / 4; const uint scalar_offset_9 = ((offset + 24u)) / 4; const uint scalar_offset_10 = ((offset + 28u)) / 4; - const GammaTransferParams tint_symbol_11 = {asfloat(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(buffer[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(buffer[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(buffer[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(buffer[scalar_offset_9 / 4][scalar_offset_9 % 4]), buffer[scalar_offset_10 / 4][scalar_offset_10 % 4]}; - return tint_symbol_11; + const GammaTransferParams tint_symbol_1 = {asfloat(ext_tex_params[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(ext_tex_params[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(ext_tex_params[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(ext_tex_params[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(ext_tex_params[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(ext_tex_params[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(ext_tex_params[scalar_offset_9 / 4][scalar_offset_9 % 4]), ext_tex_params[scalar_offset_10 / 4][scalar_offset_10 % 4]}; + return tint_symbol_1; } -float3x3 tint_symbol_7(uint4 buffer[13], uint offset) { +float3x3 ext_tex_params_load_6(uint offset) { const uint scalar_offset_11 = ((offset + 0u)) / 4; const uint scalar_offset_12 = ((offset + 16u)) / 4; const uint scalar_offset_13 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset_11 / 4].xyz), asfloat(buffer[scalar_offset_12 / 4].xyz), asfloat(buffer[scalar_offset_13 / 4].xyz)); + return float3x3(asfloat(ext_tex_params[scalar_offset_11 / 4].xyz), asfloat(ext_tex_params[scalar_offset_12 / 4].xyz), asfloat(ext_tex_params[scalar_offset_13 / 4].xyz)); } -float3x2 tint_symbol_9(uint4 buffer[13], uint offset) { +float3x2 ext_tex_params_load_8(uint offset) { const uint scalar_offset_14 = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset_14 / 4]; + uint4 ubo_load = ext_tex_params[scalar_offset_14 / 4]; const uint scalar_offset_15 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_15 / 4]; + uint4 ubo_load_1 = ext_tex_params[scalar_offset_15 / 4]; const uint scalar_offset_16 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_16 / 4]; + uint4 ubo_load_2 = ext_tex_params[scalar_offset_16 / 4]; return float3x2(asfloat(((scalar_offset_14 & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_15 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_16 & 2) ? ubo_load_2.zw : ubo_load_2.xy))); } -ExternalTextureParams tint_symbol_1(uint4 buffer[13], uint offset) { +ExternalTextureParams ext_tex_params_load(uint offset) { const uint scalar_offset_17 = ((offset + 0u)) / 4; const uint scalar_offset_18 = ((offset + 4u)) / 4; - const ExternalTextureParams tint_symbol_12 = {buffer[scalar_offset_17 / 4][scalar_offset_17 % 4], buffer[scalar_offset_18 / 4][scalar_offset_18 % 4], tint_symbol_3(buffer, (offset + 16u)), tint_symbol_5(buffer, (offset + 64u)), tint_symbol_5(buffer, (offset + 96u)), tint_symbol_7(buffer, (offset + 128u)), tint_symbol_9(buffer, (offset + 176u))}; - return tint_symbol_12; + const ExternalTextureParams tint_symbol_2 = {ext_tex_params[scalar_offset_17 / 4][scalar_offset_17 % 4], ext_tex_params[scalar_offset_18 / 4][scalar_offset_18 % 4], ext_tex_params_load_2((offset + 16u)), ext_tex_params_load_4((offset + 64u)), ext_tex_params_load_4((offset + 96u)), ext_tex_params_load_6((offset + 128u)), ext_tex_params_load_8((offset + 176u))}; + return tint_symbol_2; } void textureLoad_1bfdfb() { uint2 arg_1 = (1u).xx; - float4 res = textureLoadExternal(arg_0, ext_tex_plane_1, arg_1, tint_symbol_1(ext_tex_params, 0u)); + float4 res = textureLoadExternal(arg_0, ext_tex_plane_1, arg_1, ext_tex_params_load(0u)); } struct tint_symbol { diff --git a/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.dxc.hlsl index f4f4be1af0..eaf70d636e 100644 --- a/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.dxc.hlsl @@ -47,14 +47,14 @@ float4 textureLoadExternal(Texture2D plane0, Texture2D plane1, i return float4(color, 1.0f); } -float3x4 tint_symbol_3(uint4 buffer[13], uint offset) { +float3x4 ext_tex_params_load_2(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); + return float3x4(asfloat(ext_tex_params[scalar_offset / 4]), asfloat(ext_tex_params[scalar_offset_1 / 4]), asfloat(ext_tex_params[scalar_offset_2 / 4])); } -GammaTransferParams tint_symbol_5(uint4 buffer[13], uint offset) { +GammaTransferParams ext_tex_params_load_4(uint offset) { const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_4 = ((offset + 4u)) / 4; const uint scalar_offset_5 = ((offset + 8u)) / 4; @@ -63,37 +63,37 @@ GammaTransferParams tint_symbol_5(uint4 buffer[13], uint offset) { const uint scalar_offset_8 = ((offset + 20u)) / 4; const uint scalar_offset_9 = ((offset + 24u)) / 4; const uint scalar_offset_10 = ((offset + 28u)) / 4; - const GammaTransferParams tint_symbol_11 = {asfloat(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(buffer[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(buffer[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(buffer[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(buffer[scalar_offset_9 / 4][scalar_offset_9 % 4]), buffer[scalar_offset_10 / 4][scalar_offset_10 % 4]}; - return tint_symbol_11; + const GammaTransferParams tint_symbol_1 = {asfloat(ext_tex_params[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(ext_tex_params[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(ext_tex_params[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(ext_tex_params[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(ext_tex_params[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(ext_tex_params[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(ext_tex_params[scalar_offset_9 / 4][scalar_offset_9 % 4]), ext_tex_params[scalar_offset_10 / 4][scalar_offset_10 % 4]}; + return tint_symbol_1; } -float3x3 tint_symbol_7(uint4 buffer[13], uint offset) { +float3x3 ext_tex_params_load_6(uint offset) { const uint scalar_offset_11 = ((offset + 0u)) / 4; const uint scalar_offset_12 = ((offset + 16u)) / 4; const uint scalar_offset_13 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset_11 / 4].xyz), asfloat(buffer[scalar_offset_12 / 4].xyz), asfloat(buffer[scalar_offset_13 / 4].xyz)); + return float3x3(asfloat(ext_tex_params[scalar_offset_11 / 4].xyz), asfloat(ext_tex_params[scalar_offset_12 / 4].xyz), asfloat(ext_tex_params[scalar_offset_13 / 4].xyz)); } -float3x2 tint_symbol_9(uint4 buffer[13], uint offset) { +float3x2 ext_tex_params_load_8(uint offset) { const uint scalar_offset_14 = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset_14 / 4]; + uint4 ubo_load = ext_tex_params[scalar_offset_14 / 4]; const uint scalar_offset_15 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_15 / 4]; + uint4 ubo_load_1 = ext_tex_params[scalar_offset_15 / 4]; const uint scalar_offset_16 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_16 / 4]; + uint4 ubo_load_2 = ext_tex_params[scalar_offset_16 / 4]; return float3x2(asfloat(((scalar_offset_14 & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_15 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_16 & 2) ? ubo_load_2.zw : ubo_load_2.xy))); } -ExternalTextureParams tint_symbol_1(uint4 buffer[13], uint offset) { +ExternalTextureParams ext_tex_params_load(uint offset) { const uint scalar_offset_17 = ((offset + 0u)) / 4; const uint scalar_offset_18 = ((offset + 4u)) / 4; - const ExternalTextureParams tint_symbol_12 = {buffer[scalar_offset_17 / 4][scalar_offset_17 % 4], buffer[scalar_offset_18 / 4][scalar_offset_18 % 4], tint_symbol_3(buffer, (offset + 16u)), tint_symbol_5(buffer, (offset + 64u)), tint_symbol_5(buffer, (offset + 96u)), tint_symbol_7(buffer, (offset + 128u)), tint_symbol_9(buffer, (offset + 176u))}; - return tint_symbol_12; + const ExternalTextureParams tint_symbol_2 = {ext_tex_params[scalar_offset_17 / 4][scalar_offset_17 % 4], ext_tex_params[scalar_offset_18 / 4][scalar_offset_18 % 4], ext_tex_params_load_2((offset + 16u)), ext_tex_params_load_4((offset + 64u)), ext_tex_params_load_4((offset + 96u)), ext_tex_params_load_6((offset + 128u)), ext_tex_params_load_8((offset + 176u))}; + return tint_symbol_2; } void textureLoad_8acf41() { int2 arg_1 = (1).xx; - float4 res = textureLoadExternal(arg_0, ext_tex_plane_1, arg_1, tint_symbol_1(ext_tex_params, 0u)); + float4 res = textureLoadExternal(arg_0, ext_tex_plane_1, arg_1, ext_tex_params_load(0u)); } struct tint_symbol { diff --git a/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.fxc.hlsl index f4f4be1af0..eaf70d636e 100644 --- a/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.fxc.hlsl +++ b/test/tint/builtins/gen/var/textureLoad/8acf41.wgsl.expected.fxc.hlsl @@ -47,14 +47,14 @@ float4 textureLoadExternal(Texture2D plane0, Texture2D plane1, i return float4(color, 1.0f); } -float3x4 tint_symbol_3(uint4 buffer[13], uint offset) { +float3x4 ext_tex_params_load_2(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); + return float3x4(asfloat(ext_tex_params[scalar_offset / 4]), asfloat(ext_tex_params[scalar_offset_1 / 4]), asfloat(ext_tex_params[scalar_offset_2 / 4])); } -GammaTransferParams tint_symbol_5(uint4 buffer[13], uint offset) { +GammaTransferParams ext_tex_params_load_4(uint offset) { const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_4 = ((offset + 4u)) / 4; const uint scalar_offset_5 = ((offset + 8u)) / 4; @@ -63,37 +63,37 @@ GammaTransferParams tint_symbol_5(uint4 buffer[13], uint offset) { const uint scalar_offset_8 = ((offset + 20u)) / 4; const uint scalar_offset_9 = ((offset + 24u)) / 4; const uint scalar_offset_10 = ((offset + 28u)) / 4; - const GammaTransferParams tint_symbol_11 = {asfloat(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(buffer[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(buffer[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(buffer[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(buffer[scalar_offset_9 / 4][scalar_offset_9 % 4]), buffer[scalar_offset_10 / 4][scalar_offset_10 % 4]}; - return tint_symbol_11; + const GammaTransferParams tint_symbol_1 = {asfloat(ext_tex_params[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(ext_tex_params[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(ext_tex_params[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(ext_tex_params[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(ext_tex_params[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(ext_tex_params[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(ext_tex_params[scalar_offset_9 / 4][scalar_offset_9 % 4]), ext_tex_params[scalar_offset_10 / 4][scalar_offset_10 % 4]}; + return tint_symbol_1; } -float3x3 tint_symbol_7(uint4 buffer[13], uint offset) { +float3x3 ext_tex_params_load_6(uint offset) { const uint scalar_offset_11 = ((offset + 0u)) / 4; const uint scalar_offset_12 = ((offset + 16u)) / 4; const uint scalar_offset_13 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset_11 / 4].xyz), asfloat(buffer[scalar_offset_12 / 4].xyz), asfloat(buffer[scalar_offset_13 / 4].xyz)); + return float3x3(asfloat(ext_tex_params[scalar_offset_11 / 4].xyz), asfloat(ext_tex_params[scalar_offset_12 / 4].xyz), asfloat(ext_tex_params[scalar_offset_13 / 4].xyz)); } -float3x2 tint_symbol_9(uint4 buffer[13], uint offset) { +float3x2 ext_tex_params_load_8(uint offset) { const uint scalar_offset_14 = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset_14 / 4]; + uint4 ubo_load = ext_tex_params[scalar_offset_14 / 4]; const uint scalar_offset_15 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_15 / 4]; + uint4 ubo_load_1 = ext_tex_params[scalar_offset_15 / 4]; const uint scalar_offset_16 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_16 / 4]; + uint4 ubo_load_2 = ext_tex_params[scalar_offset_16 / 4]; return float3x2(asfloat(((scalar_offset_14 & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_15 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_16 & 2) ? ubo_load_2.zw : ubo_load_2.xy))); } -ExternalTextureParams tint_symbol_1(uint4 buffer[13], uint offset) { +ExternalTextureParams ext_tex_params_load(uint offset) { const uint scalar_offset_17 = ((offset + 0u)) / 4; const uint scalar_offset_18 = ((offset + 4u)) / 4; - const ExternalTextureParams tint_symbol_12 = {buffer[scalar_offset_17 / 4][scalar_offset_17 % 4], buffer[scalar_offset_18 / 4][scalar_offset_18 % 4], tint_symbol_3(buffer, (offset + 16u)), tint_symbol_5(buffer, (offset + 64u)), tint_symbol_5(buffer, (offset + 96u)), tint_symbol_7(buffer, (offset + 128u)), tint_symbol_9(buffer, (offset + 176u))}; - return tint_symbol_12; + const ExternalTextureParams tint_symbol_2 = {ext_tex_params[scalar_offset_17 / 4][scalar_offset_17 % 4], ext_tex_params[scalar_offset_18 / 4][scalar_offset_18 % 4], ext_tex_params_load_2((offset + 16u)), ext_tex_params_load_4((offset + 64u)), ext_tex_params_load_4((offset + 96u)), ext_tex_params_load_6((offset + 128u)), ext_tex_params_load_8((offset + 176u))}; + return tint_symbol_2; } void textureLoad_8acf41() { int2 arg_1 = (1).xx; - float4 res = textureLoadExternal(arg_0, ext_tex_plane_1, arg_1, tint_symbol_1(ext_tex_params, 0u)); + float4 res = textureLoadExternal(arg_0, ext_tex_plane_1, arg_1, ext_tex_params_load(0u)); } struct tint_symbol { diff --git a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.dxc.hlsl index 678344ff29..3f7528b108 100644 --- a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.dxc.hlsl @@ -58,14 +58,14 @@ float4 textureSampleExternal(Texture2D plane0, Texture2D plane1, return float4(color, 1.0f); } -float3x4 tint_symbol_3(uint4 buffer[13], uint offset) { +float3x4 ext_tex_params_load_2(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); + return float3x4(asfloat(ext_tex_params[scalar_offset / 4]), asfloat(ext_tex_params[scalar_offset_1 / 4]), asfloat(ext_tex_params[scalar_offset_2 / 4])); } -GammaTransferParams tint_symbol_5(uint4 buffer[13], uint offset) { +GammaTransferParams ext_tex_params_load_4(uint offset) { const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_4 = ((offset + 4u)) / 4; const uint scalar_offset_5 = ((offset + 8u)) / 4; @@ -74,37 +74,37 @@ GammaTransferParams tint_symbol_5(uint4 buffer[13], uint offset) { const uint scalar_offset_8 = ((offset + 20u)) / 4; const uint scalar_offset_9 = ((offset + 24u)) / 4; const uint scalar_offset_10 = ((offset + 28u)) / 4; - const GammaTransferParams tint_symbol_11 = {asfloat(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(buffer[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(buffer[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(buffer[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(buffer[scalar_offset_9 / 4][scalar_offset_9 % 4]), buffer[scalar_offset_10 / 4][scalar_offset_10 % 4]}; - return tint_symbol_11; + const GammaTransferParams tint_symbol_1 = {asfloat(ext_tex_params[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(ext_tex_params[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(ext_tex_params[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(ext_tex_params[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(ext_tex_params[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(ext_tex_params[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(ext_tex_params[scalar_offset_9 / 4][scalar_offset_9 % 4]), ext_tex_params[scalar_offset_10 / 4][scalar_offset_10 % 4]}; + return tint_symbol_1; } -float3x3 tint_symbol_7(uint4 buffer[13], uint offset) { +float3x3 ext_tex_params_load_6(uint offset) { const uint scalar_offset_11 = ((offset + 0u)) / 4; const uint scalar_offset_12 = ((offset + 16u)) / 4; const uint scalar_offset_13 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset_11 / 4].xyz), asfloat(buffer[scalar_offset_12 / 4].xyz), asfloat(buffer[scalar_offset_13 / 4].xyz)); + return float3x3(asfloat(ext_tex_params[scalar_offset_11 / 4].xyz), asfloat(ext_tex_params[scalar_offset_12 / 4].xyz), asfloat(ext_tex_params[scalar_offset_13 / 4].xyz)); } -float3x2 tint_symbol_9(uint4 buffer[13], uint offset) { +float3x2 ext_tex_params_load_8(uint offset) { const uint scalar_offset_14 = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset_14 / 4]; + uint4 ubo_load = ext_tex_params[scalar_offset_14 / 4]; const uint scalar_offset_15 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_15 / 4]; + uint4 ubo_load_1 = ext_tex_params[scalar_offset_15 / 4]; const uint scalar_offset_16 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_16 / 4]; + uint4 ubo_load_2 = ext_tex_params[scalar_offset_16 / 4]; return float3x2(asfloat(((scalar_offset_14 & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_15 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_16 & 2) ? ubo_load_2.zw : ubo_load_2.xy))); } -ExternalTextureParams tint_symbol_1(uint4 buffer[13], uint offset) { +ExternalTextureParams ext_tex_params_load(uint offset) { const uint scalar_offset_17 = ((offset + 0u)) / 4; const uint scalar_offset_18 = ((offset + 4u)) / 4; - const ExternalTextureParams tint_symbol_12 = {buffer[scalar_offset_17 / 4][scalar_offset_17 % 4], buffer[scalar_offset_18 / 4][scalar_offset_18 % 4], tint_symbol_3(buffer, (offset + 16u)), tint_symbol_5(buffer, (offset + 64u)), tint_symbol_5(buffer, (offset + 96u)), tint_symbol_7(buffer, (offset + 128u)), tint_symbol_9(buffer, (offset + 176u))}; - return tint_symbol_12; + const ExternalTextureParams tint_symbol_2 = {ext_tex_params[scalar_offset_17 / 4][scalar_offset_17 % 4], ext_tex_params[scalar_offset_18 / 4][scalar_offset_18 % 4], ext_tex_params_load_2((offset + 16u)), ext_tex_params_load_4((offset + 64u)), ext_tex_params_load_4((offset + 96u)), ext_tex_params_load_6((offset + 128u)), ext_tex_params_load_8((offset + 176u))}; + return tint_symbol_2; } void textureSampleBaseClampToEdge_7c04e6() { float2 arg_2 = (1.0f).xx; - float4 res = textureSampleExternal(arg_0, ext_tex_plane_1, arg_1, arg_2, tint_symbol_1(ext_tex_params, 0u)); + float4 res = textureSampleExternal(arg_0, ext_tex_plane_1, arg_1, arg_2, ext_tex_params_load(0u)); } struct tint_symbol { diff --git a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.fxc.hlsl index 678344ff29..3f7528b108 100644 --- a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.fxc.hlsl +++ b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.fxc.hlsl @@ -58,14 +58,14 @@ float4 textureSampleExternal(Texture2D plane0, Texture2D plane1, return float4(color, 1.0f); } -float3x4 tint_symbol_3(uint4 buffer[13], uint offset) { +float3x4 ext_tex_params_load_2(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); + return float3x4(asfloat(ext_tex_params[scalar_offset / 4]), asfloat(ext_tex_params[scalar_offset_1 / 4]), asfloat(ext_tex_params[scalar_offset_2 / 4])); } -GammaTransferParams tint_symbol_5(uint4 buffer[13], uint offset) { +GammaTransferParams ext_tex_params_load_4(uint offset) { const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_4 = ((offset + 4u)) / 4; const uint scalar_offset_5 = ((offset + 8u)) / 4; @@ -74,37 +74,37 @@ GammaTransferParams tint_symbol_5(uint4 buffer[13], uint offset) { const uint scalar_offset_8 = ((offset + 20u)) / 4; const uint scalar_offset_9 = ((offset + 24u)) / 4; const uint scalar_offset_10 = ((offset + 28u)) / 4; - const GammaTransferParams tint_symbol_11 = {asfloat(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(buffer[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(buffer[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(buffer[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(buffer[scalar_offset_9 / 4][scalar_offset_9 % 4]), buffer[scalar_offset_10 / 4][scalar_offset_10 % 4]}; - return tint_symbol_11; + const GammaTransferParams tint_symbol_1 = {asfloat(ext_tex_params[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(ext_tex_params[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(ext_tex_params[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(ext_tex_params[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(ext_tex_params[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(ext_tex_params[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(ext_tex_params[scalar_offset_9 / 4][scalar_offset_9 % 4]), ext_tex_params[scalar_offset_10 / 4][scalar_offset_10 % 4]}; + return tint_symbol_1; } -float3x3 tint_symbol_7(uint4 buffer[13], uint offset) { +float3x3 ext_tex_params_load_6(uint offset) { const uint scalar_offset_11 = ((offset + 0u)) / 4; const uint scalar_offset_12 = ((offset + 16u)) / 4; const uint scalar_offset_13 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset_11 / 4].xyz), asfloat(buffer[scalar_offset_12 / 4].xyz), asfloat(buffer[scalar_offset_13 / 4].xyz)); + return float3x3(asfloat(ext_tex_params[scalar_offset_11 / 4].xyz), asfloat(ext_tex_params[scalar_offset_12 / 4].xyz), asfloat(ext_tex_params[scalar_offset_13 / 4].xyz)); } -float3x2 tint_symbol_9(uint4 buffer[13], uint offset) { +float3x2 ext_tex_params_load_8(uint offset) { const uint scalar_offset_14 = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset_14 / 4]; + uint4 ubo_load = ext_tex_params[scalar_offset_14 / 4]; const uint scalar_offset_15 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_15 / 4]; + uint4 ubo_load_1 = ext_tex_params[scalar_offset_15 / 4]; const uint scalar_offset_16 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_16 / 4]; + uint4 ubo_load_2 = ext_tex_params[scalar_offset_16 / 4]; return float3x2(asfloat(((scalar_offset_14 & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_15 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_16 & 2) ? ubo_load_2.zw : ubo_load_2.xy))); } -ExternalTextureParams tint_symbol_1(uint4 buffer[13], uint offset) { +ExternalTextureParams ext_tex_params_load(uint offset) { const uint scalar_offset_17 = ((offset + 0u)) / 4; const uint scalar_offset_18 = ((offset + 4u)) / 4; - const ExternalTextureParams tint_symbol_12 = {buffer[scalar_offset_17 / 4][scalar_offset_17 % 4], buffer[scalar_offset_18 / 4][scalar_offset_18 % 4], tint_symbol_3(buffer, (offset + 16u)), tint_symbol_5(buffer, (offset + 64u)), tint_symbol_5(buffer, (offset + 96u)), tint_symbol_7(buffer, (offset + 128u)), tint_symbol_9(buffer, (offset + 176u))}; - return tint_symbol_12; + const ExternalTextureParams tint_symbol_2 = {ext_tex_params[scalar_offset_17 / 4][scalar_offset_17 % 4], ext_tex_params[scalar_offset_18 / 4][scalar_offset_18 % 4], ext_tex_params_load_2((offset + 16u)), ext_tex_params_load_4((offset + 64u)), ext_tex_params_load_4((offset + 96u)), ext_tex_params_load_6((offset + 128u)), ext_tex_params_load_8((offset + 176u))}; + return tint_symbol_2; } void textureSampleBaseClampToEdge_7c04e6() { float2 arg_2 = (1.0f).xx; - float4 res = textureSampleExternal(arg_0, ext_tex_plane_1, arg_1, arg_2, tint_symbol_1(ext_tex_params, 0u)); + float4 res = textureSampleExternal(arg_0, ext_tex_plane_1, arg_1, arg_2, ext_tex_params_load(0u)); } struct tint_symbol { diff --git a/test/tint/builtins/textureLoad/texture_external_param.wgsl.expected.dxc.hlsl b/test/tint/builtins/textureLoad/texture_external_param.wgsl.expected.dxc.hlsl index 327f874123..6feb649549 100644 --- a/test/tint/builtins/textureLoad/texture_external_param.wgsl.expected.dxc.hlsl +++ b/test/tint/builtins/textureLoad/texture_external_param.wgsl.expected.dxc.hlsl @@ -51,14 +51,14 @@ float4 textureLoad2d(Texture2D tint_symbol, Texture2D ext_tex_pl return textureLoadExternal(tint_symbol, ext_tex_plane_1_1, coords, ext_tex_params_1); } -float3x4 tint_symbol_4(uint4 buffer[13], uint offset) { +float3x4 ext_tex_params_load_2(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); + return float3x4(asfloat(ext_tex_params[scalar_offset / 4]), asfloat(ext_tex_params[scalar_offset_1 / 4]), asfloat(ext_tex_params[scalar_offset_2 / 4])); } -GammaTransferParams tint_symbol_6(uint4 buffer[13], uint offset) { +GammaTransferParams ext_tex_params_load_4(uint offset) { const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_4 = ((offset + 4u)) / 4; const uint scalar_offset_5 = ((offset + 8u)) / 4; @@ -67,36 +67,36 @@ GammaTransferParams tint_symbol_6(uint4 buffer[13], uint offset) { const uint scalar_offset_8 = ((offset + 20u)) / 4; const uint scalar_offset_9 = ((offset + 24u)) / 4; const uint scalar_offset_10 = ((offset + 28u)) / 4; - const GammaTransferParams tint_symbol_12 = {asfloat(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(buffer[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(buffer[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(buffer[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(buffer[scalar_offset_9 / 4][scalar_offset_9 % 4]), buffer[scalar_offset_10 / 4][scalar_offset_10 % 4]}; - return tint_symbol_12; + const GammaTransferParams tint_symbol_2 = {asfloat(ext_tex_params[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(ext_tex_params[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(ext_tex_params[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(ext_tex_params[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(ext_tex_params[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(ext_tex_params[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(ext_tex_params[scalar_offset_9 / 4][scalar_offset_9 % 4]), ext_tex_params[scalar_offset_10 / 4][scalar_offset_10 % 4]}; + return tint_symbol_2; } -float3x3 tint_symbol_8(uint4 buffer[13], uint offset) { +float3x3 ext_tex_params_load_6(uint offset) { const uint scalar_offset_11 = ((offset + 0u)) / 4; const uint scalar_offset_12 = ((offset + 16u)) / 4; const uint scalar_offset_13 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset_11 / 4].xyz), asfloat(buffer[scalar_offset_12 / 4].xyz), asfloat(buffer[scalar_offset_13 / 4].xyz)); + return float3x3(asfloat(ext_tex_params[scalar_offset_11 / 4].xyz), asfloat(ext_tex_params[scalar_offset_12 / 4].xyz), asfloat(ext_tex_params[scalar_offset_13 / 4].xyz)); } -float3x2 tint_symbol_10(uint4 buffer[13], uint offset) { +float3x2 ext_tex_params_load_8(uint offset) { const uint scalar_offset_14 = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset_14 / 4]; + uint4 ubo_load = ext_tex_params[scalar_offset_14 / 4]; const uint scalar_offset_15 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_15 / 4]; + uint4 ubo_load_1 = ext_tex_params[scalar_offset_15 / 4]; const uint scalar_offset_16 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_16 / 4]; + uint4 ubo_load_2 = ext_tex_params[scalar_offset_16 / 4]; return float3x2(asfloat(((scalar_offset_14 & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_15 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_16 & 2) ? ubo_load_2.zw : ubo_load_2.xy))); } -ExternalTextureParams tint_symbol_2(uint4 buffer[13], uint offset) { +ExternalTextureParams ext_tex_params_load(uint offset) { const uint scalar_offset_17 = ((offset + 0u)) / 4; const uint scalar_offset_18 = ((offset + 4u)) / 4; - const ExternalTextureParams tint_symbol_13 = {buffer[scalar_offset_17 / 4][scalar_offset_17 % 4], buffer[scalar_offset_18 / 4][scalar_offset_18 % 4], tint_symbol_4(buffer, (offset + 16u)), tint_symbol_6(buffer, (offset + 64u)), tint_symbol_6(buffer, (offset + 96u)), tint_symbol_8(buffer, (offset + 128u)), tint_symbol_10(buffer, (offset + 176u))}; - return tint_symbol_13; + const ExternalTextureParams tint_symbol_3 = {ext_tex_params[scalar_offset_17 / 4][scalar_offset_17 % 4], ext_tex_params[scalar_offset_18 / 4][scalar_offset_18 % 4], ext_tex_params_load_2((offset + 16u)), ext_tex_params_load_4((offset + 64u)), ext_tex_params_load_4((offset + 96u)), ext_tex_params_load_6((offset + 128u)), ext_tex_params_load_8((offset + 176u))}; + return tint_symbol_3; } void doTextureLoad() { - float4 res = textureLoad2d(arg_0, ext_tex_plane_1, tint_symbol_2(ext_tex_params, 0u), (0).xx); + float4 res = textureLoad2d(arg_0, ext_tex_plane_1, ext_tex_params_load(0u), (0).xx); } struct tint_symbol_1 { diff --git a/test/tint/builtins/textureLoad/texture_external_param.wgsl.expected.fxc.hlsl b/test/tint/builtins/textureLoad/texture_external_param.wgsl.expected.fxc.hlsl index 327f874123..6feb649549 100644 --- a/test/tint/builtins/textureLoad/texture_external_param.wgsl.expected.fxc.hlsl +++ b/test/tint/builtins/textureLoad/texture_external_param.wgsl.expected.fxc.hlsl @@ -51,14 +51,14 @@ float4 textureLoad2d(Texture2D tint_symbol, Texture2D ext_tex_pl return textureLoadExternal(tint_symbol, ext_tex_plane_1_1, coords, ext_tex_params_1); } -float3x4 tint_symbol_4(uint4 buffer[13], uint offset) { +float3x4 ext_tex_params_load_2(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4])); + return float3x4(asfloat(ext_tex_params[scalar_offset / 4]), asfloat(ext_tex_params[scalar_offset_1 / 4]), asfloat(ext_tex_params[scalar_offset_2 / 4])); } -GammaTransferParams tint_symbol_6(uint4 buffer[13], uint offset) { +GammaTransferParams ext_tex_params_load_4(uint offset) { const uint scalar_offset_3 = ((offset + 0u)) / 4; const uint scalar_offset_4 = ((offset + 4u)) / 4; const uint scalar_offset_5 = ((offset + 8u)) / 4; @@ -67,36 +67,36 @@ GammaTransferParams tint_symbol_6(uint4 buffer[13], uint offset) { const uint scalar_offset_8 = ((offset + 20u)) / 4; const uint scalar_offset_9 = ((offset + 24u)) / 4; const uint scalar_offset_10 = ((offset + 28u)) / 4; - const GammaTransferParams tint_symbol_12 = {asfloat(buffer[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(buffer[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(buffer[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(buffer[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(buffer[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(buffer[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(buffer[scalar_offset_9 / 4][scalar_offset_9 % 4]), buffer[scalar_offset_10 / 4][scalar_offset_10 % 4]}; - return tint_symbol_12; + const GammaTransferParams tint_symbol_2 = {asfloat(ext_tex_params[scalar_offset_3 / 4][scalar_offset_3 % 4]), asfloat(ext_tex_params[scalar_offset_4 / 4][scalar_offset_4 % 4]), asfloat(ext_tex_params[scalar_offset_5 / 4][scalar_offset_5 % 4]), asfloat(ext_tex_params[scalar_offset_6 / 4][scalar_offset_6 % 4]), asfloat(ext_tex_params[scalar_offset_7 / 4][scalar_offset_7 % 4]), asfloat(ext_tex_params[scalar_offset_8 / 4][scalar_offset_8 % 4]), asfloat(ext_tex_params[scalar_offset_9 / 4][scalar_offset_9 % 4]), ext_tex_params[scalar_offset_10 / 4][scalar_offset_10 % 4]}; + return tint_symbol_2; } -float3x3 tint_symbol_8(uint4 buffer[13], uint offset) { +float3x3 ext_tex_params_load_6(uint offset) { const uint scalar_offset_11 = ((offset + 0u)) / 4; const uint scalar_offset_12 = ((offset + 16u)) / 4; const uint scalar_offset_13 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset_11 / 4].xyz), asfloat(buffer[scalar_offset_12 / 4].xyz), asfloat(buffer[scalar_offset_13 / 4].xyz)); + return float3x3(asfloat(ext_tex_params[scalar_offset_11 / 4].xyz), asfloat(ext_tex_params[scalar_offset_12 / 4].xyz), asfloat(ext_tex_params[scalar_offset_13 / 4].xyz)); } -float3x2 tint_symbol_10(uint4 buffer[13], uint offset) { +float3x2 ext_tex_params_load_8(uint offset) { const uint scalar_offset_14 = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset_14 / 4]; + uint4 ubo_load = ext_tex_params[scalar_offset_14 / 4]; const uint scalar_offset_15 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_15 / 4]; + uint4 ubo_load_1 = ext_tex_params[scalar_offset_15 / 4]; const uint scalar_offset_16 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_16 / 4]; + uint4 ubo_load_2 = ext_tex_params[scalar_offset_16 / 4]; return float3x2(asfloat(((scalar_offset_14 & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_15 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_16 & 2) ? ubo_load_2.zw : ubo_load_2.xy))); } -ExternalTextureParams tint_symbol_2(uint4 buffer[13], uint offset) { +ExternalTextureParams ext_tex_params_load(uint offset) { const uint scalar_offset_17 = ((offset + 0u)) / 4; const uint scalar_offset_18 = ((offset + 4u)) / 4; - const ExternalTextureParams tint_symbol_13 = {buffer[scalar_offset_17 / 4][scalar_offset_17 % 4], buffer[scalar_offset_18 / 4][scalar_offset_18 % 4], tint_symbol_4(buffer, (offset + 16u)), tint_symbol_6(buffer, (offset + 64u)), tint_symbol_6(buffer, (offset + 96u)), tint_symbol_8(buffer, (offset + 128u)), tint_symbol_10(buffer, (offset + 176u))}; - return tint_symbol_13; + const ExternalTextureParams tint_symbol_3 = {ext_tex_params[scalar_offset_17 / 4][scalar_offset_17 % 4], ext_tex_params[scalar_offset_18 / 4][scalar_offset_18 % 4], ext_tex_params_load_2((offset + 16u)), ext_tex_params_load_4((offset + 64u)), ext_tex_params_load_4((offset + 96u)), ext_tex_params_load_6((offset + 128u)), ext_tex_params_load_8((offset + 176u))}; + return tint_symbol_3; } void doTextureLoad() { - float4 res = textureLoad2d(arg_0, ext_tex_plane_1, tint_symbol_2(ext_tex_params, 0u), (0).xx); + float4 res = textureLoad2d(arg_0, ext_tex_plane_1, ext_tex_params_load(0u), (0).xx); } struct tint_symbol_1 { diff --git a/test/tint/expressions/binary/mul/mat3x2-vec3/f16.wgsl.expected.dxc.hlsl b/test/tint/expressions/binary/mul/mat3x2-vec3/f16.wgsl.expected.dxc.hlsl index 523d7b4349..fe85aff74c 100644 --- a/test/tint/expressions/binary/mul/mat3x2-vec3/f16.wgsl.expected.dxc.hlsl +++ b/test/tint/expressions/binary/mul/mat3x2-vec3/f16.wgsl.expected.dxc.hlsl @@ -2,13 +2,13 @@ cbuffer cbuffer_data : register(b0, space0) { uint4 data[2]; }; -matrix tint_symbol_2(uint4 buffer[2], uint offset) { +matrix data_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint ubo_load = buffer[scalar_offset / 4][scalar_offset % 4]; + uint ubo_load = data[scalar_offset / 4][scalar_offset % 4]; const uint scalar_offset_1 = ((offset + 4u)) / 4; - uint ubo_load_1 = buffer[scalar_offset_1 / 4][scalar_offset_1 % 4]; + uint ubo_load_1 = data[scalar_offset_1 / 4][scalar_offset_1 % 4]; const uint scalar_offset_2 = ((offset + 8u)) / 4; - uint ubo_load_2 = buffer[scalar_offset_2 / 4][scalar_offset_2 % 4]; + uint ubo_load_2 = data[scalar_offset_2 / 4][scalar_offset_2 % 4]; return matrix(vector(float16_t(f16tof32(ubo_load & 0xFFFF)), float16_t(f16tof32(ubo_load >> 16))), vector(float16_t(f16tof32(ubo_load_1 & 0xFFFF)), float16_t(f16tof32(ubo_load_1 >> 16))), vector(float16_t(f16tof32(ubo_load_2 & 0xFFFF)), float16_t(f16tof32(ubo_load_2 >> 16)))); } @@ -16,6 +16,6 @@ void main() { uint2 ubo_load_3 = data[1].xy; vector ubo_load_3_xz = vector(f16tof32(ubo_load_3 & 0xFFFF)); float16_t ubo_load_3_y = f16tof32(ubo_load_3[0] >> 16); - const vector x = mul(vector(ubo_load_3_xz[0], ubo_load_3_y, ubo_load_3_xz[1]), tint_symbol_2(data, 0u)); + const vector x = mul(vector(ubo_load_3_xz[0], ubo_load_3_y, ubo_load_3_xz[1]), data_load(0u)); return; } diff --git a/test/tint/expressions/binary/mul/mat3x2-vec3/f32.wgsl.expected.dxc.hlsl b/test/tint/expressions/binary/mul/mat3x2-vec3/f32.wgsl.expected.dxc.hlsl index 6e12e5cfc5..95f8c11e63 100644 --- a/test/tint/expressions/binary/mul/mat3x2-vec3/f32.wgsl.expected.dxc.hlsl +++ b/test/tint/expressions/binary/mul/mat3x2-vec3/f32.wgsl.expected.dxc.hlsl @@ -2,17 +2,17 @@ cbuffer cbuffer_data : register(b0, space0) { uint4 data[3]; }; -float3x2 tint_symbol_2(uint4 buffer[3], uint offset) { +float3x2 data_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = data[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = data[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = data[scalar_offset_2 / 4]; return float3x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy))); } void main() { - const float2 x = mul(asfloat(data[2].xyz), tint_symbol_2(data, 0u)); + const float2 x = mul(asfloat(data[2].xyz), data_load(0u)); return; } diff --git a/test/tint/expressions/binary/mul/mat3x2-vec3/f32.wgsl.expected.fxc.hlsl b/test/tint/expressions/binary/mul/mat3x2-vec3/f32.wgsl.expected.fxc.hlsl index 6e12e5cfc5..95f8c11e63 100644 --- a/test/tint/expressions/binary/mul/mat3x2-vec3/f32.wgsl.expected.fxc.hlsl +++ b/test/tint/expressions/binary/mul/mat3x2-vec3/f32.wgsl.expected.fxc.hlsl @@ -2,17 +2,17 @@ cbuffer cbuffer_data : register(b0, space0) { uint4 data[3]; }; -float3x2 tint_symbol_2(uint4 buffer[3], uint offset) { +float3x2 data_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load = buffer[scalar_offset / 4]; + uint4 ubo_load = data[scalar_offset / 4]; const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_1 = data[scalar_offset_1 / 4]; const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_2 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_2 = data[scalar_offset_2 / 4]; return float3x2(asfloat(((scalar_offset & 2) ? ubo_load.zw : ubo_load.xy)), asfloat(((scalar_offset_1 & 2) ? ubo_load_1.zw : ubo_load_1.xy)), asfloat(((scalar_offset_2 & 2) ? ubo_load_2.zw : ubo_load_2.xy))); } void main() { - const float2 x = mul(asfloat(data[2].xyz), tint_symbol_2(data, 0u)); + const float2 x = mul(asfloat(data[2].xyz), data_load(0u)); return; } diff --git a/test/tint/expressions/binary/mul/mat3x3-vec3/f16.wgsl.expected.dxc.hlsl b/test/tint/expressions/binary/mul/mat3x3-vec3/f16.wgsl.expected.dxc.hlsl index a60cb20fe5..e1672516e4 100644 --- a/test/tint/expressions/binary/mul/mat3x3-vec3/f16.wgsl.expected.dxc.hlsl +++ b/test/tint/expressions/binary/mul/mat3x3-vec3/f16.wgsl.expected.dxc.hlsl @@ -2,19 +2,19 @@ cbuffer cbuffer_data : register(b0, space0) { uint4 data[2]; }; -matrix tint_symbol_2(uint4 buffer[2], uint offset) { +matrix data_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = data[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = data[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = data[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); float16_t ubo_load_4_y = f16tof32(ubo_load_4[0] >> 16); @@ -25,6 +25,6 @@ void main() { uint2 ubo_load_6 = data[1].zw; vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); float16_t ubo_load_6_y = f16tof32(ubo_load_6[0] >> 16); - const vector x = mul(vector(ubo_load_6_xz[0], ubo_load_6_y, ubo_load_6_xz[1]), tint_symbol_2(data, 0u)); + const vector x = mul(vector(ubo_load_6_xz[0], ubo_load_6_y, ubo_load_6_xz[1]), data_load(0u)); return; } diff --git a/test/tint/expressions/binary/mul/mat3x3-vec3/f32.wgsl.expected.dxc.hlsl b/test/tint/expressions/binary/mul/mat3x3-vec3/f32.wgsl.expected.dxc.hlsl index c680c08b29..a7889f2cea 100644 --- a/test/tint/expressions/binary/mul/mat3x3-vec3/f32.wgsl.expected.dxc.hlsl +++ b/test/tint/expressions/binary/mul/mat3x3-vec3/f32.wgsl.expected.dxc.hlsl @@ -2,14 +2,14 @@ cbuffer cbuffer_data : register(b0, space0) { uint4 data[4]; }; -float3x3 tint_symbol_2(uint4 buffer[4], uint offset) { +float3x3 data_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz)); + return float3x3(asfloat(data[scalar_offset / 4].xyz), asfloat(data[scalar_offset_1 / 4].xyz), asfloat(data[scalar_offset_2 / 4].xyz)); } void main() { - const float3 x = mul(asfloat(data[3].xyz), tint_symbol_2(data, 0u)); + const float3 x = mul(asfloat(data[3].xyz), data_load(0u)); return; } diff --git a/test/tint/expressions/binary/mul/mat3x3-vec3/f32.wgsl.expected.fxc.hlsl b/test/tint/expressions/binary/mul/mat3x3-vec3/f32.wgsl.expected.fxc.hlsl index c680c08b29..a7889f2cea 100644 --- a/test/tint/expressions/binary/mul/mat3x3-vec3/f32.wgsl.expected.fxc.hlsl +++ b/test/tint/expressions/binary/mul/mat3x3-vec3/f32.wgsl.expected.fxc.hlsl @@ -2,14 +2,14 @@ cbuffer cbuffer_data : register(b0, space0) { uint4 data[4]; }; -float3x3 tint_symbol_2(uint4 buffer[4], uint offset) { +float3x3 data_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz)); + return float3x3(asfloat(data[scalar_offset / 4].xyz), asfloat(data[scalar_offset_1 / 4].xyz), asfloat(data[scalar_offset_2 / 4].xyz)); } void main() { - const float3 x = mul(asfloat(data[3].xyz), tint_symbol_2(data, 0u)); + const float3 x = mul(asfloat(data[3].xyz), data_load(0u)); return; } diff --git a/test/tint/expressions/binary/mul/vec3-mat3x3/f16.wgsl.expected.dxc.hlsl b/test/tint/expressions/binary/mul/vec3-mat3x3/f16.wgsl.expected.dxc.hlsl index 4f3858766a..bbc5e1431b 100644 --- a/test/tint/expressions/binary/mul/vec3-mat3x3/f16.wgsl.expected.dxc.hlsl +++ b/test/tint/expressions/binary/mul/vec3-mat3x3/f16.wgsl.expected.dxc.hlsl @@ -2,19 +2,19 @@ cbuffer cbuffer_data : register(b0, space0) { uint4 data[2]; }; -matrix tint_symbol_3(uint4 buffer[2], uint offset) { +matrix data_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = data[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = data[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = data[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); float16_t ubo_load_4_y = f16tof32(ubo_load_4[0] >> 16); @@ -25,6 +25,6 @@ void main() { uint2 ubo_load_6 = data[1].zw; vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); float16_t ubo_load_6_y = f16tof32(ubo_load_6[0] >> 16); - const vector x = mul(tint_symbol_3(data, 0u), vector(ubo_load_6_xz[0], ubo_load_6_y, ubo_load_6_xz[1])); + const vector x = mul(data_load_1(0u), vector(ubo_load_6_xz[0], ubo_load_6_y, ubo_load_6_xz[1])); return; } diff --git a/test/tint/expressions/binary/mul/vec3-mat3x3/f32.wgsl.expected.dxc.hlsl b/test/tint/expressions/binary/mul/vec3-mat3x3/f32.wgsl.expected.dxc.hlsl index 4bd768f2a7..c4a04f3f66 100644 --- a/test/tint/expressions/binary/mul/vec3-mat3x3/f32.wgsl.expected.dxc.hlsl +++ b/test/tint/expressions/binary/mul/vec3-mat3x3/f32.wgsl.expected.dxc.hlsl @@ -2,14 +2,14 @@ cbuffer cbuffer_data : register(b0, space0) { uint4 data[4]; }; -float3x3 tint_symbol_3(uint4 buffer[4], uint offset) { +float3x3 data_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz)); + return float3x3(asfloat(data[scalar_offset / 4].xyz), asfloat(data[scalar_offset_1 / 4].xyz), asfloat(data[scalar_offset_2 / 4].xyz)); } void main() { - const float3 x = mul(tint_symbol_3(data, 0u), asfloat(data[3].xyz)); + const float3 x = mul(data_load_1(0u), asfloat(data[3].xyz)); return; } diff --git a/test/tint/expressions/binary/mul/vec3-mat3x3/f32.wgsl.expected.fxc.hlsl b/test/tint/expressions/binary/mul/vec3-mat3x3/f32.wgsl.expected.fxc.hlsl index 4bd768f2a7..c4a04f3f66 100644 --- a/test/tint/expressions/binary/mul/vec3-mat3x3/f32.wgsl.expected.fxc.hlsl +++ b/test/tint/expressions/binary/mul/vec3-mat3x3/f32.wgsl.expected.fxc.hlsl @@ -2,14 +2,14 @@ cbuffer cbuffer_data : register(b0, space0) { uint4 data[4]; }; -float3x3 tint_symbol_3(uint4 buffer[4], uint offset) { +float3x3 data_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; - return float3x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz)); + return float3x3(asfloat(data[scalar_offset / 4].xyz), asfloat(data[scalar_offset_1 / 4].xyz), asfloat(data[scalar_offset_2 / 4].xyz)); } void main() { - const float3 x = mul(tint_symbol_3(data, 0u), asfloat(data[3].xyz)); + const float3 x = mul(data_load_1(0u), asfloat(data[3].xyz)); return; } diff --git a/test/tint/expressions/binary/mul/vec3-mat4x3/f16.wgsl.expected.dxc.hlsl b/test/tint/expressions/binary/mul/vec3-mat4x3/f16.wgsl.expected.dxc.hlsl index 818c96e51d..e622477c71 100644 --- a/test/tint/expressions/binary/mul/vec3-mat4x3/f16.wgsl.expected.dxc.hlsl +++ b/test/tint/expressions/binary/mul/vec3-mat4x3/f16.wgsl.expected.dxc.hlsl @@ -2,24 +2,24 @@ cbuffer cbuffer_data : register(b0, space0) { uint4 data[3]; }; -matrix tint_symbol_3(uint4 buffer[3], uint offset) { +matrix data_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - uint4 ubo_load_1 = buffer[scalar_offset / 4]; + uint4 ubo_load_1 = data[scalar_offset / 4]; uint2 ubo_load = ((scalar_offset & 2) ? ubo_load_1.zw : ubo_load_1.xy); vector ubo_load_xz = vector(f16tof32(ubo_load & 0xFFFF)); float16_t ubo_load_y = f16tof32(ubo_load[0] >> 16); const uint scalar_offset_1 = ((offset + 8u)) / 4; - uint4 ubo_load_3 = buffer[scalar_offset_1 / 4]; + uint4 ubo_load_3 = data[scalar_offset_1 / 4]; uint2 ubo_load_2 = ((scalar_offset_1 & 2) ? ubo_load_3.zw : ubo_load_3.xy); vector ubo_load_2_xz = vector(f16tof32(ubo_load_2 & 0xFFFF)); float16_t ubo_load_2_y = f16tof32(ubo_load_2[0] >> 16); const uint scalar_offset_2 = ((offset + 16u)) / 4; - uint4 ubo_load_5 = buffer[scalar_offset_2 / 4]; + uint4 ubo_load_5 = data[scalar_offset_2 / 4]; uint2 ubo_load_4 = ((scalar_offset_2 & 2) ? ubo_load_5.zw : ubo_load_5.xy); vector ubo_load_4_xz = vector(f16tof32(ubo_load_4 & 0xFFFF)); float16_t ubo_load_4_y = f16tof32(ubo_load_4[0] >> 16); const uint scalar_offset_3 = ((offset + 24u)) / 4; - uint4 ubo_load_7 = buffer[scalar_offset_3 / 4]; + uint4 ubo_load_7 = data[scalar_offset_3 / 4]; uint2 ubo_load_6 = ((scalar_offset_3 & 2) ? ubo_load_7.zw : ubo_load_7.xy); vector ubo_load_6_xz = vector(f16tof32(ubo_load_6 & 0xFFFF)); float16_t ubo_load_6_y = f16tof32(ubo_load_6[0] >> 16); @@ -30,6 +30,6 @@ void main() { uint2 ubo_load_8 = data[2].xy; vector ubo_load_8_xz = vector(f16tof32(ubo_load_8 & 0xFFFF)); float16_t ubo_load_8_y = f16tof32(ubo_load_8[0] >> 16); - const vector x = mul(tint_symbol_3(data, 0u), vector(ubo_load_8_xz[0], ubo_load_8_y, ubo_load_8_xz[1])); + const vector x = mul(data_load_1(0u), vector(ubo_load_8_xz[0], ubo_load_8_y, ubo_load_8_xz[1])); return; } diff --git a/test/tint/expressions/binary/mul/vec3-mat4x3/f32.wgsl.expected.dxc.hlsl b/test/tint/expressions/binary/mul/vec3-mat4x3/f32.wgsl.expected.dxc.hlsl index 574af42142..8d756d615e 100644 --- a/test/tint/expressions/binary/mul/vec3-mat4x3/f32.wgsl.expected.dxc.hlsl +++ b/test/tint/expressions/binary/mul/vec3-mat4x3/f32.wgsl.expected.dxc.hlsl @@ -2,15 +2,15 @@ cbuffer cbuffer_data : register(b0, space0) { uint4 data[5]; }; -float4x3 tint_symbol_3(uint4 buffer[5], uint offset) { +float4x3 data_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz)); + return float4x3(asfloat(data[scalar_offset / 4].xyz), asfloat(data[scalar_offset_1 / 4].xyz), asfloat(data[scalar_offset_2 / 4].xyz), asfloat(data[scalar_offset_3 / 4].xyz)); } void main() { - const float4 x = mul(tint_symbol_3(data, 0u), asfloat(data[4].xyz)); + const float4 x = mul(data_load_1(0u), asfloat(data[4].xyz)); return; } diff --git a/test/tint/expressions/binary/mul/vec3-mat4x3/f32.wgsl.expected.fxc.hlsl b/test/tint/expressions/binary/mul/vec3-mat4x3/f32.wgsl.expected.fxc.hlsl index 574af42142..8d756d615e 100644 --- a/test/tint/expressions/binary/mul/vec3-mat4x3/f32.wgsl.expected.fxc.hlsl +++ b/test/tint/expressions/binary/mul/vec3-mat4x3/f32.wgsl.expected.fxc.hlsl @@ -2,15 +2,15 @@ cbuffer cbuffer_data : register(b0, space0) { uint4 data[5]; }; -float4x3 tint_symbol_3(uint4 buffer[5], uint offset) { +float4x3 data_load_1(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x3(asfloat(buffer[scalar_offset / 4].xyz), asfloat(buffer[scalar_offset_1 / 4].xyz), asfloat(buffer[scalar_offset_2 / 4].xyz), asfloat(buffer[scalar_offset_3 / 4].xyz)); + return float4x3(asfloat(data[scalar_offset / 4].xyz), asfloat(data[scalar_offset_1 / 4].xyz), asfloat(data[scalar_offset_2 / 4].xyz), asfloat(data[scalar_offset_3 / 4].xyz)); } void main() { - const float4 x = mul(tint_symbol_3(data, 0u), asfloat(data[4].xyz)); + const float4 x = mul(data_load_1(0u), asfloat(data[4].xyz)); return; } diff --git a/test/tint/layout/storage/mat2x2/f32.wgsl.expected.dxc.hlsl b/test/tint/layout/storage/mat2x2/f32.wgsl.expected.dxc.hlsl index 49afc068ce..49bbb8f52b 100644 --- a/test/tint/layout/storage/mat2x2/f32.wgsl.expected.dxc.hlsl +++ b/test/tint/layout/storage/mat2x2/f32.wgsl.expected.dxc.hlsl @@ -1,17 +1,17 @@ RWByteAddressBuffer ssbo : register(u0, space0); -float2x2 tint_symbol(RWByteAddressBuffer buffer, uint offset) { - return float2x2(asfloat(buffer.Load2((offset + 0u))), asfloat(buffer.Load2((offset + 8u)))); +float2x2 ssbo_load(uint offset) { + return float2x2(asfloat(ssbo.Load2((offset + 0u))), asfloat(ssbo.Load2((offset + 8u)))); } -void tint_symbol_2(RWByteAddressBuffer buffer, uint offset, float2x2 value) { - buffer.Store2((offset + 0u), asuint(value[0u])); - buffer.Store2((offset + 8u), asuint(value[1u])); +void ssbo_store(uint offset, float2x2 value) { + ssbo.Store2((offset + 0u), asuint(value[0u])); + ssbo.Store2((offset + 8u), asuint(value[1u])); } [numthreads(1, 1, 1)] void f() { - const float2x2 v = tint_symbol(ssbo, 0u); - tint_symbol_2(ssbo, 0u, v); + const float2x2 v = ssbo_load(0u); + ssbo_store(0u, v); return; } diff --git a/test/tint/layout/storage/mat2x2/f32.wgsl.expected.fxc.hlsl b/test/tint/layout/storage/mat2x2/f32.wgsl.expected.fxc.hlsl index 49afc068ce..49bbb8f52b 100644 --- a/test/tint/layout/storage/mat2x2/f32.wgsl.expected.fxc.hlsl +++ b/test/tint/layout/storage/mat2x2/f32.wgsl.expected.fxc.hlsl @@ -1,17 +1,17 @@ RWByteAddressBuffer ssbo : register(u0, space0); -float2x2 tint_symbol(RWByteAddressBuffer buffer, uint offset) { - return float2x2(asfloat(buffer.Load2((offset + 0u))), asfloat(buffer.Load2((offset + 8u)))); +float2x2 ssbo_load(uint offset) { + return float2x2(asfloat(ssbo.Load2((offset + 0u))), asfloat(ssbo.Load2((offset + 8u)))); } -void tint_symbol_2(RWByteAddressBuffer buffer, uint offset, float2x2 value) { - buffer.Store2((offset + 0u), asuint(value[0u])); - buffer.Store2((offset + 8u), asuint(value[1u])); +void ssbo_store(uint offset, float2x2 value) { + ssbo.Store2((offset + 0u), asuint(value[0u])); + ssbo.Store2((offset + 8u), asuint(value[1u])); } [numthreads(1, 1, 1)] void f() { - const float2x2 v = tint_symbol(ssbo, 0u); - tint_symbol_2(ssbo, 0u, v); + const float2x2 v = ssbo_load(0u); + ssbo_store(0u, v); return; } diff --git a/test/tint/layout/storage/mat2x2/stride/16.spvasm.expected.dxc.hlsl b/test/tint/layout/storage/mat2x2/stride/16.spvasm.expected.dxc.hlsl index 0c201315da..45f02cd634 100644 --- a/test/tint/layout/storage/mat2x2/stride/16.spvasm.expected.dxc.hlsl +++ b/test/tint/layout/storage/mat2x2/stride/16.spvasm.expected.dxc.hlsl @@ -10,45 +10,45 @@ float2x2 arr_to_mat2x2_stride_16(strided_arr arr[2]) { typedef strided_arr mat2x2_stride_16_to_arr_ret[2]; mat2x2_stride_16_to_arr_ret mat2x2_stride_16_to_arr(float2x2 m) { - const strided_arr tint_symbol_7 = {m[0u]}; - const strided_arr tint_symbol_8 = {m[1u]}; - const strided_arr tint_symbol_9[2] = {tint_symbol_7, tint_symbol_8}; - return tint_symbol_9; + const strided_arr tint_symbol_1 = {m[0u]}; + const strided_arr tint_symbol_2 = {m[1u]}; + const strided_arr tint_symbol_3[2] = {tint_symbol_1, tint_symbol_2}; + return tint_symbol_3; } -strided_arr tint_symbol_2(RWByteAddressBuffer buffer, uint offset) { - const strided_arr tint_symbol_10 = {asfloat(buffer.Load2((offset + 0u)))}; - return tint_symbol_10; +strided_arr ssbo_load_1(uint offset) { + const strided_arr tint_symbol_4 = {asfloat(ssbo.Load2((offset + 0u)))}; + return tint_symbol_4; } -typedef strided_arr tint_symbol_1_ret[2]; -tint_symbol_1_ret tint_symbol_1(RWByteAddressBuffer buffer, uint offset) { +typedef strided_arr ssbo_load_ret[2]; +ssbo_load_ret ssbo_load(uint offset) { strided_arr arr_1[2] = (strided_arr[2])0; { for(uint i = 0u; (i < 2u); i = (i + 1u)) { - arr_1[i] = tint_symbol_2(buffer, (offset + (i * 16u))); + arr_1[i] = ssbo_load_1((offset + (i * 16u))); } } return arr_1; } -void tint_symbol_5(RWByteAddressBuffer buffer, uint offset, strided_arr value) { - buffer.Store2((offset + 0u), asuint(value.el)); +void ssbo_store_1(uint offset, strided_arr value) { + ssbo.Store2((offset + 0u), asuint(value.el)); } -void tint_symbol_4(RWByteAddressBuffer buffer, uint offset, strided_arr value[2]) { +void ssbo_store(uint offset, strided_arr value[2]) { strided_arr array_1[2] = value; { for(uint i_1 = 0u; (i_1 < 2u); i_1 = (i_1 + 1u)) { - tint_symbol_5(buffer, (offset + (i_1 * 16u)), array_1[i_1]); + ssbo_store_1((offset + (i_1 * 16u)), array_1[i_1]); } } } void f_1() { - const float2x2 x_15 = arr_to_mat2x2_stride_16(tint_symbol_1(ssbo, 0u)); + const float2x2 x_15 = arr_to_mat2x2_stride_16(ssbo_load(0u)); const strided_arr tint_symbol[2] = mat2x2_stride_16_to_arr(x_15); - tint_symbol_4(ssbo, 0u, tint_symbol); + ssbo_store(0u, tint_symbol); return; } diff --git a/test/tint/layout/storage/mat2x2/stride/16.spvasm.expected.fxc.hlsl b/test/tint/layout/storage/mat2x2/stride/16.spvasm.expected.fxc.hlsl index 0c201315da..45f02cd634 100644 --- a/test/tint/layout/storage/mat2x2/stride/16.spvasm.expected.fxc.hlsl +++ b/test/tint/layout/storage/mat2x2/stride/16.spvasm.expected.fxc.hlsl @@ -10,45 +10,45 @@ float2x2 arr_to_mat2x2_stride_16(strided_arr arr[2]) { typedef strided_arr mat2x2_stride_16_to_arr_ret[2]; mat2x2_stride_16_to_arr_ret mat2x2_stride_16_to_arr(float2x2 m) { - const strided_arr tint_symbol_7 = {m[0u]}; - const strided_arr tint_symbol_8 = {m[1u]}; - const strided_arr tint_symbol_9[2] = {tint_symbol_7, tint_symbol_8}; - return tint_symbol_9; + const strided_arr tint_symbol_1 = {m[0u]}; + const strided_arr tint_symbol_2 = {m[1u]}; + const strided_arr tint_symbol_3[2] = {tint_symbol_1, tint_symbol_2}; + return tint_symbol_3; } -strided_arr tint_symbol_2(RWByteAddressBuffer buffer, uint offset) { - const strided_arr tint_symbol_10 = {asfloat(buffer.Load2((offset + 0u)))}; - return tint_symbol_10; +strided_arr ssbo_load_1(uint offset) { + const strided_arr tint_symbol_4 = {asfloat(ssbo.Load2((offset + 0u)))}; + return tint_symbol_4; } -typedef strided_arr tint_symbol_1_ret[2]; -tint_symbol_1_ret tint_symbol_1(RWByteAddressBuffer buffer, uint offset) { +typedef strided_arr ssbo_load_ret[2]; +ssbo_load_ret ssbo_load(uint offset) { strided_arr arr_1[2] = (strided_arr[2])0; { for(uint i = 0u; (i < 2u); i = (i + 1u)) { - arr_1[i] = tint_symbol_2(buffer, (offset + (i * 16u))); + arr_1[i] = ssbo_load_1((offset + (i * 16u))); } } return arr_1; } -void tint_symbol_5(RWByteAddressBuffer buffer, uint offset, strided_arr value) { - buffer.Store2((offset + 0u), asuint(value.el)); +void ssbo_store_1(uint offset, strided_arr value) { + ssbo.Store2((offset + 0u), asuint(value.el)); } -void tint_symbol_4(RWByteAddressBuffer buffer, uint offset, strided_arr value[2]) { +void ssbo_store(uint offset, strided_arr value[2]) { strided_arr array_1[2] = value; { for(uint i_1 = 0u; (i_1 < 2u); i_1 = (i_1 + 1u)) { - tint_symbol_5(buffer, (offset + (i_1 * 16u)), array_1[i_1]); + ssbo_store_1((offset + (i_1 * 16u)), array_1[i_1]); } } } void f_1() { - const float2x2 x_15 = arr_to_mat2x2_stride_16(tint_symbol_1(ssbo, 0u)); + const float2x2 x_15 = arr_to_mat2x2_stride_16(ssbo_load(0u)); const strided_arr tint_symbol[2] = mat2x2_stride_16_to_arr(x_15); - tint_symbol_4(ssbo, 0u, tint_symbol); + ssbo_store(0u, tint_symbol); return; } diff --git a/test/tint/ptr_ref/load/param/storage/array_in_struct.wgsl.expected.dxc.hlsl b/test/tint/ptr_ref/load/param/storage/array_in_struct.wgsl.expected.dxc.hlsl index a3f14afa13..efd7af4cc5 100644 --- a/test/tint/ptr_ref/load/param/storage/array_in_struct.wgsl.expected.dxc.hlsl +++ b/test/tint/ptr_ref/load/param/storage/array_in_struct.wgsl.expected.dxc.hlsl @@ -1,11 +1,11 @@ ByteAddressBuffer S : register(t0, space0); -typedef int tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(ByteAddressBuffer buffer, uint offset) { +typedef int S_load_ret[4]; +S_load_ret S_load(uint offset) { int arr_1[4] = (int[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr_1[i] = asint(buffer.Load((offset + (i * 4u)))); + arr_1[i] = asint(S.Load((offset + (i * 4u)))); } } return arr_1; @@ -13,7 +13,7 @@ tint_symbol_ret tint_symbol(ByteAddressBuffer buffer, uint offset) { typedef int func_S_arr_ret[4]; func_S_arr_ret func_S_arr() { - return tint_symbol(S, 0u); + return S_load(0u); } [numthreads(1, 1, 1)] diff --git a/test/tint/ptr_ref/load/param/storage/array_in_struct.wgsl.expected.fxc.hlsl b/test/tint/ptr_ref/load/param/storage/array_in_struct.wgsl.expected.fxc.hlsl index a3f14afa13..efd7af4cc5 100644 --- a/test/tint/ptr_ref/load/param/storage/array_in_struct.wgsl.expected.fxc.hlsl +++ b/test/tint/ptr_ref/load/param/storage/array_in_struct.wgsl.expected.fxc.hlsl @@ -1,11 +1,11 @@ ByteAddressBuffer S : register(t0, space0); -typedef int tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(ByteAddressBuffer buffer, uint offset) { +typedef int S_load_ret[4]; +S_load_ret S_load(uint offset) { int arr_1[4] = (int[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - arr_1[i] = asint(buffer.Load((offset + (i * 4u)))); + arr_1[i] = asint(S.Load((offset + (i * 4u)))); } } return arr_1; @@ -13,7 +13,7 @@ tint_symbol_ret tint_symbol(ByteAddressBuffer buffer, uint offset) { typedef int func_S_arr_ret[4]; func_S_arr_ret func_S_arr() { - return tint_symbol(S, 0u); + return S_load(0u); } [numthreads(1, 1, 1)] diff --git a/test/tint/ptr_ref/load/param/storage/struct_in_array.wgsl.expected.dxc.hlsl b/test/tint/ptr_ref/load/param/storage/struct_in_array.wgsl.expected.dxc.hlsl index 05f09cb9ff..d12626f8ed 100644 --- a/test/tint/ptr_ref/load/param/storage/struct_in_array.wgsl.expected.dxc.hlsl +++ b/test/tint/ptr_ref/load/param/storage/struct_in_array.wgsl.expected.dxc.hlsl @@ -4,18 +4,18 @@ struct str { ByteAddressBuffer S : register(t0, space0); -str tint_symbol(ByteAddressBuffer buffer, uint offset) { - const str tint_symbol_2 = {asint(buffer.Load((offset + 0u)))}; - return tint_symbol_2; +str S_load(uint offset) { + const str tint_symbol = {asint(S.Load((offset + 0u)))}; + return tint_symbol; } str func_S_X(uint pointer[1]) { - return tint_symbol(S, (4u * pointer[0])); + return S_load((4u * pointer[0])); } [numthreads(1, 1, 1)] void main() { - const uint tint_symbol_3[1] = {2u}; - const str r = func_S_X(tint_symbol_3); + const uint tint_symbol_1[1] = {2u}; + const str r = func_S_X(tint_symbol_1); return; } diff --git a/test/tint/ptr_ref/load/param/storage/struct_in_array.wgsl.expected.fxc.hlsl b/test/tint/ptr_ref/load/param/storage/struct_in_array.wgsl.expected.fxc.hlsl index 05f09cb9ff..d12626f8ed 100644 --- a/test/tint/ptr_ref/load/param/storage/struct_in_array.wgsl.expected.fxc.hlsl +++ b/test/tint/ptr_ref/load/param/storage/struct_in_array.wgsl.expected.fxc.hlsl @@ -4,18 +4,18 @@ struct str { ByteAddressBuffer S : register(t0, space0); -str tint_symbol(ByteAddressBuffer buffer, uint offset) { - const str tint_symbol_2 = {asint(buffer.Load((offset + 0u)))}; - return tint_symbol_2; +str S_load(uint offset) { + const str tint_symbol = {asint(S.Load((offset + 0u)))}; + return tint_symbol; } str func_S_X(uint pointer[1]) { - return tint_symbol(S, (4u * pointer[0])); + return S_load((4u * pointer[0])); } [numthreads(1, 1, 1)] void main() { - const uint tint_symbol_3[1] = {2u}; - const str r = func_S_X(tint_symbol_3); + const uint tint_symbol_1[1] = {2u}; + const str r = func_S_X(tint_symbol_1); return; } diff --git a/test/tint/ptr_ref/load/param/storage/vec2_f32_in_mat2x2.wgsl.expected.dxc.hlsl b/test/tint/ptr_ref/load/param/storage/vec2_f32_in_mat2x2.wgsl.expected.dxc.hlsl index 809f70e402..eba873200e 100644 --- a/test/tint/ptr_ref/load/param/storage/vec2_f32_in_mat2x2.wgsl.expected.dxc.hlsl +++ b/test/tint/ptr_ref/load/param/storage/vec2_f32_in_mat2x2.wgsl.expected.dxc.hlsl @@ -6,7 +6,7 @@ float2 func_S_X(uint pointer[1]) { [numthreads(1, 1, 1)] void main() { - const uint tint_symbol_1[1] = {1u}; - const float2 r = func_S_X(tint_symbol_1); + const uint tint_symbol[1] = {1u}; + const float2 r = func_S_X(tint_symbol); return; } diff --git a/test/tint/ptr_ref/load/param/storage/vec2_f32_in_mat2x2.wgsl.expected.fxc.hlsl b/test/tint/ptr_ref/load/param/storage/vec2_f32_in_mat2x2.wgsl.expected.fxc.hlsl index 809f70e402..eba873200e 100644 --- a/test/tint/ptr_ref/load/param/storage/vec2_f32_in_mat2x2.wgsl.expected.fxc.hlsl +++ b/test/tint/ptr_ref/load/param/storage/vec2_f32_in_mat2x2.wgsl.expected.fxc.hlsl @@ -6,7 +6,7 @@ float2 func_S_X(uint pointer[1]) { [numthreads(1, 1, 1)] void main() { - const uint tint_symbol_1[1] = {1u}; - const float2 r = func_S_X(tint_symbol_1); + const uint tint_symbol[1] = {1u}; + const float2 r = func_S_X(tint_symbol); return; } diff --git a/test/tint/ptr_ref/load/param/storage/vec4_f32_in_mat2x4.wgsl.expected.dxc.hlsl b/test/tint/ptr_ref/load/param/storage/vec4_f32_in_mat2x4.wgsl.expected.dxc.hlsl index 10793c7129..c0b633a2e9 100644 --- a/test/tint/ptr_ref/load/param/storage/vec4_f32_in_mat2x4.wgsl.expected.dxc.hlsl +++ b/test/tint/ptr_ref/load/param/storage/vec4_f32_in_mat2x4.wgsl.expected.dxc.hlsl @@ -6,7 +6,7 @@ float4 func_S_X(uint pointer[1]) { [numthreads(1, 1, 1)] void main() { - const uint tint_symbol_1[1] = {1u}; - const float4 r = func_S_X(tint_symbol_1); + const uint tint_symbol[1] = {1u}; + const float4 r = func_S_X(tint_symbol); return; } diff --git a/test/tint/ptr_ref/load/param/storage/vec4_f32_in_mat2x4.wgsl.expected.fxc.hlsl b/test/tint/ptr_ref/load/param/storage/vec4_f32_in_mat2x4.wgsl.expected.fxc.hlsl index 10793c7129..c0b633a2e9 100644 --- a/test/tint/ptr_ref/load/param/storage/vec4_f32_in_mat2x4.wgsl.expected.fxc.hlsl +++ b/test/tint/ptr_ref/load/param/storage/vec4_f32_in_mat2x4.wgsl.expected.fxc.hlsl @@ -6,7 +6,7 @@ float4 func_S_X(uint pointer[1]) { [numthreads(1, 1, 1)] void main() { - const uint tint_symbol_1[1] = {1u}; - const float4 r = func_S_X(tint_symbol_1); + const uint tint_symbol[1] = {1u}; + const float4 r = func_S_X(tint_symbol); return; } diff --git a/test/tint/ptr_ref/load/param/uniform/array_in_struct.wgsl.expected.dxc.hlsl b/test/tint/ptr_ref/load/param/uniform/array_in_struct.wgsl.expected.dxc.hlsl index df6d009399..a228d97d4c 100644 --- a/test/tint/ptr_ref/load/param/uniform/array_in_struct.wgsl.expected.dxc.hlsl +++ b/test/tint/ptr_ref/load/param/uniform/array_in_struct.wgsl.expected.dxc.hlsl @@ -2,13 +2,13 @@ cbuffer cbuffer_S : register(b0, space0) { uint4 S[4]; }; -typedef int4 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[4], uint offset) { +typedef int4 S_load_ret[4]; +S_load_ret S_load(uint offset) { int4 arr_1[4] = (int4[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { const uint scalar_offset = ((offset + (i * 16u))) / 4; - arr_1[i] = asint(buffer[scalar_offset / 4]); + arr_1[i] = asint(S[scalar_offset / 4]); } } return arr_1; @@ -16,7 +16,7 @@ tint_symbol_ret tint_symbol(uint4 buffer[4], uint offset) { typedef int4 func_S_arr_ret[4]; func_S_arr_ret func_S_arr() { - return tint_symbol(S, 0u); + return S_load(0u); } [numthreads(1, 1, 1)] diff --git a/test/tint/ptr_ref/load/param/uniform/array_in_struct.wgsl.expected.fxc.hlsl b/test/tint/ptr_ref/load/param/uniform/array_in_struct.wgsl.expected.fxc.hlsl index df6d009399..a228d97d4c 100644 --- a/test/tint/ptr_ref/load/param/uniform/array_in_struct.wgsl.expected.fxc.hlsl +++ b/test/tint/ptr_ref/load/param/uniform/array_in_struct.wgsl.expected.fxc.hlsl @@ -2,13 +2,13 @@ cbuffer cbuffer_S : register(b0, space0) { uint4 S[4]; }; -typedef int4 tint_symbol_ret[4]; -tint_symbol_ret tint_symbol(uint4 buffer[4], uint offset) { +typedef int4 S_load_ret[4]; +S_load_ret S_load(uint offset) { int4 arr_1[4] = (int4[4])0; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { const uint scalar_offset = ((offset + (i * 16u))) / 4; - arr_1[i] = asint(buffer[scalar_offset / 4]); + arr_1[i] = asint(S[scalar_offset / 4]); } } return arr_1; @@ -16,7 +16,7 @@ tint_symbol_ret tint_symbol(uint4 buffer[4], uint offset) { typedef int4 func_S_arr_ret[4]; func_S_arr_ret func_S_arr() { - return tint_symbol(S, 0u); + return S_load(0u); } [numthreads(1, 1, 1)] diff --git a/test/tint/ptr_ref/load/param/uniform/struct_in_array.wgsl.expected.dxc.hlsl b/test/tint/ptr_ref/load/param/uniform/struct_in_array.wgsl.expected.dxc.hlsl index cea8a9a44f..e8b9f2b902 100644 --- a/test/tint/ptr_ref/load/param/uniform/struct_in_array.wgsl.expected.dxc.hlsl +++ b/test/tint/ptr_ref/load/param/uniform/struct_in_array.wgsl.expected.dxc.hlsl @@ -6,19 +6,19 @@ cbuffer cbuffer_S : register(b0, space0) { uint4 S[4]; }; -str tint_symbol(uint4 buffer[4], uint offset) { +str S_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - const str tint_symbol_2 = {asint(buffer[scalar_offset / 4])}; - return tint_symbol_2; + const str tint_symbol = {asint(S[scalar_offset / 4])}; + return tint_symbol; } str func_S_X(uint pointer[1]) { - return tint_symbol(S, (16u * pointer[0])); + return S_load((16u * pointer[0])); } [numthreads(1, 1, 1)] void main() { - const uint tint_symbol_3[1] = {2u}; - const str r = func_S_X(tint_symbol_3); + const uint tint_symbol_1[1] = {2u}; + const str r = func_S_X(tint_symbol_1); return; } diff --git a/test/tint/ptr_ref/load/param/uniform/struct_in_array.wgsl.expected.fxc.hlsl b/test/tint/ptr_ref/load/param/uniform/struct_in_array.wgsl.expected.fxc.hlsl index cea8a9a44f..e8b9f2b902 100644 --- a/test/tint/ptr_ref/load/param/uniform/struct_in_array.wgsl.expected.fxc.hlsl +++ b/test/tint/ptr_ref/load/param/uniform/struct_in_array.wgsl.expected.fxc.hlsl @@ -6,19 +6,19 @@ cbuffer cbuffer_S : register(b0, space0) { uint4 S[4]; }; -str tint_symbol(uint4 buffer[4], uint offset) { +str S_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; - const str tint_symbol_2 = {asint(buffer[scalar_offset / 4])}; - return tint_symbol_2; + const str tint_symbol = {asint(S[scalar_offset / 4])}; + return tint_symbol; } str func_S_X(uint pointer[1]) { - return tint_symbol(S, (16u * pointer[0])); + return S_load((16u * pointer[0])); } [numthreads(1, 1, 1)] void main() { - const uint tint_symbol_3[1] = {2u}; - const str r = func_S_X(tint_symbol_3); + const uint tint_symbol_1[1] = {2u}; + const str r = func_S_X(tint_symbol_1); return; } diff --git a/test/tint/ptr_ref/load/param/uniform/vec2_f32_in_mat2x2.wgsl.expected.dxc.hlsl b/test/tint/ptr_ref/load/param/uniform/vec2_f32_in_mat2x2.wgsl.expected.dxc.hlsl index 7718f577c4..73428f2cff 100644 --- a/test/tint/ptr_ref/load/param/uniform/vec2_f32_in_mat2x2.wgsl.expected.dxc.hlsl +++ b/test/tint/ptr_ref/load/param/uniform/vec2_f32_in_mat2x2.wgsl.expected.dxc.hlsl @@ -10,7 +10,7 @@ float2 func_S_X(uint pointer[1]) { [numthreads(1, 1, 1)] void main() { - const uint tint_symbol_1[1] = {1u}; - const float2 r = func_S_X(tint_symbol_1); + const uint tint_symbol[1] = {1u}; + const float2 r = func_S_X(tint_symbol); return; } diff --git a/test/tint/ptr_ref/load/param/uniform/vec2_f32_in_mat2x2.wgsl.expected.fxc.hlsl b/test/tint/ptr_ref/load/param/uniform/vec2_f32_in_mat2x2.wgsl.expected.fxc.hlsl index 7718f577c4..73428f2cff 100644 --- a/test/tint/ptr_ref/load/param/uniform/vec2_f32_in_mat2x2.wgsl.expected.fxc.hlsl +++ b/test/tint/ptr_ref/load/param/uniform/vec2_f32_in_mat2x2.wgsl.expected.fxc.hlsl @@ -10,7 +10,7 @@ float2 func_S_X(uint pointer[1]) { [numthreads(1, 1, 1)] void main() { - const uint tint_symbol_1[1] = {1u}; - const float2 r = func_S_X(tint_symbol_1); + const uint tint_symbol[1] = {1u}; + const float2 r = func_S_X(tint_symbol); return; } diff --git a/test/tint/ptr_ref/load/param/uniform/vec4_f32_in_mat2x4.wgsl.expected.dxc.hlsl b/test/tint/ptr_ref/load/param/uniform/vec4_f32_in_mat2x4.wgsl.expected.dxc.hlsl index 8aeba474ea..f3acebf394 100644 --- a/test/tint/ptr_ref/load/param/uniform/vec4_f32_in_mat2x4.wgsl.expected.dxc.hlsl +++ b/test/tint/ptr_ref/load/param/uniform/vec4_f32_in_mat2x4.wgsl.expected.dxc.hlsl @@ -9,7 +9,7 @@ float4 func_S_X(uint pointer[1]) { [numthreads(1, 1, 1)] void main() { - const uint tint_symbol_1[1] = {1u}; - const float4 r = func_S_X(tint_symbol_1); + const uint tint_symbol[1] = {1u}; + const float4 r = func_S_X(tint_symbol); return; } diff --git a/test/tint/ptr_ref/load/param/uniform/vec4_f32_in_mat2x4.wgsl.expected.fxc.hlsl b/test/tint/ptr_ref/load/param/uniform/vec4_f32_in_mat2x4.wgsl.expected.fxc.hlsl index 8aeba474ea..f3acebf394 100644 --- a/test/tint/ptr_ref/load/param/uniform/vec4_f32_in_mat2x4.wgsl.expected.fxc.hlsl +++ b/test/tint/ptr_ref/load/param/uniform/vec4_f32_in_mat2x4.wgsl.expected.fxc.hlsl @@ -9,7 +9,7 @@ float4 func_S_X(uint pointer[1]) { [numthreads(1, 1, 1)] void main() { - const uint tint_symbol_1[1] = {1u}; - const float4 r = func_S_X(tint_symbol_1); + const uint tint_symbol[1] = {1u}; + const float4 r = func_S_X(tint_symbol); return; } diff --git a/test/tint/ptr_ref/store/param/storage/array_in_struct.wgsl.expected.dxc.hlsl b/test/tint/ptr_ref/store/param/storage/array_in_struct.wgsl.expected.dxc.hlsl index 517d789014..4cbff97837 100644 --- a/test/tint/ptr_ref/store/param/storage/array_in_struct.wgsl.expected.dxc.hlsl +++ b/test/tint/ptr_ref/store/param/storage/array_in_struct.wgsl.expected.dxc.hlsl @@ -1,17 +1,17 @@ RWByteAddressBuffer S : register(u0, space0); -void tint_symbol(RWByteAddressBuffer buffer, uint offset, int value[4]) { +void S_store(uint offset, int value[4]) { int array_1[4] = value; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - buffer.Store((offset + (i * 4u)), asuint(array_1[i])); + S.Store((offset + (i * 4u)), asuint(array_1[i])); } } } void func_S_arr() { - const int tint_symbol_2[4] = (int[4])0; - tint_symbol(S, 0u, tint_symbol_2); + const int tint_symbol[4] = (int[4])0; + S_store(0u, tint_symbol); } [numthreads(1, 1, 1)] diff --git a/test/tint/ptr_ref/store/param/storage/array_in_struct.wgsl.expected.fxc.hlsl b/test/tint/ptr_ref/store/param/storage/array_in_struct.wgsl.expected.fxc.hlsl index 517d789014..4cbff97837 100644 --- a/test/tint/ptr_ref/store/param/storage/array_in_struct.wgsl.expected.fxc.hlsl +++ b/test/tint/ptr_ref/store/param/storage/array_in_struct.wgsl.expected.fxc.hlsl @@ -1,17 +1,17 @@ RWByteAddressBuffer S : register(u0, space0); -void tint_symbol(RWByteAddressBuffer buffer, uint offset, int value[4]) { +void S_store(uint offset, int value[4]) { int array_1[4] = value; { for(uint i = 0u; (i < 4u); i = (i + 1u)) { - buffer.Store((offset + (i * 4u)), asuint(array_1[i])); + S.Store((offset + (i * 4u)), asuint(array_1[i])); } } } void func_S_arr() { - const int tint_symbol_2[4] = (int[4])0; - tint_symbol(S, 0u, tint_symbol_2); + const int tint_symbol[4] = (int[4])0; + S_store(0u, tint_symbol); } [numthreads(1, 1, 1)] diff --git a/test/tint/ptr_ref/store/param/storage/struct_in_array.wgsl.expected.dxc.hlsl b/test/tint/ptr_ref/store/param/storage/struct_in_array.wgsl.expected.dxc.hlsl index b51e632b52..19a8f15981 100644 --- a/test/tint/ptr_ref/store/param/storage/struct_in_array.wgsl.expected.dxc.hlsl +++ b/test/tint/ptr_ref/store/param/storage/struct_in_array.wgsl.expected.dxc.hlsl @@ -4,18 +4,18 @@ struct str { RWByteAddressBuffer S : register(u0, space0); -void tint_symbol(RWByteAddressBuffer buffer, uint offset, str value) { - buffer.Store((offset + 0u), asuint(value.i)); +void S_store(uint offset, str value) { + S.Store((offset + 0u), asuint(value.i)); } void func_S_X(uint pointer[1]) { - const str tint_symbol_2 = (str)0; - tint_symbol(S, (4u * pointer[0]), tint_symbol_2); + const str tint_symbol = (str)0; + S_store((4u * pointer[0]), tint_symbol); } [numthreads(1, 1, 1)] void main() { - const uint tint_symbol_3[1] = {2u}; - func_S_X(tint_symbol_3); + const uint tint_symbol_1[1] = {2u}; + func_S_X(tint_symbol_1); return; } diff --git a/test/tint/ptr_ref/store/param/storage/struct_in_array.wgsl.expected.fxc.hlsl b/test/tint/ptr_ref/store/param/storage/struct_in_array.wgsl.expected.fxc.hlsl index b51e632b52..19a8f15981 100644 --- a/test/tint/ptr_ref/store/param/storage/struct_in_array.wgsl.expected.fxc.hlsl +++ b/test/tint/ptr_ref/store/param/storage/struct_in_array.wgsl.expected.fxc.hlsl @@ -4,18 +4,18 @@ struct str { RWByteAddressBuffer S : register(u0, space0); -void tint_symbol(RWByteAddressBuffer buffer, uint offset, str value) { - buffer.Store((offset + 0u), asuint(value.i)); +void S_store(uint offset, str value) { + S.Store((offset + 0u), asuint(value.i)); } void func_S_X(uint pointer[1]) { - const str tint_symbol_2 = (str)0; - tint_symbol(S, (4u * pointer[0]), tint_symbol_2); + const str tint_symbol = (str)0; + S_store((4u * pointer[0]), tint_symbol); } [numthreads(1, 1, 1)] void main() { - const uint tint_symbol_3[1] = {2u}; - func_S_X(tint_symbol_3); + const uint tint_symbol_1[1] = {2u}; + func_S_X(tint_symbol_1); return; } diff --git a/test/tint/ptr_ref/store/param/storage/vec2_f32_in_mat2x2.wgsl.expected.dxc.hlsl b/test/tint/ptr_ref/store/param/storage/vec2_f32_in_mat2x2.wgsl.expected.dxc.hlsl index c2a926b447..5f9ff67078 100644 --- a/test/tint/ptr_ref/store/param/storage/vec2_f32_in_mat2x2.wgsl.expected.dxc.hlsl +++ b/test/tint/ptr_ref/store/param/storage/vec2_f32_in_mat2x2.wgsl.expected.dxc.hlsl @@ -6,7 +6,7 @@ void func_S_X(uint pointer[1]) { [numthreads(1, 1, 1)] void main() { - const uint tint_symbol_1[1] = {1u}; - func_S_X(tint_symbol_1); + const uint tint_symbol[1] = {1u}; + func_S_X(tint_symbol); return; } diff --git a/test/tint/ptr_ref/store/param/storage/vec2_f32_in_mat2x2.wgsl.expected.fxc.hlsl b/test/tint/ptr_ref/store/param/storage/vec2_f32_in_mat2x2.wgsl.expected.fxc.hlsl index c2a926b447..5f9ff67078 100644 --- a/test/tint/ptr_ref/store/param/storage/vec2_f32_in_mat2x2.wgsl.expected.fxc.hlsl +++ b/test/tint/ptr_ref/store/param/storage/vec2_f32_in_mat2x2.wgsl.expected.fxc.hlsl @@ -6,7 +6,7 @@ void func_S_X(uint pointer[1]) { [numthreads(1, 1, 1)] void main() { - const uint tint_symbol_1[1] = {1u}; - func_S_X(tint_symbol_1); + const uint tint_symbol[1] = {1u}; + func_S_X(tint_symbol); return; } diff --git a/test/tint/ptr_ref/store/param/storage/vec4_f32_in_mat2x4.wgsl.expected.dxc.hlsl b/test/tint/ptr_ref/store/param/storage/vec4_f32_in_mat2x4.wgsl.expected.dxc.hlsl index a345b7a06f..b5e0a29db4 100644 --- a/test/tint/ptr_ref/store/param/storage/vec4_f32_in_mat2x4.wgsl.expected.dxc.hlsl +++ b/test/tint/ptr_ref/store/param/storage/vec4_f32_in_mat2x4.wgsl.expected.dxc.hlsl @@ -6,7 +6,7 @@ void func_S_X(uint pointer[1]) { [numthreads(1, 1, 1)] void main() { - const uint tint_symbol_1[1] = {1u}; - func_S_X(tint_symbol_1); + const uint tint_symbol[1] = {1u}; + func_S_X(tint_symbol); return; } diff --git a/test/tint/ptr_ref/store/param/storage/vec4_f32_in_mat2x4.wgsl.expected.fxc.hlsl b/test/tint/ptr_ref/store/param/storage/vec4_f32_in_mat2x4.wgsl.expected.fxc.hlsl index a345b7a06f..b5e0a29db4 100644 --- a/test/tint/ptr_ref/store/param/storage/vec4_f32_in_mat2x4.wgsl.expected.fxc.hlsl +++ b/test/tint/ptr_ref/store/param/storage/vec4_f32_in_mat2x4.wgsl.expected.fxc.hlsl @@ -6,7 +6,7 @@ void func_S_X(uint pointer[1]) { [numthreads(1, 1, 1)] void main() { - const uint tint_symbol_1[1] = {1u}; - func_S_X(tint_symbol_1); + const uint tint_symbol[1] = {1u}; + func_S_X(tint_symbol); return; } diff --git a/test/tint/samples/cube.wgsl.expected.dxc.hlsl b/test/tint/samples/cube.wgsl.expected.dxc.hlsl index 82af450e84..833e31755e 100644 --- a/test/tint/samples/cube.wgsl.expected.dxc.hlsl +++ b/test/tint/samples/cube.wgsl.expected.dxc.hlsl @@ -19,24 +19,24 @@ struct tint_symbol_2 { float4 Position : SV_Position; }; -float4x4 tint_symbol_6(uint4 buffer[4], uint offset) { +float4x4 uniforms_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]), asfloat(buffer[scalar_offset_3 / 4])); + return float4x4(asfloat(uniforms[scalar_offset / 4]), asfloat(uniforms[scalar_offset_1 / 4]), asfloat(uniforms[scalar_offset_2 / 4]), asfloat(uniforms[scalar_offset_3 / 4])); } VertexOutput vtx_main_inner(VertexInput input) { VertexOutput output = (VertexOutput)0; - output.Position = mul(input.cur_position, tint_symbol_6(uniforms, 0u)); + output.Position = mul(input.cur_position, uniforms_load(0u)); output.vtxFragColor = input.color; return output; } tint_symbol_2 vtx_main(tint_symbol_1 tint_symbol) { - const VertexInput tint_symbol_8 = {tint_symbol.cur_position, tint_symbol.color}; - const VertexOutput inner_result = vtx_main_inner(tint_symbol_8); + const VertexInput tint_symbol_6 = {tint_symbol.cur_position, tint_symbol.color}; + const VertexOutput inner_result = vtx_main_inner(tint_symbol_6); tint_symbol_2 wrapper_result = (tint_symbol_2)0; wrapper_result.vtxFragColor = inner_result.vtxFragColor; wrapper_result.Position = inner_result.Position; diff --git a/test/tint/samples/cube.wgsl.expected.fxc.hlsl b/test/tint/samples/cube.wgsl.expected.fxc.hlsl index 82af450e84..833e31755e 100644 --- a/test/tint/samples/cube.wgsl.expected.fxc.hlsl +++ b/test/tint/samples/cube.wgsl.expected.fxc.hlsl @@ -19,24 +19,24 @@ struct tint_symbol_2 { float4 Position : SV_Position; }; -float4x4 tint_symbol_6(uint4 buffer[4], uint offset) { +float4x4 uniforms_load(uint offset) { const uint scalar_offset = ((offset + 0u)) / 4; const uint scalar_offset_1 = ((offset + 16u)) / 4; const uint scalar_offset_2 = ((offset + 32u)) / 4; const uint scalar_offset_3 = ((offset + 48u)) / 4; - return float4x4(asfloat(buffer[scalar_offset / 4]), asfloat(buffer[scalar_offset_1 / 4]), asfloat(buffer[scalar_offset_2 / 4]), asfloat(buffer[scalar_offset_3 / 4])); + return float4x4(asfloat(uniforms[scalar_offset / 4]), asfloat(uniforms[scalar_offset_1 / 4]), asfloat(uniforms[scalar_offset_2 / 4]), asfloat(uniforms[scalar_offset_3 / 4])); } VertexOutput vtx_main_inner(VertexInput input) { VertexOutput output = (VertexOutput)0; - output.Position = mul(input.cur_position, tint_symbol_6(uniforms, 0u)); + output.Position = mul(input.cur_position, uniforms_load(0u)); output.vtxFragColor = input.color; return output; } tint_symbol_2 vtx_main(tint_symbol_1 tint_symbol) { - const VertexInput tint_symbol_8 = {tint_symbol.cur_position, tint_symbol.color}; - const VertexOutput inner_result = vtx_main_inner(tint_symbol_8); + const VertexInput tint_symbol_6 = {tint_symbol.cur_position, tint_symbol.color}; + const VertexOutput inner_result = vtx_main_inner(tint_symbol_6); tint_symbol_2 wrapper_result = (tint_symbol_2)0; wrapper_result.vtxFragColor = inner_result.vtxFragColor; wrapper_result.Position = inner_result.Position; diff --git a/test/tint/shader_io/compute_input_builtins_struct.wgsl.expected.dxc.hlsl b/test/tint/shader_io/compute_input_builtins_struct.wgsl.expected.dxc.hlsl index 783117eb83..d3dd9c3061 100644 --- a/test/tint/shader_io/compute_input_builtins_struct.wgsl.expected.dxc.hlsl +++ b/test/tint/shader_io/compute_input_builtins_struct.wgsl.expected.dxc.hlsl @@ -22,7 +22,7 @@ void main_inner(ComputeInputs inputs) { [numthreads(1, 1, 1)] void main(tint_symbol_1 tint_symbol) { - const ComputeInputs tint_symbol_5 = {tint_symbol.local_invocation_id, tint_symbol.local_invocation_index, tint_symbol.global_invocation_id, tint_symbol.workgroup_id, tint_symbol_3[0].xyz}; - main_inner(tint_symbol_5); + const ComputeInputs tint_symbol_4 = {tint_symbol.local_invocation_id, tint_symbol.local_invocation_index, tint_symbol.global_invocation_id, tint_symbol.workgroup_id, tint_symbol_3[0].xyz}; + main_inner(tint_symbol_4); return; } diff --git a/test/tint/shader_io/compute_input_builtins_struct.wgsl.expected.fxc.hlsl b/test/tint/shader_io/compute_input_builtins_struct.wgsl.expected.fxc.hlsl index 783117eb83..d3dd9c3061 100644 --- a/test/tint/shader_io/compute_input_builtins_struct.wgsl.expected.fxc.hlsl +++ b/test/tint/shader_io/compute_input_builtins_struct.wgsl.expected.fxc.hlsl @@ -22,7 +22,7 @@ void main_inner(ComputeInputs inputs) { [numthreads(1, 1, 1)] void main(tint_symbol_1 tint_symbol) { - const ComputeInputs tint_symbol_5 = {tint_symbol.local_invocation_id, tint_symbol.local_invocation_index, tint_symbol.global_invocation_id, tint_symbol.workgroup_id, tint_symbol_3[0].xyz}; - main_inner(tint_symbol_5); + const ComputeInputs tint_symbol_4 = {tint_symbol.local_invocation_id, tint_symbol.local_invocation_index, tint_symbol.global_invocation_id, tint_symbol.workgroup_id, tint_symbol_3[0].xyz}; + main_inner(tint_symbol_4); return; } diff --git a/test/tint/shader_io/shared_struct_storage_buffer.wgsl.expected.dxc.hlsl b/test/tint/shader_io/shared_struct_storage_buffer.wgsl.expected.dxc.hlsl index 45c61bb370..6922096c62 100644 --- a/test/tint/shader_io/shared_struct_storage_buffer.wgsl.expected.dxc.hlsl +++ b/test/tint/shader_io/shared_struct_storage_buffer.wgsl.expected.dxc.hlsl @@ -12,21 +12,21 @@ struct tint_symbol_1 { float4 v : SV_Position; }; -void tint_symbol_2(RWByteAddressBuffer buffer, uint offset, S value) { - buffer.Store((offset + 0u), asuint(value.f)); - buffer.Store((offset + 4u), asuint(value.u)); - buffer.Store4((offset + 128u), asuint(value.v)); +void output_store(uint offset, S value) { + output.Store((offset + 0u), asuint(value.f)); + output.Store((offset + 4u), asuint(value.u)); + output.Store4((offset + 128u), asuint(value.v)); } void frag_main_inner(S input) { const float f = input.f; const uint u = input.u; const float4 v = input.v; - tint_symbol_2(output, 0u, input); + output_store(0u, input); } void frag_main(tint_symbol_1 tint_symbol) { - const S tint_symbol_6 = {tint_symbol.f, tint_symbol.u, tint_symbol.v}; - frag_main_inner(tint_symbol_6); + const S tint_symbol_2 = {tint_symbol.f, tint_symbol.u, tint_symbol.v}; + frag_main_inner(tint_symbol_2); return; } diff --git a/test/tint/shader_io/shared_struct_storage_buffer.wgsl.expected.fxc.hlsl b/test/tint/shader_io/shared_struct_storage_buffer.wgsl.expected.fxc.hlsl index 45c61bb370..6922096c62 100644 --- a/test/tint/shader_io/shared_struct_storage_buffer.wgsl.expected.fxc.hlsl +++ b/test/tint/shader_io/shared_struct_storage_buffer.wgsl.expected.fxc.hlsl @@ -12,21 +12,21 @@ struct tint_symbol_1 { float4 v : SV_Position; }; -void tint_symbol_2(RWByteAddressBuffer buffer, uint offset, S value) { - buffer.Store((offset + 0u), asuint(value.f)); - buffer.Store((offset + 4u), asuint(value.u)); - buffer.Store4((offset + 128u), asuint(value.v)); +void output_store(uint offset, S value) { + output.Store((offset + 0u), asuint(value.f)); + output.Store((offset + 4u), asuint(value.u)); + output.Store4((offset + 128u), asuint(value.v)); } void frag_main_inner(S input) { const float f = input.f; const uint u = input.u; const float4 v = input.v; - tint_symbol_2(output, 0u, input); + output_store(0u, input); } void frag_main(tint_symbol_1 tint_symbol) { - const S tint_symbol_6 = {tint_symbol.f, tint_symbol.u, tint_symbol.v}; - frag_main_inner(tint_symbol_6); + const S tint_symbol_2 = {tint_symbol.f, tint_symbol.u, tint_symbol.v}; + frag_main_inner(tint_symbol_2); return; } diff --git a/test/tint/shader_io/shared_struct_storage_buffer_f16.wgsl.expected.dxc.hlsl b/test/tint/shader_io/shared_struct_storage_buffer_f16.wgsl.expected.dxc.hlsl index 614cc724bd..16d985212c 100644 --- a/test/tint/shader_io/shared_struct_storage_buffer_f16.wgsl.expected.dxc.hlsl +++ b/test/tint/shader_io/shared_struct_storage_buffer_f16.wgsl.expected.dxc.hlsl @@ -16,12 +16,12 @@ struct tint_symbol_1 { float4 v : SV_Position; }; -void tint_symbol_2(RWByteAddressBuffer buffer, uint offset, S value) { - buffer.Store((offset + 0u), asuint(value.f)); - buffer.Store((offset + 4u), asuint(value.u)); - buffer.Store4((offset + 128u), asuint(value.v)); - buffer.Store((offset + 160u), value.x); - buffer.Store >((offset + 192u), value.y); +void output_store(uint offset, S value) { + output.Store((offset + 0u), asuint(value.f)); + output.Store((offset + 4u), asuint(value.u)); + output.Store4((offset + 128u), asuint(value.v)); + output.Store((offset + 160u), value.x); + output.Store >((offset + 192u), value.y); } void frag_main_inner(S input) { @@ -30,11 +30,11 @@ void frag_main_inner(S input) { const float4 v = input.v; const float16_t x = input.x; const vector y = input.y; - tint_symbol_2(output, 0u, input); + output_store(0u, input); } void frag_main(tint_symbol_1 tint_symbol) { - const S tint_symbol_8 = {tint_symbol.f, tint_symbol.u, tint_symbol.v, tint_symbol.x, tint_symbol.y}; - frag_main_inner(tint_symbol_8); + const S tint_symbol_2 = {tint_symbol.f, tint_symbol.u, tint_symbol.v, tint_symbol.x, tint_symbol.y}; + frag_main_inner(tint_symbol_2); return; } diff --git a/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_dynamic_array.wgsl.expected.dxc.hlsl b/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_dynamic_array.wgsl.expected.dxc.hlsl index 4ae06055e9..9413d565a2 100644 --- a/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_dynamic_array.wgsl.expected.dxc.hlsl +++ b/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_dynamic_array.wgsl.expected.dxc.hlsl @@ -7,13 +7,13 @@ cbuffer cbuffer_uniforms : register(b4, space1) { }; RWByteAddressBuffer s1 : register(u0, space0); -void tint_symbol_1(RWByteAddressBuffer buffer, uint offset, InnerS value) { - buffer.Store((offset + 0u), asuint(value.v)); +void s1_store(uint offset, InnerS value) { + s1.Store((offset + 0u), asuint(value.v)); } [numthreads(1, 1, 1)] void main() { InnerS v = (InnerS)0; - tint_symbol_1(s1, (4u * uniforms[0].x), v); + s1_store((4u * uniforms[0].x), v); return; } diff --git a/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_dynamic_array.wgsl.expected.fxc.hlsl b/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_dynamic_array.wgsl.expected.fxc.hlsl index 4ae06055e9..9413d565a2 100644 --- a/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_dynamic_array.wgsl.expected.fxc.hlsl +++ b/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_dynamic_array.wgsl.expected.fxc.hlsl @@ -7,13 +7,13 @@ cbuffer cbuffer_uniforms : register(b4, space1) { }; RWByteAddressBuffer s1 : register(u0, space0); -void tint_symbol_1(RWByteAddressBuffer buffer, uint offset, InnerS value) { - buffer.Store((offset + 0u), asuint(value.v)); +void s1_store(uint offset, InnerS value) { + s1.Store((offset + 0u), asuint(value.v)); } [numthreads(1, 1, 1)] void main() { InnerS v = (InnerS)0; - tint_symbol_1(s1, (4u * uniforms[0].x), v); + s1_store((4u * uniforms[0].x), v); return; } diff --git a/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_dynamic_array_struct_array.wgsl.expected.dxc.hlsl b/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_dynamic_array_struct_array.wgsl.expected.dxc.hlsl index 222fd91b33..ed3e737b54 100644 --- a/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_dynamic_array_struct_array.wgsl.expected.dxc.hlsl +++ b/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_dynamic_array_struct_array.wgsl.expected.dxc.hlsl @@ -7,13 +7,13 @@ cbuffer cbuffer_uniforms : register(b4, space1) { }; RWByteAddressBuffer s : register(u0, space0); -void tint_symbol_1(RWByteAddressBuffer buffer, uint offset, InnerS value) { - buffer.Store((offset + 0u), asuint(value.v)); +void s_store(uint offset, InnerS value) { + s.Store((offset + 0u), asuint(value.v)); } [numthreads(1, 1, 1)] void main() { InnerS v = (InnerS)0; - tint_symbol_1(s, ((32u * uniforms[0].x) + (4u * uniforms[0].y)), v); + s_store(((32u * uniforms[0].x) + (4u * uniforms[0].y)), v); return; } diff --git a/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_dynamic_array_struct_array.wgsl.expected.fxc.hlsl b/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_dynamic_array_struct_array.wgsl.expected.fxc.hlsl index 222fd91b33..ed3e737b54 100644 --- a/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_dynamic_array_struct_array.wgsl.expected.fxc.hlsl +++ b/test/tint/statements/assign/indexed_assign_to_array_in_struct/struct_dynamic_array_struct_array.wgsl.expected.fxc.hlsl @@ -7,13 +7,13 @@ cbuffer cbuffer_uniforms : register(b4, space1) { }; RWByteAddressBuffer s : register(u0, space0); -void tint_symbol_1(RWByteAddressBuffer buffer, uint offset, InnerS value) { - buffer.Store((offset + 0u), asuint(value.v)); +void s_store(uint offset, InnerS value) { + s.Store((offset + 0u), asuint(value.v)); } [numthreads(1, 1, 1)] void main() { InnerS v = (InnerS)0; - tint_symbol_1(s, ((32u * uniforms[0].x) + (4u * uniforms[0].y)), v); + s_store(((32u * uniforms[0].x) + (4u * uniforms[0].y)), v); return; } diff --git a/test/tint/statements/compound_assign/matrix/minus.wgsl.expected.dxc.hlsl b/test/tint/statements/compound_assign/matrix/minus.wgsl.expected.dxc.hlsl index 6b0784defc..2fabef2d49 100644 --- a/test/tint/statements/compound_assign/matrix/minus.wgsl.expected.dxc.hlsl +++ b/test/tint/statements/compound_assign/matrix/minus.wgsl.expected.dxc.hlsl @@ -5,17 +5,17 @@ void unused_entry_point() { RWByteAddressBuffer v : register(u0, space0); -void tint_symbol(RWByteAddressBuffer buffer, uint offset, float4x4 value) { - buffer.Store4((offset + 0u), asuint(value[0u])); - buffer.Store4((offset + 16u), asuint(value[1u])); - buffer.Store4((offset + 32u), asuint(value[2u])); - buffer.Store4((offset + 48u), asuint(value[3u])); +void v_store(uint offset, float4x4 value) { + v.Store4((offset + 0u), asuint(value[0u])); + v.Store4((offset + 16u), asuint(value[1u])); + v.Store4((offset + 32u), asuint(value[2u])); + v.Store4((offset + 48u), asuint(value[3u])); } -float4x4 tint_symbol_2(RWByteAddressBuffer buffer, uint offset) { - return float4x4(asfloat(buffer.Load4((offset + 0u))), asfloat(buffer.Load4((offset + 16u))), asfloat(buffer.Load4((offset + 32u))), asfloat(buffer.Load4((offset + 48u)))); +float4x4 v_load(uint offset) { + return float4x4(asfloat(v.Load4((offset + 0u))), asfloat(v.Load4((offset + 16u))), asfloat(v.Load4((offset + 32u))), asfloat(v.Load4((offset + 48u)))); } void foo() { - tint_symbol(v, 0u, (tint_symbol_2(v, 0u) - float4x4((0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx))); + v_store(0u, (v_load(0u) - float4x4((0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx))); } diff --git a/test/tint/statements/compound_assign/matrix/minus.wgsl.expected.fxc.hlsl b/test/tint/statements/compound_assign/matrix/minus.wgsl.expected.fxc.hlsl index 6b0784defc..2fabef2d49 100644 --- a/test/tint/statements/compound_assign/matrix/minus.wgsl.expected.fxc.hlsl +++ b/test/tint/statements/compound_assign/matrix/minus.wgsl.expected.fxc.hlsl @@ -5,17 +5,17 @@ void unused_entry_point() { RWByteAddressBuffer v : register(u0, space0); -void tint_symbol(RWByteAddressBuffer buffer, uint offset, float4x4 value) { - buffer.Store4((offset + 0u), asuint(value[0u])); - buffer.Store4((offset + 16u), asuint(value[1u])); - buffer.Store4((offset + 32u), asuint(value[2u])); - buffer.Store4((offset + 48u), asuint(value[3u])); +void v_store(uint offset, float4x4 value) { + v.Store4((offset + 0u), asuint(value[0u])); + v.Store4((offset + 16u), asuint(value[1u])); + v.Store4((offset + 32u), asuint(value[2u])); + v.Store4((offset + 48u), asuint(value[3u])); } -float4x4 tint_symbol_2(RWByteAddressBuffer buffer, uint offset) { - return float4x4(asfloat(buffer.Load4((offset + 0u))), asfloat(buffer.Load4((offset + 16u))), asfloat(buffer.Load4((offset + 32u))), asfloat(buffer.Load4((offset + 48u)))); +float4x4 v_load(uint offset) { + return float4x4(asfloat(v.Load4((offset + 0u))), asfloat(v.Load4((offset + 16u))), asfloat(v.Load4((offset + 32u))), asfloat(v.Load4((offset + 48u)))); } void foo() { - tint_symbol(v, 0u, (tint_symbol_2(v, 0u) - float4x4((0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx))); + v_store(0u, (v_load(0u) - float4x4((0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx))); } diff --git a/test/tint/statements/compound_assign/matrix/plus.wgsl.expected.dxc.hlsl b/test/tint/statements/compound_assign/matrix/plus.wgsl.expected.dxc.hlsl index efa7687a93..ccd7bc0e24 100644 --- a/test/tint/statements/compound_assign/matrix/plus.wgsl.expected.dxc.hlsl +++ b/test/tint/statements/compound_assign/matrix/plus.wgsl.expected.dxc.hlsl @@ -5,17 +5,17 @@ void unused_entry_point() { RWByteAddressBuffer v : register(u0, space0); -void tint_symbol(RWByteAddressBuffer buffer, uint offset, float4x4 value) { - buffer.Store4((offset + 0u), asuint(value[0u])); - buffer.Store4((offset + 16u), asuint(value[1u])); - buffer.Store4((offset + 32u), asuint(value[2u])); - buffer.Store4((offset + 48u), asuint(value[3u])); +void v_store(uint offset, float4x4 value) { + v.Store4((offset + 0u), asuint(value[0u])); + v.Store4((offset + 16u), asuint(value[1u])); + v.Store4((offset + 32u), asuint(value[2u])); + v.Store4((offset + 48u), asuint(value[3u])); } -float4x4 tint_symbol_2(RWByteAddressBuffer buffer, uint offset) { - return float4x4(asfloat(buffer.Load4((offset + 0u))), asfloat(buffer.Load4((offset + 16u))), asfloat(buffer.Load4((offset + 32u))), asfloat(buffer.Load4((offset + 48u)))); +float4x4 v_load(uint offset) { + return float4x4(asfloat(v.Load4((offset + 0u))), asfloat(v.Load4((offset + 16u))), asfloat(v.Load4((offset + 32u))), asfloat(v.Load4((offset + 48u)))); } void foo() { - tint_symbol(v, 0u, (tint_symbol_2(v, 0u) + float4x4((0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx))); + v_store(0u, (v_load(0u) + float4x4((0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx))); } diff --git a/test/tint/statements/compound_assign/matrix/plus.wgsl.expected.fxc.hlsl b/test/tint/statements/compound_assign/matrix/plus.wgsl.expected.fxc.hlsl index efa7687a93..ccd7bc0e24 100644 --- a/test/tint/statements/compound_assign/matrix/plus.wgsl.expected.fxc.hlsl +++ b/test/tint/statements/compound_assign/matrix/plus.wgsl.expected.fxc.hlsl @@ -5,17 +5,17 @@ void unused_entry_point() { RWByteAddressBuffer v : register(u0, space0); -void tint_symbol(RWByteAddressBuffer buffer, uint offset, float4x4 value) { - buffer.Store4((offset + 0u), asuint(value[0u])); - buffer.Store4((offset + 16u), asuint(value[1u])); - buffer.Store4((offset + 32u), asuint(value[2u])); - buffer.Store4((offset + 48u), asuint(value[3u])); +void v_store(uint offset, float4x4 value) { + v.Store4((offset + 0u), asuint(value[0u])); + v.Store4((offset + 16u), asuint(value[1u])); + v.Store4((offset + 32u), asuint(value[2u])); + v.Store4((offset + 48u), asuint(value[3u])); } -float4x4 tint_symbol_2(RWByteAddressBuffer buffer, uint offset) { - return float4x4(asfloat(buffer.Load4((offset + 0u))), asfloat(buffer.Load4((offset + 16u))), asfloat(buffer.Load4((offset + 32u))), asfloat(buffer.Load4((offset + 48u)))); +float4x4 v_load(uint offset) { + return float4x4(asfloat(v.Load4((offset + 0u))), asfloat(v.Load4((offset + 16u))), asfloat(v.Load4((offset + 32u))), asfloat(v.Load4((offset + 48u)))); } void foo() { - tint_symbol(v, 0u, (tint_symbol_2(v, 0u) + float4x4((0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx))); + v_store(0u, (v_load(0u) + float4x4((0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx))); } diff --git a/test/tint/statements/compound_assign/matrix/times-scalar.wgsl.expected.dxc.hlsl b/test/tint/statements/compound_assign/matrix/times-scalar.wgsl.expected.dxc.hlsl index 24236fdc85..a5678ded6e 100644 --- a/test/tint/statements/compound_assign/matrix/times-scalar.wgsl.expected.dxc.hlsl +++ b/test/tint/statements/compound_assign/matrix/times-scalar.wgsl.expected.dxc.hlsl @@ -5,17 +5,17 @@ void unused_entry_point() { RWByteAddressBuffer v : register(u0, space0); -void tint_symbol(RWByteAddressBuffer buffer, uint offset, float4x4 value) { - buffer.Store4((offset + 0u), asuint(value[0u])); - buffer.Store4((offset + 16u), asuint(value[1u])); - buffer.Store4((offset + 32u), asuint(value[2u])); - buffer.Store4((offset + 48u), asuint(value[3u])); +void v_store(uint offset, float4x4 value) { + v.Store4((offset + 0u), asuint(value[0u])); + v.Store4((offset + 16u), asuint(value[1u])); + v.Store4((offset + 32u), asuint(value[2u])); + v.Store4((offset + 48u), asuint(value[3u])); } -float4x4 tint_symbol_2(RWByteAddressBuffer buffer, uint offset) { - return float4x4(asfloat(buffer.Load4((offset + 0u))), asfloat(buffer.Load4((offset + 16u))), asfloat(buffer.Load4((offset + 32u))), asfloat(buffer.Load4((offset + 48u)))); +float4x4 v_load(uint offset) { + return float4x4(asfloat(v.Load4((offset + 0u))), asfloat(v.Load4((offset + 16u))), asfloat(v.Load4((offset + 32u))), asfloat(v.Load4((offset + 48u)))); } void foo() { - tint_symbol(v, 0u, (tint_symbol_2(v, 0u) * 2.0f)); + v_store(0u, (v_load(0u) * 2.0f)); } diff --git a/test/tint/statements/compound_assign/matrix/times-scalar.wgsl.expected.fxc.hlsl b/test/tint/statements/compound_assign/matrix/times-scalar.wgsl.expected.fxc.hlsl index 24236fdc85..a5678ded6e 100644 --- a/test/tint/statements/compound_assign/matrix/times-scalar.wgsl.expected.fxc.hlsl +++ b/test/tint/statements/compound_assign/matrix/times-scalar.wgsl.expected.fxc.hlsl @@ -5,17 +5,17 @@ void unused_entry_point() { RWByteAddressBuffer v : register(u0, space0); -void tint_symbol(RWByteAddressBuffer buffer, uint offset, float4x4 value) { - buffer.Store4((offset + 0u), asuint(value[0u])); - buffer.Store4((offset + 16u), asuint(value[1u])); - buffer.Store4((offset + 32u), asuint(value[2u])); - buffer.Store4((offset + 48u), asuint(value[3u])); +void v_store(uint offset, float4x4 value) { + v.Store4((offset + 0u), asuint(value[0u])); + v.Store4((offset + 16u), asuint(value[1u])); + v.Store4((offset + 32u), asuint(value[2u])); + v.Store4((offset + 48u), asuint(value[3u])); } -float4x4 tint_symbol_2(RWByteAddressBuffer buffer, uint offset) { - return float4x4(asfloat(buffer.Load4((offset + 0u))), asfloat(buffer.Load4((offset + 16u))), asfloat(buffer.Load4((offset + 32u))), asfloat(buffer.Load4((offset + 48u)))); +float4x4 v_load(uint offset) { + return float4x4(asfloat(v.Load4((offset + 0u))), asfloat(v.Load4((offset + 16u))), asfloat(v.Load4((offset + 32u))), asfloat(v.Load4((offset + 48u)))); } void foo() { - tint_symbol(v, 0u, (tint_symbol_2(v, 0u) * 2.0f)); + v_store(0u, (v_load(0u) * 2.0f)); } diff --git a/test/tint/statements/compound_assign/matrix/times.wgsl.expected.dxc.hlsl b/test/tint/statements/compound_assign/matrix/times.wgsl.expected.dxc.hlsl index 05313f1946..5aee6d4f65 100644 --- a/test/tint/statements/compound_assign/matrix/times.wgsl.expected.dxc.hlsl +++ b/test/tint/statements/compound_assign/matrix/times.wgsl.expected.dxc.hlsl @@ -5,17 +5,17 @@ void unused_entry_point() { RWByteAddressBuffer v : register(u0, space0); -void tint_symbol(RWByteAddressBuffer buffer, uint offset, float4x4 value) { - buffer.Store4((offset + 0u), asuint(value[0u])); - buffer.Store4((offset + 16u), asuint(value[1u])); - buffer.Store4((offset + 32u), asuint(value[2u])); - buffer.Store4((offset + 48u), asuint(value[3u])); +void v_store(uint offset, float4x4 value) { + v.Store4((offset + 0u), asuint(value[0u])); + v.Store4((offset + 16u), asuint(value[1u])); + v.Store4((offset + 32u), asuint(value[2u])); + v.Store4((offset + 48u), asuint(value[3u])); } -float4x4 tint_symbol_2(RWByteAddressBuffer buffer, uint offset) { - return float4x4(asfloat(buffer.Load4((offset + 0u))), asfloat(buffer.Load4((offset + 16u))), asfloat(buffer.Load4((offset + 32u))), asfloat(buffer.Load4((offset + 48u)))); +float4x4 v_load(uint offset) { + return float4x4(asfloat(v.Load4((offset + 0u))), asfloat(v.Load4((offset + 16u))), asfloat(v.Load4((offset + 32u))), asfloat(v.Load4((offset + 48u)))); } void foo() { - tint_symbol(v, 0u, mul(float4x4((0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx), tint_symbol_2(v, 0u))); + v_store(0u, mul(float4x4((0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx), v_load(0u))); } diff --git a/test/tint/statements/compound_assign/matrix/times.wgsl.expected.fxc.hlsl b/test/tint/statements/compound_assign/matrix/times.wgsl.expected.fxc.hlsl index 05313f1946..5aee6d4f65 100644 --- a/test/tint/statements/compound_assign/matrix/times.wgsl.expected.fxc.hlsl +++ b/test/tint/statements/compound_assign/matrix/times.wgsl.expected.fxc.hlsl @@ -5,17 +5,17 @@ void unused_entry_point() { RWByteAddressBuffer v : register(u0, space0); -void tint_symbol(RWByteAddressBuffer buffer, uint offset, float4x4 value) { - buffer.Store4((offset + 0u), asuint(value[0u])); - buffer.Store4((offset + 16u), asuint(value[1u])); - buffer.Store4((offset + 32u), asuint(value[2u])); - buffer.Store4((offset + 48u), asuint(value[3u])); +void v_store(uint offset, float4x4 value) { + v.Store4((offset + 0u), asuint(value[0u])); + v.Store4((offset + 16u), asuint(value[1u])); + v.Store4((offset + 32u), asuint(value[2u])); + v.Store4((offset + 48u), asuint(value[3u])); } -float4x4 tint_symbol_2(RWByteAddressBuffer buffer, uint offset) { - return float4x4(asfloat(buffer.Load4((offset + 0u))), asfloat(buffer.Load4((offset + 16u))), asfloat(buffer.Load4((offset + 32u))), asfloat(buffer.Load4((offset + 48u)))); +float4x4 v_load(uint offset) { + return float4x4(asfloat(v.Load4((offset + 0u))), asfloat(v.Load4((offset + 16u))), asfloat(v.Load4((offset + 32u))), asfloat(v.Load4((offset + 48u)))); } void foo() { - tint_symbol(v, 0u, mul(float4x4((0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx), tint_symbol_2(v, 0u))); + v_store(0u, mul(float4x4((0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx, (0.0f).xxxx), v_load(0u))); } diff --git a/test/tint/statements/discard/atomic_cmpxchg.wgsl.expected.dxc.hlsl b/test/tint/statements/discard/atomic_cmpxchg.wgsl.expected.dxc.hlsl index ed03b3f20e..a7d7fd2a69 100644 --- a/test/tint/statements/discard/atomic_cmpxchg.wgsl.expected.dxc.hlsl +++ b/test/tint/statements/discard/atomic_cmpxchg.wgsl.expected.dxc.hlsl @@ -15,9 +15,9 @@ struct atomic_compare_exchange_weak_ret_type { bool exchanged; }; -atomic_compare_exchange_weak_ret_type tint_atomicCompareExchangeWeak(RWByteAddressBuffer buffer, uint offset, int compare, int value) { +atomic_compare_exchange_weak_ret_type aatomicCompareExchangeWeak(uint offset, int compare, int value) { atomic_compare_exchange_weak_ret_type result=(atomic_compare_exchange_weak_ret_type)0; - buffer.InterlockedCompareExchange(offset, compare, value, result.old_value); + a.InterlockedCompareExchange(offset, compare, value, result.old_value); result.exchanged = result.old_value == compare; return result; } @@ -28,7 +28,7 @@ int foo_inner() { int x = 0; tint_symbol_2 tint_symbol_1 = (tint_symbol_2)0; if (!(tint_discarded)) { - const atomic_compare_exchange_weak_ret_type tint_symbol_3 = tint_atomicCompareExchangeWeak(a, 0u, 0, 1); + const atomic_compare_exchange_weak_ret_type tint_symbol_3 = aatomicCompareExchangeWeak(0u, 0, 1); tint_symbol_1.old_value = tint_symbol_3.old_value; tint_symbol_1.exchanged = tint_symbol_3.exchanged; } diff --git a/test/tint/statements/discard/atomic_cmpxchg.wgsl.expected.fxc.hlsl b/test/tint/statements/discard/atomic_cmpxchg.wgsl.expected.fxc.hlsl index ed03b3f20e..a7d7fd2a69 100644 --- a/test/tint/statements/discard/atomic_cmpxchg.wgsl.expected.fxc.hlsl +++ b/test/tint/statements/discard/atomic_cmpxchg.wgsl.expected.fxc.hlsl @@ -15,9 +15,9 @@ struct atomic_compare_exchange_weak_ret_type { bool exchanged; }; -atomic_compare_exchange_weak_ret_type tint_atomicCompareExchangeWeak(RWByteAddressBuffer buffer, uint offset, int compare, int value) { +atomic_compare_exchange_weak_ret_type aatomicCompareExchangeWeak(uint offset, int compare, int value) { atomic_compare_exchange_weak_ret_type result=(atomic_compare_exchange_weak_ret_type)0; - buffer.InterlockedCompareExchange(offset, compare, value, result.old_value); + a.InterlockedCompareExchange(offset, compare, value, result.old_value); result.exchanged = result.old_value == compare; return result; } @@ -28,7 +28,7 @@ int foo_inner() { int x = 0; tint_symbol_2 tint_symbol_1 = (tint_symbol_2)0; if (!(tint_discarded)) { - const atomic_compare_exchange_weak_ret_type tint_symbol_3 = tint_atomicCompareExchangeWeak(a, 0u, 0, 1); + const atomic_compare_exchange_weak_ret_type tint_symbol_3 = aatomicCompareExchangeWeak(0u, 0, 1); tint_symbol_1.old_value = tint_symbol_3.old_value; tint_symbol_1.exchanged = tint_symbol_3.exchanged; } diff --git a/test/tint/statements/discard/atomic_in_for_loop_continuing.wgsl.expected.dxc.hlsl b/test/tint/statements/discard/atomic_in_for_loop_continuing.wgsl.expected.dxc.hlsl index 44d8b38244..abd1ed8eea 100644 --- a/test/tint/statements/discard/atomic_in_for_loop_continuing.wgsl.expected.dxc.hlsl +++ b/test/tint/statements/discard/atomic_in_for_loop_continuing.wgsl.expected.dxc.hlsl @@ -11,9 +11,9 @@ struct tint_symbol_3 { int value : SV_Target0; }; -int tint_atomicAdd(RWByteAddressBuffer buffer, uint offset, int value) { +int aatomicAdd(uint offset, int value) { int original_value = 0; - buffer.InterlockedAdd(offset, value, original_value); + a.InterlockedAdd(offset, value, original_value); return original_value; } @@ -35,7 +35,7 @@ int foo_inner(float tint_symbol, float2 coord) { { int tint_symbol_4 = 0; if (!(tint_discarded)) { - tint_symbol_4 = tint_atomicAdd(a, 0u, 1); + tint_symbol_4 = aatomicAdd(0u, 1); } i = tint_symbol_4; } diff --git a/test/tint/statements/discard/atomic_in_for_loop_continuing.wgsl.expected.fxc.hlsl b/test/tint/statements/discard/atomic_in_for_loop_continuing.wgsl.expected.fxc.hlsl index 44d8b38244..abd1ed8eea 100644 --- a/test/tint/statements/discard/atomic_in_for_loop_continuing.wgsl.expected.fxc.hlsl +++ b/test/tint/statements/discard/atomic_in_for_loop_continuing.wgsl.expected.fxc.hlsl @@ -11,9 +11,9 @@ struct tint_symbol_3 { int value : SV_Target0; }; -int tint_atomicAdd(RWByteAddressBuffer buffer, uint offset, int value) { +int aatomicAdd(uint offset, int value) { int original_value = 0; - buffer.InterlockedAdd(offset, value, original_value); + a.InterlockedAdd(offset, value, original_value); return original_value; } @@ -35,7 +35,7 @@ int foo_inner(float tint_symbol, float2 coord) { { int tint_symbol_4 = 0; if (!(tint_discarded)) { - tint_symbol_4 = tint_atomicAdd(a, 0u, 1); + tint_symbol_4 = aatomicAdd(0u, 1); } i = tint_symbol_4; }