tint/resolver: forbid spelling non-instantiable pointer types
Fixed: tint:1553 Change-Id: Ib77777a7142d302fe2d0d083de601f7b5042ad6a Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/111881 Commit-Queue: Ben Clayton <bclayton@google.com> Kokoro: Ben Clayton <bclayton@google.com> Reviewed-by: David Neto <dneto@google.com>
This commit is contained in:
parent
29e4e07542
commit
d205b716ca
File diff suppressed because it is too large
Load Diff
|
@ -26,49 +26,52 @@ using namespace tint::number_suffixes; // NOLINT
|
|||
using ResolverHostShareableValidationTest = ResolverTest;
|
||||
|
||||
TEST_F(ResolverHostShareableValidationTest, BoolMember) {
|
||||
auto* s = Structure("S", utils::Vector{Member(Source{{12, 34}}, "x", ty.bool_())});
|
||||
auto* s =
|
||||
Structure("S", utils::Vector{Member(Source{{56, 78}}, "x", ty.bool_(Source{{12, 34}}))});
|
||||
|
||||
GlobalVar(Source{{56, 78}}, "g", ty.Of(s), ast::AddressSpace::kStorage, ast::Access::kRead,
|
||||
GlobalVar(Source{{90, 12}}, "g", ty.Of(s), ast::AddressSpace::kStorage, ast::Access::kRead,
|
||||
Binding(0_a), Group(0_a));
|
||||
|
||||
ASSERT_FALSE(r()->Resolve());
|
||||
|
||||
EXPECT_EQ(
|
||||
r()->error(),
|
||||
R"(56:78 error: Type 'bool' cannot be used in address space 'storage' as it is non-host-shareable
|
||||
12:34 note: while analyzing structure member S.x
|
||||
56:78 note: while instantiating 'var' g)");
|
||||
R"(12:34 error: Type 'bool' cannot be used in address space 'storage' as it is non-host-shareable
|
||||
56:78 note: while analyzing structure member S.x
|
||||
90:12 note: while instantiating 'var' g)");
|
||||
}
|
||||
|
||||
TEST_F(ResolverHostShareableValidationTest, BoolVectorMember) {
|
||||
auto* s = Structure("S", utils::Vector{Member(Source{{12, 34}}, "x", ty.vec3<bool>())});
|
||||
auto* s = Structure(
|
||||
"S", utils::Vector{Member(Source{{56, 78}}, "x", ty.vec3<bool>(Source{{12, 34}}))});
|
||||
|
||||
GlobalVar(Source{{56, 78}}, "g", ty.Of(s), ast::AddressSpace::kStorage, ast::Access::kRead,
|
||||
GlobalVar(Source{{90, 12}}, "g", ty.Of(s), ast::AddressSpace::kStorage, ast::Access::kRead,
|
||||
Binding(0_a), Group(0_a));
|
||||
|
||||
ASSERT_FALSE(r()->Resolve());
|
||||
|
||||
EXPECT_EQ(
|
||||
r()->error(),
|
||||
R"(56:78 error: Type 'vec3<bool>' cannot be used in address space 'storage' as it is non-host-shareable
|
||||
12:34 note: while analyzing structure member S.x
|
||||
56:78 note: while instantiating 'var' g)");
|
||||
R"(12:34 error: Type 'vec3<bool>' cannot be used in address space 'storage' as it is non-host-shareable
|
||||
56:78 note: while analyzing structure member S.x
|
||||
90:12 note: while instantiating 'var' g)");
|
||||
}
|
||||
|
||||
TEST_F(ResolverHostShareableValidationTest, Aliases) {
|
||||
auto* a1 = Alias("a1", ty.bool_());
|
||||
auto* s = Structure("S", utils::Vector{Member(Source{{12, 34}}, "x", ty.Of(a1))});
|
||||
Alias("a1", ty.bool_());
|
||||
auto* s = Structure(
|
||||
"S", utils::Vector{Member(Source{{56, 78}}, "x", ty.type_name(Source{{12, 34}}, "a1"))});
|
||||
auto* a2 = Alias("a2", ty.Of(s));
|
||||
GlobalVar(Source{{56, 78}}, "g", ty.Of(a2), ast::AddressSpace::kStorage, ast::Access::kRead,
|
||||
GlobalVar(Source{{90, 12}}, "g", ty.Of(a2), ast::AddressSpace::kStorage, ast::Access::kRead,
|
||||
Binding(0_a), Group(0_a));
|
||||
|
||||
ASSERT_FALSE(r()->Resolve());
|
||||
|
||||
EXPECT_EQ(
|
||||
r()->error(),
|
||||
R"(56:78 error: Type 'bool' cannot be used in address space 'storage' as it is non-host-shareable
|
||||
12:34 note: while analyzing structure member S.x
|
||||
56:78 note: while instantiating 'var' g)");
|
||||
R"(12:34 error: Type 'bool' cannot be used in address space 'storage' as it is non-host-shareable
|
||||
56:78 note: while analyzing structure member S.x
|
||||
90:12 note: while instantiating 'var' g)");
|
||||
}
|
||||
|
||||
TEST_F(ResolverHostShareableValidationTest, NestedStructures) {
|
||||
|
@ -85,7 +88,7 @@ TEST_F(ResolverHostShareableValidationTest, NestedStructures) {
|
|||
|
||||
EXPECT_EQ(
|
||||
r()->error(),
|
||||
R"(9:10 error: Type 'bool' cannot be used in address space 'storage' as it is non-host-shareable
|
||||
R"(error: Type 'bool' cannot be used in address space 'storage' as it is non-host-shareable
|
||||
1:2 note: while analyzing structure member I1.x
|
||||
3:4 note: while analyzing structure member I2.y
|
||||
5:6 note: while analyzing structure member I3.z
|
||||
|
|
|
@ -262,7 +262,18 @@ sem::Type* Resolver::Type(const ast::Type* ty) {
|
|||
if (access == ast::Access::kUndefined) {
|
||||
access = DefaultAccessForAddressSpace(t->address_space);
|
||||
}
|
||||
return builder_->create<sem::Pointer>(el, t->address_space, access);
|
||||
auto ptr = builder_->create<sem::Pointer>(el, t->address_space, access);
|
||||
if (!ptr) {
|
||||
return nullptr;
|
||||
}
|
||||
if (!validator_.Pointer(t, ptr)) {
|
||||
return nullptr;
|
||||
}
|
||||
if (!ApplyAddressSpaceUsageToType(t->address_space, el, t->type->source)) {
|
||||
AddNote("while instantiating " + builder_->FriendlyName(ptr), t->source);
|
||||
return nullptr;
|
||||
}
|
||||
return ptr;
|
||||
}
|
||||
return nullptr;
|
||||
},
|
||||
|
@ -625,7 +636,8 @@ sem::Variable* Resolver::Var(const ast::Var* var, bool is_global) {
|
|||
|
||||
auto* var_ty = builder_->create<sem::Reference>(storage_ty, address_space, access);
|
||||
|
||||
if (!ApplyAddressSpaceUsageToType(address_space, var_ty, var->source)) {
|
||||
if (!ApplyAddressSpaceUsageToType(address_space, var_ty,
|
||||
var->type ? var->type->source : var->source)) {
|
||||
AddNote("while instantiating 'var' " + builder_->Symbols().NameFor(var->symbol),
|
||||
var->source);
|
||||
return nullptr;
|
||||
|
@ -727,7 +739,7 @@ sem::Parameter* Resolver::Parameter(const ast::Parameter* param, uint32_t index)
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
if (!ApplyAddressSpaceUsageToType(ast::AddressSpace::kNone, ty, param->source)) {
|
||||
if (!ApplyAddressSpaceUsageToType(ast::AddressSpace::kNone, ty, param->type->source)) {
|
||||
add_note();
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -3562,12 +3574,14 @@ bool Resolver::ApplyAddressSpaceUsageToType(ast::AddressSpace address_space,
|
|||
str->AddUsage(address_space);
|
||||
|
||||
for (auto* member : str->Members()) {
|
||||
if (!ApplyAddressSpaceUsageToType(address_space, const_cast<sem::Type*>(member->Type()),
|
||||
usage)) {
|
||||
auto decl = member->Declaration();
|
||||
if (decl &&
|
||||
!ApplyAddressSpaceUsageToType(address_space, const_cast<sem::Type*>(member->Type()),
|
||||
decl->type->source)) {
|
||||
std::stringstream err;
|
||||
err << "while analyzing structure member " << sem_.TypeNameOf(str) << "."
|
||||
<< builder_->Symbols().NameFor(member->Declaration()->symbol);
|
||||
AddNote(err.str(), member->Declaration()->source);
|
||||
<< builder_->Symbols().NameFor(decl->symbol);
|
||||
AddNote(err.str(), decl->source);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -608,7 +608,7 @@ struct DataType<ptr<T>> {
|
|||
/// @return a new AST alias type
|
||||
static inline const ast::Type* AST(ProgramBuilder& b) {
|
||||
return b.create<ast::Pointer>(DataType<T>::AST(b), ast::AddressSpace::kPrivate,
|
||||
ast::Access::kReadWrite);
|
||||
ast::Access::kUndefined);
|
||||
}
|
||||
/// @param b the ProgramBuilder
|
||||
/// @return the semantic aliased type
|
||||
|
|
|
@ -321,12 +321,11 @@ TEST_F(ResolverTypeValidationTest, ArraySize_UnderElementCountLimit) {
|
|||
|
||||
TEST_F(ResolverTypeValidationTest, ArraySize_OverElementCountLimit) {
|
||||
// var<private> a : array<f32, 65536>;
|
||||
GlobalVar(Source{{1, 2}}, "a",
|
||||
ty.array(Source{{12, 34}}, ty.f32(), Expr(Source{{12, 34}}, 65536_a)),
|
||||
GlobalVar(Source{{56, 78}}, "a", ty.array(Source{{12, 34}}, ty.f32(), Expr(65536_a)),
|
||||
ast::AddressSpace::kPrivate);
|
||||
EXPECT_FALSE(r()->Resolve());
|
||||
EXPECT_EQ(r()->error(), R"(1:2 error: array count (65536) must be less than 65536
|
||||
1:2 note: while instantiating 'var' a)");
|
||||
EXPECT_EQ(r()->error(), R"(12:34 error: array count (65536) must be less than 65536
|
||||
56:78 note: while instantiating 'var' a)");
|
||||
}
|
||||
|
||||
TEST_F(ResolverTypeValidationTest, ArraySize_StorageBufferLargeArray) {
|
||||
|
@ -569,7 +568,7 @@ TEST_F(ResolverTypeValidationTest, RuntimeArrayInFunction_Fail) {
|
|||
/// @vertex
|
||||
// fn func() { var a : array<i32>; }
|
||||
|
||||
auto* var = Var(Source{{12, 34}}, "a", ty.array<i32>());
|
||||
auto* var = Var(Source{{56, 78}}, "a", ty.array(Source{{12, 34}}, ty.i32()));
|
||||
|
||||
Func("func", utils::Empty, ty.void_(),
|
||||
utils::Vector{
|
||||
|
@ -582,7 +581,7 @@ TEST_F(ResolverTypeValidationTest, RuntimeArrayInFunction_Fail) {
|
|||
EXPECT_FALSE(r()->Resolve());
|
||||
EXPECT_EQ(r()->error(),
|
||||
R"(12:34 error: runtime-sized arrays can only be used in the <storage> address space
|
||||
12:34 note: while instantiating 'var' a)");
|
||||
56:78 note: while instantiating 'var' a)");
|
||||
}
|
||||
|
||||
TEST_F(ResolverTypeValidationTest, Struct_Member_VectorNoType) {
|
||||
|
@ -731,23 +730,24 @@ TEST_F(ResolverTypeValidationTest, RuntimeArrayIsNotLast_Fail) {
|
|||
}
|
||||
|
||||
TEST_F(ResolverTypeValidationTest, RuntimeArrayAsGlobalVariable) {
|
||||
GlobalVar(Source{{56, 78}}, "g", ty.array<i32>(), ast::AddressSpace::kPrivate);
|
||||
GlobalVar(Source{{56, 78}}, "g", ty.array(Source{{12, 34}}, ty.i32()),
|
||||
ast::AddressSpace::kPrivate);
|
||||
|
||||
ASSERT_FALSE(r()->Resolve());
|
||||
|
||||
EXPECT_EQ(r()->error(),
|
||||
R"(56:78 error: runtime-sized arrays can only be used in the <storage> address space
|
||||
R"(12:34 error: runtime-sized arrays can only be used in the <storage> address space
|
||||
56:78 note: while instantiating 'var' g)");
|
||||
}
|
||||
|
||||
TEST_F(ResolverTypeValidationTest, RuntimeArrayAsLocalVariable) {
|
||||
auto* v = Var(Source{{56, 78}}, "g", ty.array<i32>());
|
||||
auto* v = Var(Source{{56, 78}}, "g", ty.array(Source{{12, 34}}, ty.i32()));
|
||||
WrapInFunction(v);
|
||||
|
||||
ASSERT_FALSE(r()->Resolve());
|
||||
|
||||
EXPECT_EQ(r()->error(),
|
||||
R"(56:78 error: runtime-sized arrays can only be used in the <storage> address space
|
||||
R"(12:34 error: runtime-sized arrays can only be used in the <storage> address space
|
||||
56:78 note: while instantiating 'var' g)");
|
||||
}
|
||||
|
||||
|
@ -755,7 +755,7 @@ TEST_F(ResolverTypeValidationTest, RuntimeArrayAsParameter_Fail) {
|
|||
// fn func(a : array<u32>) {}
|
||||
// @vertex fn main() {}
|
||||
|
||||
auto* param = Param(Source{{12, 34}}, "a", ty.array<i32>());
|
||||
auto* param = Param(Source{{56, 78}}, "a", ty.array(Source{{12, 34}}, ty.i32()));
|
||||
|
||||
Func("func", utils::Vector{param}, ty.void_(),
|
||||
utils::Vector{
|
||||
|
@ -773,14 +773,14 @@ TEST_F(ResolverTypeValidationTest, RuntimeArrayAsParameter_Fail) {
|
|||
EXPECT_FALSE(r()->Resolve()) << r()->error();
|
||||
EXPECT_EQ(r()->error(),
|
||||
R"(12:34 error: runtime-sized arrays can only be used in the <storage> address space
|
||||
12:34 note: while instantiating parameter a)");
|
||||
56:78 note: while instantiating parameter a)");
|
||||
}
|
||||
|
||||
TEST_F(ResolverTypeValidationTest, PtrToRuntimeArrayAsParameter_Fail) {
|
||||
TEST_F(ResolverTypeValidationTest, PtrToRuntimeArrayAsPointerParameter_Fail) {
|
||||
// fn func(a : ptr<workgroup, array<u32>>) {}
|
||||
|
||||
auto* param =
|
||||
Param(Source{{12, 34}}, "a", ty.pointer(ty.array<i32>(), ast::AddressSpace::kWorkgroup));
|
||||
auto* param = Param("a", ty.pointer(Source{{56, 78}}, ty.array(Source{{12, 34}}, ty.i32()),
|
||||
ast::AddressSpace::kWorkgroup));
|
||||
|
||||
Func("func", utils::Vector{param}, ty.void_(),
|
||||
utils::Vector{
|
||||
|
@ -790,7 +790,23 @@ TEST_F(ResolverTypeValidationTest, PtrToRuntimeArrayAsParameter_Fail) {
|
|||
EXPECT_FALSE(r()->Resolve()) << r()->error();
|
||||
EXPECT_EQ(r()->error(),
|
||||
R"(12:34 error: runtime-sized arrays can only be used in the <storage> address space
|
||||
12:34 note: while instantiating parameter a)");
|
||||
56:78 note: while instantiating ptr<workgroup, array<i32>, read_write>)");
|
||||
}
|
||||
|
||||
TEST_F(ResolverTypeValidationTest, PtrToRuntimeArrayAsParameter_Fail) {
|
||||
// fn func(a : ptr<workgroup, array<u32>>) {}
|
||||
|
||||
auto* param = Param(Source{{56, 78}}, "a", ty.array(Source{{12, 34}}, ty.i32()));
|
||||
|
||||
Func("func", utils::Vector{param}, ty.void_(),
|
||||
utils::Vector{
|
||||
Return(),
|
||||
});
|
||||
|
||||
EXPECT_FALSE(r()->Resolve()) << r()->error();
|
||||
EXPECT_EQ(r()->error(),
|
||||
R"(12:34 error: runtime-sized arrays can only be used in the <storage> address space
|
||||
56:78 note: while instantiating parameter a)");
|
||||
}
|
||||
|
||||
TEST_F(ResolverTypeValidationTest, AliasRuntimeArrayIsNotLast_Fail) {
|
||||
|
|
|
@ -269,6 +269,28 @@ bool Validator::Atomic(const ast::Atomic* a, const sem::Atomic* s) const {
|
|||
return true;
|
||||
}
|
||||
|
||||
bool Validator::Pointer(const ast::Pointer* a, const sem::Pointer* s) const {
|
||||
if (s->AddressSpace() == ast::AddressSpace::kUndefined) {
|
||||
AddError("ptr missing address space", a->source);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (a->access != ast::Access::kUndefined) {
|
||||
// https://www.w3.org/TR/WGSL/#access-mode-defaults
|
||||
// When writing a variable declaration or a pointer type in WGSL source:
|
||||
// * For the storage address space, the access mode is optional, and defaults to read.
|
||||
// * For other address spaces, the access mode must not be written.
|
||||
if (a->address_space != ast::AddressSpace::kStorage) {
|
||||
AddError("only pointers in <storage> address space may declare an access mode",
|
||||
a->source);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return CheckTypeAccessAddressSpace(s->StoreType(), s->Access(), s->AddressSpace(), utils::Empty,
|
||||
a->source);
|
||||
}
|
||||
|
||||
bool Validator::StorageTexture(const ast::StorageTexture* t) const {
|
||||
switch (t->access) {
|
||||
case ast::Access::kWrite:
|
||||
|
@ -355,11 +377,10 @@ bool Validator::VariableInitializer(const ast::Variable* v,
|
|||
default:
|
||||
// https://gpuweb.github.io/gpuweb/wgsl/#var-and-let
|
||||
// Optionally has an initializer expression, if the variable is in the private or
|
||||
// function address spacees.
|
||||
// function address spaces.
|
||||
AddError("var of address space '" + utils::ToString(address_space) +
|
||||
"' cannot have an initializer. var initializers are only "
|
||||
"supported for the address spacees "
|
||||
"'private' and 'function'",
|
||||
"' cannot have an initializer. var initializers are only supported "
|
||||
"for the address spaces 'private' and 'function'",
|
||||
v->source);
|
||||
return false;
|
||||
}
|
||||
|
@ -672,9 +693,10 @@ bool Validator::Var(const sem::Variable* v) const {
|
|||
}
|
||||
|
||||
if (var->declared_access != ast::Access::kUndefined) {
|
||||
// https://gpuweb.github.io/gpuweb/wgsl/#variable-declaration
|
||||
// The access mode always has a default, and except for variables in the storage address
|
||||
// space, must not be written.
|
||||
// https://www.w3.org/TR/WGSL/#access-mode-defaults
|
||||
// When writing a variable declaration or a pointer type in WGSL source:
|
||||
// * For the storage address space, the access mode is optional, and defaults to read.
|
||||
// * For other address spaces, the access mode must not be written.
|
||||
if (var->declared_address_space != ast::AddressSpace::kStorage) {
|
||||
AddError("only variables in <storage> address space may declare an access mode",
|
||||
var->source);
|
||||
|
|
|
@ -169,6 +169,12 @@ class Validator {
|
|||
/// @returns true on success, false otherwise.
|
||||
bool Atomic(const ast::Atomic* a, const sem::Atomic* s) const;
|
||||
|
||||
/// Validates a pointer type
|
||||
/// @param a the pointer ast node
|
||||
/// @param s the pointer sem node
|
||||
/// @returns true on success, false otherwise.
|
||||
bool Pointer(const ast::Pointer* a, const sem::Pointer* s) const;
|
||||
|
||||
/// Validates an assignment
|
||||
/// @param a the assignment statement
|
||||
/// @param rhs_ty the type of the right hand side
|
||||
|
|
|
@ -321,16 +321,16 @@ TEST_F(ResolverVariableValidationTest, NonConstructibleType_Atomic) {
|
|||
|
||||
TEST_F(ResolverVariableValidationTest, NonConstructibleType_RuntimeArray) {
|
||||
auto* s = Structure("S", utils::Vector{
|
||||
Member(Source{{56, 78}}, "m", ty.array(ty.i32())),
|
||||
Member(Source{{12, 34}}, "m", ty.array<i32>()),
|
||||
});
|
||||
auto* v = Var(Source{{12, 34}}, "v", ty.Of(s));
|
||||
auto* v = Var(Source{{56, 78}}, "v", ty.Of(s));
|
||||
WrapInFunction(v);
|
||||
|
||||
EXPECT_FALSE(r()->Resolve());
|
||||
EXPECT_EQ(r()->error(),
|
||||
R"(12:34 error: runtime-sized arrays can only be used in the <storage> address space
|
||||
56:78 note: while analyzing structure member S.m
|
||||
12:34 note: while instantiating 'var' v)");
|
||||
R"(error: runtime-sized arrays can only be used in the <storage> address space
|
||||
12:34 note: while analyzing structure member S.m
|
||||
56:78 note: while instantiating 'var' v)");
|
||||
}
|
||||
|
||||
TEST_F(ResolverVariableValidationTest, NonConstructibleType_Struct_WithAtomic) {
|
||||
|
@ -365,7 +365,7 @@ TEST_F(ResolverVariableValidationTest, InvalidAddressSpaceForInitializer) {
|
|||
EXPECT_EQ(r()->error(),
|
||||
"12:34 error: var of address space 'workgroup' cannot have "
|
||||
"an initializer. var initializers are only supported for the "
|
||||
"address spacees 'private' and 'function'");
|
||||
"address spaces 'private' and 'function'");
|
||||
}
|
||||
|
||||
TEST_F(ResolverVariableValidationTest, VectorConstNoType) {
|
||||
|
@ -486,5 +486,18 @@ TEST_F(ResolverVariableValidationTest, ConstInitWithOverrideExpr) {
|
|||
56:78 note: consider changing 'const' to 'let')");
|
||||
}
|
||||
|
||||
TEST_F(ResolverVariableValidationTest, GlobalVariable_PushConstantWithInitializer) {
|
||||
// enable chromium_experimental_push_constant;
|
||||
// var<push_constant> a : u32 = 0u;
|
||||
Enable(ast::Extension::kChromiumExperimentalPushConstant);
|
||||
GlobalVar(Source{{1u, 2u}}, "a", ty.u32(), ast::AddressSpace::kPushConstant,
|
||||
Expr(Source{{3u, 4u}}, u32(0)));
|
||||
|
||||
ASSERT_FALSE(r()->Resolve());
|
||||
EXPECT_EQ(
|
||||
r()->error(),
|
||||
R"(1:2 error: var of address space 'push_constant' cannot have an initializer. var initializers are only supported for the address spaces 'private' and 'function')");
|
||||
}
|
||||
|
||||
} // namespace
|
||||
} // namespace tint::resolver
|
||||
|
|
|
@ -466,6 +466,9 @@ struct DecomposeMemoryAccess::State {
|
|||
const sem::VariableUser* var_user) {
|
||||
auto address_space = var_user->Variable()->AddressSpace();
|
||||
auto access = var_user->Variable()->Access();
|
||||
if (address_space != ast::AddressSpace::kStorage) {
|
||||
access = ast::Access::kUndefined;
|
||||
}
|
||||
return utils::GetOrCreate(
|
||||
load_funcs, LoadStoreKey{address_space, access, buf_ty, el_ty}, [&] {
|
||||
utils::Vector params{
|
||||
|
@ -562,6 +565,9 @@ struct DecomposeMemoryAccess::State {
|
|||
const sem::VariableUser* var_user) {
|
||||
auto address_space = var_user->Variable()->AddressSpace();
|
||||
auto access = var_user->Variable()->Access();
|
||||
if (address_space != ast::AddressSpace::kStorage) {
|
||||
access = ast::Access::kUndefined;
|
||||
}
|
||||
return utils::GetOrCreate(
|
||||
store_funcs, LoadStoreKey{address_space, access, buf_ty, el_ty}, [&] {
|
||||
utils::Vector params{
|
||||
|
@ -670,7 +676,11 @@ struct DecomposeMemoryAccess::State {
|
|||
const sem::Builtin* intrinsic,
|
||||
const sem::VariableUser* var_user) {
|
||||
auto op = intrinsic->Type();
|
||||
auto address_space = var_user->Variable()->AddressSpace();
|
||||
auto access = var_user->Variable()->Access();
|
||||
if (address_space != ast::AddressSpace::kStorage) {
|
||||
access = ast::Access::kUndefined;
|
||||
}
|
||||
return utils::GetOrCreate(atomic_funcs, AtomicKey{access, buf_ty, el_ty, op}, [&] {
|
||||
// The first parameter to all WGSL atomics is the expression to the
|
||||
// atomic. This is replaced with two parameters: the buffer and offset.
|
||||
|
|
|
@ -804,126 +804,126 @@ struct UB {
|
|||
@group(0) @binding(0) var<uniform> ub : UB;
|
||||
|
||||
@internal(intrinsic_load_uniform_f32) @internal(disable_validation__function_has_no_body)
|
||||
fn tint_symbol(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB, read>, offset : u32) -> f32
|
||||
fn tint_symbol(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, 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<uniform, UB, read>, offset : u32) -> i32
|
||||
fn tint_symbol_1(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, 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<uniform, UB, read>, offset : u32) -> u32
|
||||
fn tint_symbol_2(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, 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<uniform, UB, read>, offset : u32) -> f16
|
||||
fn tint_symbol_3(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, 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<uniform, UB, read>, offset : u32) -> vec2<f32>
|
||||
fn tint_symbol_4(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, offset : u32) -> vec2<f32>
|
||||
|
||||
@internal(intrinsic_load_uniform_vec2_i32) @internal(disable_validation__function_has_no_body)
|
||||
fn tint_symbol_5(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB, read>, offset : u32) -> vec2<i32>
|
||||
fn tint_symbol_5(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, offset : u32) -> vec2<i32>
|
||||
|
||||
@internal(intrinsic_load_uniform_vec2_u32) @internal(disable_validation__function_has_no_body)
|
||||
fn tint_symbol_6(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB, read>, offset : u32) -> vec2<u32>
|
||||
fn tint_symbol_6(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, offset : u32) -> vec2<u32>
|
||||
|
||||
@internal(intrinsic_load_uniform_vec2_f16) @internal(disable_validation__function_has_no_body)
|
||||
fn tint_symbol_7(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB, read>, offset : u32) -> vec2<f16>
|
||||
fn tint_symbol_7(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, offset : u32) -> vec2<f16>
|
||||
|
||||
@internal(intrinsic_load_uniform_vec3_f32) @internal(disable_validation__function_has_no_body)
|
||||
fn tint_symbol_8(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB, read>, offset : u32) -> vec3<f32>
|
||||
fn tint_symbol_8(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, offset : u32) -> vec3<f32>
|
||||
|
||||
@internal(intrinsic_load_uniform_vec3_i32) @internal(disable_validation__function_has_no_body)
|
||||
fn tint_symbol_9(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB, read>, offset : u32) -> vec3<i32>
|
||||
fn tint_symbol_9(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, offset : u32) -> vec3<i32>
|
||||
|
||||
@internal(intrinsic_load_uniform_vec3_u32) @internal(disable_validation__function_has_no_body)
|
||||
fn tint_symbol_10(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB, read>, offset : u32) -> vec3<u32>
|
||||
fn tint_symbol_10(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, offset : u32) -> vec3<u32>
|
||||
|
||||
@internal(intrinsic_load_uniform_vec3_f16) @internal(disable_validation__function_has_no_body)
|
||||
fn tint_symbol_11(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB, read>, offset : u32) -> vec3<f16>
|
||||
fn tint_symbol_11(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, offset : u32) -> vec3<f16>
|
||||
|
||||
@internal(intrinsic_load_uniform_vec4_f32) @internal(disable_validation__function_has_no_body)
|
||||
fn tint_symbol_12(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB, read>, offset : u32) -> vec4<f32>
|
||||
fn tint_symbol_12(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, offset : u32) -> vec4<f32>
|
||||
|
||||
@internal(intrinsic_load_uniform_vec4_i32) @internal(disable_validation__function_has_no_body)
|
||||
fn tint_symbol_13(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB, read>, offset : u32) -> vec4<i32>
|
||||
fn tint_symbol_13(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, offset : u32) -> vec4<i32>
|
||||
|
||||
@internal(intrinsic_load_uniform_vec4_u32) @internal(disable_validation__function_has_no_body)
|
||||
fn tint_symbol_14(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB, read>, offset : u32) -> vec4<u32>
|
||||
fn tint_symbol_14(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, offset : u32) -> vec4<u32>
|
||||
|
||||
@internal(intrinsic_load_uniform_vec4_f16) @internal(disable_validation__function_has_no_body)
|
||||
fn tint_symbol_15(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB, read>, offset : u32) -> vec4<f16>
|
||||
fn tint_symbol_15(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, offset : u32) -> vec4<f16>
|
||||
|
||||
fn tint_symbol_16(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB, read>, offset : u32) -> mat2x2<f32> {
|
||||
fn tint_symbol_16(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, offset : u32) -> mat2x2<f32> {
|
||||
return mat2x2<f32>(tint_symbol_4(buffer, (offset + 0u)), tint_symbol_4(buffer, (offset + 8u)));
|
||||
}
|
||||
|
||||
fn tint_symbol_17(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB, read>, offset : u32) -> mat2x3<f32> {
|
||||
fn tint_symbol_17(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, offset : u32) -> mat2x3<f32> {
|
||||
return mat2x3<f32>(tint_symbol_8(buffer, (offset + 0u)), tint_symbol_8(buffer, (offset + 16u)));
|
||||
}
|
||||
|
||||
fn tint_symbol_18(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB, read>, offset : u32) -> mat2x4<f32> {
|
||||
fn tint_symbol_18(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, offset : u32) -> mat2x4<f32> {
|
||||
return mat2x4<f32>(tint_symbol_12(buffer, (offset + 0u)), tint_symbol_12(buffer, (offset + 16u)));
|
||||
}
|
||||
|
||||
fn tint_symbol_19(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB, read>, offset : u32) -> mat3x2<f32> {
|
||||
fn tint_symbol_19(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, offset : u32) -> mat3x2<f32> {
|
||||
return mat3x2<f32>(tint_symbol_4(buffer, (offset + 0u)), tint_symbol_4(buffer, (offset + 8u)), tint_symbol_4(buffer, (offset + 16u)));
|
||||
}
|
||||
|
||||
fn tint_symbol_20(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB, read>, offset : u32) -> mat3x3<f32> {
|
||||
fn tint_symbol_20(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, offset : u32) -> mat3x3<f32> {
|
||||
return mat3x3<f32>(tint_symbol_8(buffer, (offset + 0u)), tint_symbol_8(buffer, (offset + 16u)), tint_symbol_8(buffer, (offset + 32u)));
|
||||
}
|
||||
|
||||
fn tint_symbol_21(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB, read>, offset : u32) -> mat3x4<f32> {
|
||||
fn tint_symbol_21(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, offset : u32) -> mat3x4<f32> {
|
||||
return mat3x4<f32>(tint_symbol_12(buffer, (offset + 0u)), tint_symbol_12(buffer, (offset + 16u)), tint_symbol_12(buffer, (offset + 32u)));
|
||||
}
|
||||
|
||||
fn tint_symbol_22(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB, read>, offset : u32) -> mat4x2<f32> {
|
||||
fn tint_symbol_22(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, offset : u32) -> mat4x2<f32> {
|
||||
return mat4x2<f32>(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 tint_symbol_23(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB, read>, offset : u32) -> mat4x3<f32> {
|
||||
fn tint_symbol_23(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, offset : u32) -> mat4x3<f32> {
|
||||
return mat4x3<f32>(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 tint_symbol_24(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB, read>, offset : u32) -> mat4x4<f32> {
|
||||
fn tint_symbol_24(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, offset : u32) -> mat4x4<f32> {
|
||||
return mat4x4<f32>(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 tint_symbol_25(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB, read>, offset : u32) -> mat2x2<f16> {
|
||||
fn tint_symbol_25(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, offset : u32) -> mat2x2<f16> {
|
||||
return mat2x2<f16>(tint_symbol_7(buffer, (offset + 0u)), tint_symbol_7(buffer, (offset + 4u)));
|
||||
}
|
||||
|
||||
fn tint_symbol_26(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB, read>, offset : u32) -> mat2x3<f16> {
|
||||
fn tint_symbol_26(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, offset : u32) -> mat2x3<f16> {
|
||||
return mat2x3<f16>(tint_symbol_11(buffer, (offset + 0u)), tint_symbol_11(buffer, (offset + 8u)));
|
||||
}
|
||||
|
||||
fn tint_symbol_27(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB, read>, offset : u32) -> mat2x4<f16> {
|
||||
fn tint_symbol_27(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, offset : u32) -> mat2x4<f16> {
|
||||
return mat2x4<f16>(tint_symbol_15(buffer, (offset + 0u)), tint_symbol_15(buffer, (offset + 8u)));
|
||||
}
|
||||
|
||||
fn tint_symbol_28(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB, read>, offset : u32) -> mat3x2<f16> {
|
||||
fn tint_symbol_28(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, offset : u32) -> mat3x2<f16> {
|
||||
return mat3x2<f16>(tint_symbol_7(buffer, (offset + 0u)), tint_symbol_7(buffer, (offset + 4u)), tint_symbol_7(buffer, (offset + 8u)));
|
||||
}
|
||||
|
||||
fn tint_symbol_29(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB, read>, offset : u32) -> mat3x3<f16> {
|
||||
fn tint_symbol_29(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, offset : u32) -> mat3x3<f16> {
|
||||
return mat3x3<f16>(tint_symbol_11(buffer, (offset + 0u)), tint_symbol_11(buffer, (offset + 8u)), tint_symbol_11(buffer, (offset + 16u)));
|
||||
}
|
||||
|
||||
fn tint_symbol_30(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB, read>, offset : u32) -> mat3x4<f16> {
|
||||
fn tint_symbol_30(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, offset : u32) -> mat3x4<f16> {
|
||||
return mat3x4<f16>(tint_symbol_15(buffer, (offset + 0u)), tint_symbol_15(buffer, (offset + 8u)), tint_symbol_15(buffer, (offset + 16u)));
|
||||
}
|
||||
|
||||
fn tint_symbol_31(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB, read>, offset : u32) -> mat4x2<f16> {
|
||||
fn tint_symbol_31(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, offset : u32) -> mat4x2<f16> {
|
||||
return mat4x2<f16>(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 tint_symbol_32(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB, read>, offset : u32) -> mat4x3<f16> {
|
||||
fn tint_symbol_32(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, offset : u32) -> mat4x3<f16> {
|
||||
return mat4x3<f16>(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 tint_symbol_33(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB, read>, offset : u32) -> mat4x4<f16> {
|
||||
fn tint_symbol_33(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, offset : u32) -> mat4x4<f16> {
|
||||
return mat4x4<f16>(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 tint_symbol_34(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB, read>, offset : u32) -> array<vec3<f32>, 2u> {
|
||||
fn tint_symbol_34(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, offset : u32) -> array<vec3<f32>, 2u> {
|
||||
var arr : array<vec3<f32>, 2u>;
|
||||
for(var i = 0u; (i < 2u); i = (i + 1u)) {
|
||||
arr[i] = tint_symbol_8(buffer, (offset + (i * 16u)));
|
||||
|
@ -931,7 +931,7 @@ fn tint_symbol_34(@internal(disable_validation__function_parameter) buffer : ptr
|
|||
return arr;
|
||||
}
|
||||
|
||||
fn tint_symbol_35(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB, read>, offset : u32) -> array<mat4x2<f16>, 2u> {
|
||||
fn tint_symbol_35(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, offset : u32) -> array<mat4x2<f16>, 2u> {
|
||||
var arr_1 : array<mat4x2<f16>, 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)));
|
||||
|
@ -1075,126 +1075,126 @@ 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<uniform, UB, read>, offset : u32) -> f32
|
||||
fn tint_symbol(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, 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<uniform, UB, read>, offset : u32) -> i32
|
||||
fn tint_symbol_1(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, 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<uniform, UB, read>, offset : u32) -> u32
|
||||
fn tint_symbol_2(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, 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<uniform, UB, read>, offset : u32) -> f16
|
||||
fn tint_symbol_3(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, 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<uniform, UB, read>, offset : u32) -> vec2<f32>
|
||||
fn tint_symbol_4(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, offset : u32) -> vec2<f32>
|
||||
|
||||
@internal(intrinsic_load_uniform_vec2_i32) @internal(disable_validation__function_has_no_body)
|
||||
fn tint_symbol_5(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB, read>, offset : u32) -> vec2<i32>
|
||||
fn tint_symbol_5(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, offset : u32) -> vec2<i32>
|
||||
|
||||
@internal(intrinsic_load_uniform_vec2_u32) @internal(disable_validation__function_has_no_body)
|
||||
fn tint_symbol_6(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB, read>, offset : u32) -> vec2<u32>
|
||||
fn tint_symbol_6(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, offset : u32) -> vec2<u32>
|
||||
|
||||
@internal(intrinsic_load_uniform_vec2_f16) @internal(disable_validation__function_has_no_body)
|
||||
fn tint_symbol_7(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB, read>, offset : u32) -> vec2<f16>
|
||||
fn tint_symbol_7(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, offset : u32) -> vec2<f16>
|
||||
|
||||
@internal(intrinsic_load_uniform_vec3_f32) @internal(disable_validation__function_has_no_body)
|
||||
fn tint_symbol_8(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB, read>, offset : u32) -> vec3<f32>
|
||||
fn tint_symbol_8(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, offset : u32) -> vec3<f32>
|
||||
|
||||
@internal(intrinsic_load_uniform_vec3_i32) @internal(disable_validation__function_has_no_body)
|
||||
fn tint_symbol_9(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB, read>, offset : u32) -> vec3<i32>
|
||||
fn tint_symbol_9(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, offset : u32) -> vec3<i32>
|
||||
|
||||
@internal(intrinsic_load_uniform_vec3_u32) @internal(disable_validation__function_has_no_body)
|
||||
fn tint_symbol_10(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB, read>, offset : u32) -> vec3<u32>
|
||||
fn tint_symbol_10(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, offset : u32) -> vec3<u32>
|
||||
|
||||
@internal(intrinsic_load_uniform_vec3_f16) @internal(disable_validation__function_has_no_body)
|
||||
fn tint_symbol_11(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB, read>, offset : u32) -> vec3<f16>
|
||||
fn tint_symbol_11(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, offset : u32) -> vec3<f16>
|
||||
|
||||
@internal(intrinsic_load_uniform_vec4_f32) @internal(disable_validation__function_has_no_body)
|
||||
fn tint_symbol_12(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB, read>, offset : u32) -> vec4<f32>
|
||||
fn tint_symbol_12(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, offset : u32) -> vec4<f32>
|
||||
|
||||
@internal(intrinsic_load_uniform_vec4_i32) @internal(disable_validation__function_has_no_body)
|
||||
fn tint_symbol_13(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB, read>, offset : u32) -> vec4<i32>
|
||||
fn tint_symbol_13(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, offset : u32) -> vec4<i32>
|
||||
|
||||
@internal(intrinsic_load_uniform_vec4_u32) @internal(disable_validation__function_has_no_body)
|
||||
fn tint_symbol_14(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB, read>, offset : u32) -> vec4<u32>
|
||||
fn tint_symbol_14(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, offset : u32) -> vec4<u32>
|
||||
|
||||
@internal(intrinsic_load_uniform_vec4_f16) @internal(disable_validation__function_has_no_body)
|
||||
fn tint_symbol_15(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB, read>, offset : u32) -> vec4<f16>
|
||||
fn tint_symbol_15(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, offset : u32) -> vec4<f16>
|
||||
|
||||
fn tint_symbol_16(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB, read>, offset : u32) -> mat2x2<f32> {
|
||||
fn tint_symbol_16(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, offset : u32) -> mat2x2<f32> {
|
||||
return mat2x2<f32>(tint_symbol_4(buffer, (offset + 0u)), tint_symbol_4(buffer, (offset + 8u)));
|
||||
}
|
||||
|
||||
fn tint_symbol_17(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB, read>, offset : u32) -> mat2x3<f32> {
|
||||
fn tint_symbol_17(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, offset : u32) -> mat2x3<f32> {
|
||||
return mat2x3<f32>(tint_symbol_8(buffer, (offset + 0u)), tint_symbol_8(buffer, (offset + 16u)));
|
||||
}
|
||||
|
||||
fn tint_symbol_18(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB, read>, offset : u32) -> mat2x4<f32> {
|
||||
fn tint_symbol_18(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, offset : u32) -> mat2x4<f32> {
|
||||
return mat2x4<f32>(tint_symbol_12(buffer, (offset + 0u)), tint_symbol_12(buffer, (offset + 16u)));
|
||||
}
|
||||
|
||||
fn tint_symbol_19(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB, read>, offset : u32) -> mat3x2<f32> {
|
||||
fn tint_symbol_19(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, offset : u32) -> mat3x2<f32> {
|
||||
return mat3x2<f32>(tint_symbol_4(buffer, (offset + 0u)), tint_symbol_4(buffer, (offset + 8u)), tint_symbol_4(buffer, (offset + 16u)));
|
||||
}
|
||||
|
||||
fn tint_symbol_20(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB, read>, offset : u32) -> mat3x3<f32> {
|
||||
fn tint_symbol_20(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, offset : u32) -> mat3x3<f32> {
|
||||
return mat3x3<f32>(tint_symbol_8(buffer, (offset + 0u)), tint_symbol_8(buffer, (offset + 16u)), tint_symbol_8(buffer, (offset + 32u)));
|
||||
}
|
||||
|
||||
fn tint_symbol_21(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB, read>, offset : u32) -> mat3x4<f32> {
|
||||
fn tint_symbol_21(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, offset : u32) -> mat3x4<f32> {
|
||||
return mat3x4<f32>(tint_symbol_12(buffer, (offset + 0u)), tint_symbol_12(buffer, (offset + 16u)), tint_symbol_12(buffer, (offset + 32u)));
|
||||
}
|
||||
|
||||
fn tint_symbol_22(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB, read>, offset : u32) -> mat4x2<f32> {
|
||||
fn tint_symbol_22(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, offset : u32) -> mat4x2<f32> {
|
||||
return mat4x2<f32>(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 tint_symbol_23(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB, read>, offset : u32) -> mat4x3<f32> {
|
||||
fn tint_symbol_23(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, offset : u32) -> mat4x3<f32> {
|
||||
return mat4x3<f32>(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 tint_symbol_24(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB, read>, offset : u32) -> mat4x4<f32> {
|
||||
fn tint_symbol_24(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, offset : u32) -> mat4x4<f32> {
|
||||
return mat4x4<f32>(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 tint_symbol_25(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB, read>, offset : u32) -> mat2x2<f16> {
|
||||
fn tint_symbol_25(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, offset : u32) -> mat2x2<f16> {
|
||||
return mat2x2<f16>(tint_symbol_7(buffer, (offset + 0u)), tint_symbol_7(buffer, (offset + 4u)));
|
||||
}
|
||||
|
||||
fn tint_symbol_26(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB, read>, offset : u32) -> mat2x3<f16> {
|
||||
fn tint_symbol_26(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, offset : u32) -> mat2x3<f16> {
|
||||
return mat2x3<f16>(tint_symbol_11(buffer, (offset + 0u)), tint_symbol_11(buffer, (offset + 8u)));
|
||||
}
|
||||
|
||||
fn tint_symbol_27(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB, read>, offset : u32) -> mat2x4<f16> {
|
||||
fn tint_symbol_27(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, offset : u32) -> mat2x4<f16> {
|
||||
return mat2x4<f16>(tint_symbol_15(buffer, (offset + 0u)), tint_symbol_15(buffer, (offset + 8u)));
|
||||
}
|
||||
|
||||
fn tint_symbol_28(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB, read>, offset : u32) -> mat3x2<f16> {
|
||||
fn tint_symbol_28(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, offset : u32) -> mat3x2<f16> {
|
||||
return mat3x2<f16>(tint_symbol_7(buffer, (offset + 0u)), tint_symbol_7(buffer, (offset + 4u)), tint_symbol_7(buffer, (offset + 8u)));
|
||||
}
|
||||
|
||||
fn tint_symbol_29(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB, read>, offset : u32) -> mat3x3<f16> {
|
||||
fn tint_symbol_29(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, offset : u32) -> mat3x3<f16> {
|
||||
return mat3x3<f16>(tint_symbol_11(buffer, (offset + 0u)), tint_symbol_11(buffer, (offset + 8u)), tint_symbol_11(buffer, (offset + 16u)));
|
||||
}
|
||||
|
||||
fn tint_symbol_30(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB, read>, offset : u32) -> mat3x4<f16> {
|
||||
fn tint_symbol_30(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, offset : u32) -> mat3x4<f16> {
|
||||
return mat3x4<f16>(tint_symbol_15(buffer, (offset + 0u)), tint_symbol_15(buffer, (offset + 8u)), tint_symbol_15(buffer, (offset + 16u)));
|
||||
}
|
||||
|
||||
fn tint_symbol_31(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB, read>, offset : u32) -> mat4x2<f16> {
|
||||
fn tint_symbol_31(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, offset : u32) -> mat4x2<f16> {
|
||||
return mat4x2<f16>(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 tint_symbol_32(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB, read>, offset : u32) -> mat4x3<f16> {
|
||||
fn tint_symbol_32(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, offset : u32) -> mat4x3<f16> {
|
||||
return mat4x3<f16>(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 tint_symbol_33(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB, read>, offset : u32) -> mat4x4<f16> {
|
||||
fn tint_symbol_33(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, offset : u32) -> mat4x4<f16> {
|
||||
return mat4x4<f16>(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 tint_symbol_34(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB, read>, offset : u32) -> array<vec3<f32>, 2u> {
|
||||
fn tint_symbol_34(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, offset : u32) -> array<vec3<f32>, 2u> {
|
||||
var arr : array<vec3<f32>, 2u>;
|
||||
for(var i = 0u; (i < 2u); i = (i + 1u)) {
|
||||
arr[i] = tint_symbol_8(buffer, (offset + (i * 16u)));
|
||||
|
@ -1202,7 +1202,7 @@ fn tint_symbol_34(@internal(disable_validation__function_parameter) buffer : ptr
|
|||
return arr;
|
||||
}
|
||||
|
||||
fn tint_symbol_35(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB, read>, offset : u32) -> array<mat4x2<f16>, 2u> {
|
||||
fn tint_symbol_35(@internal(disable_validation__function_parameter) buffer : ptr<uniform, UB>, offset : u32) -> array<mat4x2<f16>, 2u> {
|
||||
var arr_1 : array<mat4x2<f16>, 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)));
|
||||
|
|
|
@ -139,7 +139,7 @@ struct ModuleScopeVarToEntryPointParam::State {
|
|||
}
|
||||
case ast::AddressSpace::kStorage:
|
||||
case ast::AddressSpace::kUniform: {
|
||||
// Variables into the Storage and Uniform address spacees are redeclared as entry
|
||||
// Variables into the Storage and Uniform address spaces are redeclared as entry
|
||||
// point parameters with a pointer type.
|
||||
auto attributes = ctx.Clone(var->Declaration()->attributes);
|
||||
attributes.Push(ctx.dst->Disable(ast::DisabledValidation::kEntryPointParameter));
|
||||
|
@ -192,7 +192,7 @@ struct ModuleScopeVarToEntryPointParam::State {
|
|||
[[fallthrough]];
|
||||
}
|
||||
case ast::AddressSpace::kPrivate: {
|
||||
// Variables in the Private and Workgroup address spacees are redeclared at function
|
||||
// Variables in the Private and Workgroup address spaces are redeclared at function
|
||||
// scope. Disable address space validation on this variable.
|
||||
auto* disable_validation =
|
||||
ctx.dst->Disable(ast::DisabledValidation::kIgnoreAddressSpace);
|
||||
|
@ -497,7 +497,7 @@ struct ModuleScopeVarToEntryPointParam::State {
|
|||
}
|
||||
}
|
||||
|
||||
// Now remove all module-scope variables with these address spacees.
|
||||
// Now remove all module-scope variables with these address spaces.
|
||||
for (auto* var_ast : ctx.src->AST().GlobalVariables()) {
|
||||
auto* var_sem = ctx.src->Sem().Get(var_ast);
|
||||
if (var_sem->AddressSpace() != ast::AddressSpace::kNone) {
|
||||
|
|
Loading…
Reference in New Issue