tint: Rename 'type' to 'alias'
Bug: tint:1812 Change-Id: I50bd8b036b47b4ec223a81eda53bd658d19645e9 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/117211 Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Dan Sinclair <dsinclair@chromium.org> Commit-Queue: Ben Clayton <bclayton@google.com>
This commit is contained in:
parent
c252c642f4
commit
9dc48bcef3
|
@ -1,5 +1,11 @@
|
|||
# Tint changes during Origin Trial
|
||||
|
||||
## Changes for M111
|
||||
|
||||
## Deprecated Features
|
||||
|
||||
* The keyword to alias a type has been renamed from `type` to `alias`. [tint:1812](crbug.com/tint/1812)
|
||||
|
||||
## Changes for M110
|
||||
|
||||
### Breaking changes
|
||||
|
|
|
@ -950,7 +950,7 @@ TEST_F(SpvParserMemoryTest, RemapStorageBuffer_TypesAndVarDeclarations) {
|
|||
auto p = parser(test::Assemble(assembly));
|
||||
ASSERT_TRUE(p->BuildAndParseInternalModuleExceptFunctions()) << assembly << p->error();
|
||||
const auto module_str = test::ToString(p->program());
|
||||
EXPECT_THAT(module_str, HasSubstr(R"(type RTArr = @stride(4) array<u32>;
|
||||
EXPECT_THAT(module_str, HasSubstr(R"(alias RTArr = @stride(4) array<u32>;
|
||||
|
||||
struct S {
|
||||
/* @offset(0) */
|
||||
|
|
|
@ -1251,7 +1251,7 @@ TEST_F(SpvModuleScopeVarParserTest, StructMember_NonReadableDecoration_Dropped)
|
|||
ASSERT_TRUE(p->BuildAndParseInternalModuleExceptFunctions());
|
||||
EXPECT_TRUE(p->error().empty());
|
||||
const auto module_str = test::ToString(p->program());
|
||||
EXPECT_THAT(module_str, HasSubstr(R"(type Arr = @stride(4) array<u32, 2u>;
|
||||
EXPECT_THAT(module_str, HasSubstr(R"(alias Arr = @stride(4) array<u32, 2u>;
|
||||
|
||||
struct S {
|
||||
/* @offset(0) */
|
||||
|
@ -2424,13 +2424,13 @@ TEST_F(SpvModuleScopeVarParserTest, SampleMask_In_WithStride) {
|
|||
ASSERT_TRUE(p->BuildAndParseInternalModule()) << p->error() << assembly;
|
||||
EXPECT_TRUE(p->error().empty());
|
||||
const auto module_str = test::ToString(p->program());
|
||||
const std::string expected = R"(type Arr = @stride(4) array<u32, 1u>;
|
||||
const std::string expected = R"(alias Arr = @stride(4) array<u32, 1u>;
|
||||
|
||||
type Arr_1 = @stride(4) array<u32, 2u>;
|
||||
alias Arr_1 = @stride(4) array<u32, 2u>;
|
||||
|
||||
type Arr_2 = @stride(4) array<i32, 1u>;
|
||||
alias Arr_2 = @stride(4) array<i32, 1u>;
|
||||
|
||||
type Arr_3 = @stride(4) array<i32, 2u>;
|
||||
alias Arr_3 = @stride(4) array<i32, 2u>;
|
||||
|
||||
var<private> x_1 : Arr;
|
||||
|
||||
|
@ -2463,13 +2463,13 @@ TEST_F(SpvModuleScopeVarParserTest, SampleMask_Out_WithStride) {
|
|||
ASSERT_TRUE(p->BuildAndParseInternalModule()) << p->error() << assembly;
|
||||
EXPECT_TRUE(p->error().empty());
|
||||
const auto module_str = test::ToString(p->program());
|
||||
const std::string expected = R"(type Arr = @stride(4) array<u32, 1u>;
|
||||
const std::string expected = R"(alias Arr = @stride(4) array<u32, 1u>;
|
||||
|
||||
type Arr_1 = @stride(4) array<u32, 2u>;
|
||||
alias Arr_1 = @stride(4) array<u32, 2u>;
|
||||
|
||||
type Arr_2 = @stride(4) array<i32, 1u>;
|
||||
alias Arr_2 = @stride(4) array<i32, 1u>;
|
||||
|
||||
type Arr_3 = @stride(4) array<i32, 2u>;
|
||||
alias Arr_3 = @stride(4) array<i32, 2u>;
|
||||
|
||||
var<private> x_1 : Arr;
|
||||
|
||||
|
|
|
@ -89,9 +89,9 @@ TEST_F(SpvParserTest, NamedTypes_AnonRTArray_Dup_EmitBoth) {
|
|||
%arr2 = OpTypeRuntimeArray %uint
|
||||
)"));
|
||||
EXPECT_TRUE(p->BuildAndParseInternalModule());
|
||||
EXPECT_THAT(test::ToString(p->program()), HasSubstr(R"(type RTArr = @stride(8) array<u32>;
|
||||
EXPECT_THAT(test::ToString(p->program()), HasSubstr(R"(alias RTArr = @stride(8) array<u32>;
|
||||
|
||||
type RTArr_1 = @stride(8) array<u32>;
|
||||
alias RTArr_1 = @stride(8) array<u32>;
|
||||
)"));
|
||||
|
||||
p->DeliberatelyInvalidSpirv();
|
||||
|
@ -135,9 +135,9 @@ TEST_F(SpvParserTest, NamedTypes_AnonArray_Dup_EmitBoth) {
|
|||
%arr2 = OpTypeArray %uint %uint_5
|
||||
)"));
|
||||
EXPECT_TRUE(p->BuildAndParseInternalModule());
|
||||
EXPECT_THAT(test::ToString(p->program()), HasSubstr(R"(type Arr = @stride(8) array<u32, 5u>;
|
||||
EXPECT_THAT(test::ToString(p->program()), HasSubstr(R"(alias Arr = @stride(8) array<u32, 5u>;
|
||||
|
||||
type Arr_1 = @stride(8) array<u32, 5u>;
|
||||
alias Arr_1 = @stride(8) array<u32, 5u>;
|
||||
)"));
|
||||
|
||||
p->DeliberatelyInvalidSpirv();
|
||||
|
|
|
@ -1115,6 +1115,9 @@ Token Lexer::try_punctuation() {
|
|||
}
|
||||
|
||||
Token Lexer::check_keyword(const Source& source, std::string_view str) {
|
||||
if (str == "alias") {
|
||||
return {Token::Type::kAlias, source, "alias"};
|
||||
}
|
||||
if (str == "array") {
|
||||
return {Token::Type::kArray, source, "array"};
|
||||
}
|
||||
|
|
|
@ -1057,7 +1057,8 @@ TEST_P(KeywordTest, Parses) {
|
|||
INSTANTIATE_TEST_SUITE_P(
|
||||
LexerTest,
|
||||
KeywordTest,
|
||||
testing::Values(TokenData{"array", Token::Type::kArray},
|
||||
testing::Values(TokenData{"alias", Token::Type::kAlias},
|
||||
TokenData{"array", Token::Type::kArray},
|
||||
TokenData{"bitcast", Token::Type::kBitcast},
|
||||
TokenData{"bool", Token::Type::kBool},
|
||||
TokenData{"break", Token::Type::kBreak},
|
||||
|
|
|
@ -1008,13 +1008,18 @@ Maybe<ParserImpl::VariableQualifier> ParserImpl::variable_qualifier() {
|
|||
}
|
||||
|
||||
// type_alias_decl
|
||||
// : TYPE IDENT EQUAL type_specifier
|
||||
// : ALIAS IDENT EQUAL type_specifier
|
||||
Maybe<const ast::Alias*> ParserImpl::type_alias_decl() {
|
||||
if (!peek_is(Token::Type::kType)) {
|
||||
Source source;
|
||||
if (match(Token::Type::kAlias, &source)) {
|
||||
// matched.
|
||||
} else if (match(Token::Type::kType, &source)) {
|
||||
// TODO(crbug.com/tint/1812): DEPRECATED
|
||||
deprecated(source, "'type' has been renamed to 'alias'");
|
||||
} else {
|
||||
return Failure::kNoMatch;
|
||||
}
|
||||
|
||||
auto& t = next();
|
||||
const char* use = "type alias";
|
||||
|
||||
auto name = expect_ident(use);
|
||||
|
@ -1034,7 +1039,7 @@ Maybe<const ast::Alias*> ParserImpl::type_alias_decl() {
|
|||
return add_error(peek(), "invalid type alias");
|
||||
}
|
||||
|
||||
return builder_.ty.alias(make_source_range_from(t.source()), name.value, type.value);
|
||||
return builder_.ty.alias(make_source_range_from(source), name.value, type.value);
|
||||
}
|
||||
|
||||
// vec_prefix
|
||||
|
|
|
@ -52,8 +52,13 @@ fn f() { return 1 & >; }
|
|||
}
|
||||
|
||||
TEST_F(ParserImplErrorTest, AliasDeclInvalidAttribute) {
|
||||
EXPECT("@invariant type e=u32;",
|
||||
R"(test.wgsl:1:2 error: unexpected attributes
|
||||
EXPECT(
|
||||
"@invariant type e=u32;",
|
||||
R"(test.wgsl:1:12 warning: use of deprecated language feature: 'type' has been renamed to 'alias'
|
||||
@invariant type e=u32;
|
||||
^^^^
|
||||
|
||||
test.wgsl:1:2 error: unexpected attributes
|
||||
@invariant type e=u32;
|
||||
^^^^^^^^^
|
||||
)");
|
||||
|
@ -745,29 +750,80 @@ struct S { @size(if) i : i32, };
|
|||
}
|
||||
|
||||
TEST_F(ParserImplErrorTest, GlobalDeclTypeAliasMissingIdentifier) {
|
||||
EXPECT("type 1 = f32;",
|
||||
R"(test.wgsl:1:6 error: expected identifier for type alias
|
||||
type 1 = f32;
|
||||
^
|
||||
EXPECT("alias 1 = f32;",
|
||||
R"(test.wgsl:1:7 error: expected identifier for type alias
|
||||
alias 1 = f32;
|
||||
^
|
||||
)");
|
||||
}
|
||||
|
||||
TEST_F(ParserImplErrorTest, GlobalDeclTypeAliasInvalidType) {
|
||||
EXPECT("type meow = 1;", R"(test.wgsl:1:13 error: invalid type alias
|
||||
EXPECT("alias meow = 1;", R"(test.wgsl:1:14 error: invalid type alias
|
||||
alias meow = 1;
|
||||
^
|
||||
)");
|
||||
}
|
||||
|
||||
TEST_F(ParserImplErrorTest, GlobalDeclTypeAliasMissingAssignment) {
|
||||
EXPECT("alias meow f32", R"(test.wgsl:1:12 error: expected '=' for type alias
|
||||
alias meow f32
|
||||
^^^
|
||||
)");
|
||||
}
|
||||
|
||||
TEST_F(ParserImplErrorTest, GlobalDeclTypeAliasMissingSemicolon) {
|
||||
EXPECT("alias meow = f32", R"(test.wgsl:1:17 error: expected ';' for type alias
|
||||
alias meow = f32
|
||||
^
|
||||
)");
|
||||
}
|
||||
|
||||
// TODO(crbug.com/tint/1812): DEPRECATED
|
||||
TEST_F(ParserImplErrorTest, DEPRECATED_GlobalDeclTypeAliasMissingIdentifier) {
|
||||
EXPECT("alias 1 = f32;",
|
||||
R"(test.wgsl:1:7 error: expected identifier for type alias
|
||||
alias 1 = f32;
|
||||
^
|
||||
)");
|
||||
}
|
||||
|
||||
// TODO(crbug.com/tint/1812): DEPRECATED
|
||||
TEST_F(ParserImplErrorTest, DEPRECATED_GlobalDeclTypeAliasInvalidType) {
|
||||
EXPECT(
|
||||
"type meow = 1;",
|
||||
R"(test.wgsl:1:1 warning: use of deprecated language feature: 'type' has been renamed to 'alias'
|
||||
type meow = 1;
|
||||
^^^^
|
||||
|
||||
test.wgsl:1:13 error: invalid type alias
|
||||
type meow = 1;
|
||||
^
|
||||
)");
|
||||
}
|
||||
|
||||
TEST_F(ParserImplErrorTest, GlobalDeclTypeAliasMissingAssignment) {
|
||||
EXPECT("type meow f32", R"(test.wgsl:1:11 error: expected '=' for type alias
|
||||
// TODO(crbug.com/tint/1812): DEPRECATED
|
||||
TEST_F(ParserImplErrorTest, DEPRECATED_GlobalDeclTypeAliasMissingAssignment) {
|
||||
EXPECT(
|
||||
"type meow f32",
|
||||
R"(test.wgsl:1:1 warning: use of deprecated language feature: 'type' has been renamed to 'alias'
|
||||
type meow f32
|
||||
^^^^
|
||||
|
||||
test.wgsl:1:11 error: expected '=' for type alias
|
||||
type meow f32
|
||||
^^^
|
||||
)");
|
||||
}
|
||||
|
||||
TEST_F(ParserImplErrorTest, GlobalDeclTypeAliasMissingSemicolon) {
|
||||
EXPECT("type meow = f32", R"(test.wgsl:1:16 error: expected ';' for type alias
|
||||
// TODO(crbug.com/tint/1812): DEPRECATED
|
||||
TEST_F(ParserImplErrorTest, DEPRECATED_GlobalDeclTypeAliasMissingSemicolon) {
|
||||
EXPECT(
|
||||
"type meow = f32",
|
||||
R"(test.wgsl:1:1 warning: use of deprecated language feature: 'type' has been renamed to 'alias'
|
||||
type meow = f32
|
||||
^^^^
|
||||
|
||||
test.wgsl:1:16 error: expected ';' for type alias
|
||||
type meow = f32
|
||||
^
|
||||
)");
|
||||
|
|
|
@ -99,7 +99,7 @@ TEST_F(ParserImplTest, GlobalDecl_GlobalConst_MissingSemicolon) {
|
|||
}
|
||||
|
||||
TEST_F(ParserImplTest, GlobalDecl_TypeAlias) {
|
||||
auto p = parser("type A = i32;");
|
||||
auto p = parser("alias A = i32;");
|
||||
p->global_decl();
|
||||
ASSERT_FALSE(p->has_error()) << p->error();
|
||||
|
||||
|
@ -113,6 +113,42 @@ TEST_F(ParserImplTest, GlobalDecl_TypeAlias_StructIdent) {
|
|||
auto p = parser(R"(struct A {
|
||||
a : f32,
|
||||
}
|
||||
alias B = A;)");
|
||||
p->global_decl();
|
||||
p->global_decl();
|
||||
ASSERT_FALSE(p->has_error()) << p->error();
|
||||
|
||||
auto program = p->program();
|
||||
ASSERT_EQ(program.AST().TypeDecls().Length(), 2u);
|
||||
ASSERT_TRUE(program.AST().TypeDecls()[0]->Is<ast::Struct>());
|
||||
auto* str = program.AST().TypeDecls()[0]->As<ast::Struct>();
|
||||
EXPECT_EQ(str->name, program.Symbols().Get("A"));
|
||||
|
||||
ASSERT_TRUE(program.AST().TypeDecls()[1]->Is<ast::Alias>());
|
||||
auto* alias = program.AST().TypeDecls()[1]->As<ast::Alias>();
|
||||
EXPECT_EQ(alias->name, program.Symbols().Get("B"));
|
||||
auto* tn = alias->type->As<ast::TypeName>();
|
||||
EXPECT_NE(tn, nullptr);
|
||||
EXPECT_EQ(tn->name, str->name);
|
||||
}
|
||||
|
||||
// TODO(crbug.com/tint/1812): DEPRECATED
|
||||
TEST_F(ParserImplTest, DEPRECATED_GlobalDecl_TypeAlias) {
|
||||
auto p = parser("type A = i32;");
|
||||
p->global_decl();
|
||||
ASSERT_FALSE(p->has_error()) << p->error();
|
||||
|
||||
auto program = p->program();
|
||||
ASSERT_EQ(program.AST().TypeDecls().Length(), 1u);
|
||||
ASSERT_TRUE(program.AST().TypeDecls()[0]->Is<ast::Alias>());
|
||||
EXPECT_EQ(program.Symbols().NameFor(program.AST().TypeDecls()[0]->As<ast::Alias>()->name), "A");
|
||||
}
|
||||
|
||||
// TODO(crbug.com/tint/1812): DEPRECATED
|
||||
TEST_F(ParserImplTest, DEPRECATED_GlobalDecl_TypeAlias_StructIdent) {
|
||||
auto p = parser(R"(struct A {
|
||||
a : f32,
|
||||
}
|
||||
type B = A;)");
|
||||
p->global_decl();
|
||||
p->global_decl();
|
||||
|
@ -133,10 +169,20 @@ type B = A;)");
|
|||
}
|
||||
|
||||
TEST_F(ParserImplTest, GlobalDecl_TypeAlias_MissingSemicolon) {
|
||||
auto p = parser("alias A = i32");
|
||||
p->global_decl();
|
||||
ASSERT_TRUE(p->has_error());
|
||||
EXPECT_EQ(p->error(), "1:14: expected ';' for type alias");
|
||||
}
|
||||
|
||||
// TODO(crbug.com/tint/1812): DEPRECATED
|
||||
TEST_F(ParserImplTest, DEPRECATED_GlobalDecl_TypeAlias_MissingSemicolon) {
|
||||
auto p = parser("type A = i32");
|
||||
p->global_decl();
|
||||
ASSERT_TRUE(p->has_error());
|
||||
EXPECT_EQ(p->error(), "1:13: expected ';' for type alias");
|
||||
EXPECT_EQ(p->error(),
|
||||
R"(1:1: use of deprecated language feature: 'type' has been renamed to 'alias'
|
||||
1:13: expected ';' for type alias)");
|
||||
}
|
||||
|
||||
TEST_F(ParserImplTest, GlobalDecl_Function) {
|
||||
|
|
|
@ -78,10 +78,10 @@ TEST_P(ParserImplReservedKeywordTest, StructMember) {
|
|||
}
|
||||
TEST_P(ParserImplReservedKeywordTest, Alias) {
|
||||
auto name = GetParam();
|
||||
auto p = parser("type " + name + " = i32;");
|
||||
auto p = parser("alias " + name + " = i32;");
|
||||
EXPECT_FALSE(p->Parse());
|
||||
EXPECT_TRUE(p->has_error());
|
||||
EXPECT_EQ(p->error(), "1:6: '" + name + "' is a reserved keyword");
|
||||
EXPECT_EQ(p->error(), "1:7: '" + name + "' is a reserved keyword");
|
||||
}
|
||||
INSTANTIATE_TEST_SUITE_P(ParserImplReservedKeywordTest,
|
||||
ParserImplReservedKeywordTest,
|
||||
|
|
|
@ -73,7 +73,9 @@ TEST_F(ParserImplTest, TypeDecl_MissingIdent) {
|
|||
EXPECT_FALSE(t.matched);
|
||||
EXPECT_TRUE(p->has_error());
|
||||
EXPECT_EQ(t.value, nullptr);
|
||||
EXPECT_EQ(p->error(), "1:6: expected identifier for type alias");
|
||||
EXPECT_EQ(p->error(),
|
||||
R"(1:1: use of deprecated language feature: 'type' has been renamed to 'alias'
|
||||
1:6: expected identifier for type alias)");
|
||||
}
|
||||
|
||||
TEST_F(ParserImplTest, TypeDecl_InvalidIdent) {
|
||||
|
@ -83,7 +85,9 @@ TEST_F(ParserImplTest, TypeDecl_InvalidIdent) {
|
|||
EXPECT_FALSE(t.matched);
|
||||
EXPECT_TRUE(p->has_error());
|
||||
EXPECT_EQ(t.value, nullptr);
|
||||
EXPECT_EQ(p->error(), "1:6: expected identifier for type alias");
|
||||
EXPECT_EQ(p->error(),
|
||||
R"(1:1: use of deprecated language feature: 'type' has been renamed to 'alias'
|
||||
1:6: expected identifier for type alias)");
|
||||
}
|
||||
|
||||
TEST_F(ParserImplTest, TypeDecl_MissingEqual) {
|
||||
|
@ -93,7 +97,9 @@ TEST_F(ParserImplTest, TypeDecl_MissingEqual) {
|
|||
EXPECT_FALSE(t.matched);
|
||||
EXPECT_TRUE(p->has_error());
|
||||
EXPECT_EQ(t.value, nullptr);
|
||||
EXPECT_EQ(p->error(), "1:8: expected '=' for type alias");
|
||||
EXPECT_EQ(p->error(),
|
||||
R"(1:1: use of deprecated language feature: 'type' has been renamed to 'alias'
|
||||
1:8: expected '=' for type alias)");
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -135,6 +135,8 @@ std::string_view Token::TypeToName(Type type) {
|
|||
case Token::Type::kShiftRightEqual:
|
||||
return ">>=";
|
||||
|
||||
case Token::Type::kAlias:
|
||||
return "alias";
|
||||
case Token::Type::kArray:
|
||||
return "array";
|
||||
case Token::Type::kAtomic:
|
||||
|
|
|
@ -145,6 +145,8 @@ class Token {
|
|||
/// A '<<='
|
||||
kShiftLeftEqual,
|
||||
|
||||
/// A 'alias'
|
||||
kAlias,
|
||||
/// A 'array'
|
||||
kArray,
|
||||
/// A 'atomic'
|
||||
|
|
|
@ -143,7 +143,7 @@ fn main() {
|
|||
}
|
||||
)";
|
||||
auto* expect = R"(
|
||||
type Numbers = array<vec4<f32>, 4u>;
|
||||
alias Numbers = array<vec4<f32>, 4u>;
|
||||
|
||||
@internal(block)
|
||||
struct u_block {
|
||||
|
@ -718,13 +718,13 @@ struct Inner {
|
|||
f : f32,
|
||||
}
|
||||
|
||||
type MyInner = Inner;
|
||||
alias MyInner = Inner;
|
||||
|
||||
struct Outer {
|
||||
i : MyInner,
|
||||
}
|
||||
|
||||
type MyOuter = Outer;
|
||||
alias MyOuter = Outer;
|
||||
|
||||
@internal(block)
|
||||
struct u0_block {
|
||||
|
@ -792,7 +792,7 @@ struct u1_block {
|
|||
|
||||
@group(0) @binding(1) var<uniform> u1 : u1_block;
|
||||
|
||||
type MyInner = Inner;
|
||||
alias MyInner = Inner;
|
||||
|
||||
@internal(block)
|
||||
struct u0_block {
|
||||
|
@ -801,7 +801,7 @@ struct u0_block {
|
|||
|
||||
@group(0) @binding(0) var<uniform> u0 : u0_block;
|
||||
|
||||
type MyOuter = Outer;
|
||||
alias MyOuter = Outer;
|
||||
|
||||
struct Outer {
|
||||
i : MyInner,
|
||||
|
|
|
@ -173,7 +173,7 @@ fn frag_main(@location(1) loc1 : myf32) {
|
|||
)";
|
||||
|
||||
auto* expect = R"(
|
||||
type myf32 = f32;
|
||||
alias myf32 = f32;
|
||||
|
||||
struct tint_symbol_1 {
|
||||
@location(1)
|
||||
|
@ -222,7 +222,7 @@ fn frag_main(tint_symbol : tint_symbol_1) {
|
|||
frag_main_inner(tint_symbol.loc1);
|
||||
}
|
||||
|
||||
type myf32 = f32;
|
||||
alias myf32 = f32;
|
||||
)";
|
||||
|
||||
DataMap data;
|
||||
|
@ -1589,7 +1589,7 @@ fn frag_main(inputs : MyFragmentInput) -> MyFragmentOutput {
|
|||
)";
|
||||
|
||||
auto* expect = R"(
|
||||
type myf32 = f32;
|
||||
alias myf32 = f32;
|
||||
|
||||
struct FragmentInput {
|
||||
col1 : myf32,
|
||||
|
@ -1601,9 +1601,9 @@ struct FragmentOutput {
|
|||
col2 : myf32,
|
||||
}
|
||||
|
||||
type MyFragmentInput = FragmentInput;
|
||||
alias MyFragmentInput = FragmentInput;
|
||||
|
||||
type MyFragmentOutput = FragmentOutput;
|
||||
alias MyFragmentOutput = FragmentOutput;
|
||||
|
||||
fn foo(x : MyFragmentInput) -> myf32 {
|
||||
return x.col1;
|
||||
|
@ -1703,9 +1703,9 @@ fn frag_main(tint_symbol : tint_symbol_1) -> tint_symbol_2 {
|
|||
return wrapper_result;
|
||||
}
|
||||
|
||||
type MyFragmentInput = FragmentInput;
|
||||
alias MyFragmentInput = FragmentInput;
|
||||
|
||||
type MyFragmentOutput = FragmentOutput;
|
||||
alias MyFragmentOutput = FragmentOutput;
|
||||
|
||||
fn foo(x : MyFragmentInput) -> myf32 {
|
||||
return x.col1;
|
||||
|
@ -1721,7 +1721,7 @@ struct FragmentOutput {
|
|||
col2 : myf32,
|
||||
}
|
||||
|
||||
type myf32 = f32;
|
||||
alias myf32 = f32;
|
||||
)";
|
||||
|
||||
DataMap data;
|
||||
|
|
|
@ -247,7 +247,7 @@ fn main() -> vec4<f32> {
|
|||
}
|
||||
)";
|
||||
auto* expect = R"(
|
||||
type Tex2d = texture_2d<f32>;
|
||||
alias Tex2d = texture_2d<f32>;
|
||||
|
||||
@group(0) @binding(0) @internal(disable_validation__binding_point_collision) var placeholder_sampler : sampler;
|
||||
|
||||
|
@ -297,7 +297,7 @@ fn sample(t_s_1 : texture_2d<f32>, coords : vec2<f32>) -> vec4<f32> {
|
|||
return textureSample(t_s_1, placeholder_sampler, coords);
|
||||
}
|
||||
|
||||
type Tex2d = texture_2d<f32>;
|
||||
alias Tex2d = texture_2d<f32>;
|
||||
)";
|
||||
|
||||
DataMap data;
|
||||
|
|
|
@ -3439,9 +3439,9 @@ struct S1 {
|
|||
c : i32,
|
||||
}
|
||||
|
||||
type A1 = S1;
|
||||
alias A1 = S1;
|
||||
|
||||
type A1_Array = array<S1, 3>;
|
||||
alias A1_Array = array<S1, 3>;
|
||||
|
||||
struct S2 {
|
||||
a : i32,
|
||||
|
@ -3449,9 +3449,9 @@ struct S2 {
|
|||
c : i32,
|
||||
}
|
||||
|
||||
type A2 = S2;
|
||||
alias A2 = S2;
|
||||
|
||||
type A2_Array = array<S2>;
|
||||
alias A2_Array = array<S2>;
|
||||
|
||||
struct SB {
|
||||
@size(128)
|
||||
|
@ -3537,9 +3537,9 @@ struct SB {
|
|||
b : A2_Array,
|
||||
}
|
||||
|
||||
type A2_Array = array<S2>;
|
||||
alias A2_Array = array<S2>;
|
||||
|
||||
type A2 = S2;
|
||||
alias A2 = S2;
|
||||
|
||||
struct S2 {
|
||||
a : i32,
|
||||
|
@ -3547,9 +3547,9 @@ struct S2 {
|
|||
c : i32,
|
||||
}
|
||||
|
||||
type A1 = S1;
|
||||
alias A1 = S1;
|
||||
|
||||
type A1_Array = array<S1, 3>;
|
||||
alias A1_Array = array<S1, 3>;
|
||||
|
||||
struct S1 {
|
||||
a : i32,
|
||||
|
|
|
@ -533,7 +533,7 @@ struct strided_arr {
|
|||
el : f32,
|
||||
}
|
||||
|
||||
type ARR = array<strided_arr, 4u>;
|
||||
alias ARR = array<strided_arr, 4u>;
|
||||
|
||||
struct S {
|
||||
a : ARR,
|
||||
|
@ -626,14 +626,14 @@ struct strided_arr {
|
|||
el : f32,
|
||||
}
|
||||
|
||||
type ARR_A = array<strided_arr, 2u>;
|
||||
alias ARR_A = array<strided_arr, 2u>;
|
||||
|
||||
struct strided_arr_1 {
|
||||
@size(128)
|
||||
el : array<ARR_A, 3u>,
|
||||
}
|
||||
|
||||
type ARR_B = array<strided_arr_1, 4u>;
|
||||
alias ARR_B = array<strided_arr_1, 4u>;
|
||||
|
||||
struct S {
|
||||
a : ARR_B,
|
||||
|
|
|
@ -242,7 +242,7 @@ enable chromium_experimental_full_ptr_parameters;
|
|||
|
||||
@group(0) @binding(0) var<uniform> U : array<array<array<vec4<i32>, 8>, 8>, 8>;
|
||||
|
||||
type U_X_X_X = array<u32, 3u>;
|
||||
alias U_X_X_X = array<u32, 3u>;
|
||||
|
||||
fn a_U_X_X_X(pre : i32, p : U_X_X_X, post : i32) -> vec4<i32> {
|
||||
return U[p[0]][p[1]][p[2]];
|
||||
|
@ -339,7 +339,7 @@ fn third() -> i32 {
|
|||
return i;
|
||||
}
|
||||
|
||||
type U_X_X_X = array<u32, 3u>;
|
||||
alias U_X_X_X = array<u32, 3u>;
|
||||
|
||||
fn a_U_X_X_X(pre : i32, p : U_X_X_X, post : i32) -> vec4<i32> {
|
||||
return U[p[0]][p[1]][p[2]];
|
||||
|
@ -429,7 +429,7 @@ fn second() -> i32 {
|
|||
return i;
|
||||
}
|
||||
|
||||
type U_X_X = array<u32, 2u>;
|
||||
alias U_X_X = array<u32, 2u>;
|
||||
|
||||
fn a_U_X_X(pre : i32, p : U_X_X, post : i32) -> vec4<i32> {
|
||||
return U[p[0]][p[1]];
|
||||
|
@ -515,7 +515,7 @@ fn second() -> i32 {
|
|||
return i;
|
||||
}
|
||||
|
||||
type U_X_X = array<u32, 2u>;
|
||||
alias U_X_X = array<u32, 2u>;
|
||||
|
||||
fn a_U_X_X(pre : i32, p : U_X_X, post : i32) -> vec4<i32> {
|
||||
return U[p[0]][p[1]];
|
||||
|
@ -605,7 +605,7 @@ fn second() -> i32 {
|
|||
return i;
|
||||
}
|
||||
|
||||
type U_X_X = array<u32, 2u>;
|
||||
alias U_X_X = array<u32, 2u>;
|
||||
|
||||
fn a_U_X_X(pre : i32, p : U_X_X, post : i32) -> vec4<i32> {
|
||||
return U[p[0]][p[1]];
|
||||
|
@ -695,7 +695,7 @@ fn second() -> i32 {
|
|||
return i;
|
||||
}
|
||||
|
||||
type U_X_X = array<u32, 2u>;
|
||||
alias U_X_X = array<u32, 2u>;
|
||||
|
||||
fn a_U_X_X(pre : i32, p : U_X_X, post : i32) -> vec4<i32> {
|
||||
return U[p[0]][p[1]];
|
||||
|
@ -793,7 +793,7 @@ enable chromium_experimental_full_ptr_parameters;
|
|||
|
||||
@group(0) @binding(0) var<uniform> U : array<vec4<i32>, 8>;
|
||||
|
||||
type U_X = array<u32, 1u>;
|
||||
alias U_X = array<u32, 1u>;
|
||||
|
||||
fn a_U_X(pre : i32, p : U_X, post : i32) -> vec4<i32> {
|
||||
return U[p[0]];
|
||||
|
@ -880,7 +880,7 @@ struct Inner {
|
|||
mat : mat3x4<f32>,
|
||||
}
|
||||
|
||||
type InnerArr = array<Inner, 4>;
|
||||
alias InnerArr = array<Inner, 4>;
|
||||
|
||||
struct Outer {
|
||||
arr : InnerArr,
|
||||
|
@ -889,19 +889,19 @@ struct Outer {
|
|||
|
||||
@group(0) @binding(0) var<uniform> U : Outer;
|
||||
|
||||
type U_mat_X = array<u32, 1u>;
|
||||
alias U_mat_X = array<u32, 1u>;
|
||||
|
||||
fn f0_U_mat_X(p : U_mat_X) -> f32 {
|
||||
return U.mat[p[0]].x;
|
||||
}
|
||||
|
||||
type U_arr_X_mat_X = array<u32, 2u>;
|
||||
alias U_arr_X_mat_X = array<u32, 2u>;
|
||||
|
||||
fn f0_U_arr_X_mat_X(p : U_arr_X_mat_X) -> f32 {
|
||||
return U.arr[p[0]].mat[p[0]].x;
|
||||
}
|
||||
|
||||
type U_arr_X_mat_X_1 = array<u32, 2u>;
|
||||
alias U_arr_X_mat_X_1 = array<u32, 2u>;
|
||||
|
||||
fn f0_U_arr_X_mat_X_1(p : U_arr_X_mat_X_1) -> f32 {
|
||||
return U.arr[p[0]].mat[p[1]].x;
|
||||
|
@ -926,7 +926,7 @@ fn f1_U_mat() -> f32 {
|
|||
return res;
|
||||
}
|
||||
|
||||
type U_arr_X_mat = array<u32, 1u>;
|
||||
alias U_arr_X_mat = array<u32, 1u>;
|
||||
|
||||
fn f1_U_arr_X_mat(p : U_arr_X_mat) -> f32 {
|
||||
var res : f32;
|
||||
|
@ -947,7 +947,7 @@ fn f1_U_arr_X_mat(p : U_arr_X_mat) -> f32 {
|
|||
return res;
|
||||
}
|
||||
|
||||
type U_arr_X = array<u32, 1u>;
|
||||
alias U_arr_X = array<u32, 1u>;
|
||||
|
||||
fn f2_U_arr_X(p : U_arr_X) -> f32 {
|
||||
let p_mat = &(U.arr[p[0]].mat);
|
||||
|
@ -1087,7 +1087,7 @@ enable chromium_experimental_full_ptr_parameters;
|
|||
|
||||
@group(0) @binding(0) var<storage, read_write> S : array<vec4<i32>, 8>;
|
||||
|
||||
type S_X = array<u32, 1u>;
|
||||
alias S_X = array<u32, 1u>;
|
||||
|
||||
fn a_S_X(pre : i32, p : S_X, post : i32) {
|
||||
S[p[0]] = vec4<i32>();
|
||||
|
@ -1174,7 +1174,7 @@ struct Inner {
|
|||
mat : mat3x4<f32>,
|
||||
}
|
||||
|
||||
type InnerArr = array<Inner, 4>;
|
||||
alias InnerArr = array<Inner, 4>;
|
||||
|
||||
struct Outer {
|
||||
arr : InnerArr,
|
||||
|
@ -1183,19 +1183,19 @@ struct Outer {
|
|||
|
||||
@group(0) @binding(0) var<storage> S : Outer;
|
||||
|
||||
type S_mat_X = array<u32, 1u>;
|
||||
alias S_mat_X = array<u32, 1u>;
|
||||
|
||||
fn f0_S_mat_X(p : S_mat_X) -> f32 {
|
||||
return S.mat[p[0]].x;
|
||||
}
|
||||
|
||||
type S_arr_X_mat_X = array<u32, 2u>;
|
||||
alias S_arr_X_mat_X = array<u32, 2u>;
|
||||
|
||||
fn f0_S_arr_X_mat_X(p : S_arr_X_mat_X) -> f32 {
|
||||
return S.arr[p[0]].mat[p[0]].x;
|
||||
}
|
||||
|
||||
type S_arr_X_mat_X_1 = array<u32, 2u>;
|
||||
alias S_arr_X_mat_X_1 = array<u32, 2u>;
|
||||
|
||||
fn f0_S_arr_X_mat_X_1(p : S_arr_X_mat_X_1) -> f32 {
|
||||
return S.arr[p[0]].mat[p[1]].x;
|
||||
|
@ -1220,7 +1220,7 @@ fn f1_S_mat() -> f32 {
|
|||
return res;
|
||||
}
|
||||
|
||||
type S_arr_X_mat = array<u32, 1u>;
|
||||
alias S_arr_X_mat = array<u32, 1u>;
|
||||
|
||||
fn f1_S_arr_X_mat(p : S_arr_X_mat) -> f32 {
|
||||
var res : f32;
|
||||
|
@ -1241,7 +1241,7 @@ fn f1_S_arr_X_mat(p : S_arr_X_mat) -> f32 {
|
|||
return res;
|
||||
}
|
||||
|
||||
type S_arr_X = array<u32, 1u>;
|
||||
alias S_arr_X = array<u32, 1u>;
|
||||
|
||||
fn f2_S_arr_X(p : S_arr_X) -> f32 {
|
||||
let p_mat = &(S.arr[p[0]].mat);
|
||||
|
@ -1296,7 +1296,7 @@ enable chromium_experimental_full_ptr_parameters;
|
|||
|
||||
var<workgroup> W : array<vec4<i32>, 8>;
|
||||
|
||||
type W_X = array<u32, 1u>;
|
||||
alias W_X = array<u32, 1u>;
|
||||
|
||||
fn a_W_X(pre : i32, p : W_X, post : i32) -> vec4<i32> {
|
||||
return W[p[0]];
|
||||
|
@ -1332,7 +1332,7 @@ enable chromium_experimental_full_ptr_parameters;
|
|||
|
||||
var<workgroup> W : array<vec4<i32>, 8>;
|
||||
|
||||
type W_X = array<u32, 1u>;
|
||||
alias W_X = array<u32, 1u>;
|
||||
|
||||
fn a_W_X(pre : i32, p : W_X, post : i32) {
|
||||
W[p[0]] = vec4<i32>();
|
||||
|
@ -1418,7 +1418,7 @@ struct Inner {
|
|||
mat : mat3x4<f32>,
|
||||
}
|
||||
|
||||
type InnerArr = array<Inner, 4>;
|
||||
alias InnerArr = array<Inner, 4>;
|
||||
|
||||
struct Outer {
|
||||
arr : InnerArr,
|
||||
|
@ -1427,19 +1427,19 @@ struct Outer {
|
|||
|
||||
var<workgroup> W : Outer;
|
||||
|
||||
type W_mat_X = array<u32, 1u>;
|
||||
alias W_mat_X = array<u32, 1u>;
|
||||
|
||||
fn f0_W_mat_X(p : W_mat_X) -> f32 {
|
||||
return W.mat[p[0]].x;
|
||||
}
|
||||
|
||||
type W_arr_X_mat_X = array<u32, 2u>;
|
||||
alias W_arr_X_mat_X = array<u32, 2u>;
|
||||
|
||||
fn f0_W_arr_X_mat_X(p : W_arr_X_mat_X) -> f32 {
|
||||
return W.arr[p[0]].mat[p[0]].x;
|
||||
}
|
||||
|
||||
type W_arr_X_mat_X_1 = array<u32, 2u>;
|
||||
alias W_arr_X_mat_X_1 = array<u32, 2u>;
|
||||
|
||||
fn f0_W_arr_X_mat_X_1(p : W_arr_X_mat_X_1) -> f32 {
|
||||
return W.arr[p[0]].mat[p[1]].x;
|
||||
|
@ -1464,7 +1464,7 @@ fn f1_W_mat() -> f32 {
|
|||
return res;
|
||||
}
|
||||
|
||||
type W_arr_X_mat = array<u32, 1u>;
|
||||
alias W_arr_X_mat = array<u32, 1u>;
|
||||
|
||||
fn f1_W_arr_X_mat(p : W_arr_X_mat) -> f32 {
|
||||
var res : f32;
|
||||
|
@ -1485,7 +1485,7 @@ fn f1_W_arr_X_mat(p : W_arr_X_mat) -> f32 {
|
|||
return res;
|
||||
}
|
||||
|
||||
type W_arr_X = array<u32, 1u>;
|
||||
alias W_arr_X = array<u32, 1u>;
|
||||
|
||||
fn f2_W_arr_X(p : W_arr_X) -> f32 {
|
||||
let p_mat = &(W.arr[p[0]].mat);
|
||||
|
@ -1762,7 +1762,7 @@ fn a_F_i(pre : i32, p : ptr<private, str>, post : i32) -> i32 {
|
|||
return (*(p)).i;
|
||||
}
|
||||
|
||||
type F_X = array<u32, 1u>;
|
||||
alias F_X = array<u32, 1u>;
|
||||
|
||||
fn a_F_X(pre : i32, p_base : ptr<private, array<i32, 4u>>, p_indices : F_X, post : i32) -> i32 {
|
||||
return (*(p_base))[p_indices[0]];
|
||||
|
@ -1774,7 +1774,7 @@ var<private> Ps : str;
|
|||
|
||||
var<private> Pa : array<i32, 4>;
|
||||
|
||||
type F_X_1 = array<u32, 1u>;
|
||||
alias F_X_1 = array<u32, 1u>;
|
||||
|
||||
fn b() {
|
||||
a_F(10, &(Pi), 20);
|
||||
|
@ -1890,7 +1890,7 @@ struct Inner {
|
|||
mat : mat3x4<f32>,
|
||||
}
|
||||
|
||||
type InnerArr = array<Inner, 4>;
|
||||
alias InnerArr = array<Inner, 4>;
|
||||
|
||||
struct Outer {
|
||||
arr : InnerArr,
|
||||
|
@ -1899,27 +1899,27 @@ struct Outer {
|
|||
|
||||
var<private> P : Outer;
|
||||
|
||||
type F_mat_X = array<u32, 1u>;
|
||||
alias F_mat_X = array<u32, 1u>;
|
||||
|
||||
fn f0_F_mat_X(p_base : ptr<private, Outer>, p_indices : F_mat_X) -> f32 {
|
||||
return (*(p_base)).mat[p_indices[0]].x;
|
||||
}
|
||||
|
||||
type F_arr_X_mat_X = array<u32, 2u>;
|
||||
alias F_arr_X_mat_X = array<u32, 2u>;
|
||||
|
||||
fn f0_F_arr_X_mat_X(p_base : ptr<private, Outer>, p_indices : F_arr_X_mat_X) -> f32 {
|
||||
return (*(p_base)).arr[p_indices[0]].mat[p_indices[0]].x;
|
||||
}
|
||||
|
||||
type F_arr_X_mat_X_1 = array<u32, 2u>;
|
||||
alias F_arr_X_mat_X_1 = array<u32, 2u>;
|
||||
|
||||
fn f0_F_arr_X_mat_X_1(p_base : ptr<private, Outer>, p_indices : F_arr_X_mat_X_1) -> f32 {
|
||||
return (*(p_base)).arr[p_indices[0]].mat[p_indices[1]].x;
|
||||
}
|
||||
|
||||
type F_mat_X_1 = array<u32, 1u>;
|
||||
alias F_mat_X_1 = array<u32, 1u>;
|
||||
|
||||
type F_arr_X_mat_X_2 = array<u32, 2u>;
|
||||
alias F_arr_X_mat_X_2 = array<u32, 2u>;
|
||||
|
||||
fn f1_F_mat(p : ptr<private, Outer>) -> f32 {
|
||||
var res : f32;
|
||||
|
@ -1940,9 +1940,9 @@ fn f1_F_mat(p : ptr<private, Outer>) -> f32 {
|
|||
return res;
|
||||
}
|
||||
|
||||
type F_arr_X_mat = array<u32, 1u>;
|
||||
alias F_arr_X_mat = array<u32, 1u>;
|
||||
|
||||
type F_arr_X_mat_X_3 = array<u32, 2u>;
|
||||
alias F_arr_X_mat_X_3 = array<u32, 2u>;
|
||||
|
||||
fn f1_F_arr_X_mat(p_base : ptr<private, Outer>, p_indices : F_arr_X_mat) -> f32 {
|
||||
var res : f32;
|
||||
|
@ -1963,16 +1963,16 @@ fn f1_F_arr_X_mat(p_base : ptr<private, Outer>, p_indices : F_arr_X_mat) -> f32
|
|||
return res;
|
||||
}
|
||||
|
||||
type F_arr_X = array<u32, 1u>;
|
||||
alias F_arr_X = array<u32, 1u>;
|
||||
|
||||
type F_arr_X_mat_1 = array<u32, 1u>;
|
||||
alias F_arr_X_mat_1 = array<u32, 1u>;
|
||||
|
||||
fn f2_F_arr_X(p_base : ptr<private, Outer>, p_indices : F_arr_X) -> f32 {
|
||||
let p_mat = &((*(p_base)).arr[p_indices[0]].mat);
|
||||
return f1_F_arr_X_mat(p_base, F_arr_X_mat_1(p_indices[0u]));
|
||||
}
|
||||
|
||||
type F_arr_X_1 = array<u32, 1u>;
|
||||
alias F_arr_X_1 = array<u32, 1u>;
|
||||
|
||||
fn f3_F_arr_F_mat(p0 : ptr<private, Outer>, p1 : ptr<private, Outer>) -> f32 {
|
||||
let p0_inner = &((*(p0)).arr[3]);
|
||||
|
@ -2001,7 +2001,7 @@ struct Inner {
|
|||
mat : mat3x4<f32>,
|
||||
}
|
||||
|
||||
type InnerArr = array<Inner, 4>;
|
||||
alias InnerArr = array<Inner, 4>;
|
||||
|
||||
struct Outer {
|
||||
arr : InnerArr,
|
||||
|
@ -2268,13 +2268,13 @@ fn a_F_i(pre : i32, p : ptr<function, str>, post : i32) -> i32 {
|
|||
return (*(p)).i;
|
||||
}
|
||||
|
||||
type F_X = array<u32, 1u>;
|
||||
alias F_X = array<u32, 1u>;
|
||||
|
||||
fn a_F_X(pre : i32, p_base : ptr<function, array<i32, 4u>>, p_indices : F_X, post : i32) -> i32 {
|
||||
return (*(p_base))[p_indices[0]];
|
||||
}
|
||||
|
||||
type F_X_1 = array<u32, 1u>;
|
||||
alias F_X_1 = array<u32, 1u>;
|
||||
|
||||
fn b() {
|
||||
var Fi : i32;
|
||||
|
@ -2460,13 +2460,13 @@ fn fn_u_U_str_i() -> vec4<i32> {
|
|||
return U_str.i;
|
||||
}
|
||||
|
||||
type U_arr_X = array<u32, 1u>;
|
||||
alias U_arr_X = array<u32, 1u>;
|
||||
|
||||
fn fn_u_U_arr_X(p : U_arr_X) -> vec4<i32> {
|
||||
return U_arr[p[0]];
|
||||
}
|
||||
|
||||
type U_arr_arr_X_X = array<u32, 2u>;
|
||||
alias U_arr_arr_X_X = array<u32, 2u>;
|
||||
|
||||
fn fn_u_U_arr_arr_X_X(p : U_arr_arr_X_X) -> vec4<i32> {
|
||||
return U_arr_arr[p[0]][p[1]];
|
||||
|
@ -2480,13 +2480,13 @@ fn fn_s_S_str_i() -> vec4<i32> {
|
|||
return S_str.i;
|
||||
}
|
||||
|
||||
type S_arr_X = array<u32, 1u>;
|
||||
alias S_arr_X = array<u32, 1u>;
|
||||
|
||||
fn fn_s_S_arr_X(p : S_arr_X) -> vec4<i32> {
|
||||
return S_arr[p[0]];
|
||||
}
|
||||
|
||||
type S_arr_arr_X_X = array<u32, 2u>;
|
||||
alias S_arr_arr_X_X = array<u32, 2u>;
|
||||
|
||||
fn fn_s_S_arr_arr_X_X(p : S_arr_arr_X_X) -> vec4<i32> {
|
||||
return S_arr_arr[p[0]][p[1]];
|
||||
|
@ -2500,13 +2500,13 @@ fn fn_w_W_str_i() -> vec4<i32> {
|
|||
return W_str.i;
|
||||
}
|
||||
|
||||
type W_arr_X = array<u32, 1u>;
|
||||
alias W_arr_X = array<u32, 1u>;
|
||||
|
||||
fn fn_w_W_arr_X(p : W_arr_X) -> vec4<i32> {
|
||||
return W_arr[p[0]];
|
||||
}
|
||||
|
||||
type W_arr_arr_X_X = array<u32, 2u>;
|
||||
alias W_arr_arr_X_X = array<u32, 2u>;
|
||||
|
||||
fn fn_w_W_arr_arr_X_X(p : W_arr_arr_X_X) -> vec4<i32> {
|
||||
return W_arr_arr[p[0]][p[1]];
|
||||
|
@ -2578,7 +2578,7 @@ fn a(i : i32) -> i32 {
|
|||
return i;
|
||||
}
|
||||
|
||||
type S_X = array<u32, 1u>;
|
||||
alias S_X = array<u32, 1u>;
|
||||
|
||||
fn b_S_X(p : S_X) -> i32 {
|
||||
return S[p[0]][a(S[p[0]][0][1][2])][a(S[p[0]][a(3)][4][5])][a(S[p[0]][6][a(7)][8])];
|
||||
|
@ -2620,13 +2620,13 @@ enable chromium_experimental_full_ptr_parameters;
|
|||
|
||||
@group(0) @binding(0) var<storage> S : array<array<array<array<i32, 9>, 9>, 9>, 50>;
|
||||
|
||||
type S_X_X_X_X = array<u32, 4u>;
|
||||
alias S_X_X_X_X = array<u32, 4u>;
|
||||
|
||||
fn a_S_X_X_X_X(pre : i32, i : S_X_X_X_X, post : i32) -> i32 {
|
||||
return S[i[0]][i[0]][i[1]][i[2]];
|
||||
}
|
||||
|
||||
type S_X = array<u32, 1u>;
|
||||
alias S_X = array<u32, 1u>;
|
||||
|
||||
fn b_S_X(p : S_X) -> i32 {
|
||||
return a_S_X_X_X_X(10, S_X_X_X_X(p[0u], u32(a_S_X_X_X_X(20, S_X_X_X_X(p[0u], 0, 1, 2), 30)), u32(a_S_X_X_X_X(40, S_X_X_X_X(p[0u], 3, 4, 5), 50)), u32(a_S_X_X_X_X(60, S_X_X_X_X(p[0u], 6, 7, 8), 70))), 80);
|
||||
|
@ -2673,9 +2673,9 @@ fn a(i : i32) -> i32 {
|
|||
return i;
|
||||
}
|
||||
|
||||
type S_X = array<u32, 1u>;
|
||||
alias S_X = array<u32, 1u>;
|
||||
|
||||
type U_X = array<u32, 1u>;
|
||||
alias U_X = array<u32, 1u>;
|
||||
|
||||
fn b_S_X_U_X(s : S_X, u : U_X) -> i32 {
|
||||
return S[s[0]][a(U[u[0]][0][1].x)][a(U[u[0]][a(3)][4].y)];
|
||||
|
|
|
@ -621,7 +621,7 @@ struct tint_symbol_1 {
|
|||
arr : array<f32>,
|
||||
}
|
||||
|
||||
type myarray = array<f32>;
|
||||
alias myarray = array<f32>;
|
||||
|
||||
@compute @workgroup_size(1)
|
||||
fn main(@group(0) @binding(0) @internal(disable_validation__entry_point_parameter) @internal(disable_validation__ignore_address_space) tint_symbol : ptr<storage, tint_symbol_1>) {
|
||||
|
@ -656,7 +656,7 @@ fn main(@group(0) @binding(0) @internal(disable_validation__entry_point_paramete
|
|||
_ = (*(tint_symbol)).arr[0];
|
||||
}
|
||||
|
||||
type myarray = array<f32>;
|
||||
alias myarray = array<f32>;
|
||||
)";
|
||||
|
||||
auto got = Run<ModuleScopeVarToEntryPointParam>(src);
|
||||
|
|
|
@ -1657,7 +1657,7 @@ struct ExternalTextureParams {
|
|||
|
||||
@group(0) @binding(3) var<uniform> ext_tex_params : ExternalTextureParams;
|
||||
|
||||
type ET = texture_external;
|
||||
alias ET = texture_external;
|
||||
|
||||
fn gammaCorrection(v : vec3<f32>, params : GammaTransferParams) -> vec3<f32> {
|
||||
let cond = (abs(v) < vec3<f32>(params.D));
|
||||
|
@ -1795,7 +1795,7 @@ fn f(t : texture_2d<f32>, ext_tex_plane_1_1 : texture_2d<f32>, ext_tex_params_1
|
|||
|
||||
@group(0) @binding(1) var smp : sampler;
|
||||
|
||||
type ET = texture_external;
|
||||
alias ET = texture_external;
|
||||
)";
|
||||
DataMap data;
|
||||
data.Add<MultiplanarExternalTexture::NewBindingPoints>(MultiplanarExternalTexture::BindingsMap{
|
||||
|
|
|
@ -386,7 +386,7 @@ fn foo() {
|
|||
auto* expect = R"(
|
||||
enable chromium_experimental_full_ptr_parameters;
|
||||
|
||||
type Array = array<array<vec3<u32>, 4>, 3>;
|
||||
alias Array = array<array<vec3<u32>, 4>, 3>;
|
||||
|
||||
@group(0) @binding(0) var<storage, read_write> v : Array;
|
||||
|
||||
|
|
|
@ -1194,7 +1194,7 @@ struct S1 {
|
|||
|
||||
TEST_F(PromoteInitializersToLetTest, NoChangeOnVarDecl) {
|
||||
auto* src = R"(
|
||||
type F = f32;
|
||||
alias F = f32;
|
||||
|
||||
fn f() {
|
||||
var local_arr = array<f32, 4u>(0.0, 1.0, 2.0, 3.0);
|
||||
|
@ -1222,7 +1222,7 @@ fn f() {
|
|||
|
||||
const module_str : F = F(2.0);
|
||||
|
||||
type F = f32;
|
||||
alias F = f32;
|
||||
|
||||
const module_arr : array<f32, 4u> = array<f32, 4u>(0.0, 1.0, 2.0, 3.0);
|
||||
)";
|
||||
|
|
|
@ -1673,7 +1673,7 @@ fn f() {
|
|||
)");
|
||||
|
||||
auto expect = expand(R"(
|
||||
type tint_symbol = i32;
|
||||
alias tint_symbol = i32;
|
||||
|
||||
@fragment
|
||||
fn tint_symbol_1() {
|
||||
|
|
|
@ -389,7 +389,7 @@ TEST_F(SingleEntryPointTest, OverridableConstants_TransitiveUses) {
|
|||
|
||||
@id(5) override c5 : u32 = (2 * c4);
|
||||
|
||||
type arr_ty = array<i32, (2 * c5)>;
|
||||
alias arr_ty = array<i32, (2 * c5)>;
|
||||
|
||||
var<workgroup> arr : arr_ty;
|
||||
|
||||
|
@ -593,7 +593,7 @@ TEST_F(SingleEntryPointTest, GlobalConstUsedAsArraySize) {
|
|||
auto* src = R"(
|
||||
const MY_SIZE = 5u;
|
||||
|
||||
type Arr = array<i32, MY_SIZE>;
|
||||
alias Arr = array<i32, MY_SIZE>;
|
||||
|
||||
@fragment
|
||||
fn main() {
|
||||
|
|
|
@ -226,13 +226,13 @@ fn f() {
|
|||
)";
|
||||
|
||||
auto* expect = R"(
|
||||
type A0 = u32;
|
||||
alias A0 = u32;
|
||||
|
||||
type A1 = array<A0, 1>;
|
||||
alias A1 = array<A0, 1>;
|
||||
|
||||
type A2 = array<A1, 2>;
|
||||
alias A2 = array<A1, 2>;
|
||||
|
||||
type A3 = array<A2, 3>;
|
||||
alias A3 = array<A2, 3>;
|
||||
|
||||
var<workgroup> wg : array<array<array<atomic<u32>, 1u>, 2u>, 3u>;
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ fn Z() {
|
|||
)";
|
||||
|
||||
auto* expect = R"(
|
||||
type a = i32;
|
||||
alias a = i32;
|
||||
|
||||
fn X() {
|
||||
var a_1 = false;
|
||||
|
@ -116,7 +116,7 @@ fn Z() {
|
|||
const a_3 = true;
|
||||
}
|
||||
|
||||
type a = i32;
|
||||
alias a = i32;
|
||||
)";
|
||||
|
||||
auto got = Run<Unshadow>(src);
|
||||
|
@ -704,7 +704,7 @@ fn F(a : a) {
|
|||
)";
|
||||
|
||||
auto* expect = R"(
|
||||
type a = i32;
|
||||
alias a = i32;
|
||||
|
||||
fn F(a_1 : a) {
|
||||
{
|
||||
|
@ -745,7 +745,7 @@ fn F(a_1 : a) {
|
|||
}
|
||||
}
|
||||
|
||||
type a = i32;
|
||||
alias a = i32;
|
||||
)";
|
||||
|
||||
auto got = Run<Unshadow>(src);
|
||||
|
|
|
@ -108,7 +108,7 @@ bool GeneratorImpl::EmitTypeDecl(const ast::TypeDecl* ty) {
|
|||
ty,
|
||||
[&](const ast::Alias* alias) { //
|
||||
auto out = line();
|
||||
out << "type " << program_->Symbols().NameFor(alias->name) << " = ";
|
||||
out << "alias " << program_->Symbols().NameFor(alias->name) << " = ";
|
||||
if (!EmitType(out, alias->type)) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ TEST_F(WgslGeneratorImplTest, EmitAlias_F32) {
|
|||
GeneratorImpl& gen = Build();
|
||||
|
||||
ASSERT_TRUE(gen.EmitTypeDecl(alias)) << gen.error();
|
||||
EXPECT_EQ(gen.result(), R"(type a = f32;
|
||||
EXPECT_EQ(gen.result(), R"(alias a = f32;
|
||||
)");
|
||||
}
|
||||
|
||||
|
@ -45,7 +45,7 @@ TEST_F(WgslGeneratorImplTest, EmitTypeDecl_Struct) {
|
|||
a : f32,
|
||||
b : i32,
|
||||
}
|
||||
type B = A;
|
||||
alias B = A;
|
||||
)");
|
||||
}
|
||||
|
||||
|
@ -60,7 +60,7 @@ TEST_F(WgslGeneratorImplTest, EmitAlias_ToStruct) {
|
|||
GeneratorImpl& gen = Build();
|
||||
|
||||
ASSERT_TRUE(gen.EmitTypeDecl(alias)) << gen.error();
|
||||
EXPECT_EQ(gen.result(), R"(type B = A;
|
||||
EXPECT_EQ(gen.result(), R"(alias B = A;
|
||||
)");
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
type ArrayType = array<vec4<i32>, 4>;
|
||||
alias ArrayType = array<vec4<i32>, 4>;
|
||||
|
||||
struct S {
|
||||
arr : ArrayType,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
type ArrayType = array<vec4<i32>, 4>;
|
||||
alias ArrayType = array<vec4<i32>, 4>;
|
||||
|
||||
struct S {
|
||||
arr : ArrayType,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
type ArrayType = array<vec4<i32>, 4>;
|
||||
alias ArrayType = array<vec4<i32>, 4>;
|
||||
|
||||
struct S {
|
||||
arr : ArrayType,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
type ArrayType = array<vec4<i32>, 4>;
|
||||
alias ArrayType = array<vec4<i32>, 4>;
|
||||
|
||||
struct S {
|
||||
arr : ArrayType,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
type ArrayType = array<vec4<i32>, 4>;
|
||||
alias ArrayType = array<vec4<i32>, 4>;
|
||||
|
||||
struct S {
|
||||
arr : ArrayType,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
type ArrayType = array<vec4<i32>, 4>;
|
||||
alias ArrayType = array<vec4<i32>, 4>;
|
||||
|
||||
struct S {
|
||||
arr : ArrayType,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
type ArrayType = array<i32, 4>;
|
||||
alias ArrayType = array<i32, 4>;
|
||||
|
||||
struct S {
|
||||
arr : array<i32, 4>,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
type ArrayType = array<i32, 4>;
|
||||
alias ArrayType = array<i32, 4>;
|
||||
|
||||
struct S {
|
||||
arr : array<i32, 4>,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
type ArrayType = array<vec4<i32>, 4>;
|
||||
alias ArrayType = array<vec4<i32>, 4>;
|
||||
|
||||
struct S {
|
||||
arr : ArrayType,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
type ArrayType = array<vec4<i32>, 4>;
|
||||
alias ArrayType = array<vec4<i32>, 4>;
|
||||
|
||||
struct S {
|
||||
arr : ArrayType,
|
||||
|
|
|
@ -3,16 +3,16 @@ struct strided_arr {
|
|||
el : f32,
|
||||
}
|
||||
|
||||
type Arr = array<strided_arr, 2u>;
|
||||
alias Arr = array<strided_arr, 2u>;
|
||||
|
||||
type Arr_1 = array<Arr, 3u>;
|
||||
alias Arr_1 = array<Arr, 3u>;
|
||||
|
||||
struct strided_arr_1 {
|
||||
@size(128)
|
||||
el : Arr_1,
|
||||
}
|
||||
|
||||
type Arr_2 = array<strided_arr_1, 4u>;
|
||||
alias Arr_2 = array<strided_arr_1, 4u>;
|
||||
|
||||
struct S {
|
||||
/* @offset(0) */
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
type Arr = array<mat4x4<f32>, 2u>;
|
||||
alias Arr = array<mat4x4<f32>, 2u>;
|
||||
|
||||
struct strided_arr {
|
||||
@size(16)
|
||||
el : f32,
|
||||
}
|
||||
|
||||
type Arr_1 = array<strided_arr, 4u>;
|
||||
alias Arr_1 = array<strided_arr, 4u>;
|
||||
|
||||
struct LeftOver {
|
||||
/* @offset(0) */
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
const MY_SIZE = 5u;
|
||||
|
||||
type Arr = array<i32, MY_SIZE>;
|
||||
alias Arr = array<i32, MY_SIZE>;
|
||||
|
||||
@fragment
|
||||
fn main() {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
const MY_SIZE = 5u;
|
||||
|
||||
type Arr = array<i32, MY_SIZE>;
|
||||
alias Arr = array<i32, MY_SIZE>;
|
||||
|
||||
@fragment
|
||||
fn main() {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// flags: --transform substitute_override
|
||||
|
||||
override O = 123;
|
||||
type A = array<i32, O*2>;
|
||||
alias A = array<i32, O*2>;
|
||||
|
||||
var<workgroup> W : A;
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
const O = 123;
|
||||
|
||||
type A = array<i32, (O * 2)>;
|
||||
alias A = array<i32, (O * 2)>;
|
||||
|
||||
var<workgroup> W : A;
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ struct S {
|
|||
b : i32,
|
||||
}
|
||||
|
||||
type RTArr = array<S>;
|
||||
alias RTArr = array<S>;
|
||||
|
||||
struct sb_block {
|
||||
/* @offset(0) */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
type Arr = array<u32, 50>;
|
||||
alias Arr = array<u32, 50>;
|
||||
|
||||
struct Buf{
|
||||
count : u32,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
type Arr = array<u32, 50>;
|
||||
alias Arr = array<u32, 50>;
|
||||
|
||||
struct Buf {
|
||||
count : u32,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
type ArrayExplicitStride = array<i32, 2>;
|
||||
type ArrayImplicitStride = array<i32, 2>;
|
||||
alias ArrayExplicitStride = array<i32, 2>;
|
||||
alias ArrayImplicitStride = array<i32, 2>;
|
||||
|
||||
fn foo() {
|
||||
var explicitStride : ArrayExplicitStride;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
type ArrayExplicitStride = array<i32, 2>;
|
||||
alias ArrayExplicitStride = array<i32, 2>;
|
||||
|
||||
type ArrayImplicitStride = array<i32, 2>;
|
||||
alias ArrayImplicitStride = array<i32, 2>;
|
||||
|
||||
fn foo() {
|
||||
var explicitStride : ArrayExplicitStride;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
type Arr = array<i32, 6u>;
|
||||
alias Arr = array<i32, 6u>;
|
||||
|
||||
struct sspp962805860buildInformationS {
|
||||
/* @offset(0) */
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
type RTArr = array<f32>;
|
||||
alias RTArr = array<f32>;
|
||||
|
||||
type RTArr_1 = array<f32>;
|
||||
alias RTArr_1 = array<f32>;
|
||||
|
||||
struct ResultMatrix {
|
||||
/* @offset(0) */
|
||||
numbers : RTArr_1,
|
||||
}
|
||||
|
||||
type RTArr_2 = array<f32>;
|
||||
alias RTArr_2 = array<f32>;
|
||||
|
||||
struct FirstMatrix {
|
||||
/* @offset(0) */
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
type Arr = array<u32, 1u>;
|
||||
alias Arr = array<u32, 1u>;
|
||||
|
||||
type Arr_1 = array<Arr, 2u>;
|
||||
alias Arr_1 = array<Arr, 2u>;
|
||||
|
||||
type Arr_2 = array<Arr_1, 3u>;
|
||||
alias Arr_2 = array<Arr_1, 3u>;
|
||||
|
||||
var<private> local_invocation_index_1 : u32;
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
type A0 = atomic<u32>;
|
||||
type A1 = array<A0, 1>;
|
||||
type A2 = array<A1, 2>;
|
||||
type A3 = array<A2, 3>;
|
||||
alias A0 = atomic<u32>;
|
||||
alias A1 = array<A0, 1>;
|
||||
alias A2 = array<A1, 2>;
|
||||
alias A3 = array<A2, 3>;
|
||||
|
||||
var<workgroup> wg : A3;
|
||||
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
type A0 = atomic<u32>;
|
||||
alias A0 = atomic<u32>;
|
||||
|
||||
type A1 = array<A0, 1>;
|
||||
alias A1 = array<A0, 1>;
|
||||
|
||||
type A2 = array<A1, 2>;
|
||||
alias A2 = array<A1, 2>;
|
||||
|
||||
type A3 = array<A2, 3>;
|
||||
alias A3 = array<A2, 3>;
|
||||
|
||||
var<workgroup> wg : A3;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
type Arr = array<u32, 4u>;
|
||||
alias Arr = array<u32, 4u>;
|
||||
|
||||
var<private> local_invocation_index_1 : u32;
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
type Arr = array<u32, 1u>;
|
||||
alias Arr = array<u32, 1u>;
|
||||
|
||||
type Arr_1 = array<Arr, 2u>;
|
||||
alias Arr_1 = array<Arr, 2u>;
|
||||
|
||||
type Arr_2 = array<Arr_1, 3u>;
|
||||
alias Arr_2 = array<Arr_1, 3u>;
|
||||
|
||||
var<private> local_invocation_index_1 : u32;
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ struct S {
|
|||
y : u32,
|
||||
}
|
||||
|
||||
type Arr = array<S, 10u>;
|
||||
alias Arr = array<S, 10u>;
|
||||
|
||||
var<private> local_invocation_index_1 : u32;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
type Arr = array<u32, 10u>;
|
||||
alias Arr = array<u32, 10u>;
|
||||
|
||||
struct S_atomic {
|
||||
/* @offset(0) */
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// flags: --overrides wgsize=64
|
||||
override wgsize : i32;
|
||||
type Array = array<i32, wgsize * 2>;
|
||||
alias Array = array<i32, wgsize * 2>;
|
||||
var<workgroup> v : Array;
|
||||
|
||||
fn foo() -> i32 {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
const wgsize : i32 = 64i;
|
||||
|
||||
type Array = array<i32, (wgsize * 2)>;
|
||||
alias Array = array<i32, (wgsize * 2)>;
|
||||
|
||||
var<workgroup> v : Array;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
type MyArray = array<f32, 10>;
|
||||
alias MyArray = array<f32, 10>;
|
||||
|
||||
// Global consts
|
||||
const c1 = 1;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
type MyArray = array<f32, 10>;
|
||||
alias MyArray = array<f32, 10>;
|
||||
|
||||
const c1 = 1;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
type MyArray = array<f32, 10>;
|
||||
alias MyArray = array<f32, 10>;
|
||||
|
||||
// Function-scope consts
|
||||
fn const_decls() {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
type MyArray = array<f32, 10>;
|
||||
alias MyArray = array<f32, 10>;
|
||||
|
||||
fn const_decls() {
|
||||
const v1 = 1;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
type a = i32;
|
||||
type a__ = i32;
|
||||
type b = a;
|
||||
type b__ = a__;
|
||||
alias a = i32;
|
||||
alias a__ = i32;
|
||||
alias b = a;
|
||||
alias b__ = a__;
|
||||
|
||||
fn f() {
|
||||
var c : b;
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
type a = i32;
|
||||
alias a = i32;
|
||||
|
||||
type a__ = i32;
|
||||
alias a__ = i32;
|
||||
|
||||
type b = a;
|
||||
alias b = a;
|
||||
|
||||
type b__ = a__;
|
||||
alias b__ = a__;
|
||||
|
||||
fn f() {
|
||||
var c : b;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
type a = i32;
|
||||
type _a = i32;
|
||||
type b = a;
|
||||
type _b = _a;
|
||||
alias a = i32;
|
||||
alias _a = i32;
|
||||
alias b = a;
|
||||
alias _b = _a;
|
||||
|
||||
fn f() {
|
||||
var c : b;
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
type a = i32;
|
||||
alias a = i32;
|
||||
|
||||
type _a = i32;
|
||||
alias _a = i32;
|
||||
|
||||
type b = a;
|
||||
alias b = a;
|
||||
|
||||
type _b = _a;
|
||||
alias _b = _a;
|
||||
|
||||
fn f() {
|
||||
var c : b;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
type A = i32;
|
||||
type _A = i32;
|
||||
type B = A;
|
||||
type _B = _A;
|
||||
alias A = i32;
|
||||
alias _A = i32;
|
||||
alias B = A;
|
||||
alias _B = _A;
|
||||
|
||||
fn f() {
|
||||
var c : B;
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
type A = i32;
|
||||
alias A = i32;
|
||||
|
||||
type _A = i32;
|
||||
alias _A = i32;
|
||||
|
||||
type B = A;
|
||||
alias B = A;
|
||||
|
||||
type _B = _A;
|
||||
alias _B = _A;
|
||||
|
||||
fn f() {
|
||||
var c : B;
|
||||
|
|
|
@ -2,7 +2,7 @@ struct MyStruct {
|
|||
f1 : f32,
|
||||
};
|
||||
|
||||
type MyArray = array<f32, 10>;
|
||||
alias MyArray = array<f32, 10>;
|
||||
|
||||
fn ret_i32() -> i32 { return 1; }
|
||||
fn ret_u32() -> u32 { return 1u; }
|
||||
|
|
|
@ -2,7 +2,7 @@ struct MyStruct {
|
|||
f1 : f32,
|
||||
}
|
||||
|
||||
type MyArray = array<f32, 10>;
|
||||
alias MyArray = array<f32, 10>;
|
||||
|
||||
fn ret_i32() -> i32 {
|
||||
return 1;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
type T1 = T2;
|
||||
type T2 = i32;
|
||||
alias T1 = T2;
|
||||
alias T2 = i32;
|
||||
|
||||
@fragment
|
||||
fn f() {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
type T1 = T2;
|
||||
alias T1 = T2;
|
||||
|
||||
type T2 = i32;
|
||||
alias T2 = i32;
|
||||
|
||||
@fragment
|
||||
fn f() {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
type T = S;
|
||||
alias T = S;
|
||||
|
||||
struct S {
|
||||
m : i32,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
type T = S;
|
||||
alias T = S;
|
||||
|
||||
struct S {
|
||||
m : i32,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
var<private> A : array<T, 4>;
|
||||
type T = i32;
|
||||
alias T = i32;
|
||||
|
||||
@fragment
|
||||
fn f() {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
var<private> A : array<T, 4>;
|
||||
|
||||
type T = i32;
|
||||
alias T = i32;
|
||||
|
||||
@fragment
|
||||
fn f() {
|
||||
|
|
|
@ -3,4 +3,4 @@ fn f() {
|
|||
var b : T;
|
||||
}
|
||||
|
||||
type T = i32;
|
||||
alias T = i32;
|
||||
|
|
|
@ -3,4 +3,4 @@ fn f() {
|
|||
var b : T;
|
||||
}
|
||||
|
||||
type T = i32;
|
||||
alias T = i32;
|
||||
|
|
|
@ -2,7 +2,7 @@ struct S {
|
|||
m : T,
|
||||
}
|
||||
|
||||
type T = i32;
|
||||
alias T = i32;
|
||||
|
||||
@fragment
|
||||
fn f() {
|
||||
|
|
|
@ -2,7 +2,7 @@ struct S {
|
|||
m : T,
|
||||
}
|
||||
|
||||
type T = i32;
|
||||
alias T = i32;
|
||||
|
||||
@fragment
|
||||
fn f() {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
type a = i32;
|
||||
alias a = i32;
|
||||
|
||||
fn f() {
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
type a = i32;
|
||||
alias a = i32;
|
||||
|
||||
fn f() {
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
type a = i32;
|
||||
alias a = i32;
|
||||
|
||||
fn f() {
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
type a = i32;
|
||||
alias a = i32;
|
||||
|
||||
fn f() {
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
type a = i32;
|
||||
alias a = i32;
|
||||
|
||||
fn f(a : a) {
|
||||
let b = a;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
type a = i32;
|
||||
alias a = i32;
|
||||
|
||||
fn f(a : a) {
|
||||
let b = a;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
type a = i32;
|
||||
alias a = i32;
|
||||
|
||||
fn f() {
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
type a = i32;
|
||||
alias a = i32;
|
||||
|
||||
fn f() {
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
type a = vec3f;
|
||||
alias a = vec3f;
|
||||
|
||||
fn f() {
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
type a = vec3f;
|
||||
alias a = vec3f;
|
||||
|
||||
fn f() {
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
type a = vec3f;
|
||||
alias a = vec3f;
|
||||
|
||||
fn f() {
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
type a = vec3f;
|
||||
alias a = vec3f;
|
||||
|
||||
fn f() {
|
||||
{
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
|
||||
// Evilness 😈. Don't go getting any ideas!
|
||||
struct vec4f { i : i32, }
|
||||
type vec2f = f32;
|
||||
type vec2i = bool;
|
||||
alias vec2f = f32;
|
||||
alias vec2i = bool;
|
||||
|
||||
@vertex fn main(@builtin(vertex_index) VertexIndex : u32) -> @builtin(position) vec4<f32> {
|
||||
let s = vec4f(1);
|
||||
|
|
|
@ -2,9 +2,9 @@ struct tint_symbol {
|
|||
tint_symbol_1 : i32,
|
||||
}
|
||||
|
||||
type tint_symbol_2 = f32;
|
||||
alias tint_symbol_2 = f32;
|
||||
|
||||
type tint_symbol_3 = bool;
|
||||
alias tint_symbol_3 = bool;
|
||||
|
||||
@vertex
|
||||
fn tint_symbol_4(@builtin(vertex_index) tint_symbol_5 : u32) -> @builtin(position) vec4<f32> {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
type a = vec3f;
|
||||
alias a = vec3f;
|
||||
|
||||
fn f() {
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
type a = vec3f;
|
||||
alias a = vec3f;
|
||||
|
||||
fn f() {
|
||||
{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
type 𝓉𝓎𝓅ℯ_𝒶 = i32;
|
||||
type 𝐭𝐲𝐩𝐞_𝐛 = f32;
|
||||
alias 𝓉𝓎𝓅ℯ_𝒶 = i32;
|
||||
alias 𝐭𝐲𝐩𝐞_𝐛 = f32;
|
||||
|
||||
fn 𝓯𝓾𝓷𝓬𝓽𝓲𝓸𝓷(ᵖᵃʳᵃᵐ : 𝓉𝓎𝓅ℯ_𝒶) -> 𝐭𝐲𝐩𝐞_𝐛 {
|
||||
return 𝐭𝐲𝐩𝐞_𝐛(ᵖᵃʳᵃᵐ);
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue