diff --git a/docs/tint/origin-trial-changes.md b/docs/tint/origin-trial-changes.md index 3da2ed96fa..bd27dd1582 100644 --- a/docs/tint/origin-trial-changes.md +++ b/docs/tint/origin-trial-changes.md @@ -18,6 +18,7 @@ ### Breaking changes +* Uniformity analysis failures are now an error [tint:880](crbug.com/tint/880) * Indexing an array, vector or matrix with a compile-time expression that's out-of-bounds is now an error [tint:1665](crbug.com/tint/1665) ## Changes for M106 diff --git a/src/tint/resolver/resolver.cc b/src/tint/resolver/resolver.cc index a7e917d15f..ded0afa596 100644 --- a/src/tint/resolver/resolver.cc +++ b/src/tint/resolver/resolver.cc @@ -167,7 +167,7 @@ bool Resolver::ResolveInternal() { if (!enabled_extensions_.Contains(ast::Extension::kChromiumDisableUniformityAnalysis)) { if (!AnalyzeUniformity(builder_, dependencies_)) { - // TODO(jrprice): Reject programs that fail uniformity analysis. + return false; } } diff --git a/src/tint/resolver/uniformity.cc b/src/tint/resolver/uniformity.cc index e4c31c9394..b5e5687bc7 100644 --- a/src/tint/resolver/uniformity.cc +++ b/src/tint/resolver/uniformity.cc @@ -1548,9 +1548,8 @@ class UniformityGraph { // Helper to produce a diagnostic message with the severity required by this invocation of // the `MakeError` function. auto report = [&](Source source, std::string msg) { - // TODO(jrprice): Switch to error instead of warning when feedback has settled. diag::Diagnostic error{}; - error.severity = note ? diag::Severity::Note : diag::Severity::Warning; + error.severity = note ? diag::Severity::Note : diag::Severity::Error; error.system = diag::System::Resolver; error.source = source; error.message = msg; diff --git a/src/tint/resolver/uniformity_test.cc b/src/tint/resolver/uniformity_test.cc index e2e2796789..18e6a16b49 100644 --- a/src/tint/resolver/uniformity_test.cc +++ b/src/tint/resolver/uniformity_test.cc @@ -51,8 +51,7 @@ class UniformityAnalysisTestBase { EXPECT_EQ(program.Diagnostics().count(), 0u) << error_; } } else { - // TODO(jrprice): expect false when uniformity issues become errors. - EXPECT_TRUE(valid) << error_; + EXPECT_FALSE(valid); } } @@ -318,7 +317,7 @@ fn foo() { bool should_pass = !(MayBeNonUniform(condition) && RequiredToBeUniform(function)); RunTest(src, should_pass); if (!should_pass) { - EXPECT_THAT(error_, ::testing::StartsWith("test:31:5 warning: ")); + EXPECT_THAT(error_, ::testing::StartsWith("test:31:5 error: ")); EXPECT_THAT(error_, ::testing::HasSubstr("must only be called from uniform control flow")); } } @@ -391,7 +390,7 @@ fn main() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:17:3 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:17:3 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -440,7 +439,7 @@ fn main() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:21:3 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:21:3 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -528,7 +527,7 @@ fn bar() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:11:7 warning: parameter 'i' of 'foo' must be uniform + R"(test:11:7 error: parameter 'i' of 'foo' must be uniform foo(rw); ^^ @@ -581,7 +580,7 @@ fn bar() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:10:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:10:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -646,7 +645,7 @@ fn bar() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:17:3 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:17:3 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -697,7 +696,7 @@ fn main(@builtin()" + GetParam().name + if (!should_pass) { EXPECT_EQ( error_, - R"(test:5:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:5:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -732,7 +731,7 @@ fn main(s : S) { if (!should_pass) { EXPECT_EQ( error_, - R"(test:9:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:9:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -777,7 +776,7 @@ fn main(s : S) { RunTest(src, false); EXPECT_EQ(error_, - R"(test:10:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:10:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -808,7 +807,7 @@ fn main(@builtin()" + GetParam().name + RunTest(src, should_pass); if (!should_pass) { EXPECT_EQ(error_, - R"(test:5:5 warning: 'dpdx' must only be called from uniform control flow + R"(test:5:5 error: 'dpdx' must only be called from uniform control flow dpdx(0.5); ^^^^ @@ -842,7 +841,7 @@ fn main(s : S) { RunTest(src, should_pass); if (!should_pass) { EXPECT_EQ(error_, - R"(test:9:5 warning: 'dpdx' must only be called from uniform control flow + R"(test:9:5 error: 'dpdx' must only be called from uniform control flow dpdx(0.5); ^^^^ @@ -879,7 +878,7 @@ fn main(@location(0) l : f32) { RunTest(src, false); EXPECT_EQ(error_, - R"(test:5:5 warning: 'dpdx' must only be called from uniform control flow + R"(test:5:5 error: 'dpdx' must only be called from uniform control flow dpdx(0.5); ^^^^ @@ -909,7 +908,7 @@ fn main(s : S) { RunTest(src, false); EXPECT_EQ(error_, - R"(test:9:5 warning: 'dpdx' must only be called from uniform control flow + R"(test:9:5 error: 'dpdx' must only be called from uniform control flow dpdx(0.5); ^^^^ @@ -1025,7 +1024,7 @@ fn foo() { EXPECT_THAT( error_, ::testing::StartsWith( - R"(test:13:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:13:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier();)")); EXPECT_THAT(error_, ::testing::HasSubstr("test:14:9 note: reading from read_write storage buffer " @@ -1065,7 +1064,7 @@ fn foo() { EXPECT_THAT( error_, ::testing::StartsWith( - R"(test:14:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:14:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier();)")); EXPECT_THAT(error_, ::testing::HasSubstr("test:13:9 note: reading from read_write storage buffer " @@ -1106,7 +1105,7 @@ fn foo() { EXPECT_THAT( error_, ::testing::StartsWith( - R"(test:15:7 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:15:7 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier();)")); EXPECT_THAT(error_, ::testing::HasSubstr("test:13:9 note: reading from read_write storage buffer " @@ -1157,7 +1156,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:7:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:7:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -1212,7 +1211,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:8:7 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:8:7 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -1282,7 +1281,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:8:7 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:8:7 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -1366,7 +1365,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:14:7 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:14:7 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -1404,7 +1403,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:15:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:15:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -1447,7 +1446,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:20:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:20:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -1521,7 +1520,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:20:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:20:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -1562,7 +1561,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:8:7 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:8:7 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -1608,7 +1607,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:16:9 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:16:9 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -1649,7 +1648,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:8:7 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:8:7 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -1690,7 +1689,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:8:7 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:8:7 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -1826,7 +1825,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:15:3 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:15:3 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -1871,7 +1870,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:6:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:6:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -1906,7 +1905,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:14:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:14:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -1945,7 +1944,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:14:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:14:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -1982,7 +1981,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:8:7 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:8:7 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -2037,7 +2036,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:10:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:10:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -2092,7 +2091,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:8:7 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:8:7 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -2153,7 +2152,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:15:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:15:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -2198,7 +2197,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:21:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:21:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -2240,7 +2239,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:8:7 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:8:7 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -2281,7 +2280,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:8:7 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:8:7 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -2342,7 +2341,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:7:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:7:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -2379,7 +2378,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:9:7 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:9:7 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -2444,7 +2443,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:17:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:17:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -2491,7 +2490,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:23:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:23:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -2534,7 +2533,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:9:7 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:9:7 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -2577,7 +2576,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:9:7 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:9:7 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -2672,7 +2671,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:6:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:6:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -2700,7 +2699,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:7:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:7:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -2729,7 +2728,7 @@ fn main() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:8:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:8:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -2758,7 +2757,7 @@ fn main() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:8:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:8:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -2787,7 +2786,7 @@ fn main() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:8:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:8:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -2816,7 +2815,7 @@ fn main() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:8:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:8:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -2844,7 +2843,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:7:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:7:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -2875,7 +2874,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:8:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:8:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -2952,7 +2951,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:15:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:15:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -3035,7 +3034,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:12:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:12:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -3072,7 +3071,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:13:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:13:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -3229,7 +3228,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:9:3 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:9:3 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -3259,7 +3258,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:9:3 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:9:3 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -3296,7 +3295,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:7:7 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:7:7 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -3326,7 +3325,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:7:7 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:7:7 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -3361,7 +3360,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:11:7 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:11:7 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -3428,7 +3427,7 @@ fn foo() { fallthrough; ^^^^^^^^^^^ -test:14:7 warning: 'workgroupBarrier' must only be called from uniform control flow +test:14:7 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -3498,7 +3497,7 @@ fn foo() { fallthrough; ^^^^^^^^^^^ -test:14:9 warning: 'workgroupBarrier' must only be called from uniform control flow +test:14:9 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -3537,7 +3536,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:14:9 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:14:9 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -3577,7 +3576,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:19:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:19:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -3643,7 +3642,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:18:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:18:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -3712,7 +3711,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:21:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:21:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -3754,7 +3753,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:9:7 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:9:7 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -3892,7 +3891,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:17:3 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:17:3 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -3929,7 +3928,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:8:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:8:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -3959,7 +3958,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:9:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:9:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -4024,7 +4023,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:11:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:11:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -4052,7 +4051,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:7:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:7:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -4081,7 +4080,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:8:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:8:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -4113,7 +4112,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:12:7 warning: parameter 'p' of 'bar' must be uniform + R"(test:12:7 error: parameter 'p' of 'bar' must be uniform bar(&v); ^ @@ -4187,7 +4186,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:9:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:9:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -4235,7 +4234,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:10:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:10:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -4265,7 +4264,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:9:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:9:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -4297,7 +4296,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:11:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:11:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -4348,7 +4347,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:11:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:11:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -4398,7 +4397,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:12:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:12:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -4451,7 +4450,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:12:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:12:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -4485,7 +4484,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:13:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:13:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -4568,7 +4567,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:21:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:21:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -4662,7 +4661,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:18:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:18:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -4699,7 +4698,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:16:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:16:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -4736,7 +4735,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:16:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:16:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -4781,7 +4780,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:24:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:24:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -4820,7 +4819,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:18:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:18:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -4856,7 +4855,7 @@ fn foo(p : ptr) { RunTest(src, false); EXPECT_EQ(error_, - R"(test:7:7 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:7:7 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -4892,7 +4891,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:15:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:15:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -4929,7 +4928,7 @@ fn main() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:16:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:16:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -4966,7 +4965,7 @@ fn main() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:16:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:16:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -5007,7 +5006,7 @@ fn main() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:20:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:20:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -5066,7 +5065,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:14:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:14:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -5123,7 +5122,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:14:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:14:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -5178,7 +5177,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:12:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:12:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -5216,7 +5215,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:14:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:14:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -5256,7 +5255,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:16:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:16:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -5324,10 +5323,9 @@ TEST_F(UniformityAnalysisTest, MaximumNumberOfPointerParameters) { main_body.Push(b.If(b.Equal("v254", 0_i), b.Block(b.CallStmt(b.Call("workgroupBarrier"))))); b.Func("main", utils::Empty, ty.void_(), main_body); - // TODO(jrprice): Expect false when uniformity issues become errors. - EXPECT_TRUE(RunTest(std::move(b))) << error_; + EXPECT_FALSE(RunTest(std::move(b))); EXPECT_EQ(error_, - R"(warning: 'workgroupBarrier' must only be called from uniform control flow + R"(error: 'workgroupBarrier' must only be called from uniform control flow note: control flow depends on non-uniform value note: reading from module-scope private variable 'non_uniform_global' may result in a non-uniform value)"); } @@ -5363,7 +5361,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:6:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:6:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -5392,7 +5390,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:8:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:8:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -5437,7 +5435,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:8:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:8:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -5470,7 +5468,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:9:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:9:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -5503,7 +5501,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:9:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:9:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -5532,7 +5530,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:8:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:8:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -5581,7 +5579,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:10:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:10:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -5614,7 +5612,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:12:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:12:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -5667,7 +5665,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:12:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:12:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -5704,7 +5702,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:13:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:13:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -5741,7 +5739,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:13:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:13:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -5782,7 +5780,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:6:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:6:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -5811,7 +5809,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:8:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:8:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -5856,7 +5854,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:8:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:8:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -5886,7 +5884,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:9:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:9:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -5919,7 +5917,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:9:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:9:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -5952,7 +5950,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:9:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:9:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -5986,7 +5984,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:10:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:10:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -6040,7 +6038,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:6:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:6:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -6067,7 +6065,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:6:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:6:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -6094,7 +6092,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:6:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:6:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -6124,7 +6122,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:8:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:8:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -6154,7 +6152,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:8:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:8:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -6188,7 +6186,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:14:3 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:14:3 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -6227,7 +6225,7 @@ fn main() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:15:3 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:15:3 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -6266,7 +6264,7 @@ fn main() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:15:3 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:15:3 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -6305,7 +6303,7 @@ fn main() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:15:3 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:15:3 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -6448,7 +6446,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:6:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:6:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -6475,7 +6473,7 @@ fn foo() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:6:5 warning: 'storageBarrier' must only be called from uniform control flow + R"(test:6:5 error: 'storageBarrier' must only be called from uniform control flow storageBarrier(); ^^^^^^^^^^^^^^ @@ -6532,10 +6530,9 @@ TEST_F(UniformityAnalysisTest, StressGraphTraversalDepth) { foo_body.Push(b.If(b.Equal(v_last, 0_i), b.Block(b.CallStmt(b.Call("workgroupBarrier"))))); b.Func("foo", utils::Empty, ty.void_(), foo_body); - // TODO(jrprice): Expect false when uniformity issues become errors. - EXPECT_TRUE(RunTest(std::move(b))) << error_; + EXPECT_FALSE(RunTest(std::move(b))); EXPECT_EQ(error_, - R"(warning: 'workgroupBarrier' must only be called from uniform control flow + R"(error: 'workgroupBarrier' must only be called from uniform control flow note: control flow depends on non-uniform value note: reading from module-scope private variable 'v0' may result in a non-uniform value)"); } @@ -6561,7 +6558,7 @@ fn main() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:10:5 warning: 'foo' must only be called from uniform control flow + R"(test:10:5 error: 'foo' must only be called from uniform control flow foo(); ^^^ @@ -6604,7 +6601,7 @@ fn main() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:18:5 warning: 'foo' must only be called from uniform control flow + R"(test:18:5 error: 'foo' must only be called from uniform control flow foo(); ^^^ @@ -6647,7 +6644,7 @@ fn main() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:19:7 warning: parameter 'c' of 'foo' must be uniform + R"(test:19:7 error: parameter 'c' of 'foo' must be uniform foo(non_uniform); ^^^^^^^^^^^ @@ -6694,7 +6691,7 @@ fn main() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:18:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:18:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -6732,7 +6729,7 @@ fn main() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:15:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:15:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -6774,7 +6771,7 @@ fn main() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:15:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:15:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ @@ -6820,7 +6817,7 @@ fn main() { RunTest(src, false); EXPECT_EQ(error_, - R"(test:15:5 warning: 'workgroupBarrier' must only be called from uniform control flow + R"(test:15:5 error: 'workgroupBarrier' must only be called from uniform control flow workgroupBarrier(); ^^^^^^^^^^^^^^^^ diff --git a/test/tint/benchmark/skinned-shadowed-pbr-fragment.wgsl b/test/tint/benchmark/skinned-shadowed-pbr-fragment.wgsl index d0f8354616..b6b466e558 100644 --- a/test/tint/benchmark/skinned-shadowed-pbr-fragment.wgsl +++ b/test/tint/benchmark/skinned-shadowed-pbr-fragment.wgsl @@ -229,7 +229,8 @@ fn GetSurfaceInfo(input : VertexOutput) -> SurfaceInfo { let baseColorMap = textureSample(baseColorTexture, baseColorSampler, input.texcoord); surface.baseColor = ((input.color * material.baseColorFactor) * baseColorMap); if ((surface.baseColor.a < material.alphaCutoff)) { - discard; + // Violates uniformity analysis: + // discard; } surface.albedo = surface.baseColor.rgb; let metallicRoughnessMap = textureSample(metallicRoughnessTexture, metallicRoughnessSampler, input.texcoord); diff --git a/test/tint/bug/dawn/947.wgsl b/test/tint/bug/dawn/947.wgsl index 5c5fa77029..181bba81bd 100644 --- a/test/tint/bug/dawn/947.wgsl +++ b/test/tint/bug/dawn/947.wgsl @@ -56,7 +56,9 @@ struct VertexOutputs { discard; } - var srcColor = textureSample(myTexture, mySampler, texcoord); + // Violates uniformity analysis: + // var srcColor = textureSample(myTexture, mySampler, texcoord); + var srcColor = vec4(0); // Swizzling of texture formats when sampling / rendering is handled by the // hardware so we don't need special logic in this shader. This is covered by tests. return srcColor; diff --git a/test/tint/bug/dawn/947.wgsl.expected.dxc.hlsl b/test/tint/bug/dawn/947.wgsl.expected.dxc.hlsl index be587b091d..7557169e12 100644 --- a/test/tint/bug/dawn/947.wgsl.expected.dxc.hlsl +++ b/test/tint/bug/dawn/947.wgsl.expected.dxc.hlsl @@ -1,15 +1,3 @@ -bug/dawn/947.wgsl:59:20 warning: 'textureSample' must only be called from uniform control flow - var srcColor = textureSample(myTexture, mySampler, texcoord); - ^^^^^^^^^^^^^ - -bug/dawn/947.wgsl:55:5 note: control flow depends on non-uniform value - if (!all(clampedTexcoord == texcoord)) { - ^^ - -bug/dawn/947.wgsl:55:33 note: reading from user-defined input 'texcoord' may result in a non-uniform value - if (!all(clampedTexcoord == texcoord)) { - ^^^^^^^^ - cbuffer cbuffer_uniforms : register(b0, space0) { uint4 uniforms[1]; }; @@ -65,7 +53,7 @@ float4 fs_main_inner(float2 texcoord) { tint_discard = true; return (0.0f).xxxx; } - float4 srcColor = myTexture.Sample(mySampler, texcoord); + float4 srcColor = (0.0f).xxxx; return srcColor; } diff --git a/test/tint/bug/dawn/947.wgsl.expected.fxc.hlsl b/test/tint/bug/dawn/947.wgsl.expected.fxc.hlsl index be587b091d..7557169e12 100644 --- a/test/tint/bug/dawn/947.wgsl.expected.fxc.hlsl +++ b/test/tint/bug/dawn/947.wgsl.expected.fxc.hlsl @@ -1,15 +1,3 @@ -bug/dawn/947.wgsl:59:20 warning: 'textureSample' must only be called from uniform control flow - var srcColor = textureSample(myTexture, mySampler, texcoord); - ^^^^^^^^^^^^^ - -bug/dawn/947.wgsl:55:5 note: control flow depends on non-uniform value - if (!all(clampedTexcoord == texcoord)) { - ^^ - -bug/dawn/947.wgsl:55:33 note: reading from user-defined input 'texcoord' may result in a non-uniform value - if (!all(clampedTexcoord == texcoord)) { - ^^^^^^^^ - cbuffer cbuffer_uniforms : register(b0, space0) { uint4 uniforms[1]; }; @@ -65,7 +53,7 @@ float4 fs_main_inner(float2 texcoord) { tint_discard = true; return (0.0f).xxxx; } - float4 srcColor = myTexture.Sample(mySampler, texcoord); + float4 srcColor = (0.0f).xxxx; return srcColor; } diff --git a/test/tint/bug/dawn/947.wgsl.expected.glsl b/test/tint/bug/dawn/947.wgsl.expected.glsl index 7113cf5604..e2e36f7f92 100644 --- a/test/tint/bug/dawn/947.wgsl.expected.glsl +++ b/test/tint/bug/dawn/947.wgsl.expected.glsl @@ -1,15 +1,3 @@ -bug/dawn/947.wgsl:59:20 warning: 'textureSample' must only be called from uniform control flow - var srcColor = textureSample(myTexture, mySampler, texcoord); - ^^^^^^^^^^^^^ - -bug/dawn/947.wgsl:55:5 note: control flow depends on non-uniform value - if (!all(clampedTexcoord == texcoord)) { - ^^ - -bug/dawn/947.wgsl:55:33 note: reading from user-defined input 'texcoord' may result in a non-uniform value - if (!all(clampedTexcoord == texcoord)) { - ^^^^^^^^ - #version 310 es layout(location = 0) out vec2 texcoords_1; @@ -61,15 +49,13 @@ struct VertexOutputs { }; bool tint_discard = false; -uniform highp sampler2D myTexture_mySampler; - vec4 fs_main(vec2 texcoord) { vec2 clampedTexcoord = clamp(texcoord, vec2(0.0f), vec2(1.0f)); if (!(all(equal(clampedTexcoord, texcoord)))) { tint_discard = true; return vec4(0.0f); } - vec4 srcColor = texture(myTexture_mySampler, texcoord); + vec4 srcColor = vec4(0.0f); return srcColor; } diff --git a/test/tint/bug/dawn/947.wgsl.expected.msl b/test/tint/bug/dawn/947.wgsl.expected.msl index b30de3057e..df5dab0a46 100644 --- a/test/tint/bug/dawn/947.wgsl.expected.msl +++ b/test/tint/bug/dawn/947.wgsl.expected.msl @@ -1,15 +1,3 @@ -bug/dawn/947.wgsl:59:20 warning: 'textureSample' must only be called from uniform control flow - var srcColor = textureSample(myTexture, mySampler, texcoord); - ^^^^^^^^^^^^^ - -bug/dawn/947.wgsl:55:5 note: control flow depends on non-uniform value - if (!all(clampedTexcoord == texcoord)) { - ^^ - -bug/dawn/947.wgsl:55:33 note: reading from user-defined input 'texcoord' may result in a non-uniform value - if (!all(clampedTexcoord == texcoord)) { - ^^^^^^^^ - #include using namespace metal; @@ -70,13 +58,13 @@ struct tint_symbol_3 { float4 value [[color(0)]]; }; -float4 fs_main_inner(float2 texcoord, thread bool* const tint_symbol_7, texture2d tint_symbol_8, sampler tint_symbol_9) { +float4 fs_main_inner(float2 texcoord, thread bool* const tint_symbol_7) { float2 clampedTexcoord = clamp(texcoord, float2(0.0f), float2(1.0f)); if (!(all((clampedTexcoord == texcoord)))) { *(tint_symbol_7) = true; return float4(0.0f); } - float4 srcColor = tint_symbol_8.sample(tint_symbol_9, texcoord); + float4 srcColor = float4(0.0f); return srcColor; } @@ -84,10 +72,10 @@ void tint_discard_func() { discard_fragment(); } -fragment tint_symbol_3 fs_main(texture2d tint_symbol_11 [[texture(0)]], sampler tint_symbol_12 [[sampler(0)]], tint_symbol_2 tint_symbol_1 [[stage_in]]) { - thread bool tint_symbol_10 = false; - float4 const inner_result_1 = fs_main_inner(tint_symbol_1.texcoord, &(tint_symbol_10), tint_symbol_11, tint_symbol_12); - if (tint_symbol_10) { +fragment tint_symbol_3 fs_main(tint_symbol_2 tint_symbol_1 [[stage_in]]) { + thread bool tint_symbol_8 = false; + float4 const inner_result_1 = fs_main_inner(tint_symbol_1.texcoord, &(tint_symbol_8)); + if (tint_symbol_8) { tint_discard_func(); tint_symbol_3 const tint_symbol_4 = tint_symbol_3{}; return tint_symbol_4; diff --git a/test/tint/bug/dawn/947.wgsl.expected.spvasm b/test/tint/bug/dawn/947.wgsl.expected.spvasm index 636dbca046..91824524a2 100644 --- a/test/tint/bug/dawn/947.wgsl.expected.spvasm +++ b/test/tint/bug/dawn/947.wgsl.expected.spvasm @@ -1,19 +1,7 @@ -bug/dawn/947.wgsl:59:20 warning: 'textureSample' must only be called from uniform control flow - var srcColor = textureSample(myTexture, mySampler, texcoord); - ^^^^^^^^^^^^^ - -bug/dawn/947.wgsl:55:5 note: control flow depends on non-uniform value - if (!all(clampedTexcoord == texcoord)) { - ^^ - -bug/dawn/947.wgsl:55:33 note: reading from user-defined input 'texcoord' may result in a non-uniform value - if (!all(clampedTexcoord == texcoord)) { - ^^^^^^^^ - ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 138 +; Bound: 133 ; Schema: 0 OpCapability Shader %117 = OpExtInstImport "GLSL.std.450" @@ -128,7 +116,6 @@ bug/dawn/947.wgsl:55:33 note: reading from user-defined input 'texcoord' may res %102 = OpTypeFunction %void %112 = OpTypeFunction %v4float %v2float %v2bool = OpTypeVector %bool 2 - %130 = OpTypeSampledImage %27 %vs_main_inner = OpFunction %VertexOutputs None %28 %VertexIndex = OpFunctionParameter %uint %32 = OpLabel @@ -216,18 +203,14 @@ bug/dawn/947.wgsl:55:33 note: reading from user-defined input 'texcoord' may res %126 = OpFunctionCall %void %tint_discard_func OpReturnValue %12 %124 = OpLabel - %128 = OpLoad %24 %mySampler - %129 = OpLoad %27 %myTexture - %131 = OpSampledImage %130 %129 %128 - %127 = OpImageSampleImplicitLod %v4float %131 %texcoord_0 - OpStore %srcColor %127 - %133 = OpLoad %v4float %srcColor - OpReturnValue %133 + OpStore %srcColor %12 + %128 = OpLoad %v4float %srcColor + OpReturnValue %128 OpFunctionEnd %fs_main = OpFunction %void None %102 - %135 = OpLabel - %137 = OpLoad %v2float %texcoord_1 - %136 = OpFunctionCall %v4float %fs_main_inner %137 - OpStore %value %136 + %130 = OpLabel + %132 = OpLoad %v2float %texcoord_1 + %131 = OpFunctionCall %v4float %fs_main_inner %132 + OpStore %value %131 OpReturn OpFunctionEnd diff --git a/test/tint/bug/dawn/947.wgsl.expected.wgsl b/test/tint/bug/dawn/947.wgsl.expected.wgsl index 69590c5e2f..c1712ae491 100644 --- a/test/tint/bug/dawn/947.wgsl.expected.wgsl +++ b/test/tint/bug/dawn/947.wgsl.expected.wgsl @@ -1,15 +1,3 @@ -bug/dawn/947.wgsl:59:20 warning: 'textureSample' must only be called from uniform control flow - var srcColor = textureSample(myTexture, mySampler, texcoord); - ^^^^^^^^^^^^^ - -bug/dawn/947.wgsl:55:5 note: control flow depends on non-uniform value - if (!all(clampedTexcoord == texcoord)) { - ^^ - -bug/dawn/947.wgsl:55:33 note: reading from user-defined input 'texcoord' may result in a non-uniform value - if (!all(clampedTexcoord == texcoord)) { - ^^^^^^^^ - struct Uniforms { u_scale : vec2, u_offset : vec2, @@ -48,6 +36,6 @@ fn fs_main(@location(0) texcoord : vec2) -> @location(0) vec4 { if (!(all((clampedTexcoord == texcoord)))) { discard; } - var srcColor = textureSample(myTexture, mySampler, texcoord); + var srcColor = vec4(0); return srcColor; } diff --git a/test/tint/bug/fxc/gradient_in_varying_loop/1112.wgsl b/test/tint/bug/fxc/gradient_in_varying_loop/1112.wgsl index dab8b71a34..2a00e8e2fb 100644 --- a/test/tint/bug/fxc/gradient_in_varying_loop/1112.wgsl +++ b/test/tint/bug/fxc/gradient_in_varying_loop/1112.wgsl @@ -20,7 +20,9 @@ fn main(@location(0) vUV : vec2) -> @location(0) vec4 { continue; } - let sampleDepth : f32 = textureSample(depthTexture, Sampler, offset.xy).r; + // Violates uniformity analysis: + // let sampleDepth : f32 = textureSample(depthTexture, Sampler, offset.xy).r; + let sampleDepth : f32 = 0; i = i + 1; } diff --git a/test/tint/bug/fxc/gradient_in_varying_loop/1112.wgsl.expected.dxc.hlsl b/test/tint/bug/fxc/gradient_in_varying_loop/1112.wgsl.expected.dxc.hlsl index d8ef362ca9..c11082afca 100644 --- a/test/tint/bug/fxc/gradient_in_varying_loop/1112.wgsl.expected.dxc.hlsl +++ b/test/tint/bug/fxc/gradient_in_varying_loop/1112.wgsl.expected.dxc.hlsl @@ -1,15 +1,3 @@ -bug/fxc/gradient_in_varying_loop/1112.wgsl:23:33 warning: 'textureSample' must only be called from uniform control flow - let sampleDepth : f32 = textureSample(depthTexture, Sampler, offset.xy).r; - ^^^^^^^^^^^^^ - -bug/fxc/gradient_in_varying_loop/1112.wgsl:18:28 note: control flow depends on non-uniform value - if (offset.x < 0.0 || offset.y < 0.0 || offset.x > 1.0 || offset.y > 1.0) { - ^^ - -bug/fxc/gradient_in_varying_loop/1112.wgsl:8:29 note: return value of 'textureSample' may be non-uniform - let random: vec3 = textureSample(randomTexture, Sampler, vUV).rgb; - ^^^^^^^^^^^^^ - SamplerState tint_symbol : register(s0, space0); Texture2D randomTexture : register(t1, space0); Texture2D depthTexture : register(t2, space0); @@ -46,7 +34,7 @@ float4 main_inner(float2 vUV) { i = (i + 1); continue; } - const float sampleDepth = depthTexture.Sample(tint_symbol, offset.xy).r; + const float sampleDepth = 0.0f; i = (i + 1); } return (1.0f).xxxx; diff --git a/test/tint/bug/fxc/gradient_in_varying_loop/1112.wgsl.expected.fxc.hlsl b/test/tint/bug/fxc/gradient_in_varying_loop/1112.wgsl.expected.fxc.hlsl index d8ef362ca9..c11082afca 100644 --- a/test/tint/bug/fxc/gradient_in_varying_loop/1112.wgsl.expected.fxc.hlsl +++ b/test/tint/bug/fxc/gradient_in_varying_loop/1112.wgsl.expected.fxc.hlsl @@ -1,15 +1,3 @@ -bug/fxc/gradient_in_varying_loop/1112.wgsl:23:33 warning: 'textureSample' must only be called from uniform control flow - let sampleDepth : f32 = textureSample(depthTexture, Sampler, offset.xy).r; - ^^^^^^^^^^^^^ - -bug/fxc/gradient_in_varying_loop/1112.wgsl:18:28 note: control flow depends on non-uniform value - if (offset.x < 0.0 || offset.y < 0.0 || offset.x > 1.0 || offset.y > 1.0) { - ^^ - -bug/fxc/gradient_in_varying_loop/1112.wgsl:8:29 note: return value of 'textureSample' may be non-uniform - let random: vec3 = textureSample(randomTexture, Sampler, vUV).rgb; - ^^^^^^^^^^^^^ - SamplerState tint_symbol : register(s0, space0); Texture2D randomTexture : register(t1, space0); Texture2D depthTexture : register(t2, space0); @@ -46,7 +34,7 @@ float4 main_inner(float2 vUV) { i = (i + 1); continue; } - const float sampleDepth = depthTexture.Sample(tint_symbol, offset.xy).r; + const float sampleDepth = 0.0f; i = (i + 1); } return (1.0f).xxxx; diff --git a/test/tint/bug/fxc/gradient_in_varying_loop/1112.wgsl.expected.glsl b/test/tint/bug/fxc/gradient_in_varying_loop/1112.wgsl.expected.glsl index d91730385d..37f5d53948 100644 --- a/test/tint/bug/fxc/gradient_in_varying_loop/1112.wgsl.expected.glsl +++ b/test/tint/bug/fxc/gradient_in_varying_loop/1112.wgsl.expected.glsl @@ -1,22 +1,9 @@ -bug/fxc/gradient_in_varying_loop/1112.wgsl:23:33 warning: 'textureSample' must only be called from uniform control flow - let sampleDepth : f32 = textureSample(depthTexture, Sampler, offset.xy).r; - ^^^^^^^^^^^^^ - -bug/fxc/gradient_in_varying_loop/1112.wgsl:18:28 note: control flow depends on non-uniform value - if (offset.x < 0.0 || offset.y < 0.0 || offset.x > 1.0 || offset.y > 1.0) { - ^^ - -bug/fxc/gradient_in_varying_loop/1112.wgsl:8:29 note: return value of 'textureSample' may be non-uniform - let random: vec3 = textureSample(randomTexture, Sampler, vUV).rgb; - ^^^^^^^^^^^^^ - #version 310 es precision mediump float; layout(location = 0) in vec2 vUV_1; layout(location = 0) out vec4 value; uniform highp sampler2D randomTexture_Sampler; -uniform highp sampler2D depthTexture_Sampler; vec4 tint_symbol(vec2 vUV) { vec3 random = texture(randomTexture_Sampler, vUV).rgb; @@ -43,7 +30,7 @@ vec4 tint_symbol(vec2 vUV) { i = (i + 1); continue; } - float sampleDepth = texture(depthTexture_Sampler, offset.xy).r; + float sampleDepth = 0.0f; i = (i + 1); } return vec4(1.0f); diff --git a/test/tint/bug/fxc/gradient_in_varying_loop/1112.wgsl.expected.msl b/test/tint/bug/fxc/gradient_in_varying_loop/1112.wgsl.expected.msl index c3386fd281..20479d969c 100644 --- a/test/tint/bug/fxc/gradient_in_varying_loop/1112.wgsl.expected.msl +++ b/test/tint/bug/fxc/gradient_in_varying_loop/1112.wgsl.expected.msl @@ -1,15 +1,3 @@ -bug/fxc/gradient_in_varying_loop/1112.wgsl:23:33 warning: 'textureSample' must only be called from uniform control flow - let sampleDepth : f32 = textureSample(depthTexture, Sampler, offset.xy).r; - ^^^^^^^^^^^^^ - -bug/fxc/gradient_in_varying_loop/1112.wgsl:18:28 note: control flow depends on non-uniform value - if (offset.x < 0.0 || offset.y < 0.0 || offset.x > 1.0 || offset.y > 1.0) { - ^^ - -bug/fxc/gradient_in_varying_loop/1112.wgsl:8:29 note: return value of 'textureSample' may be non-uniform - let random: vec3 = textureSample(randomTexture, Sampler, vUV).rgb; - ^^^^^^^^^^^^^ - #include using namespace metal; @@ -21,7 +9,7 @@ struct tint_symbol_3 { float4 value [[color(0)]]; }; -float4 tint_symbol_inner(float2 vUV, texture2d tint_symbol_4, sampler tint_symbol_5, texture2d tint_symbol_6) { +float4 tint_symbol_inner(float2 vUV, texture2d tint_symbol_4, sampler tint_symbol_5) { float3 const random = float4(tint_symbol_4.sample(tint_symbol_5, vUV)).rgb; int i = 0; while (true) { @@ -34,14 +22,14 @@ float4 tint_symbol_inner(float2 vUV, texture2d tint_symbo i = as_type((as_type(i) + as_type(1))); continue; } - float const sampleDepth = tint_symbol_6.sample(tint_symbol_5, float3(offset).xy)[0]; + float const sampleDepth = 0.0f; i = as_type((as_type(i) + as_type(1))); } return float4(1.0f); } -fragment tint_symbol_3 tint_symbol(texture2d tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]], texture2d tint_symbol_9 [[texture(1)]], tint_symbol_2 tint_symbol_1 [[stage_in]]) { - float4 const inner_result = tint_symbol_inner(tint_symbol_1.vUV, tint_symbol_7, tint_symbol_8, tint_symbol_9); +fragment tint_symbol_3 tint_symbol(texture2d tint_symbol_6 [[texture(0)]], sampler tint_symbol_7 [[sampler(0)]], tint_symbol_2 tint_symbol_1 [[stage_in]]) { + float4 const inner_result = tint_symbol_inner(tint_symbol_1.vUV, tint_symbol_6, tint_symbol_7); tint_symbol_3 wrapper_result = {}; wrapper_result.value = inner_result; return wrapper_result; diff --git a/test/tint/bug/fxc/gradient_in_varying_loop/1112.wgsl.expected.spvasm b/test/tint/bug/fxc/gradient_in_varying_loop/1112.wgsl.expected.spvasm index 42fde31b2d..7aa120de53 100644 --- a/test/tint/bug/fxc/gradient_in_varying_loop/1112.wgsl.expected.spvasm +++ b/test/tint/bug/fxc/gradient_in_varying_loop/1112.wgsl.expected.spvasm @@ -1,19 +1,7 @@ -bug/fxc/gradient_in_varying_loop/1112.wgsl:23:33 warning: 'textureSample' must only be called from uniform control flow - let sampleDepth : f32 = textureSample(depthTexture, Sampler, offset.xy).r; - ^^^^^^^^^^^^^ - -bug/fxc/gradient_in_varying_loop/1112.wgsl:18:28 note: control flow depends on non-uniform value - if (offset.x < 0.0 || offset.y < 0.0 || offset.x > 1.0 || offset.y > 1.0) { - ^^ - -bug/fxc/gradient_in_varying_loop/1112.wgsl:8:29 note: return value of 'textureSample' may be non-uniform - let random: vec3 = textureSample(randomTexture, Sampler, vUV).rgb; - ^^^^^^^^^^^^^ - ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 82 +; Bound: 76 ; Schema: 0 OpCapability Shader OpMemoryModel Logical GLSL450 @@ -61,9 +49,9 @@ bug/fxc/gradient_in_varying_loop/1112.wgsl:8:29 note: return value of 'textureSa %bool = OpTypeBool %45 = OpConstantNull %float %float_1 = OpConstant %float 1 - %75 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1 + %69 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1 %void = OpTypeVoid - %76 = OpTypeFunction %void + %70 = OpTypeFunction %void %main_inner = OpFunction %v4float None %16 %vUV = OpFunctionParameter %v2float %19 = OpLabel @@ -124,25 +112,19 @@ bug/fxc/gradient_in_varying_loop/1112.wgsl:8:29 note: return value of 'textureSa OpStore %i %66 OpBranch %33 %63 = OpLabel - %68 = OpLoad %11 %Sampler - %69 = OpLoad %14 %depthTexture - %70 = OpSampledImage %23 %69 %68 - %71 = OpVectorShuffle %v2float %43 %43 0 1 - %67 = OpImageSampleImplicitLod %v4float %70 %71 - %72 = OpCompositeExtract %float %67 0 - %73 = OpLoad %int %i - %74 = OpIAdd %int %73 %int_1 - OpStore %i %74 + %67 = OpLoad %int %i + %68 = OpIAdd %int %67 %int_1 + OpStore %i %68 OpBranch %33 %33 = OpLabel OpBranch %31 %32 = OpLabel - OpReturnValue %75 + OpReturnValue %69 OpFunctionEnd - %main = OpFunction %void None %76 - %79 = OpLabel - %81 = OpLoad %v2float %vUV_1 - %80 = OpFunctionCall %v4float %main_inner %81 - OpStore %value %80 + %main = OpFunction %void None %70 + %73 = OpLabel + %75 = OpLoad %v2float %vUV_1 + %74 = OpFunctionCall %v4float %main_inner %75 + OpStore %value %74 OpReturn OpFunctionEnd diff --git a/test/tint/bug/fxc/gradient_in_varying_loop/1112.wgsl.expected.wgsl b/test/tint/bug/fxc/gradient_in_varying_loop/1112.wgsl.expected.wgsl index 1c743a40ad..35708a3732 100644 --- a/test/tint/bug/fxc/gradient_in_varying_loop/1112.wgsl.expected.wgsl +++ b/test/tint/bug/fxc/gradient_in_varying_loop/1112.wgsl.expected.wgsl @@ -1,15 +1,3 @@ -bug/fxc/gradient_in_varying_loop/1112.wgsl:23:33 warning: 'textureSample' must only be called from uniform control flow - let sampleDepth : f32 = textureSample(depthTexture, Sampler, offset.xy).r; - ^^^^^^^^^^^^^ - -bug/fxc/gradient_in_varying_loop/1112.wgsl:18:28 note: control flow depends on non-uniform value - if (offset.x < 0.0 || offset.y < 0.0 || offset.x > 1.0 || offset.y > 1.0) { - ^^ - -bug/fxc/gradient_in_varying_loop/1112.wgsl:8:29 note: return value of 'textureSample' may be non-uniform - let random: vec3 = textureSample(randomTexture, Sampler, vUV).rgb; - ^^^^^^^^^^^^^ - @group(0) @binding(0) var Sampler : sampler; @group(0) @binding(1) var randomTexture : texture_2d; @@ -30,7 +18,7 @@ fn main(@location(0) vUV : vec2) -> @location(0) vec4 { i = (i + 1); continue; } - let sampleDepth : f32 = textureSample(depthTexture, Sampler, offset.xy).r; + let sampleDepth : f32 = 0; i = (i + 1); } return vec4(1.0); diff --git a/test/tint/bug/tint/1118.wgsl b/test/tint/bug/tint/1118.wgsl index 67703f92ca..3d59c12e30 100644 --- a/test/tint/bug/tint/1118.wgsl +++ b/test/tint/bug/tint/1118.wgsl @@ -61,7 +61,8 @@ fn main_1() { alpha = x_60; let x_62 : vec3 = vec3(0., 0., 0.); let x_64 : vec3 = vec3(0., 0., 0.); - normalW = normalize(-(cross(dpdx(x_62), dpdy(x_64)))); + // Violates uniformity analysis: + // normalW = normalize(-(cross(dpdx(x_62), dpdy(x_64)))); uvOffset = vec2(0.0, 0.0); let x_74 : vec4 = vec4(0., 0., 0., 0.); let x_76 : vec4 = baseColor; diff --git a/test/tint/bug/tint/1118.wgsl.expected.dxc.hlsl b/test/tint/bug/tint/1118.wgsl.expected.dxc.hlsl index fe4e1ffad0..e348eb1d34 100644 --- a/test/tint/bug/tint/1118.wgsl.expected.dxc.hlsl +++ b/test/tint/bug/tint/1118.wgsl.expected.dxc.hlsl @@ -1,15 +1,3 @@ -bug/tint/1118.wgsl:64:31 warning: 'dpdx' must only be called from uniform control flow - normalW = normalize(-(cross(dpdx(x_62), dpdy(x_64)))); - ^^^^ - -bug/tint/1118.wgsl:47:3 note: control flow depends on non-uniform value - if ((x_9 > 0.0)) { - ^^ - -bug/tint/1118.wgsl:46:19 note: reading from module-scope private variable 'fClipDistance3' may result in a non-uniform value - let x_9 : f32 = fClipDistance3; - ^^^^^^^^^^^^^^ - static float fClipDistance3 = 0.0f; static float fClipDistance4 = 0.0f; cbuffer cbuffer_x_29 : register(b0, space0) { @@ -61,7 +49,6 @@ void main_1() { alpha = x_60; const float3 x_62 = (0.0f).xxx; const float3 x_64 = (0.0f).xxx; - normalW = normalize(-(cross(ddx(x_62), ddy(x_64)))); uvOffset = (0.0f).xx; const float4 x_74 = (0.0f).xxxx; const float4 x_76 = baseColor; diff --git a/test/tint/bug/tint/1118.wgsl.expected.fxc.hlsl b/test/tint/bug/tint/1118.wgsl.expected.fxc.hlsl index fe4e1ffad0..e348eb1d34 100644 --- a/test/tint/bug/tint/1118.wgsl.expected.fxc.hlsl +++ b/test/tint/bug/tint/1118.wgsl.expected.fxc.hlsl @@ -1,15 +1,3 @@ -bug/tint/1118.wgsl:64:31 warning: 'dpdx' must only be called from uniform control flow - normalW = normalize(-(cross(dpdx(x_62), dpdy(x_64)))); - ^^^^ - -bug/tint/1118.wgsl:47:3 note: control flow depends on non-uniform value - if ((x_9 > 0.0)) { - ^^ - -bug/tint/1118.wgsl:46:19 note: reading from module-scope private variable 'fClipDistance3' may result in a non-uniform value - let x_9 : f32 = fClipDistance3; - ^^^^^^^^^^^^^^ - static float fClipDistance3 = 0.0f; static float fClipDistance4 = 0.0f; cbuffer cbuffer_x_29 : register(b0, space0) { @@ -61,7 +49,6 @@ void main_1() { alpha = x_60; const float3 x_62 = (0.0f).xxx; const float3 x_64 = (0.0f).xxx; - normalW = normalize(-(cross(ddx(x_62), ddy(x_64)))); uvOffset = (0.0f).xx; const float4 x_74 = (0.0f).xxxx; const float4 x_76 = baseColor; diff --git a/test/tint/bug/tint/1118.wgsl.expected.glsl b/test/tint/bug/tint/1118.wgsl.expected.glsl index 18990ec1d9..cc9147d2b0 100644 --- a/test/tint/bug/tint/1118.wgsl.expected.glsl +++ b/test/tint/bug/tint/1118.wgsl.expected.glsl @@ -1,15 +1,3 @@ -bug/tint/1118.wgsl:64:31 warning: 'dpdx' must only be called from uniform control flow - normalW = normalize(-(cross(dpdx(x_62), dpdy(x_64)))); - ^^^^ - -bug/tint/1118.wgsl:47:3 note: control flow depends on non-uniform value - if ((x_9 > 0.0)) { - ^^ - -bug/tint/1118.wgsl:46:19 note: reading from module-scope private variable 'fClipDistance3' may result in a non-uniform value - let x_9 : f32 = fClipDistance3; - ^^^^^^^^^^^^^^ - #version 310 es precision mediump float; @@ -76,7 +64,6 @@ void main_1() { alpha = x_60; vec3 x_62 = vec3(0.0f); vec3 x_64 = vec3(0.0f); - normalW = normalize(-(cross(dFdx(x_62), dFdy(x_64)))); uvOffset = vec2(0.0f); vec4 x_74 = vec4(0.0f); vec4 x_76 = baseColor; diff --git a/test/tint/bug/tint/1118.wgsl.expected.msl b/test/tint/bug/tint/1118.wgsl.expected.msl index f913012cdc..40e92e8efa 100644 --- a/test/tint/bug/tint/1118.wgsl.expected.msl +++ b/test/tint/bug/tint/1118.wgsl.expected.msl @@ -1,15 +1,3 @@ -bug/tint/1118.wgsl:64:31 warning: 'dpdx' must only be called from uniform control flow - normalW = normalize(-(cross(dpdx(x_62), dpdy(x_64)))); - ^^^^ - -bug/tint/1118.wgsl:47:3 note: control flow depends on non-uniform value - if ((x_9 > 0.0)) { - ^^ - -bug/tint/1118.wgsl:46:19 note: reading from module-scope private variable 'fClipDistance3' may result in a non-uniform value - let x_9 : f32 = fClipDistance3; - ^^^^^^^^^^^^^^ - #include using namespace metal; @@ -77,7 +65,6 @@ void main_1(thread float* const tint_symbol_7, thread bool* const tint_symbol_8, alpha = x_60; float3 const x_62 = float3(0.0f); float3 const x_64 = float3(0.0f); - normalW = normalize(-(cross(dfdx(x_62), dfdy(x_64)))); uvOffset = float2(0.0f); float4 const x_74 = float4(0.0f); float4 const x_76 = baseColor; diff --git a/test/tint/bug/tint/1118.wgsl.expected.spvasm b/test/tint/bug/tint/1118.wgsl.expected.spvasm index 8266cfa76b..4ada490613 100644 --- a/test/tint/bug/tint/1118.wgsl.expected.spvasm +++ b/test/tint/bug/tint/1118.wgsl.expected.spvasm @@ -1,19 +1,7 @@ -bug/tint/1118.wgsl:64:31 warning: 'dpdx' must only be called from uniform control flow - normalW = normalize(-(cross(dpdx(x_62), dpdy(x_64)))); - ^^^^ - -bug/tint/1118.wgsl:47:3 note: control flow depends on non-uniform value - if ((x_9 > 0.0)) { - ^^ - -bug/tint/1118.wgsl:46:19 note: reading from module-scope private variable 'fClipDistance3' may result in a non-uniform value - let x_9 : f32 = fClipDistance3; - ^^^^^^^^^^^^^^ - ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 194 +; Bound: 189 ; Schema: 0 OpCapability Shader %71 = OpExtInstImport "GLSL.std.450" @@ -132,13 +120,13 @@ bug/tint/1118.wgsl:46:19 note: reading from module-scope private variable 'fClip %78 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1 %uint_3 = OpConstant %uint 3 %_ptr_Uniform_float = OpTypePointer Uniform %float - %110 = OpConstantComposite %v3float %float_1 %float_1 %float_1 - %111 = OpConstantComposite %v4float %11 %11 %11 %float_1 + %105 = OpConstantComposite %v3float %float_1 %float_1 %float_1 + %106 = OpConstantComposite %v4float %11 %11 %11 %float_1 %_ptr_Uniform_v3float = OpTypePointer Uniform %v3float %uint_1 = OpConstant %uint 1 %main_out = OpTypeStruct %v4float - %174 = OpTypeFunction %main_out %float %float - %185 = OpConstantNull %main_out + %169 = OpTypeFunction %main_out %float %float + %180 = OpConstantNull %main_out %main_1 = OpFunction %void None %29 %32 = OpLabel %viewDirectionW = OpVariable %_ptr_Function_v3float Function %35 @@ -193,131 +181,125 @@ bug/tint/1118.wgsl:46:19 note: reading from module-scope private variable 'fClip %87 = OpAccessChain %_ptr_Uniform_float %x_49 %uint_0 %uint_3 %88 = OpLoad %float %87 OpStore %alpha %88 - %92 = OpDPdx %v3float %35 - %93 = OpDPdy %v3float %35 - %91 = OpExtInst %v3float %71 Cross %92 %93 - %90 = OpFNegate %v3float %91 - %89 = OpExtInst %v3float %71 Normalize %90 - OpStore %normalW %89 OpStore %uvOffset %45 - %94 = OpLoad %v4float %baseColor - %95 = OpCompositeExtract %float %94 0 - %96 = OpCompositeExtract %float %94 1 - %97 = OpCompositeExtract %float %94 2 - %98 = OpCompositeConstruct %v3float %95 %96 %97 - %99 = OpCompositeExtract %float %8 0 - %100 = OpCompositeExtract %float %8 1 - %101 = OpCompositeExtract %float %8 2 - %102 = OpCompositeConstruct %v3float %99 %100 %101 - %103 = OpFMul %v3float %98 %102 - %104 = OpLoad %v4float %baseColor - %105 = OpCompositeExtract %float %103 0 - %106 = OpCompositeExtract %float %103 1 - %107 = OpCompositeExtract %float %103 2 - %108 = OpCompositeExtract %float %104 3 - %109 = OpCompositeConstruct %v4float %105 %106 %107 %108 - OpStore %baseColor %109 - OpStore %baseAmbientColor %110 + %89 = OpLoad %v4float %baseColor + %90 = OpCompositeExtract %float %89 0 + %91 = OpCompositeExtract %float %89 1 + %92 = OpCompositeExtract %float %89 2 + %93 = OpCompositeConstruct %v3float %90 %91 %92 + %94 = OpCompositeExtract %float %8 0 + %95 = OpCompositeExtract %float %8 1 + %96 = OpCompositeExtract %float %8 2 + %97 = OpCompositeConstruct %v3float %94 %95 %96 + %98 = OpFMul %v3float %93 %97 + %99 = OpLoad %v4float %baseColor + %100 = OpCompositeExtract %float %98 0 + %101 = OpCompositeExtract %float %98 1 + %102 = OpCompositeExtract %float %98 2 + %103 = OpCompositeExtract %float %99 3 + %104 = OpCompositeConstruct %v4float %100 %101 %102 %103 + OpStore %baseColor %104 + OpStore %baseAmbientColor %105 OpStore %glossiness %11 OpStore %diffuseBase %35 OpStore %shadow %float_1 - OpStore %refractionColor %111 - OpStore %reflectionColor %111 - %113 = OpAccessChain %_ptr_Uniform_v3float %x_49 %uint_3 - %114 = OpLoad %v3float %113 - OpStore %emissiveColor %114 - %115 = OpLoad %v3float %diffuseBase - %116 = OpLoad %v3float %diffuseColor - %117 = OpLoad %v3float %emissiveColor - %119 = OpAccessChain %_ptr_Uniform_v3float %x_49 %uint_1 - %120 = OpLoad %v3float %119 - %121 = OpLoad %v4float %baseColor - %123 = OpFMul %v3float %115 %116 - %124 = OpFAdd %v3float %123 %117 - %125 = OpFAdd %v3float %124 %120 - %122 = OpExtInst %v3float %71 NClamp %125 %35 %110 - %126 = OpCompositeExtract %float %121 0 - %127 = OpCompositeExtract %float %121 1 - %128 = OpCompositeExtract %float %121 2 - %129 = OpCompositeConstruct %v3float %126 %127 %128 - %130 = OpFMul %v3float %122 %129 - OpStore %finalDiffuse %130 + OpStore %refractionColor %106 + OpStore %reflectionColor %106 + %108 = OpAccessChain %_ptr_Uniform_v3float %x_49 %uint_3 + %109 = OpLoad %v3float %108 + OpStore %emissiveColor %109 + %110 = OpLoad %v3float %diffuseBase + %111 = OpLoad %v3float %diffuseColor + %112 = OpLoad %v3float %emissiveColor + %114 = OpAccessChain %_ptr_Uniform_v3float %x_49 %uint_1 + %115 = OpLoad %v3float %114 + %116 = OpLoad %v4float %baseColor + %118 = OpFMul %v3float %110 %111 + %119 = OpFAdd %v3float %118 %112 + %120 = OpFAdd %v3float %119 %115 + %117 = OpExtInst %v3float %71 NClamp %120 %35 %105 + %121 = OpCompositeExtract %float %116 0 + %122 = OpCompositeExtract %float %116 1 + %123 = OpCompositeExtract %float %116 2 + %124 = OpCompositeConstruct %v3float %121 %122 %123 + %125 = OpFMul %v3float %117 %124 + OpStore %finalDiffuse %125 OpStore %finalSpecular %35 - %131 = OpLoad %v3float %finalDiffuse - %132 = OpLoad %v3float %baseAmbientColor - %133 = OpLoad %v3float %finalSpecular - %134 = OpLoad %v4float %reflectionColor - %135 = OpLoad %v4float %refractionColor - %136 = OpFMul %v3float %131 %132 - %137 = OpFAdd %v3float %136 %133 - %138 = OpCompositeExtract %float %134 0 - %139 = OpCompositeExtract %float %134 1 - %140 = OpCompositeExtract %float %134 2 + %126 = OpLoad %v3float %finalDiffuse + %127 = OpLoad %v3float %baseAmbientColor + %128 = OpLoad %v3float %finalSpecular + %129 = OpLoad %v4float %reflectionColor + %130 = OpLoad %v4float %refractionColor + %131 = OpFMul %v3float %126 %127 + %132 = OpFAdd %v3float %131 %128 + %133 = OpCompositeExtract %float %129 0 + %134 = OpCompositeExtract %float %129 1 + %135 = OpCompositeExtract %float %129 2 + %136 = OpCompositeConstruct %v3float %133 %134 %135 + %137 = OpFAdd %v3float %132 %136 + %138 = OpCompositeExtract %float %130 0 + %139 = OpCompositeExtract %float %130 1 + %140 = OpCompositeExtract %float %130 2 %141 = OpCompositeConstruct %v3float %138 %139 %140 %142 = OpFAdd %v3float %137 %141 - %143 = OpCompositeExtract %float %135 0 - %144 = OpCompositeExtract %float %135 1 - %145 = OpCompositeExtract %float %135 2 - %146 = OpCompositeConstruct %v3float %143 %144 %145 - %147 = OpFAdd %v3float %142 %146 - %148 = OpLoad %float %alpha - %149 = OpCompositeExtract %float %147 0 - %150 = OpCompositeExtract %float %147 1 - %151 = OpCompositeExtract %float %147 2 - %152 = OpCompositeConstruct %v4float %149 %150 %151 %148 - OpStore %color %152 - %153 = OpLoad %v4float %color - %155 = OpCompositeExtract %float %153 0 - %156 = OpCompositeExtract %float %153 1 - %157 = OpCompositeExtract %float %153 2 - %158 = OpCompositeConstruct %v3float %155 %156 %157 - %154 = OpExtInst %v3float %71 NMax %158 %35 - %159 = OpLoad %v4float %color - %160 = OpCompositeExtract %float %154 0 - %161 = OpCompositeExtract %float %154 1 - %162 = OpCompositeExtract %float %154 2 - %163 = OpCompositeExtract %float %159 3 - %164 = OpCompositeConstruct %v4float %160 %161 %162 %163 - OpStore %color %164 - %165 = OpAccessChain %_ptr_Uniform_float %x_137 %uint_0 - %166 = OpLoad %float %165 - %167 = OpAccessChain %_ptr_Function_float %color %uint_3 - %168 = OpLoad %float %167 - %169 = OpAccessChain %_ptr_Function_float %color %uint_3 - %170 = OpFMul %float %168 %166 - OpStore %169 %170 - %171 = OpLoad %v4float %color - OpStore %glFragColor %171 + %143 = OpLoad %float %alpha + %144 = OpCompositeExtract %float %142 0 + %145 = OpCompositeExtract %float %142 1 + %146 = OpCompositeExtract %float %142 2 + %147 = OpCompositeConstruct %v4float %144 %145 %146 %143 + OpStore %color %147 + %148 = OpLoad %v4float %color + %150 = OpCompositeExtract %float %148 0 + %151 = OpCompositeExtract %float %148 1 + %152 = OpCompositeExtract %float %148 2 + %153 = OpCompositeConstruct %v3float %150 %151 %152 + %149 = OpExtInst %v3float %71 NMax %153 %35 + %154 = OpLoad %v4float %color + %155 = OpCompositeExtract %float %149 0 + %156 = OpCompositeExtract %float %149 1 + %157 = OpCompositeExtract %float %149 2 + %158 = OpCompositeExtract %float %154 3 + %159 = OpCompositeConstruct %v4float %155 %156 %157 %158 + OpStore %color %159 + %160 = OpAccessChain %_ptr_Uniform_float %x_137 %uint_0 + %161 = OpLoad %float %160 + %162 = OpAccessChain %_ptr_Function_float %color %uint_3 + %163 = OpLoad %float %162 + %164 = OpAccessChain %_ptr_Function_float %color %uint_3 + %165 = OpFMul %float %163 %161 + OpStore %164 %165 + %166 = OpLoad %v4float %color + OpStore %glFragColor %166 OpReturn OpFunctionEnd %tint_discard_func = OpFunction %void None %29 - %173 = OpLabel + %168 = OpLabel OpKill OpFunctionEnd - %main_inner = OpFunction %main_out None %174 + %main_inner = OpFunction %main_out None %169 %fClipDistance3_param = OpFunctionParameter %float %fClipDistance4_param = OpFunctionParameter %float - %179 = OpLabel + %174 = OpLabel OpStore %fClipDistance3 %fClipDistance3_param OpStore %fClipDistance4 %fClipDistance4_param - %180 = OpFunctionCall %void %main_1 - %181 = OpLoad %bool %tint_discard - OpSelectionMerge %182 None - OpBranchConditional %181 %183 %182 - %183 = OpLabel - %184 = OpFunctionCall %void %tint_discard_func - OpReturnValue %185 - %182 = OpLabel - %186 = OpLoad %v4float %glFragColor - %187 = OpCompositeConstruct %main_out %186 - OpReturnValue %187 + %175 = OpFunctionCall %void %main_1 + %176 = OpLoad %bool %tint_discard + OpSelectionMerge %177 None + OpBranchConditional %176 %178 %177 + %178 = OpLabel + %179 = OpFunctionCall %void %tint_discard_func + OpReturnValue %180 + %177 = OpLabel + %181 = OpLoad %v4float %glFragColor + %182 = OpCompositeConstruct %main_out %181 + OpReturnValue %182 OpFunctionEnd %main = OpFunction %void None %29 - %189 = OpLabel - %191 = OpLoad %float %fClipDistance3_param_1 - %192 = OpLoad %float %fClipDistance4_param_1 - %190 = OpFunctionCall %main_out %main_inner %191 %192 - %193 = OpCompositeExtract %v4float %190 0 - OpStore %glFragColor_1_1 %193 + %184 = OpLabel + %186 = OpLoad %float %fClipDistance3_param_1 + %187 = OpLoad %float %fClipDistance4_param_1 + %185 = OpFunctionCall %main_out %main_inner %186 %187 + %188 = OpCompositeExtract %v4float %185 0 + OpStore %glFragColor_1_1 %188 OpReturn OpFunctionEnd diff --git a/test/tint/bug/tint/1118.wgsl.expected.wgsl b/test/tint/bug/tint/1118.wgsl.expected.wgsl index a82080aed0..5236f9ac40 100644 --- a/test/tint/bug/tint/1118.wgsl.expected.wgsl +++ b/test/tint/bug/tint/1118.wgsl.expected.wgsl @@ -1,15 +1,3 @@ -bug/tint/1118.wgsl:64:31 warning: 'dpdx' must only be called from uniform control flow - normalW = normalize(-(cross(dpdx(x_62), dpdy(x_64)))); - ^^^^ - -bug/tint/1118.wgsl:47:3 note: control flow depends on non-uniform value - if ((x_9 > 0.0)) { - ^^ - -bug/tint/1118.wgsl:46:19 note: reading from module-scope private variable 'fClipDistance3' may result in a non-uniform value - let x_9 : f32 = fClipDistance3; - ^^^^^^^^^^^^^^ - struct Scene { vEyePosition : vec4, } @@ -73,7 +61,6 @@ fn main_1() { alpha = x_60; let x_62 : vec3 = vec3(0.0, 0.0, 0.0); let x_64 : vec3 = vec3(0.0, 0.0, 0.0); - normalW = normalize(-(cross(dpdx(x_62), dpdy(x_64)))); uvOffset = vec2(0.0, 0.0); let x_74 : vec4 = vec4(0.0, 0.0, 0.0, 0.0); let x_76 : vec4 = baseColor; diff --git a/test/tint/bug/tint/943.spvasm b/test/tint/bug/tint/943.spvasm deleted file mode 100644 index 7fa54629f1..0000000000 --- a/test/tint/bug/tint/943.spvasm +++ /dev/null @@ -1,841 +0,0 @@ -; SPIR-V -; Version: 1.0 -; Generator: Khronos Glslang Reference Front End; 10 -; Bound: 515 -; Schema: 0 - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint GLCompute %main "main" %gl_LocalInvocationID %gl_GlobalInvocationID - OpExecutionMode %main LocalSize 1 64 1 - OpSource GLSL 450 - OpName %main "main" - OpName %coordsInBounds_vi2_vi2_ "coordsInBounds(vi2;vi2;" - OpName %coord "coord" - OpName %shape "shape" - OpName %setOutput_i1_f1_ "setOutput(i1;f1;" - OpName %flatIndex "flatIndex" - OpName %value "value" - OpName %getOutputFlatIndex_vi3_ "getOutputFlatIndex(vi3;" - OpName %coords "coords" - OpName %setOutput_i1_i1_i1_f1_ "setOutput(i1;i1;i1;f1;" - OpName %d0 "d0" - OpName %d1 "d1" - OpName %d2 "d2" - OpName %value_0 "value" - OpName %mm_matMul_i1_i1_i1_ "mm_matMul(i1;i1;i1;" - OpName %dimAOuter "dimAOuter" - OpName %dimInner "dimInner" - OpName %dimBOuter "dimBOuter" - OpName %mm_readA_i1_i1_ "mm_readA(i1;i1;" - OpName %row "row" - OpName %col "col" - OpName %mm_readB_i1_i1_ "mm_readB(i1;i1;" - OpName %row_0 "row" - OpName %col_0 "col" - OpName %mm_write_i1_i1_f1_ "mm_write(i1;i1;f1;" - OpName %row_1 "row" - OpName %col_1 "col" - OpName %value_1 "value" - OpName %dimAOuter_0 "dimAOuter" - OpName %Uniforms "Uniforms" - OpMemberName %Uniforms 0 "NAN" - OpMemberName %Uniforms 1 "aShape" - OpMemberName %Uniforms 2 "bShape" - OpMemberName %Uniforms 3 "outShape" - OpMemberName %Uniforms 4 "outShapeStrides" - OpName %_ "" - OpName %dimInner_0 "dimInner" - OpName %dimBOuter_0 "dimBOuter" - OpName %ssbOut "ssbOut" - OpMemberName %ssbOut 0 "result" - OpName %__0 "" - OpName %flatIndex_0 "flatIndex" - OpName %param "param" - OpName %param_0 "param" - OpName %param_1 "param" - OpName %tileRow "tileRow" - OpName %gl_LocalInvocationID "gl_LocalInvocationID" - OpName %tileCol "tileCol" - OpName %globalRow "globalRow" - OpName %gl_GlobalInvocationID "gl_GlobalInvocationID" - OpName %globalCol "globalCol" - OpName %numTiles "numTiles" - OpName %innerRow "innerRow" - OpName %innerCol "innerCol" - OpName %acc "acc" - OpName %tileColA "tileColA" - OpName %tileRowB "tileRowB" - OpName %t "t" - OpName %innerRow_0 "innerRow" - OpName %innerCol_0 "innerCol" - OpName %inputRow "inputRow" - OpName %inputCol "inputCol" - OpName %mm_Asub "mm_Asub" - OpName %param_2 "param" - OpName %param_3 "param" - OpName %innerRow_1 "innerRow" - OpName %innerCol_1 "innerCol" - OpName %inputRow_0 "inputRow" - OpName %inputCol_0 "inputCol" - OpName %mm_Bsub "mm_Bsub" - OpName %param_4 "param" - OpName %param_5 "param" - OpName %k "k" - OpName %inner "inner" - OpName %BCached "BCached" - OpName %innerRow_2 "innerRow" - OpName %ACached "ACached" - OpName %innerCol_2 "innerCol" - OpName %innerRow_3 "innerRow" - OpName %innerCol_3 "innerCol" - OpName %param_6 "param" - OpName %param_7 "param" - OpName %param_8 "param" - OpName %batchASize "batchASize" - OpName %param_9 "param" - OpName %param_10 "param" - OpName %ssbA "ssbA" - OpMemberName %ssbA 0 "A" - OpName %__1 "" - OpName %batch "batch" - OpName %batchBSize "batchBSize" - OpName %param_11 "param" - OpName %param_12 "param" - OpName %ssbB "ssbB" - OpMemberName %ssbB 0 "B" - OpName %__2 "" - OpName %outCoord "outCoord" - OpName %param_13 "param" - OpName %param_14 "param" - OpName %param_15 "param" - OpName %param_16 "param" - OpName %param_17 "param" - OpName %param_18 "param" - OpName %param_19 "param" - OpMemberDecorate %Uniforms 0 Offset 0 - OpMemberDecorate %Uniforms 1 Offset 16 - OpMemberDecorate %Uniforms 2 Offset 32 - OpMemberDecorate %Uniforms 3 Offset 48 - OpMemberDecorate %Uniforms 4 Offset 64 - OpDecorate %Uniforms Block - OpDecorate %_ DescriptorSet 0 - OpDecorate %_ Binding 3 - OpDecorate %_runtimearr_float ArrayStride 4 - OpMemberDecorate %ssbOut 0 NonReadable - OpMemberDecorate %ssbOut 0 Offset 0 - OpDecorate %ssbOut BufferBlock - OpDecorate %__0 DescriptorSet 0 - OpDecorate %__0 Binding 0 - OpDecorate %gl_LocalInvocationID BuiltIn LocalInvocationId - OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId - OpDecorate %_runtimearr_float_0 ArrayStride 4 - OpMemberDecorate %ssbA 0 NonWritable - OpMemberDecorate %ssbA 0 Offset 0 - OpDecorate %ssbA BufferBlock - OpDecorate %__1 DescriptorSet 0 - OpDecorate %__1 Binding 1 - OpDecorate %_runtimearr_float_1 ArrayStride 4 - OpMemberDecorate %ssbB 0 NonWritable - OpMemberDecorate %ssbB 0 Offset 0 - OpDecorate %ssbB BufferBlock - OpDecorate %__2 DescriptorSet 0 - OpDecorate %__2 Binding 2 - OpDecorate %gl_WorkGroupSize BuiltIn WorkgroupSize - %void = OpTypeVoid - %3 = OpTypeFunction %void - %int = OpTypeInt 32 1 - %v2int = OpTypeVector %int 2 - %_ptr_Function_v2int = OpTypePointer Function %v2int - %bool = OpTypeBool - %10 = OpTypeFunction %bool %_ptr_Function_v2int %_ptr_Function_v2int - %_ptr_Function_int = OpTypePointer Function %int - %float = OpTypeFloat 32 - %_ptr_Function_float = OpTypePointer Function %float - %18 = OpTypeFunction %void %_ptr_Function_int %_ptr_Function_float - %v3int = OpTypeVector %int 3 - %_ptr_Function_v3int = OpTypePointer Function %v3int - %25 = OpTypeFunction %int %_ptr_Function_v3int - %29 = OpTypeFunction %void %_ptr_Function_int %_ptr_Function_int %_ptr_Function_int %_ptr_Function_float - %36 = OpTypeFunction %void %_ptr_Function_int %_ptr_Function_int %_ptr_Function_int - %42 = OpTypeFunction %float %_ptr_Function_int %_ptr_Function_int - %51 = OpTypeFunction %void %_ptr_Function_int %_ptr_Function_int %_ptr_Function_float - %_ptr_Private_int = OpTypePointer Private %int - %dimAOuter_0 = OpVariable %_ptr_Private_int Private - %Uniforms = OpTypeStruct %float %v3int %v3int %v3int %v2int - %_ptr_Uniform_Uniforms = OpTypePointer Uniform %Uniforms - %_ = OpVariable %_ptr_Uniform_Uniforms Uniform - %int_1 = OpConstant %int 1 - %uint = OpTypeInt 32 0 - %uint_1 = OpConstant %uint 1 - %_ptr_Uniform_int = OpTypePointer Uniform %int - %dimInner_0 = OpVariable %_ptr_Private_int Private - %uint_2 = OpConstant %uint 2 - %dimBOuter_0 = OpVariable %_ptr_Private_int Private - %int_2 = OpConstant %int 2 - %int_0 = OpConstant %int 0 - %78 = OpConstantComposite %v2int %int_0 %int_0 - %v2bool = OpTypeVector %bool 2 - %_runtimearr_float = OpTypeRuntimeArray %float - %ssbOut = OpTypeStruct %_runtimearr_float - %_ptr_Uniform_ssbOut = OpTypePointer Uniform %ssbOut - %__0 = OpVariable %_ptr_Uniform_ssbOut Uniform - %_ptr_Uniform_float = OpTypePointer Uniform %float - %v3float = OpTypeVector %float 3 - %int_4 = OpConstant %int 4 - %uint_0 = OpConstant %uint 0 - %v3uint = OpTypeVector %uint 3 - %_ptr_Input_v3uint = OpTypePointer Input %v3uint - %gl_LocalInvocationID = OpVariable %_ptr_Input_v3uint Input - %_ptr_Input_uint = OpTypePointer Input %uint - %gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input - %int_64 = OpConstant %int 64 - %_arr_float_uint_1 = OpTypeArray %float %uint_1 - %_arr__arr_float_uint_1_uint_1 = OpTypeArray %_arr_float_uint_1 %uint_1 - %_ptr_Function__arr__arr_float_uint_1_uint_1 = OpTypePointer Function %_arr__arr_float_uint_1_uint_1 - %float_0 = OpConstant %float 0 - %uint_64 = OpConstant %uint 64 - %_arr_float_uint_64 = OpTypeArray %float %uint_64 - %_arr__arr_float_uint_64_uint_64 = OpTypeArray %_arr_float_uint_64 %uint_64 -%_ptr_Workgroup__arr__arr_float_uint_64_uint_64 = OpTypePointer Workgroup %_arr__arr_float_uint_64_uint_64 - %mm_Asub = OpVariable %_ptr_Workgroup__arr__arr_float_uint_64_uint_64 Workgroup - %_ptr_Workgroup_float = OpTypePointer Workgroup %float - %_arr__arr_float_uint_1_uint_64 = OpTypeArray %_arr_float_uint_1 %uint_64 - %_ptr_Workgroup__arr__arr_float_uint_1_uint_64 = OpTypePointer Workgroup %_arr__arr_float_uint_1_uint_64 - %mm_Bsub = OpVariable %_ptr_Workgroup__arr__arr_float_uint_1_uint_64 Workgroup - %uint_264 = OpConstant %uint 264 - %_ptr_Function__arr_float_uint_1 = OpTypePointer Function %_arr_float_uint_1 - %_runtimearr_float_0 = OpTypeRuntimeArray %float - %ssbA = OpTypeStruct %_runtimearr_float_0 - %_ptr_Uniform_ssbA = OpTypePointer Uniform %ssbA - %__1 = OpVariable %_ptr_Uniform_ssbA Uniform - %batch = OpVariable %_ptr_Private_int Private - %_runtimearr_float_1 = OpTypeRuntimeArray %float - %ssbB = OpTypeStruct %_runtimearr_float_1 - %_ptr_Uniform_ssbB = OpTypePointer Uniform %ssbB - %__2 = OpVariable %_ptr_Uniform_ssbB Uniform - %gl_WorkGroupSize = OpConstantComposite %v3uint %uint_1 %uint_64 %uint_1 - %main = OpFunction %void None %3 - %5 = OpLabel - %param_17 = OpVariable %_ptr_Function_int Function - %param_18 = OpVariable %_ptr_Function_int Function - %param_19 = OpVariable %_ptr_Function_int Function - %66 = OpAccessChain %_ptr_Uniform_int %_ %int_1 %uint_1 - %67 = OpLoad %int %66 - OpStore %dimAOuter_0 %67 - %70 = OpAccessChain %_ptr_Uniform_int %_ %int_1 %uint_2 - %71 = OpLoad %int %70 - OpStore %dimInner_0 %71 - %74 = OpAccessChain %_ptr_Uniform_int %_ %int_2 %uint_2 - %75 = OpLoad %int %74 - OpStore %dimBOuter_0 %75 - %504 = OpAccessChain %_ptr_Input_uint %gl_GlobalInvocationID %uint_2 - %505 = OpLoad %uint %504 - %506 = OpBitcast %int %505 - OpStore %batch %506 - %508 = OpLoad %int %dimAOuter_0 - OpStore %param_17 %508 - %510 = OpLoad %int %dimInner_0 - OpStore %param_18 %510 - %512 = OpLoad %int %dimBOuter_0 - OpStore %param_19 %512 - %513 = OpFunctionCall %void %mm_matMul_i1_i1_i1_ %param_17 %param_18 %param_19 - OpReturn - OpFunctionEnd - %coordsInBounds_vi2_vi2_ = OpFunction %bool None %10 - %coord = OpFunctionParameter %_ptr_Function_v2int - %shape = OpFunctionParameter %_ptr_Function_v2int - %14 = OpLabel - %76 = OpLoad %v2int %coord - %80 = OpSGreaterThanEqual %v2bool %76 %78 - %81 = OpAll %bool %80 - OpSelectionMerge %83 None - OpBranchConditional %81 %82 %83 - %82 = OpLabel - %84 = OpLoad %v2int %coord - %85 = OpLoad %v2int %shape - %86 = OpSLessThan %v2bool %84 %85 - %87 = OpAll %bool %86 - OpBranch %83 - %83 = OpLabel - %88 = OpPhi %bool %81 %14 %87 %82 - OpReturnValue %88 - OpFunctionEnd - %setOutput_i1_f1_ = OpFunction %void None %18 - %flatIndex = OpFunctionParameter %_ptr_Function_int - %value = OpFunctionParameter %_ptr_Function_float - %22 = OpLabel - %95 = OpLoad %int %flatIndex - %96 = OpLoad %float %value - %98 = OpAccessChain %_ptr_Uniform_float %__0 %int_0 %95 - OpStore %98 %96 - OpReturn - OpFunctionEnd - %getOutputFlatIndex_vi3_ = OpFunction %int None %25 - %coords = OpFunctionParameter %_ptr_Function_v3int - %28 = OpLabel - %99 = OpLoad %v3int %coords - %101 = OpConvertSToF %v3float %99 - %104 = OpAccessChain %_ptr_Uniform_int %_ %int_4 %uint_0 - %105 = OpLoad %int %104 - %106 = OpAccessChain %_ptr_Uniform_int %_ %int_4 %uint_1 - %107 = OpLoad %int %106 - %108 = OpCompositeConstruct %v3int %105 %107 %int_1 - %109 = OpConvertSToF %v3float %108 - %110 = OpDot %float %101 %109 - %111 = OpConvertFToS %int %110 - OpReturnValue %111 - OpFunctionEnd - %setOutput_i1_i1_i1_f1_ = OpFunction %void None %29 - %d0 = OpFunctionParameter %_ptr_Function_int - %d1 = OpFunctionParameter %_ptr_Function_int - %d2 = OpFunctionParameter %_ptr_Function_int - %value_0 = OpFunctionParameter %_ptr_Function_float - %35 = OpLabel - %flatIndex_0 = OpVariable %_ptr_Function_int Function - %param = OpVariable %_ptr_Function_v3int Function - %param_0 = OpVariable %_ptr_Function_int Function - %param_1 = OpVariable %_ptr_Function_float Function - %115 = OpLoad %int %d0 - %116 = OpLoad %int %d1 - %117 = OpLoad %int %d2 - %118 = OpCompositeConstruct %v3int %115 %116 %117 - OpStore %param %118 - %120 = OpFunctionCall %int %getOutputFlatIndex_vi3_ %param - OpStore %flatIndex_0 %120 - %122 = OpLoad %int %flatIndex_0 - OpStore %param_0 %122 - %124 = OpLoad %float %value_0 - OpStore %param_1 %124 - %125 = OpFunctionCall %void %setOutput_i1_f1_ %param_0 %param_1 - OpReturn - OpFunctionEnd - %mm_matMul_i1_i1_i1_ = OpFunction %void None %36 - %dimAOuter = OpFunctionParameter %_ptr_Function_int - %dimInner = OpFunctionParameter %_ptr_Function_int - %dimBOuter = OpFunctionParameter %_ptr_Function_int - %41 = OpLabel - %tileRow = OpVariable %_ptr_Function_int Function - %tileCol = OpVariable %_ptr_Function_int Function - %globalRow = OpVariable %_ptr_Function_int Function - %globalCol = OpVariable %_ptr_Function_int Function - %numTiles = OpVariable %_ptr_Function_int Function - %innerRow = OpVariable %_ptr_Function_int Function - %innerCol = OpVariable %_ptr_Function_int Function - %acc = OpVariable %_ptr_Function__arr__arr_float_uint_1_uint_1 Function - %tileColA = OpVariable %_ptr_Function_int Function - %tileRowB = OpVariable %_ptr_Function_int Function - %t = OpVariable %_ptr_Function_int Function - %innerRow_0 = OpVariable %_ptr_Function_int Function - %innerCol_0 = OpVariable %_ptr_Function_int Function - %inputRow = OpVariable %_ptr_Function_int Function - %inputCol = OpVariable %_ptr_Function_int Function - %param_2 = OpVariable %_ptr_Function_int Function - %param_3 = OpVariable %_ptr_Function_int Function - %innerRow_1 = OpVariable %_ptr_Function_int Function - %innerCol_1 = OpVariable %_ptr_Function_int Function - %inputRow_0 = OpVariable %_ptr_Function_int Function - %inputCol_0 = OpVariable %_ptr_Function_int Function - %param_4 = OpVariable %_ptr_Function_int Function - %param_5 = OpVariable %_ptr_Function_int Function - %k = OpVariable %_ptr_Function_int Function - %inner = OpVariable %_ptr_Function_int Function - %BCached = OpVariable %_ptr_Function__arr_float_uint_1 Function - %innerRow_2 = OpVariable %_ptr_Function_int Function - %ACached = OpVariable %_ptr_Function_float Function - %innerCol_2 = OpVariable %_ptr_Function_int Function - %innerRow_3 = OpVariable %_ptr_Function_int Function - %innerCol_3 = OpVariable %_ptr_Function_int Function - %param_6 = OpVariable %_ptr_Function_int Function - %param_7 = OpVariable %_ptr_Function_int Function - %param_8 = OpVariable %_ptr_Function_float Function - %131 = OpAccessChain %_ptr_Input_uint %gl_LocalInvocationID %uint_1 - %132 = OpLoad %uint %131 - %133 = OpBitcast %int %132 - %134 = OpIMul %int %133 %int_1 - OpStore %tileRow %134 - %136 = OpAccessChain %_ptr_Input_uint %gl_LocalInvocationID %uint_0 - %137 = OpLoad %uint %136 - %138 = OpBitcast %int %137 - %139 = OpIMul %int %138 %int_1 - OpStore %tileCol %139 - %142 = OpAccessChain %_ptr_Input_uint %gl_GlobalInvocationID %uint_1 - %143 = OpLoad %uint %142 - %144 = OpBitcast %int %143 - %145 = OpIMul %int %144 %int_1 - OpStore %globalRow %145 - %147 = OpAccessChain %_ptr_Input_uint %gl_GlobalInvocationID %uint_0 - %148 = OpLoad %uint %147 - %149 = OpBitcast %int %148 - %150 = OpIMul %int %149 %int_1 - OpStore %globalCol %150 - %152 = OpLoad %int %dimInner - %153 = OpISub %int %152 %int_1 - %155 = OpSDiv %int %153 %int_64 - %156 = OpIAdd %int %155 %int_1 - OpStore %numTiles %156 - OpStore %innerRow %int_0 - OpBranch %158 - %158 = OpLabel - OpLoopMerge %160 %161 None - OpBranch %162 - %162 = OpLabel - %163 = OpLoad %int %innerRow - %164 = OpSLessThan %bool %163 %int_1 - OpBranchConditional %164 %159 %160 - %159 = OpLabel - OpStore %innerCol %int_0 - OpBranch %166 - %166 = OpLabel - OpLoopMerge %168 %169 None - OpBranch %170 - %170 = OpLabel - %171 = OpLoad %int %innerCol - %172 = OpSLessThan %bool %171 %int_1 - OpBranchConditional %172 %167 %168 - %167 = OpLabel - %177 = OpLoad %int %innerRow - %178 = OpLoad %int %innerCol - %180 = OpAccessChain %_ptr_Function_float %acc %177 %178 - OpStore %180 %float_0 - OpBranch %169 - %169 = OpLabel - %181 = OpLoad %int %innerCol - %182 = OpIAdd %int %181 %int_1 - OpStore %innerCol %182 - OpBranch %166 - %168 = OpLabel - OpBranch %161 - %161 = OpLabel - %183 = OpLoad %int %innerRow - %184 = OpIAdd %int %183 %int_1 - OpStore %innerRow %184 - OpBranch %158 - %160 = OpLabel - %186 = OpAccessChain %_ptr_Input_uint %gl_LocalInvocationID %uint_0 - %187 = OpLoad %uint %186 - %188 = OpBitcast %int %187 - %189 = OpIMul %int %188 %int_64 - OpStore %tileColA %189 - %191 = OpAccessChain %_ptr_Input_uint %gl_LocalInvocationID %uint_1 - %192 = OpLoad %uint %191 - %193 = OpBitcast %int %192 - %194 = OpIMul %int %193 %int_1 - OpStore %tileRowB %194 - OpStore %t %int_0 - OpBranch %196 - %196 = OpLabel - OpLoopMerge %198 %199 None - OpBranch %200 - %200 = OpLabel - %201 = OpLoad %int %t - %202 = OpLoad %int %numTiles - %203 = OpSLessThan %bool %201 %202 - OpBranchConditional %203 %197 %198 - %197 = OpLabel - OpStore %innerRow_0 %int_0 - OpBranch %205 - %205 = OpLabel - OpLoopMerge %207 %208 None - OpBranch %209 - %209 = OpLabel - %210 = OpLoad %int %innerRow_0 - %211 = OpSLessThan %bool %210 %int_1 - OpBranchConditional %211 %206 %207 - %206 = OpLabel - OpStore %innerCol_0 %int_0 - OpBranch %213 - %213 = OpLabel - OpLoopMerge %215 %216 None - OpBranch %217 - %217 = OpLabel - %218 = OpLoad %int %innerCol_0 - %219 = OpSLessThan %bool %218 %int_64 - OpBranchConditional %219 %214 %215 - %214 = OpLabel - %221 = OpLoad %int %tileRow - %222 = OpLoad %int %innerRow_0 - %223 = OpIAdd %int %221 %222 - OpStore %inputRow %223 - %225 = OpLoad %int %tileColA - %226 = OpLoad %int %innerCol_0 - %227 = OpIAdd %int %225 %226 - OpStore %inputCol %227 - %233 = OpLoad %int %inputRow - %234 = OpLoad %int %inputCol - %235 = OpLoad %int %globalRow - %236 = OpLoad %int %innerRow_0 - %237 = OpIAdd %int %235 %236 - %238 = OpLoad %int %t - %239 = OpIMul %int %238 %int_64 - %240 = OpLoad %int %inputCol - %241 = OpIAdd %int %239 %240 - OpStore %param_2 %237 - OpStore %param_3 %241 - %244 = OpFunctionCall %float %mm_readA_i1_i1_ %param_2 %param_3 - %246 = OpAccessChain %_ptr_Workgroup_float %mm_Asub %233 %234 - OpStore %246 %244 - OpBranch %216 - %216 = OpLabel - %247 = OpLoad %int %innerCol_0 - %248 = OpIAdd %int %247 %int_1 - OpStore %innerCol_0 %248 - OpBranch %213 - %215 = OpLabel - OpBranch %208 - %208 = OpLabel - %249 = OpLoad %int %innerRow_0 - %250 = OpIAdd %int %249 %int_1 - OpStore %innerRow_0 %250 - OpBranch %205 - %207 = OpLabel - OpStore %innerRow_1 %int_0 - OpBranch %252 - %252 = OpLabel - OpLoopMerge %254 %255 None - OpBranch %256 - %256 = OpLabel - %257 = OpLoad %int %innerRow_1 - %258 = OpSLessThan %bool %257 %int_1 - OpBranchConditional %258 %253 %254 - %253 = OpLabel - OpStore %innerCol_1 %int_0 - OpBranch %260 - %260 = OpLabel - OpLoopMerge %262 %263 None - OpBranch %264 - %264 = OpLabel - %265 = OpLoad %int %innerCol_1 - %266 = OpSLessThan %bool %265 %int_1 - OpBranchConditional %266 %261 %262 - %261 = OpLabel - %268 = OpLoad %int %tileRowB - %269 = OpLoad %int %innerRow_1 - %270 = OpIAdd %int %268 %269 - OpStore %inputRow_0 %270 - %272 = OpLoad %int %tileCol - %273 = OpLoad %int %innerCol_1 - %274 = OpIAdd %int %272 %273 - OpStore %inputCol_0 %274 - %278 = OpLoad %int %inputRow_0 - %279 = OpLoad %int %inputCol_0 - %280 = OpLoad %int %t - %281 = OpIMul %int %280 %int_64 - %282 = OpLoad %int %inputRow_0 - %283 = OpIAdd %int %281 %282 - %284 = OpLoad %int %globalCol - %285 = OpLoad %int %innerCol_1 - %286 = OpIAdd %int %284 %285 - OpStore %param_4 %283 - OpStore %param_5 %286 - %289 = OpFunctionCall %float %mm_readB_i1_i1_ %param_4 %param_5 - %290 = OpAccessChain %_ptr_Workgroup_float %mm_Bsub %278 %279 - OpStore %290 %289 - OpBranch %263 - %263 = OpLabel - %291 = OpLoad %int %innerCol_1 - %292 = OpIAdd %int %291 %int_1 - OpStore %innerCol_1 %292 - OpBranch %260 - %262 = OpLabel - OpBranch %255 - %255 = OpLabel - %293 = OpLoad %int %innerRow_1 - %294 = OpIAdd %int %293 %int_1 - OpStore %innerRow_1 %294 - OpBranch %252 - %254 = OpLabel - OpControlBarrier %uint_2 %uint_2 %uint_264 - OpStore %k %int_0 - OpBranch %297 - %297 = OpLabel - OpLoopMerge %299 %300 None - OpBranch %301 - %301 = OpLabel - %302 = OpLoad %int %k - %303 = OpSLessThan %bool %302 %int_64 - OpBranchConditional %303 %298 %299 - %298 = OpLabel - OpStore %inner %int_0 - OpBranch %305 - %305 = OpLabel - OpLoopMerge %307 %308 None - OpBranch %309 - %309 = OpLabel - %310 = OpLoad %int %inner - %311 = OpSLessThan %bool %310 %int_1 - OpBranchConditional %311 %306 %307 - %306 = OpLabel - %314 = OpLoad %int %inner - %315 = OpLoad %int %k - %316 = OpLoad %int %tileCol - %317 = OpLoad %int %inner - %318 = OpIAdd %int %316 %317 - %319 = OpAccessChain %_ptr_Workgroup_float %mm_Bsub %315 %318 - %320 = OpLoad %float %319 - %321 = OpAccessChain %_ptr_Function_float %BCached %314 - OpStore %321 %320 - OpBranch %308 - %308 = OpLabel - %322 = OpLoad %int %inner - %323 = OpIAdd %int %322 %int_1 - OpStore %inner %323 - OpBranch %305 - %307 = OpLabel - OpStore %innerRow_2 %int_0 - OpBranch %325 - %325 = OpLabel - OpLoopMerge %327 %328 None - OpBranch %329 - %329 = OpLabel - %330 = OpLoad %int %innerRow_2 - %331 = OpSLessThan %bool %330 %int_1 - OpBranchConditional %331 %326 %327 - %326 = OpLabel - %333 = OpLoad %int %tileRow - %334 = OpLoad %int %innerRow_2 - %335 = OpIAdd %int %333 %334 - %336 = OpLoad %int %k - %337 = OpAccessChain %_ptr_Workgroup_float %mm_Asub %335 %336 - %338 = OpLoad %float %337 - OpStore %ACached %338 - OpStore %innerCol_2 %int_0 - OpBranch %340 - %340 = OpLabel - OpLoopMerge %342 %343 None - OpBranch %344 - %344 = OpLabel - %345 = OpLoad %int %innerCol_2 - %346 = OpSLessThan %bool %345 %int_1 - OpBranchConditional %346 %341 %342 - %341 = OpLabel - %347 = OpLoad %int %innerRow_2 - %348 = OpLoad %int %innerCol_2 - %349 = OpLoad %float %ACached - %350 = OpLoad %int %innerCol_2 - %351 = OpAccessChain %_ptr_Function_float %BCached %350 - %352 = OpLoad %float %351 - %353 = OpFMul %float %349 %352 - %354 = OpAccessChain %_ptr_Function_float %acc %347 %348 - %355 = OpLoad %float %354 - %356 = OpFAdd %float %355 %353 - %357 = OpAccessChain %_ptr_Function_float %acc %347 %348 - OpStore %357 %356 - OpBranch %343 - %343 = OpLabel - %358 = OpLoad %int %innerCol_2 - %359 = OpIAdd %int %358 %int_1 - OpStore %innerCol_2 %359 - OpBranch %340 - %342 = OpLabel - OpBranch %328 - %328 = OpLabel - %360 = OpLoad %int %innerRow_2 - %361 = OpIAdd %int %360 %int_1 - OpStore %innerRow_2 %361 - OpBranch %325 - %327 = OpLabel - OpBranch %300 - %300 = OpLabel - %362 = OpLoad %int %k - %363 = OpIAdd %int %362 %int_1 - OpStore %k %363 - OpBranch %297 - %299 = OpLabel - OpControlBarrier %uint_2 %uint_2 %uint_264 - OpBranch %199 - %199 = OpLabel - %364 = OpLoad %int %t - %365 = OpIAdd %int %364 %int_1 - OpStore %t %365 - OpBranch %196 - %198 = OpLabel - OpStore %innerRow_3 %int_0 - OpBranch %367 - %367 = OpLabel - OpLoopMerge %369 %370 None - OpBranch %371 - %371 = OpLabel - %372 = OpLoad %int %innerRow_3 - %373 = OpSLessThan %bool %372 %int_1 - OpBranchConditional %373 %368 %369 - %368 = OpLabel - OpStore %innerCol_3 %int_0 - OpBranch %375 - %375 = OpLabel - OpLoopMerge %377 %378 None - OpBranch %379 - %379 = OpLabel - %380 = OpLoad %int %innerCol_3 - %381 = OpSLessThan %bool %380 %int_1 - OpBranchConditional %381 %376 %377 - %376 = OpLabel - %382 = OpLoad %int %globalCol - %383 = OpLoad %int %innerCol_3 - %384 = OpIAdd %int %382 %383 - %385 = OpLoad %int %dimBOuter - %386 = OpSLessThan %bool %384 %385 - OpSelectionMerge %388 None - OpBranchConditional %386 %387 %388 - %387 = OpLabel - %389 = OpLoad %int %globalRow - %390 = OpLoad %int %innerRow_3 - %391 = OpIAdd %int %389 %390 - %392 = OpLoad %int %dimAOuter - %393 = OpSLessThan %bool %391 %392 - OpBranch %388 - %388 = OpLabel - %394 = OpPhi %bool %386 %376 %393 %387 - OpSelectionMerge %396 None - OpBranchConditional %394 %395 %396 - %395 = OpLabel - %397 = OpLoad %int %globalRow - %398 = OpLoad %int %innerRow_3 - %399 = OpIAdd %int %397 %398 - %400 = OpLoad %int %globalCol - %401 = OpLoad %int %innerCol_3 - %402 = OpIAdd %int %400 %401 - %403 = OpLoad %int %innerRow_3 - %404 = OpLoad %int %innerCol_3 - OpStore %param_6 %399 - OpStore %param_7 %402 - %408 = OpAccessChain %_ptr_Function_float %acc %403 %404 - %409 = OpLoad %float %408 - OpStore %param_8 %409 - %410 = OpFunctionCall %void %mm_write_i1_i1_f1_ %param_6 %param_7 %param_8 - OpBranch %396 - %396 = OpLabel - OpBranch %378 - %378 = OpLabel - %411 = OpLoad %int %innerCol_3 - %412 = OpIAdd %int %411 %int_1 - OpStore %innerCol_3 %412 - OpBranch %375 - %377 = OpLabel - OpBranch %370 - %370 = OpLabel - %413 = OpLoad %int %innerRow_3 - %414 = OpIAdd %int %413 %int_1 - OpStore %innerRow_3 %414 - OpBranch %367 - %369 = OpLabel - OpReturn - OpFunctionEnd - %mm_readA_i1_i1_ = OpFunction %float None %42 - %row = OpFunctionParameter %_ptr_Function_int - %col = OpFunctionParameter %_ptr_Function_int - %46 = OpLabel - %batchASize = OpVariable %_ptr_Function_int Function - %param_9 = OpVariable %_ptr_Function_v2int Function - %param_10 = OpVariable %_ptr_Function_v2int Function - %430 = OpVariable %_ptr_Function_float Function - %416 = OpAccessChain %_ptr_Uniform_int %_ %int_1 %uint_1 - %417 = OpLoad %int %416 - %418 = OpAccessChain %_ptr_Uniform_int %_ %int_1 %uint_2 - %419 = OpLoad %int %418 - %420 = OpIMul %int %417 %419 - OpStore %batchASize %420 - %421 = OpLoad %int %row - %422 = OpLoad %int %col - %423 = OpCompositeConstruct %v2int %421 %422 - %424 = OpLoad %int %dimAOuter_0 - %425 = OpLoad %int %dimInner_0 - %426 = OpCompositeConstruct %v2int %424 %425 - OpStore %param_9 %423 - OpStore %param_10 %426 - %429 = OpFunctionCall %bool %coordsInBounds_vi2_vi2_ %param_9 %param_10 - OpSelectionMerge %432 None - OpBranchConditional %429 %431 %449 - %431 = OpLabel - %438 = OpLoad %int %batch - %439 = OpLoad %int %batchASize - %440 = OpIMul %int %438 %439 - %441 = OpLoad %int %row - %442 = OpLoad %int %dimInner_0 - %443 = OpIMul %int %441 %442 - %444 = OpIAdd %int %440 %443 - %445 = OpLoad %int %col - %446 = OpIAdd %int %444 %445 - %447 = OpAccessChain %_ptr_Uniform_float %__1 %int_0 %446 - %448 = OpLoad %float %447 - OpStore %430 %448 - OpBranch %432 - %449 = OpLabel - OpStore %430 %float_0 - OpBranch %432 - %432 = OpLabel - %450 = OpLoad %float %430 - OpReturnValue %450 - OpFunctionEnd - %mm_readB_i1_i1_ = OpFunction %float None %42 - %row_0 = OpFunctionParameter %_ptr_Function_int - %col_0 = OpFunctionParameter %_ptr_Function_int - %50 = OpLabel - %batchBSize = OpVariable %_ptr_Function_int Function - %param_11 = OpVariable %_ptr_Function_v2int Function - %param_12 = OpVariable %_ptr_Function_v2int Function - %468 = OpVariable %_ptr_Function_float Function - %454 = OpAccessChain %_ptr_Uniform_int %_ %int_2 %uint_1 - %455 = OpLoad %int %454 - %456 = OpAccessChain %_ptr_Uniform_int %_ %int_2 %uint_2 - %457 = OpLoad %int %456 - %458 = OpIMul %int %455 %457 - OpStore %batchBSize %458 - %459 = OpLoad %int %row_0 - %460 = OpLoad %int %col_0 - %461 = OpCompositeConstruct %v2int %459 %460 - %462 = OpLoad %int %dimInner_0 - %463 = OpLoad %int %dimBOuter_0 - %464 = OpCompositeConstruct %v2int %462 %463 - OpStore %param_11 %461 - OpStore %param_12 %464 - %467 = OpFunctionCall %bool %coordsInBounds_vi2_vi2_ %param_11 %param_12 - OpSelectionMerge %470 None - OpBranchConditional %467 %469 %486 - %469 = OpLabel - %475 = OpLoad %int %batch - %476 = OpLoad %int %batchBSize - %477 = OpIMul %int %475 %476 - %478 = OpLoad %int %row_0 - %479 = OpLoad %int %dimBOuter_0 - %480 = OpIMul %int %478 %479 - %481 = OpIAdd %int %477 %480 - %482 = OpLoad %int %col_0 - %483 = OpIAdd %int %481 %482 - %484 = OpAccessChain %_ptr_Uniform_float %__2 %int_0 %483 - %485 = OpLoad %float %484 - OpStore %468 %485 - OpBranch %470 - %486 = OpLabel - OpStore %468 %float_0 - OpBranch %470 - %470 = OpLabel - %487 = OpLoad %float %468 - OpReturnValue %487 - OpFunctionEnd - %mm_write_i1_i1_f1_ = OpFunction %void None %51 - %row_1 = OpFunctionParameter %_ptr_Function_int - %col_1 = OpFunctionParameter %_ptr_Function_int - %value_1 = OpFunctionParameter %_ptr_Function_float - %56 = OpLabel - %outCoord = OpVariable %_ptr_Function_v3int Function - %param_13 = OpVariable %_ptr_Function_int Function - %param_14 = OpVariable %_ptr_Function_int Function - %param_15 = OpVariable %_ptr_Function_int Function - %param_16 = OpVariable %_ptr_Function_float Function - %491 = OpLoad %int %batch - %492 = OpLoad %int %row_1 - %493 = OpLoad %int %col_1 - %494 = OpCompositeConstruct %v3int %491 %492 %493 - OpStore %outCoord %494 - %496 = OpLoad %int %batch - OpStore %param_13 %496 - %498 = OpLoad %int %row_1 - OpStore %param_14 %498 - %500 = OpLoad %int %col_1 - OpStore %param_15 %500 - %502 = OpLoad %float %value_1 - OpStore %param_16 %502 - %503 = OpFunctionCall %void %setOutput_i1_i1_i1_f1_ %param_13 %param_14 %param_15 %param_16 - OpReturn - OpFunctionEnd diff --git a/test/tint/bug/tint/943.spvasm.expected.dxc.hlsl b/test/tint/bug/tint/943.spvasm.expected.dxc.hlsl deleted file mode 100644 index 695618f8b6..0000000000 --- a/test/tint/bug/tint/943.spvasm.expected.dxc.hlsl +++ /dev/null @@ -1,491 +0,0 @@ -warning: parameter 'dimInner' of 'mm_matMul_i1_i1_i1_' must be uniform -note: 'workgroupBarrier' must only be called from uniform control flow -note: reading from module-scope private variable 'dimInner_1' may result in a non-uniform value -static int dimAOuter_1 = 0; -cbuffer cbuffer_x_48 : register(b3, space0) { - uint4 x_48[5]; -}; -static int dimInner_1 = 0; -static int dimBOuter_1 = 0; -RWByteAddressBuffer x_54 : register(u0, space0); -static uint3 gl_LocalInvocationID = uint3(0u, 0u, 0u); -static uint3 gl_GlobalInvocationID = uint3(0u, 0u, 0u); -groupshared float mm_Asub[64][64]; -groupshared float mm_Bsub[64][1]; -ByteAddressBuffer x_165 : register(t1, space0); -static int batch = 0; -ByteAddressBuffer x_185 : register(t2, space0); - -bool coordsInBounds_vi2_vi2_(inout int2 coord, inout int2 shape) { - bool x_87 = false; - bool x_88 = false; - const int2 x_76 = coord; - const bool x_81 = all((x_76 >= (0).xx)); - x_88 = x_81; - if (x_81) { - const int2 x_84 = coord; - const int2 x_85 = shape; - x_87 = all((x_84 < x_85)); - x_88 = x_87; - } - return x_88; -} - -float mm_readA_i1_i1_(inout int row, inout int col) { - int batchASize = 0; - int2 param_10 = int2(0, 0); - int2 param_11 = int2(0, 0); - float x_430 = 0.0f; - const int x_417 = asint(x_48[1].y); - const int x_419 = asint(x_48[1].z); - batchASize = (x_417 * x_419); - const int x_421 = row; - const int x_422 = col; - const int x_424 = dimAOuter_1; - const int x_425 = dimInner_1; - param_10 = int2(x_421, x_422); - param_11 = int2(x_424, x_425); - const bool x_429 = coordsInBounds_vi2_vi2_(param_10, param_11); - if (x_429) { - const int x_438 = batch; - const int x_439 = batchASize; - const int x_441 = row; - const int x_442 = dimInner_1; - const int x_445 = col; - const float x_448 = asfloat(x_165.Load((4u * uint((((x_438 * x_439) + (x_441 * x_442)) + x_445))))); - x_430 = x_448; - } else { - x_430 = 0.0f; - } - const float x_450 = x_430; - return x_450; -} - -float mm_readB_i1_i1_(inout int row_1, inout int col_1) { - int batchBSize = 0; - int2 param_12 = int2(0, 0); - int2 param_13 = int2(0, 0); - float x_468 = 0.0f; - const int x_455 = asint(x_48[2].y); - const int x_457 = asint(x_48[2].z); - batchBSize = (x_455 * x_457); - const int x_459 = row_1; - const int x_460 = col_1; - const int x_462 = dimInner_1; - const int x_463 = dimBOuter_1; - param_12 = int2(x_459, x_460); - param_13 = int2(x_462, x_463); - const bool x_467 = coordsInBounds_vi2_vi2_(param_12, param_13); - if (x_467) { - const int x_475 = batch; - const int x_476 = batchBSize; - const int x_478 = row_1; - const int x_479 = dimBOuter_1; - const int x_482 = col_1; - const float x_485 = asfloat(x_185.Load((4u * uint((((x_475 * x_476) + (x_478 * x_479)) + x_482))))); - x_468 = x_485; - } else { - x_468 = 0.0f; - } - const float x_487 = x_468; - return x_487; -} - -int getOutputFlatIndex_vi3_(inout int3 coords) { - const int3 x_99 = coords; - const int x_105 = asint(x_48[4].x); - const int x_107 = asint(x_48[4].y); - return int(dot(float3(x_99), float3(int3(x_105, x_107, 1)))); -} - -void setOutput_i1_f1_(inout int flatIndex, inout float value) { - const int x_95 = flatIndex; - const float x_96 = value; - x_54.Store((4u * uint(x_95)), asuint(x_96)); - return; -} - -void setOutput_i1_i1_i1_f1_(inout int d0, inout int d1, inout int d2, inout float value_1) { - int flatIndex_1 = 0; - int3 param = int3(0, 0, 0); - int param_1 = 0; - float param_2 = 0.0f; - const int x_115 = d0; - const int x_116 = d1; - const int x_117 = d2; - param = int3(x_115, x_116, x_117); - const int x_120 = getOutputFlatIndex_vi3_(param); - flatIndex_1 = x_120; - const int x_122 = flatIndex_1; - param_1 = x_122; - const float x_124 = value_1; - param_2 = x_124; - setOutput_i1_f1_(param_1, param_2); - return; -} - -void mm_write_i1_i1_f1_(inout int row_2, inout int col_2, inout float value_2) { - int3 outCoord = int3(0, 0, 0); - int param_14 = 0; - int param_15 = 0; - int param_16 = 0; - float param_17 = 0.0f; - const int x_491 = batch; - const int x_492 = row_2; - const int x_493 = col_2; - outCoord = int3(x_491, x_492, x_493); - const int x_496 = batch; - param_14 = x_496; - const int x_498 = row_2; - param_15 = x_498; - const int x_500 = col_2; - param_16 = x_500; - const float x_502 = value_2; - param_17 = x_502; - setOutput_i1_i1_i1_f1_(param_14, param_15, param_16, param_17); - return; -} - -void mm_matMul_i1_i1_i1_(inout int dimAOuter, inout int dimInner, inout int dimBOuter) { - int tileRow = 0; - int tileCol = 0; - int globalRow = 0; - int globalCol = 0; - int numTiles = 0; - int innerRow = 0; - int innerCol = 0; - float acc[1][1] = (float[1][1])0; - int tileColA = 0; - int tileRowB = 0; - int t = 0; - int innerRow_1 = 0; - int innerCol_1 = 0; - int inputRow = 0; - int inputCol = 0; - int param_3 = 0; - int param_4 = 0; - int innerRow_2 = 0; - int innerCol_2 = 0; - int inputRow_1 = 0; - int inputCol_1 = 0; - int param_5 = 0; - int param_6 = 0; - int k = 0; - int inner = 0; - float BCached[1] = (float[1])0; - int innerRow_3 = 0; - float ACached = 0.0f; - int innerCol_3 = 0; - int innerRow_4 = 0; - int innerCol_4 = 0; - int param_7 = 0; - int param_8 = 0; - float param_9 = 0.0f; - const uint x_132 = gl_LocalInvocationID.y; - tileRow = (asint(x_132) * 1); - const uint x_137 = gl_LocalInvocationID.x; - tileCol = (asint(x_137) * 1); - const uint x_143 = gl_GlobalInvocationID.y; - globalRow = (asint(x_143) * 1); - const uint x_148 = gl_GlobalInvocationID.x; - globalCol = (asint(x_148) * 1); - const int x_152 = dimInner; - numTiles = (((x_152 - 1) / 64) + 1); - innerRow = 0; - [loop] while (true) { - const int x_163 = innerRow; - if ((x_163 < 1)) { - } else { - break; - } - innerCol = 0; - [loop] while (true) { - const int x_171 = innerCol; - if ((x_171 < 1)) { - } else { - break; - } - const int x_177 = innerRow; - const int x_178 = innerCol; - acc[x_177][x_178] = 0.0f; - { - const int x_181 = innerCol; - innerCol = (x_181 + 1); - } - } - { - const int x_183 = innerRow; - innerRow = (x_183 + 1); - } - } - const uint x_187 = gl_LocalInvocationID.x; - tileColA = (asint(x_187) * 64); - const uint x_192 = gl_LocalInvocationID.y; - tileRowB = (asint(x_192) * 1); - t = 0; - [loop] while (true) { - const int x_201 = t; - const int x_202 = numTiles; - if ((x_201 < x_202)) { - } else { - break; - } - innerRow_1 = 0; - [loop] while (true) { - const int x_210 = innerRow_1; - if ((x_210 < 1)) { - } else { - break; - } - innerCol_1 = 0; - [loop] while (true) { - const int x_218 = innerCol_1; - if ((x_218 < 64)) { - } else { - break; - } - const int x_221 = tileRow; - const int x_222 = innerRow_1; - inputRow = (x_221 + x_222); - const int x_225 = tileColA; - const int x_226 = innerCol_1; - inputCol = (x_225 + x_226); - const int x_233 = inputRow; - const int x_234 = inputCol; - const int x_235 = globalRow; - const int x_236 = innerRow_1; - const int x_238 = t; - const int x_240 = inputCol; - param_3 = (x_235 + x_236); - param_4 = ((x_238 * 64) + x_240); - const float x_244 = mm_readA_i1_i1_(param_3, param_4); - mm_Asub[x_233][x_234] = x_244; - { - const int x_247 = innerCol_1; - innerCol_1 = (x_247 + 1); - } - } - { - const int x_249 = innerRow_1; - innerRow_1 = (x_249 + 1); - } - } - innerRow_2 = 0; - [loop] while (true) { - const int x_257 = innerRow_2; - if ((x_257 < 1)) { - } else { - break; - } - innerCol_2 = 0; - [loop] while (true) { - const int x_265 = innerCol_2; - if ((x_265 < 1)) { - } else { - break; - } - const int x_268 = tileRowB; - const int x_269 = innerRow_2; - inputRow_1 = (x_268 + x_269); - const int x_272 = tileCol; - const int x_273 = innerCol_2; - inputCol_1 = (x_272 + x_273); - const int x_278 = inputRow_1; - const int x_279 = inputCol_1; - const int x_280 = t; - const int x_282 = inputRow_1; - const int x_284 = globalCol; - const int x_285 = innerCol_2; - param_5 = ((x_280 * 64) + x_282); - param_6 = (x_284 + x_285); - const float x_289 = mm_readB_i1_i1_(param_5, param_6); - mm_Bsub[x_278][x_279] = x_289; - { - const int x_291 = innerCol_2; - innerCol_2 = (x_291 + 1); - } - } - { - const int x_293 = innerRow_2; - innerRow_2 = (x_293 + 1); - } - } - GroupMemoryBarrierWithGroupSync(); - k = 0; - [loop] while (true) { - const int x_302 = k; - if ((x_302 < 64)) { - } else { - break; - } - inner = 0; - [loop] while (true) { - const int x_310 = inner; - if ((x_310 < 1)) { - } else { - break; - } - const int x_314 = inner; - const int x_315 = k; - const int x_316 = tileCol; - const int x_317 = inner; - const float x_320 = mm_Bsub[x_315][(x_316 + x_317)]; - BCached[x_314] = x_320; - { - const int x_322 = inner; - inner = (x_322 + 1); - } - } - innerRow_3 = 0; - [loop] while (true) { - const int x_330 = innerRow_3; - if ((x_330 < 1)) { - } else { - break; - } - const int x_333 = tileRow; - const int x_334 = innerRow_3; - const int x_336 = k; - const float x_338 = mm_Asub[(x_333 + x_334)][x_336]; - ACached = x_338; - innerCol_3 = 0; - [loop] while (true) { - const int x_345 = innerCol_3; - if ((x_345 < 1)) { - } else { - break; - } - const int x_347 = innerRow_3; - const int x_348 = innerCol_3; - const float x_349 = ACached; - const int x_350 = innerCol_3; - const float x_352 = BCached[x_350]; - const float x_355 = acc[x_347][x_348]; - acc[x_347][x_348] = (x_355 + (x_349 * x_352)); - { - const int x_358 = innerCol_3; - innerCol_3 = (x_358 + 1); - } - } - { - const int x_360 = innerRow_3; - innerRow_3 = (x_360 + 1); - } - } - { - const int x_362 = k; - k = (x_362 + 1); - } - } - GroupMemoryBarrierWithGroupSync(); - { - const int x_364 = t; - t = (x_364 + 1); - } - } - innerRow_4 = 0; - [loop] while (true) { - const int x_372 = innerRow_4; - if ((x_372 < 1)) { - } else { - break; - } - innerCol_4 = 0; - [loop] while (true) { - bool x_393 = false; - bool x_394 = false; - const int x_380 = innerCol_4; - if ((x_380 < 1)) { - } else { - break; - } - const int x_382 = globalCol; - const int x_383 = innerCol_4; - const int x_385 = dimBOuter; - const bool x_386 = ((x_382 + x_383) < x_385); - x_394 = x_386; - if (x_386) { - const int x_389 = globalRow; - const int x_390 = innerRow_4; - const int x_392 = dimAOuter; - x_393 = ((x_389 + x_390) < x_392); - x_394 = x_393; - } - if (x_394) { - const int x_397 = globalRow; - const int x_398 = innerRow_4; - const int x_400 = globalCol; - const int x_401 = innerCol_4; - const int x_403 = innerRow_4; - const int x_404 = innerCol_4; - param_7 = (x_397 + x_398); - param_8 = (x_400 + x_401); - const float x_409 = acc[x_403][x_404]; - param_9 = x_409; - mm_write_i1_i1_f1_(param_7, param_8, param_9); - } - { - const int x_411 = innerCol_4; - innerCol_4 = (x_411 + 1); - } - } - { - const int x_413 = innerRow_4; - innerRow_4 = (x_413 + 1); - } - } - return; -} - -void main_1() { - int param_18 = 0; - int param_19 = 0; - int param_20 = 0; - const int x_67 = asint(x_48[1].y); - dimAOuter_1 = x_67; - const int x_71 = asint(x_48[1].z); - dimInner_1 = x_71; - const int x_75 = asint(x_48[2].z); - dimBOuter_1 = x_75; - const uint x_505 = gl_GlobalInvocationID.z; - batch = asint(x_505); - const int x_508 = dimAOuter_1; - param_18 = x_508; - const int x_510 = dimInner_1; - param_19 = x_510; - const int x_512 = dimBOuter_1; - param_20 = x_512; - mm_matMul_i1_i1_i1_(param_18, param_19, param_20); - return; -} - -struct tint_symbol_1 { - uint3 gl_LocalInvocationID_param : SV_GroupThreadID; - uint local_invocation_index : SV_GroupIndex; - uint3 gl_GlobalInvocationID_param : SV_DispatchThreadID; -}; - -void main_inner(uint3 gl_LocalInvocationID_param, uint3 gl_GlobalInvocationID_param, uint local_invocation_index) { - { - const uint i_1 = local_invocation_index; - const uint i_2 = (local_invocation_index % 1u); - mm_Bsub[i_1][i_2] = 0.0f; - } - { - [loop] for(uint idx = local_invocation_index; (idx < 4096u); idx = (idx + 64u)) { - const uint i = (idx / 64u); - const uint i_1 = (idx % 64u); - mm_Asub[i][i_1] = 0.0f; - } - } - GroupMemoryBarrierWithGroupSync(); - gl_LocalInvocationID = gl_LocalInvocationID_param; - gl_GlobalInvocationID = gl_GlobalInvocationID_param; - main_1(); -} - -[numthreads(1, 64, 1)] -void main(tint_symbol_1 tint_symbol) { - main_inner(tint_symbol.gl_LocalInvocationID_param, tint_symbol.gl_GlobalInvocationID_param, tint_symbol.local_invocation_index); - return; -} diff --git a/test/tint/bug/tint/943.spvasm.expected.fxc.hlsl b/test/tint/bug/tint/943.spvasm.expected.fxc.hlsl deleted file mode 100644 index 695618f8b6..0000000000 --- a/test/tint/bug/tint/943.spvasm.expected.fxc.hlsl +++ /dev/null @@ -1,491 +0,0 @@ -warning: parameter 'dimInner' of 'mm_matMul_i1_i1_i1_' must be uniform -note: 'workgroupBarrier' must only be called from uniform control flow -note: reading from module-scope private variable 'dimInner_1' may result in a non-uniform value -static int dimAOuter_1 = 0; -cbuffer cbuffer_x_48 : register(b3, space0) { - uint4 x_48[5]; -}; -static int dimInner_1 = 0; -static int dimBOuter_1 = 0; -RWByteAddressBuffer x_54 : register(u0, space0); -static uint3 gl_LocalInvocationID = uint3(0u, 0u, 0u); -static uint3 gl_GlobalInvocationID = uint3(0u, 0u, 0u); -groupshared float mm_Asub[64][64]; -groupshared float mm_Bsub[64][1]; -ByteAddressBuffer x_165 : register(t1, space0); -static int batch = 0; -ByteAddressBuffer x_185 : register(t2, space0); - -bool coordsInBounds_vi2_vi2_(inout int2 coord, inout int2 shape) { - bool x_87 = false; - bool x_88 = false; - const int2 x_76 = coord; - const bool x_81 = all((x_76 >= (0).xx)); - x_88 = x_81; - if (x_81) { - const int2 x_84 = coord; - const int2 x_85 = shape; - x_87 = all((x_84 < x_85)); - x_88 = x_87; - } - return x_88; -} - -float mm_readA_i1_i1_(inout int row, inout int col) { - int batchASize = 0; - int2 param_10 = int2(0, 0); - int2 param_11 = int2(0, 0); - float x_430 = 0.0f; - const int x_417 = asint(x_48[1].y); - const int x_419 = asint(x_48[1].z); - batchASize = (x_417 * x_419); - const int x_421 = row; - const int x_422 = col; - const int x_424 = dimAOuter_1; - const int x_425 = dimInner_1; - param_10 = int2(x_421, x_422); - param_11 = int2(x_424, x_425); - const bool x_429 = coordsInBounds_vi2_vi2_(param_10, param_11); - if (x_429) { - const int x_438 = batch; - const int x_439 = batchASize; - const int x_441 = row; - const int x_442 = dimInner_1; - const int x_445 = col; - const float x_448 = asfloat(x_165.Load((4u * uint((((x_438 * x_439) + (x_441 * x_442)) + x_445))))); - x_430 = x_448; - } else { - x_430 = 0.0f; - } - const float x_450 = x_430; - return x_450; -} - -float mm_readB_i1_i1_(inout int row_1, inout int col_1) { - int batchBSize = 0; - int2 param_12 = int2(0, 0); - int2 param_13 = int2(0, 0); - float x_468 = 0.0f; - const int x_455 = asint(x_48[2].y); - const int x_457 = asint(x_48[2].z); - batchBSize = (x_455 * x_457); - const int x_459 = row_1; - const int x_460 = col_1; - const int x_462 = dimInner_1; - const int x_463 = dimBOuter_1; - param_12 = int2(x_459, x_460); - param_13 = int2(x_462, x_463); - const bool x_467 = coordsInBounds_vi2_vi2_(param_12, param_13); - if (x_467) { - const int x_475 = batch; - const int x_476 = batchBSize; - const int x_478 = row_1; - const int x_479 = dimBOuter_1; - const int x_482 = col_1; - const float x_485 = asfloat(x_185.Load((4u * uint((((x_475 * x_476) + (x_478 * x_479)) + x_482))))); - x_468 = x_485; - } else { - x_468 = 0.0f; - } - const float x_487 = x_468; - return x_487; -} - -int getOutputFlatIndex_vi3_(inout int3 coords) { - const int3 x_99 = coords; - const int x_105 = asint(x_48[4].x); - const int x_107 = asint(x_48[4].y); - return int(dot(float3(x_99), float3(int3(x_105, x_107, 1)))); -} - -void setOutput_i1_f1_(inout int flatIndex, inout float value) { - const int x_95 = flatIndex; - const float x_96 = value; - x_54.Store((4u * uint(x_95)), asuint(x_96)); - return; -} - -void setOutput_i1_i1_i1_f1_(inout int d0, inout int d1, inout int d2, inout float value_1) { - int flatIndex_1 = 0; - int3 param = int3(0, 0, 0); - int param_1 = 0; - float param_2 = 0.0f; - const int x_115 = d0; - const int x_116 = d1; - const int x_117 = d2; - param = int3(x_115, x_116, x_117); - const int x_120 = getOutputFlatIndex_vi3_(param); - flatIndex_1 = x_120; - const int x_122 = flatIndex_1; - param_1 = x_122; - const float x_124 = value_1; - param_2 = x_124; - setOutput_i1_f1_(param_1, param_2); - return; -} - -void mm_write_i1_i1_f1_(inout int row_2, inout int col_2, inout float value_2) { - int3 outCoord = int3(0, 0, 0); - int param_14 = 0; - int param_15 = 0; - int param_16 = 0; - float param_17 = 0.0f; - const int x_491 = batch; - const int x_492 = row_2; - const int x_493 = col_2; - outCoord = int3(x_491, x_492, x_493); - const int x_496 = batch; - param_14 = x_496; - const int x_498 = row_2; - param_15 = x_498; - const int x_500 = col_2; - param_16 = x_500; - const float x_502 = value_2; - param_17 = x_502; - setOutput_i1_i1_i1_f1_(param_14, param_15, param_16, param_17); - return; -} - -void mm_matMul_i1_i1_i1_(inout int dimAOuter, inout int dimInner, inout int dimBOuter) { - int tileRow = 0; - int tileCol = 0; - int globalRow = 0; - int globalCol = 0; - int numTiles = 0; - int innerRow = 0; - int innerCol = 0; - float acc[1][1] = (float[1][1])0; - int tileColA = 0; - int tileRowB = 0; - int t = 0; - int innerRow_1 = 0; - int innerCol_1 = 0; - int inputRow = 0; - int inputCol = 0; - int param_3 = 0; - int param_4 = 0; - int innerRow_2 = 0; - int innerCol_2 = 0; - int inputRow_1 = 0; - int inputCol_1 = 0; - int param_5 = 0; - int param_6 = 0; - int k = 0; - int inner = 0; - float BCached[1] = (float[1])0; - int innerRow_3 = 0; - float ACached = 0.0f; - int innerCol_3 = 0; - int innerRow_4 = 0; - int innerCol_4 = 0; - int param_7 = 0; - int param_8 = 0; - float param_9 = 0.0f; - const uint x_132 = gl_LocalInvocationID.y; - tileRow = (asint(x_132) * 1); - const uint x_137 = gl_LocalInvocationID.x; - tileCol = (asint(x_137) * 1); - const uint x_143 = gl_GlobalInvocationID.y; - globalRow = (asint(x_143) * 1); - const uint x_148 = gl_GlobalInvocationID.x; - globalCol = (asint(x_148) * 1); - const int x_152 = dimInner; - numTiles = (((x_152 - 1) / 64) + 1); - innerRow = 0; - [loop] while (true) { - const int x_163 = innerRow; - if ((x_163 < 1)) { - } else { - break; - } - innerCol = 0; - [loop] while (true) { - const int x_171 = innerCol; - if ((x_171 < 1)) { - } else { - break; - } - const int x_177 = innerRow; - const int x_178 = innerCol; - acc[x_177][x_178] = 0.0f; - { - const int x_181 = innerCol; - innerCol = (x_181 + 1); - } - } - { - const int x_183 = innerRow; - innerRow = (x_183 + 1); - } - } - const uint x_187 = gl_LocalInvocationID.x; - tileColA = (asint(x_187) * 64); - const uint x_192 = gl_LocalInvocationID.y; - tileRowB = (asint(x_192) * 1); - t = 0; - [loop] while (true) { - const int x_201 = t; - const int x_202 = numTiles; - if ((x_201 < x_202)) { - } else { - break; - } - innerRow_1 = 0; - [loop] while (true) { - const int x_210 = innerRow_1; - if ((x_210 < 1)) { - } else { - break; - } - innerCol_1 = 0; - [loop] while (true) { - const int x_218 = innerCol_1; - if ((x_218 < 64)) { - } else { - break; - } - const int x_221 = tileRow; - const int x_222 = innerRow_1; - inputRow = (x_221 + x_222); - const int x_225 = tileColA; - const int x_226 = innerCol_1; - inputCol = (x_225 + x_226); - const int x_233 = inputRow; - const int x_234 = inputCol; - const int x_235 = globalRow; - const int x_236 = innerRow_1; - const int x_238 = t; - const int x_240 = inputCol; - param_3 = (x_235 + x_236); - param_4 = ((x_238 * 64) + x_240); - const float x_244 = mm_readA_i1_i1_(param_3, param_4); - mm_Asub[x_233][x_234] = x_244; - { - const int x_247 = innerCol_1; - innerCol_1 = (x_247 + 1); - } - } - { - const int x_249 = innerRow_1; - innerRow_1 = (x_249 + 1); - } - } - innerRow_2 = 0; - [loop] while (true) { - const int x_257 = innerRow_2; - if ((x_257 < 1)) { - } else { - break; - } - innerCol_2 = 0; - [loop] while (true) { - const int x_265 = innerCol_2; - if ((x_265 < 1)) { - } else { - break; - } - const int x_268 = tileRowB; - const int x_269 = innerRow_2; - inputRow_1 = (x_268 + x_269); - const int x_272 = tileCol; - const int x_273 = innerCol_2; - inputCol_1 = (x_272 + x_273); - const int x_278 = inputRow_1; - const int x_279 = inputCol_1; - const int x_280 = t; - const int x_282 = inputRow_1; - const int x_284 = globalCol; - const int x_285 = innerCol_2; - param_5 = ((x_280 * 64) + x_282); - param_6 = (x_284 + x_285); - const float x_289 = mm_readB_i1_i1_(param_5, param_6); - mm_Bsub[x_278][x_279] = x_289; - { - const int x_291 = innerCol_2; - innerCol_2 = (x_291 + 1); - } - } - { - const int x_293 = innerRow_2; - innerRow_2 = (x_293 + 1); - } - } - GroupMemoryBarrierWithGroupSync(); - k = 0; - [loop] while (true) { - const int x_302 = k; - if ((x_302 < 64)) { - } else { - break; - } - inner = 0; - [loop] while (true) { - const int x_310 = inner; - if ((x_310 < 1)) { - } else { - break; - } - const int x_314 = inner; - const int x_315 = k; - const int x_316 = tileCol; - const int x_317 = inner; - const float x_320 = mm_Bsub[x_315][(x_316 + x_317)]; - BCached[x_314] = x_320; - { - const int x_322 = inner; - inner = (x_322 + 1); - } - } - innerRow_3 = 0; - [loop] while (true) { - const int x_330 = innerRow_3; - if ((x_330 < 1)) { - } else { - break; - } - const int x_333 = tileRow; - const int x_334 = innerRow_3; - const int x_336 = k; - const float x_338 = mm_Asub[(x_333 + x_334)][x_336]; - ACached = x_338; - innerCol_3 = 0; - [loop] while (true) { - const int x_345 = innerCol_3; - if ((x_345 < 1)) { - } else { - break; - } - const int x_347 = innerRow_3; - const int x_348 = innerCol_3; - const float x_349 = ACached; - const int x_350 = innerCol_3; - const float x_352 = BCached[x_350]; - const float x_355 = acc[x_347][x_348]; - acc[x_347][x_348] = (x_355 + (x_349 * x_352)); - { - const int x_358 = innerCol_3; - innerCol_3 = (x_358 + 1); - } - } - { - const int x_360 = innerRow_3; - innerRow_3 = (x_360 + 1); - } - } - { - const int x_362 = k; - k = (x_362 + 1); - } - } - GroupMemoryBarrierWithGroupSync(); - { - const int x_364 = t; - t = (x_364 + 1); - } - } - innerRow_4 = 0; - [loop] while (true) { - const int x_372 = innerRow_4; - if ((x_372 < 1)) { - } else { - break; - } - innerCol_4 = 0; - [loop] while (true) { - bool x_393 = false; - bool x_394 = false; - const int x_380 = innerCol_4; - if ((x_380 < 1)) { - } else { - break; - } - const int x_382 = globalCol; - const int x_383 = innerCol_4; - const int x_385 = dimBOuter; - const bool x_386 = ((x_382 + x_383) < x_385); - x_394 = x_386; - if (x_386) { - const int x_389 = globalRow; - const int x_390 = innerRow_4; - const int x_392 = dimAOuter; - x_393 = ((x_389 + x_390) < x_392); - x_394 = x_393; - } - if (x_394) { - const int x_397 = globalRow; - const int x_398 = innerRow_4; - const int x_400 = globalCol; - const int x_401 = innerCol_4; - const int x_403 = innerRow_4; - const int x_404 = innerCol_4; - param_7 = (x_397 + x_398); - param_8 = (x_400 + x_401); - const float x_409 = acc[x_403][x_404]; - param_9 = x_409; - mm_write_i1_i1_f1_(param_7, param_8, param_9); - } - { - const int x_411 = innerCol_4; - innerCol_4 = (x_411 + 1); - } - } - { - const int x_413 = innerRow_4; - innerRow_4 = (x_413 + 1); - } - } - return; -} - -void main_1() { - int param_18 = 0; - int param_19 = 0; - int param_20 = 0; - const int x_67 = asint(x_48[1].y); - dimAOuter_1 = x_67; - const int x_71 = asint(x_48[1].z); - dimInner_1 = x_71; - const int x_75 = asint(x_48[2].z); - dimBOuter_1 = x_75; - const uint x_505 = gl_GlobalInvocationID.z; - batch = asint(x_505); - const int x_508 = dimAOuter_1; - param_18 = x_508; - const int x_510 = dimInner_1; - param_19 = x_510; - const int x_512 = dimBOuter_1; - param_20 = x_512; - mm_matMul_i1_i1_i1_(param_18, param_19, param_20); - return; -} - -struct tint_symbol_1 { - uint3 gl_LocalInvocationID_param : SV_GroupThreadID; - uint local_invocation_index : SV_GroupIndex; - uint3 gl_GlobalInvocationID_param : SV_DispatchThreadID; -}; - -void main_inner(uint3 gl_LocalInvocationID_param, uint3 gl_GlobalInvocationID_param, uint local_invocation_index) { - { - const uint i_1 = local_invocation_index; - const uint i_2 = (local_invocation_index % 1u); - mm_Bsub[i_1][i_2] = 0.0f; - } - { - [loop] for(uint idx = local_invocation_index; (idx < 4096u); idx = (idx + 64u)) { - const uint i = (idx / 64u); - const uint i_1 = (idx % 64u); - mm_Asub[i][i_1] = 0.0f; - } - } - GroupMemoryBarrierWithGroupSync(); - gl_LocalInvocationID = gl_LocalInvocationID_param; - gl_GlobalInvocationID = gl_GlobalInvocationID_param; - main_1(); -} - -[numthreads(1, 64, 1)] -void main(tint_symbol_1 tint_symbol) { - main_inner(tint_symbol.gl_LocalInvocationID_param, tint_symbol.gl_GlobalInvocationID_param, tint_symbol.local_invocation_index); - return; -} diff --git a/test/tint/bug/tint/943.spvasm.expected.glsl b/test/tint/bug/tint/943.spvasm.expected.glsl deleted file mode 100644 index db01f58450..0000000000 --- a/test/tint/bug/tint/943.spvasm.expected.glsl +++ /dev/null @@ -1,508 +0,0 @@ -warning: parameter 'dimInner' of 'mm_matMul_i1_i1_i1_' must be uniform -note: 'workgroupBarrier' must only be called from uniform control flow -note: reading from module-scope private variable 'dimInner_1' may result in a non-uniform value -#version 310 es - -int dimAOuter_1 = 0; -layout(binding = 3, std140) uniform Uniforms_ubo { - float NAN; - uint pad; - uint pad_1; - uint pad_2; - ivec3 aShape; - uint pad_3; - ivec3 bShape; - uint pad_4; - ivec3 outShape; - uint pad_5; - ivec2 outShapeStrides; - uint pad_6; - uint pad_7; -} x_48; - -int dimInner_1 = 0; -int dimBOuter_1 = 0; -layout(binding = 0, std430) buffer ssbOut_ssbo { - float result[]; -} x_54; - -uvec3 tint_symbol = uvec3(0u, 0u, 0u); -uvec3 tint_symbol_1 = uvec3(0u, 0u, 0u); -shared float mm_Asub[64][64]; -shared float mm_Bsub[64][1]; -layout(binding = 1, std430) buffer ssbA_ssbo { - float A[]; -} x_165; - -int batch = 0; -layout(binding = 2, std430) buffer ssbB_ssbo { - float B[]; -} x_185; - -bool coordsInBounds_vi2_vi2_(inout ivec2 coord, inout ivec2 shape) { - bool x_87 = false; - bool x_88 = false; - ivec2 x_76 = coord; - bool x_81 = all(greaterThanEqual(x_76, ivec2(0))); - x_88 = x_81; - if (x_81) { - ivec2 x_84 = coord; - ivec2 x_85 = shape; - x_87 = all(lessThan(x_84, x_85)); - x_88 = x_87; - } - return x_88; -} - -float mm_readA_i1_i1_(inout int row, inout int col) { - int batchASize = 0; - ivec2 param_10 = ivec2(0, 0); - ivec2 param_11 = ivec2(0, 0); - float x_430 = 0.0f; - int x_417 = x_48.aShape.y; - int x_419 = x_48.aShape.z; - batchASize = (x_417 * x_419); - int x_421 = row; - int x_422 = col; - int x_424 = dimAOuter_1; - int x_425 = dimInner_1; - param_10 = ivec2(x_421, x_422); - param_11 = ivec2(x_424, x_425); - bool x_429 = coordsInBounds_vi2_vi2_(param_10, param_11); - if (x_429) { - int x_438 = batch; - int x_439 = batchASize; - int x_441 = row; - int x_442 = dimInner_1; - int x_445 = col; - float x_448 = x_165.A[(((x_438 * x_439) + (x_441 * x_442)) + x_445)]; - x_430 = x_448; - } else { - x_430 = 0.0f; - } - float x_450 = x_430; - return x_450; -} - -float mm_readB_i1_i1_(inout int row_1, inout int col_1) { - int batchBSize = 0; - ivec2 param_12 = ivec2(0, 0); - ivec2 param_13 = ivec2(0, 0); - float x_468 = 0.0f; - int x_455 = x_48.bShape.y; - int x_457 = x_48.bShape.z; - batchBSize = (x_455 * x_457); - int x_459 = row_1; - int x_460 = col_1; - int x_462 = dimInner_1; - int x_463 = dimBOuter_1; - param_12 = ivec2(x_459, x_460); - param_13 = ivec2(x_462, x_463); - bool x_467 = coordsInBounds_vi2_vi2_(param_12, param_13); - if (x_467) { - int x_475 = batch; - int x_476 = batchBSize; - int x_478 = row_1; - int x_479 = dimBOuter_1; - int x_482 = col_1; - float x_485 = x_185.B[(((x_475 * x_476) + (x_478 * x_479)) + x_482)]; - x_468 = x_485; - } else { - x_468 = 0.0f; - } - float x_487 = x_468; - return x_487; -} - -int getOutputFlatIndex_vi3_(inout ivec3 coords) { - ivec3 x_99 = coords; - int x_105 = x_48.outShapeStrides.x; - int x_107 = x_48.outShapeStrides.y; - return int(dot(vec3(x_99), vec3(ivec3(x_105, x_107, 1)))); -} - -void setOutput_i1_f1_(inout int flatIndex, inout float value) { - int x_95 = flatIndex; - float x_96 = value; - x_54.result[x_95] = x_96; - return; -} - -void setOutput_i1_i1_i1_f1_(inout int d0, inout int d1, inout int d2, inout float value_1) { - int flatIndex_1 = 0; - ivec3 param = ivec3(0, 0, 0); - int param_1 = 0; - float param_2 = 0.0f; - int x_115 = d0; - int x_116 = d1; - int x_117 = d2; - param = ivec3(x_115, x_116, x_117); - int x_120 = getOutputFlatIndex_vi3_(param); - flatIndex_1 = x_120; - int x_122 = flatIndex_1; - param_1 = x_122; - float x_124 = value_1; - param_2 = x_124; - setOutput_i1_f1_(param_1, param_2); - return; -} - -void mm_write_i1_i1_f1_(inout int row_2, inout int col_2, inout float value_2) { - ivec3 outCoord = ivec3(0, 0, 0); - int param_14 = 0; - int param_15 = 0; - int param_16 = 0; - float param_17 = 0.0f; - int x_491 = batch; - int x_492 = row_2; - int x_493 = col_2; - outCoord = ivec3(x_491, x_492, x_493); - int x_496 = batch; - param_14 = x_496; - int x_498 = row_2; - param_15 = x_498; - int x_500 = col_2; - param_16 = x_500; - float x_502 = value_2; - param_17 = x_502; - setOutput_i1_i1_i1_f1_(param_14, param_15, param_16, param_17); - return; -} - -void mm_matMul_i1_i1_i1_(inout int dimAOuter, inout int dimInner, inout int dimBOuter) { - int tileRow = 0; - int tileCol = 0; - int globalRow = 0; - int globalCol = 0; - int numTiles = 0; - int innerRow = 0; - int innerCol = 0; - float acc[1][1] = float[1][1](float[1](0.0f)); - int tileColA = 0; - int tileRowB = 0; - int t = 0; - int innerRow_1 = 0; - int innerCol_1 = 0; - int inputRow = 0; - int inputCol = 0; - int param_3 = 0; - int param_4 = 0; - int innerRow_2 = 0; - int innerCol_2 = 0; - int inputRow_1 = 0; - int inputCol_1 = 0; - int param_5 = 0; - int param_6 = 0; - int k = 0; - int inner = 0; - float BCached[1] = float[1](0.0f); - int innerRow_3 = 0; - float ACached = 0.0f; - int innerCol_3 = 0; - int innerRow_4 = 0; - int innerCol_4 = 0; - int param_7 = 0; - int param_8 = 0; - float param_9 = 0.0f; - uint x_132 = tint_symbol.y; - tileRow = (int(x_132) * 1); - uint x_137 = tint_symbol.x; - tileCol = (int(x_137) * 1); - uint x_143 = tint_symbol_1.y; - globalRow = (int(x_143) * 1); - uint x_148 = tint_symbol_1.x; - globalCol = (int(x_148) * 1); - int x_152 = dimInner; - numTiles = (((x_152 - 1) / 64) + 1); - innerRow = 0; - while (true) { - int x_163 = innerRow; - if ((x_163 < 1)) { - } else { - break; - } - innerCol = 0; - while (true) { - int x_171 = innerCol; - if ((x_171 < 1)) { - } else { - break; - } - int x_177 = innerRow; - int x_178 = innerCol; - acc[x_177][x_178] = 0.0f; - { - int x_181 = innerCol; - innerCol = (x_181 + 1); - } - } - { - int x_183 = innerRow; - innerRow = (x_183 + 1); - } - } - uint x_187 = tint_symbol.x; - tileColA = (int(x_187) * 64); - uint x_192 = tint_symbol.y; - tileRowB = (int(x_192) * 1); - t = 0; - while (true) { - int x_201 = t; - int x_202 = numTiles; - if ((x_201 < x_202)) { - } else { - break; - } - innerRow_1 = 0; - while (true) { - int x_210 = innerRow_1; - if ((x_210 < 1)) { - } else { - break; - } - innerCol_1 = 0; - while (true) { - int x_218 = innerCol_1; - if ((x_218 < 64)) { - } else { - break; - } - int x_221 = tileRow; - int x_222 = innerRow_1; - inputRow = (x_221 + x_222); - int x_225 = tileColA; - int x_226 = innerCol_1; - inputCol = (x_225 + x_226); - int x_233 = inputRow; - int x_234 = inputCol; - int x_235 = globalRow; - int x_236 = innerRow_1; - int x_238 = t; - int x_240 = inputCol; - param_3 = (x_235 + x_236); - param_4 = ((x_238 * 64) + x_240); - float x_244 = mm_readA_i1_i1_(param_3, param_4); - mm_Asub[x_233][x_234] = x_244; - { - int x_247 = innerCol_1; - innerCol_1 = (x_247 + 1); - } - } - { - int x_249 = innerRow_1; - innerRow_1 = (x_249 + 1); - } - } - innerRow_2 = 0; - while (true) { - int x_257 = innerRow_2; - if ((x_257 < 1)) { - } else { - break; - } - innerCol_2 = 0; - while (true) { - int x_265 = innerCol_2; - if ((x_265 < 1)) { - } else { - break; - } - int x_268 = tileRowB; - int x_269 = innerRow_2; - inputRow_1 = (x_268 + x_269); - int x_272 = tileCol; - int x_273 = innerCol_2; - inputCol_1 = (x_272 + x_273); - int x_278 = inputRow_1; - int x_279 = inputCol_1; - int x_280 = t; - int x_282 = inputRow_1; - int x_284 = globalCol; - int x_285 = innerCol_2; - param_5 = ((x_280 * 64) + x_282); - param_6 = (x_284 + x_285); - float x_289 = mm_readB_i1_i1_(param_5, param_6); - mm_Bsub[x_278][x_279] = x_289; - { - int x_291 = innerCol_2; - innerCol_2 = (x_291 + 1); - } - } - { - int x_293 = innerRow_2; - innerRow_2 = (x_293 + 1); - } - } - barrier(); - k = 0; - while (true) { - int x_302 = k; - if ((x_302 < 64)) { - } else { - break; - } - inner = 0; - while (true) { - int x_310 = inner; - if ((x_310 < 1)) { - } else { - break; - } - int x_314 = inner; - int x_315 = k; - int x_316 = tileCol; - int x_317 = inner; - float x_320 = mm_Bsub[x_315][(x_316 + x_317)]; - BCached[x_314] = x_320; - { - int x_322 = inner; - inner = (x_322 + 1); - } - } - innerRow_3 = 0; - while (true) { - int x_330 = innerRow_3; - if ((x_330 < 1)) { - } else { - break; - } - int x_333 = tileRow; - int x_334 = innerRow_3; - int x_336 = k; - float x_338 = mm_Asub[(x_333 + x_334)][x_336]; - ACached = x_338; - innerCol_3 = 0; - while (true) { - int x_345 = innerCol_3; - if ((x_345 < 1)) { - } else { - break; - } - int x_347 = innerRow_3; - int x_348 = innerCol_3; - float x_349 = ACached; - int x_350 = innerCol_3; - float x_352 = BCached[x_350]; - float x_355 = acc[x_347][x_348]; - acc[x_347][x_348] = (x_355 + (x_349 * x_352)); - { - int x_358 = innerCol_3; - innerCol_3 = (x_358 + 1); - } - } - { - int x_360 = innerRow_3; - innerRow_3 = (x_360 + 1); - } - } - { - int x_362 = k; - k = (x_362 + 1); - } - } - barrier(); - { - int x_364 = t; - t = (x_364 + 1); - } - } - innerRow_4 = 0; - while (true) { - int x_372 = innerRow_4; - if ((x_372 < 1)) { - } else { - break; - } - innerCol_4 = 0; - while (true) { - bool x_393 = false; - bool x_394 = false; - int x_380 = innerCol_4; - if ((x_380 < 1)) { - } else { - break; - } - int x_382 = globalCol; - int x_383 = innerCol_4; - int x_385 = dimBOuter; - bool x_386 = ((x_382 + x_383) < x_385); - x_394 = x_386; - if (x_386) { - int x_389 = globalRow; - int x_390 = innerRow_4; - int x_392 = dimAOuter; - x_393 = ((x_389 + x_390) < x_392); - x_394 = x_393; - } - if (x_394) { - int x_397 = globalRow; - int x_398 = innerRow_4; - int x_400 = globalCol; - int x_401 = innerCol_4; - int x_403 = innerRow_4; - int x_404 = innerCol_4; - param_7 = (x_397 + x_398); - param_8 = (x_400 + x_401); - float x_409 = acc[x_403][x_404]; - param_9 = x_409; - mm_write_i1_i1_f1_(param_7, param_8, param_9); - } - { - int x_411 = innerCol_4; - innerCol_4 = (x_411 + 1); - } - } - { - int x_413 = innerRow_4; - innerRow_4 = (x_413 + 1); - } - } - return; -} - -void main_1() { - int param_18 = 0; - int param_19 = 0; - int param_20 = 0; - int x_67 = x_48.aShape.y; - dimAOuter_1 = x_67; - int x_71 = x_48.aShape.z; - dimInner_1 = x_71; - int x_75 = x_48.bShape.z; - dimBOuter_1 = x_75; - uint x_505 = tint_symbol_1.z; - batch = int(x_505); - int x_508 = dimAOuter_1; - param_18 = x_508; - int x_510 = dimInner_1; - param_19 = x_510; - int x_512 = dimBOuter_1; - param_20 = x_512; - mm_matMul_i1_i1_i1_(param_18, param_19, param_20); - return; -} - -void tint_symbol_2(uvec3 tint_symbol_3, uvec3 tint_symbol_4, uint local_invocation_index) { - { - uint i_1 = local_invocation_index; - uint i_2 = (local_invocation_index % 1u); - mm_Bsub[i_1][i_2] = 0.0f; - } - { - for(uint idx = local_invocation_index; (idx < 4096u); idx = (idx + 64u)) { - uint i = (idx / 64u); - uint i_1 = (idx % 64u); - mm_Asub[i][i_1] = 0.0f; - } - } - barrier(); - tint_symbol = tint_symbol_3; - tint_symbol_1 = tint_symbol_4; - main_1(); -} - -layout(local_size_x = 1, local_size_y = 64, local_size_z = 1) in; -void main() { - tint_symbol_2(gl_LocalInvocationID, gl_GlobalInvocationID, gl_LocalInvocationIndex); - return; -} diff --git a/test/tint/bug/tint/943.spvasm.expected.msl b/test/tint/bug/tint/943.spvasm.expected.msl deleted file mode 100644 index 6894c3f7d0..0000000000 --- a/test/tint/bug/tint/943.spvasm.expected.msl +++ /dev/null @@ -1,516 +0,0 @@ -warning: parameter 'dimInner' of 'mm_matMul_i1_i1_i1_' must be uniform -note: 'workgroupBarrier' must only be called from uniform control flow -note: reading from module-scope private variable 'dimInner_1' may result in a non-uniform value -#include - -using namespace metal; - -template -struct tint_array { - const constant T& operator[](size_t i) const constant { return elements[i]; } - device T& operator[](size_t i) device { return elements[i]; } - const device T& operator[](size_t i) const device { return elements[i]; } - thread T& operator[](size_t i) thread { return elements[i]; } - const thread T& operator[](size_t i) const thread { return elements[i]; } - threadgroup T& operator[](size_t i) threadgroup { return elements[i]; } - const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; } - T elements[N]; -}; - -struct Uniforms { - /* 0x0000 */ float tint_symbol; - /* 0x0004 */ tint_array tint_pad; - /* 0x0010 */ packed_int3 aShape; - /* 0x001c */ tint_array tint_pad_1; - /* 0x0020 */ packed_int3 bShape; - /* 0x002c */ tint_array tint_pad_2; - /* 0x0030 */ packed_int3 outShape; - /* 0x003c */ tint_array tint_pad_3; - /* 0x0040 */ int2 outShapeStrides; -}; - -struct ssbOut { - /* 0x0000 */ tint_array result; -}; - -struct ssbA { - /* 0x0000 */ tint_array A; -}; - -struct ssbB { - /* 0x0000 */ tint_array B; -}; - -bool coordsInBounds_vi2_vi2_(thread int2* const coord, thread int2* const shape) { - bool x_87 = false; - bool x_88 = false; - int2 const x_76 = *(coord); - bool const x_81 = all((x_76 >= int2(0))); - x_88 = x_81; - if (x_81) { - int2 const x_84 = *(coord); - int2 const x_85 = *(shape); - x_87 = all((x_84 < x_85)); - x_88 = x_87; - } - return x_88; -} - -float mm_readA_i1_i1_(thread int* const row, thread int* const col, const constant Uniforms* const tint_symbol_2, thread int* const tint_symbol_3, thread int* const tint_symbol_4, thread int* const tint_symbol_5, const device ssbA* const tint_symbol_6) { - int batchASize = 0; - int2 param_10 = 0; - int2 param_11 = 0; - float x_430 = 0.0f; - int const x_417 = (*(tint_symbol_2)).aShape[1]; - int const x_419 = (*(tint_symbol_2)).aShape[2]; - batchASize = as_type((as_type(x_417) * as_type(x_419))); - int const x_421 = *(row); - int const x_422 = *(col); - int const x_424 = *(tint_symbol_3); - int const x_425 = *(tint_symbol_4); - param_10 = int2(x_421, x_422); - param_11 = int2(x_424, x_425); - bool const x_429 = coordsInBounds_vi2_vi2_(&(param_10), &(param_11)); - if (x_429) { - int const x_438 = *(tint_symbol_5); - int const x_439 = batchASize; - int const x_441 = *(row); - int const x_442 = *(tint_symbol_4); - int const x_445 = *(col); - float const x_448 = (*(tint_symbol_6)).A[as_type((as_type(as_type((as_type(as_type((as_type(x_438) * as_type(x_439)))) + as_type(as_type((as_type(x_441) * as_type(x_442))))))) + as_type(x_445)))]; - x_430 = x_448; - } else { - x_430 = 0.0f; - } - float const x_450 = x_430; - return x_450; -} - -float mm_readB_i1_i1_(thread int* const row_1, thread int* const col_1, const constant Uniforms* const tint_symbol_7, thread int* const tint_symbol_8, thread int* const tint_symbol_9, thread int* const tint_symbol_10, const device ssbB* const tint_symbol_11) { - int batchBSize = 0; - int2 param_12 = 0; - int2 param_13 = 0; - float x_468 = 0.0f; - int const x_455 = (*(tint_symbol_7)).bShape[1]; - int const x_457 = (*(tint_symbol_7)).bShape[2]; - batchBSize = as_type((as_type(x_455) * as_type(x_457))); - int const x_459 = *(row_1); - int const x_460 = *(col_1); - int const x_462 = *(tint_symbol_8); - int const x_463 = *(tint_symbol_9); - param_12 = int2(x_459, x_460); - param_13 = int2(x_462, x_463); - bool const x_467 = coordsInBounds_vi2_vi2_(&(param_12), &(param_13)); - if (x_467) { - int const x_475 = *(tint_symbol_10); - int const x_476 = batchBSize; - int const x_478 = *(row_1); - int const x_479 = *(tint_symbol_9); - int const x_482 = *(col_1); - float const x_485 = (*(tint_symbol_11)).B[as_type((as_type(as_type((as_type(as_type((as_type(x_475) * as_type(x_476)))) + as_type(as_type((as_type(x_478) * as_type(x_479))))))) + as_type(x_482)))]; - x_468 = x_485; - } else { - x_468 = 0.0f; - } - float const x_487 = x_468; - return x_487; -} - -int getOutputFlatIndex_vi3_(thread int3* const coords, const constant Uniforms* const tint_symbol_12) { - int3 const x_99 = *(coords); - int const x_105 = (*(tint_symbol_12)).outShapeStrides[0]; - int const x_107 = (*(tint_symbol_12)).outShapeStrides[1]; - return int(dot(float3(x_99), float3(int3(x_105, x_107, 1)))); -} - -void setOutput_i1_f1_(thread int* const flatIndex, thread float* const value, device ssbOut* const tint_symbol_13) { - int const x_95 = *(flatIndex); - float const x_96 = *(value); - (*(tint_symbol_13)).result[x_95] = x_96; - return; -} - -void setOutput_i1_i1_i1_f1_(thread int* const d0, thread int* const d1, thread int* const d2, thread float* const value_1, const constant Uniforms* const tint_symbol_14, device ssbOut* const tint_symbol_15) { - int flatIndex_1 = 0; - int3 param = 0; - int param_1 = 0; - float param_2 = 0.0f; - int const x_115 = *(d0); - int const x_116 = *(d1); - int const x_117 = *(d2); - param = int3(x_115, x_116, x_117); - int const x_120 = getOutputFlatIndex_vi3_(&(param), tint_symbol_14); - flatIndex_1 = x_120; - int const x_122 = flatIndex_1; - param_1 = x_122; - float const x_124 = *(value_1); - param_2 = x_124; - setOutput_i1_f1_(&(param_1), &(param_2), tint_symbol_15); - return; -} - -void mm_write_i1_i1_f1_(thread int* const row_2, thread int* const col_2, thread float* const value_2, thread int* const tint_symbol_16, const constant Uniforms* const tint_symbol_17, device ssbOut* const tint_symbol_18) { - int3 outCoord = 0; - int param_14 = 0; - int param_15 = 0; - int param_16 = 0; - float param_17 = 0.0f; - int const x_491 = *(tint_symbol_16); - int const x_492 = *(row_2); - int const x_493 = *(col_2); - outCoord = int3(x_491, x_492, x_493); - int const x_496 = *(tint_symbol_16); - param_14 = x_496; - int const x_498 = *(row_2); - param_15 = x_498; - int const x_500 = *(col_2); - param_16 = x_500; - float const x_502 = *(value_2); - param_17 = x_502; - setOutput_i1_i1_i1_f1_(&(param_14), &(param_15), &(param_16), &(param_17), tint_symbol_17, tint_symbol_18); - return; -} - -void mm_matMul_i1_i1_i1_(thread int* const dimAOuter, thread int* const dimInner, thread int* const dimBOuter, thread uint3* const tint_symbol_19, thread uint3* const tint_symbol_20, const constant Uniforms* const tint_symbol_21, thread int* const tint_symbol_22, thread int* const tint_symbol_23, thread int* const tint_symbol_24, const device ssbA* const tint_symbol_25, threadgroup tint_array, 64>* const tint_symbol_26, thread int* const tint_symbol_27, const device ssbB* const tint_symbol_28, threadgroup tint_array, 64>* const tint_symbol_29, device ssbOut* const tint_symbol_30) { - int tileRow = 0; - int tileCol = 0; - int globalRow = 0; - int globalCol = 0; - int numTiles = 0; - int innerRow = 0; - int innerCol = 0; - tint_array, 1> acc = {}; - int tileColA = 0; - int tileRowB = 0; - int t = 0; - int innerRow_1 = 0; - int innerCol_1 = 0; - int inputRow = 0; - int inputCol = 0; - int param_3 = 0; - int param_4 = 0; - int innerRow_2 = 0; - int innerCol_2 = 0; - int inputRow_1 = 0; - int inputCol_1 = 0; - int param_5 = 0; - int param_6 = 0; - int k = 0; - int inner = 0; - tint_array BCached = {}; - int innerRow_3 = 0; - float ACached = 0.0f; - int innerCol_3 = 0; - int innerRow_4 = 0; - int innerCol_4 = 0; - int param_7 = 0; - int param_8 = 0; - float param_9 = 0.0f; - uint const x_132 = (*(tint_symbol_19))[1]; - tileRow = as_type((as_type(as_type(x_132)) * as_type(1))); - uint const x_137 = (*(tint_symbol_19))[0]; - tileCol = as_type((as_type(as_type(x_137)) * as_type(1))); - uint const x_143 = (*(tint_symbol_20))[1]; - globalRow = as_type((as_type(as_type(x_143)) * as_type(1))); - uint const x_148 = (*(tint_symbol_20))[0]; - globalCol = as_type((as_type(as_type(x_148)) * as_type(1))); - int const x_152 = *(dimInner); - numTiles = as_type((as_type((as_type((as_type(x_152) - as_type(1))) / 64)) + as_type(1))); - innerRow = 0; - while (true) { - int const x_163 = innerRow; - if ((x_163 < 1)) { - } else { - break; - } - innerCol = 0; - while (true) { - int const x_171 = innerCol; - if ((x_171 < 1)) { - } else { - break; - } - int const x_177 = innerRow; - int const x_178 = innerCol; - acc[x_177][x_178] = 0.0f; - { - int const x_181 = innerCol; - innerCol = as_type((as_type(x_181) + as_type(1))); - } - } - { - int const x_183 = innerRow; - innerRow = as_type((as_type(x_183) + as_type(1))); - } - } - uint const x_187 = (*(tint_symbol_19))[0]; - tileColA = as_type((as_type(as_type(x_187)) * as_type(64))); - uint const x_192 = (*(tint_symbol_19))[1]; - tileRowB = as_type((as_type(as_type(x_192)) * as_type(1))); - t = 0; - while (true) { - int const x_201 = t; - int const x_202 = numTiles; - if ((x_201 < x_202)) { - } else { - break; - } - innerRow_1 = 0; - while (true) { - int const x_210 = innerRow_1; - if ((x_210 < 1)) { - } else { - break; - } - innerCol_1 = 0; - while (true) { - int const x_218 = innerCol_1; - if ((x_218 < 64)) { - } else { - break; - } - int const x_221 = tileRow; - int const x_222 = innerRow_1; - inputRow = as_type((as_type(x_221) + as_type(x_222))); - int const x_225 = tileColA; - int const x_226 = innerCol_1; - inputCol = as_type((as_type(x_225) + as_type(x_226))); - int const x_233 = inputRow; - int const x_234 = inputCol; - int const x_235 = globalRow; - int const x_236 = innerRow_1; - int const x_238 = t; - int const x_240 = inputCol; - param_3 = as_type((as_type(x_235) + as_type(x_236))); - param_4 = as_type((as_type(as_type((as_type(x_238) * as_type(64)))) + as_type(x_240))); - float const x_244 = mm_readA_i1_i1_(&(param_3), &(param_4), tint_symbol_21, tint_symbol_22, tint_symbol_23, tint_symbol_24, tint_symbol_25); - (*(tint_symbol_26))[x_233][x_234] = x_244; - { - int const x_247 = innerCol_1; - innerCol_1 = as_type((as_type(x_247) + as_type(1))); - } - } - { - int const x_249 = innerRow_1; - innerRow_1 = as_type((as_type(x_249) + as_type(1))); - } - } - innerRow_2 = 0; - while (true) { - int const x_257 = innerRow_2; - if ((x_257 < 1)) { - } else { - break; - } - innerCol_2 = 0; - while (true) { - int const x_265 = innerCol_2; - if ((x_265 < 1)) { - } else { - break; - } - int const x_268 = tileRowB; - int const x_269 = innerRow_2; - inputRow_1 = as_type((as_type(x_268) + as_type(x_269))); - int const x_272 = tileCol; - int const x_273 = innerCol_2; - inputCol_1 = as_type((as_type(x_272) + as_type(x_273))); - int const x_278 = inputRow_1; - int const x_279 = inputCol_1; - int const x_280 = t; - int const x_282 = inputRow_1; - int const x_284 = globalCol; - int const x_285 = innerCol_2; - param_5 = as_type((as_type(as_type((as_type(x_280) * as_type(64)))) + as_type(x_282))); - param_6 = as_type((as_type(x_284) + as_type(x_285))); - float const x_289 = mm_readB_i1_i1_(&(param_5), &(param_6), tint_symbol_21, tint_symbol_23, tint_symbol_27, tint_symbol_24, tint_symbol_28); - (*(tint_symbol_29))[x_278][x_279] = x_289; - { - int const x_291 = innerCol_2; - innerCol_2 = as_type((as_type(x_291) + as_type(1))); - } - } - { - int const x_293 = innerRow_2; - innerRow_2 = as_type((as_type(x_293) + as_type(1))); - } - } - threadgroup_barrier(mem_flags::mem_threadgroup); - k = 0; - while (true) { - int const x_302 = k; - if ((x_302 < 64)) { - } else { - break; - } - inner = 0; - while (true) { - int const x_310 = inner; - if ((x_310 < 1)) { - } else { - break; - } - int const x_314 = inner; - int const x_315 = k; - int const x_316 = tileCol; - int const x_317 = inner; - float const x_320 = (*(tint_symbol_29))[x_315][as_type((as_type(x_316) + as_type(x_317)))]; - BCached[x_314] = x_320; - { - int const x_322 = inner; - inner = as_type((as_type(x_322) + as_type(1))); - } - } - innerRow_3 = 0; - while (true) { - int const x_330 = innerRow_3; - if ((x_330 < 1)) { - } else { - break; - } - int const x_333 = tileRow; - int const x_334 = innerRow_3; - int const x_336 = k; - float const x_338 = (*(tint_symbol_26))[as_type((as_type(x_333) + as_type(x_334)))][x_336]; - ACached = x_338; - innerCol_3 = 0; - while (true) { - int const x_345 = innerCol_3; - if ((x_345 < 1)) { - } else { - break; - } - int const x_347 = innerRow_3; - int const x_348 = innerCol_3; - float const x_349 = ACached; - int const x_350 = innerCol_3; - float const x_352 = BCached[x_350]; - float const x_355 = acc[x_347][x_348]; - acc[x_347][x_348] = (x_355 + (x_349 * x_352)); - { - int const x_358 = innerCol_3; - innerCol_3 = as_type((as_type(x_358) + as_type(1))); - } - } - { - int const x_360 = innerRow_3; - innerRow_3 = as_type((as_type(x_360) + as_type(1))); - } - } - { - int const x_362 = k; - k = as_type((as_type(x_362) + as_type(1))); - } - } - threadgroup_barrier(mem_flags::mem_threadgroup); - { - int const x_364 = t; - t = as_type((as_type(x_364) + as_type(1))); - } - } - innerRow_4 = 0; - while (true) { - int const x_372 = innerRow_4; - if ((x_372 < 1)) { - } else { - break; - } - innerCol_4 = 0; - while (true) { - bool x_393 = false; - bool x_394 = false; - int const x_380 = innerCol_4; - if ((x_380 < 1)) { - } else { - break; - } - int const x_382 = globalCol; - int const x_383 = innerCol_4; - int const x_385 = *(dimBOuter); - bool const x_386 = (as_type((as_type(x_382) + as_type(x_383))) < x_385); - x_394 = x_386; - if (x_386) { - int const x_389 = globalRow; - int const x_390 = innerRow_4; - int const x_392 = *(dimAOuter); - x_393 = (as_type((as_type(x_389) + as_type(x_390))) < x_392); - x_394 = x_393; - } - if (x_394) { - int const x_397 = globalRow; - int const x_398 = innerRow_4; - int const x_400 = globalCol; - int const x_401 = innerCol_4; - int const x_403 = innerRow_4; - int const x_404 = innerCol_4; - param_7 = as_type((as_type(x_397) + as_type(x_398))); - param_8 = as_type((as_type(x_400) + as_type(x_401))); - float const x_409 = acc[x_403][x_404]; - param_9 = x_409; - mm_write_i1_i1_f1_(&(param_7), &(param_8), &(param_9), tint_symbol_24, tint_symbol_21, tint_symbol_30); - } - { - int const x_411 = innerCol_4; - innerCol_4 = as_type((as_type(x_411) + as_type(1))); - } - } - { - int const x_413 = innerRow_4; - innerRow_4 = as_type((as_type(x_413) + as_type(1))); - } - } - return; -} - -void main_1(const constant Uniforms* const tint_symbol_31, thread int* const tint_symbol_32, thread int* const tint_symbol_33, thread int* const tint_symbol_34, thread uint3* const tint_symbol_35, thread int* const tint_symbol_36, thread uint3* const tint_symbol_37, const device ssbA* const tint_symbol_38, threadgroup tint_array, 64>* const tint_symbol_39, const device ssbB* const tint_symbol_40, threadgroup tint_array, 64>* const tint_symbol_41, device ssbOut* const tint_symbol_42) { - int param_18 = 0; - int param_19 = 0; - int param_20 = 0; - int const x_67 = (*(tint_symbol_31)).aShape[1]; - *(tint_symbol_32) = x_67; - int const x_71 = (*(tint_symbol_31)).aShape[2]; - *(tint_symbol_33) = x_71; - int const x_75 = (*(tint_symbol_31)).bShape[2]; - *(tint_symbol_34) = x_75; - uint const x_505 = (*(tint_symbol_35))[2]; - *(tint_symbol_36) = as_type(x_505); - int const x_508 = *(tint_symbol_32); - param_18 = x_508; - int const x_510 = *(tint_symbol_33); - param_19 = x_510; - int const x_512 = *(tint_symbol_34); - param_20 = x_512; - mm_matMul_i1_i1_i1_(&(param_18), &(param_19), &(param_20), tint_symbol_37, tint_symbol_35, tint_symbol_31, tint_symbol_32, tint_symbol_33, tint_symbol_36, tint_symbol_38, tint_symbol_39, tint_symbol_34, tint_symbol_40, tint_symbol_41, tint_symbol_42); - return; -} - -void tint_symbol_1_inner(uint3 gl_LocalInvocationID_param, uint3 gl_GlobalInvocationID_param, uint local_invocation_index, threadgroup tint_array, 64>* const tint_symbol_43, threadgroup tint_array, 64>* const tint_symbol_44, thread uint3* const tint_symbol_45, thread uint3* const tint_symbol_46, const constant Uniforms* const tint_symbol_47, thread int* const tint_symbol_48, thread int* const tint_symbol_49, thread int* const tint_symbol_50, thread int* const tint_symbol_51, const device ssbA* const tint_symbol_52, const device ssbB* const tint_symbol_53, device ssbOut* const tint_symbol_54) { - { - uint const i_1 = local_invocation_index; - uint const i_2 = (local_invocation_index % 1u); - (*(tint_symbol_43))[i_1][i_2] = 0.0f; - } - for(uint idx = local_invocation_index; (idx < 4096u); idx = (idx + 64u)) { - uint const i = (idx / 64u); - uint const i_1 = (idx % 64u); - (*(tint_symbol_44))[i][i_1] = 0.0f; - } - threadgroup_barrier(mem_flags::mem_threadgroup); - *(tint_symbol_45) = gl_LocalInvocationID_param; - *(tint_symbol_46) = gl_GlobalInvocationID_param; - main_1(tint_symbol_47, tint_symbol_48, tint_symbol_49, tint_symbol_50, tint_symbol_46, tint_symbol_51, tint_symbol_45, tint_symbol_52, tint_symbol_44, tint_symbol_53, tint_symbol_43, tint_symbol_54); -} - -kernel void tint_symbol_1(const constant Uniforms* tint_symbol_59 [[buffer(0)]], const device ssbA* tint_symbol_64 [[buffer(2)]], const device ssbB* tint_symbol_65 [[buffer(3)]], device ssbOut* tint_symbol_66 [[buffer(1)]], uint3 gl_LocalInvocationID_param [[thread_position_in_threadgroup]], uint3 gl_GlobalInvocationID_param [[thread_position_in_grid]], uint local_invocation_index [[thread_index_in_threadgroup]]) { - threadgroup tint_array, 64> tint_symbol_55; - threadgroup tint_array, 64> tint_symbol_56; - thread uint3 tint_symbol_57 = 0u; - thread uint3 tint_symbol_58 = 0u; - thread int tint_symbol_60 = 0; - thread int tint_symbol_61 = 0; - thread int tint_symbol_62 = 0; - thread int tint_symbol_63 = 0; - tint_symbol_1_inner(gl_LocalInvocationID_param, gl_GlobalInvocationID_param, local_invocation_index, &(tint_symbol_55), &(tint_symbol_56), &(tint_symbol_57), &(tint_symbol_58), tint_symbol_59, &(tint_symbol_60), &(tint_symbol_61), &(tint_symbol_62), &(tint_symbol_63), tint_symbol_64, tint_symbol_65, tint_symbol_66); - return; -} - diff --git a/test/tint/bug/tint/943.spvasm.expected.spvasm b/test/tint/bug/tint/943.spvasm.expected.spvasm deleted file mode 100644 index 5022f2dfb5..0000000000 --- a/test/tint/bug/tint/943.spvasm.expected.spvasm +++ /dev/null @@ -1,998 +0,0 @@ -warning: parameter 'dimInner' of 'mm_matMul_i1_i1_i1_' must be uniform -note: 'workgroupBarrier' must only be called from uniform control flow -note: reading from module-scope private variable 'dimInner_1' may result in a non-uniform value -; SPIR-V -; Version: 1.3 -; Generator: Google Tint Compiler; 0 -; Bound: 630 -; Schema: 0 - OpCapability Shader - OpMemoryModel Logical GLSL450 - OpEntryPoint GLCompute %main "main" %gl_LocalInvocationID_param_1 %gl_GlobalInvocationID_param_1 %local_invocation_index_1 - OpExecutionMode %main LocalSize 1 64 1 - OpName %gl_LocalInvocationID_param_1 "gl_LocalInvocationID_param_1" - OpName %gl_GlobalInvocationID_param_1 "gl_GlobalInvocationID_param_1" - OpName %local_invocation_index_1 "local_invocation_index_1" - OpName %dimAOuter_1 "dimAOuter_1" - OpName %Uniforms "Uniforms" - OpMemberName %Uniforms 0 "NAN" - OpMemberName %Uniforms 1 "aShape" - OpMemberName %Uniforms 2 "bShape" - OpMemberName %Uniforms 3 "outShape" - OpMemberName %Uniforms 4 "outShapeStrides" - OpName %x_48 "x_48" - OpName %dimInner_1 "dimInner_1" - OpName %dimBOuter_1 "dimBOuter_1" - OpName %ssbOut "ssbOut" - OpMemberName %ssbOut 0 "result" - OpName %x_54 "x_54" - OpName %gl_LocalInvocationID "gl_LocalInvocationID" - OpName %gl_GlobalInvocationID "gl_GlobalInvocationID" - OpName %mm_Asub "mm_Asub" - OpName %mm_Bsub "mm_Bsub" - OpName %ssbA "ssbA" - OpMemberName %ssbA 0 "A" - OpName %x_165 "x_165" - OpName %batch "batch" - OpName %ssbB "ssbB" - OpMemberName %ssbB 0 "B" - OpName %x_185 "x_185" - OpName %coordsInBounds_vi2_vi2_ "coordsInBounds_vi2_vi2_" - OpName %coord "coord" - OpName %shape "shape" - OpName %x_87 "x_87" - OpName %x_88 "x_88" - OpName %mm_readA_i1_i1_ "mm_readA_i1_i1_" - OpName %row "row" - OpName %col "col" - OpName %batchASize "batchASize" - OpName %param_10 "param_10" - OpName %param_11 "param_11" - OpName %x_430 "x_430" - OpName %mm_readB_i1_i1_ "mm_readB_i1_i1_" - OpName %row_1 "row_1" - OpName %col_1 "col_1" - OpName %batchBSize "batchBSize" - OpName %param_12 "param_12" - OpName %param_13 "param_13" - OpName %x_468 "x_468" - OpName %getOutputFlatIndex_vi3_ "getOutputFlatIndex_vi3_" - OpName %coords "coords" - OpName %setOutput_i1_f1_ "setOutput_i1_f1_" - OpName %flatIndex "flatIndex" - OpName %value "value" - OpName %setOutput_i1_i1_i1_f1_ "setOutput_i1_i1_i1_f1_" - OpName %d0 "d0" - OpName %d1 "d1" - OpName %d2 "d2" - OpName %value_1 "value_1" - OpName %flatIndex_1 "flatIndex_1" - OpName %param "param" - OpName %param_1 "param_1" - OpName %param_2 "param_2" - OpName %mm_write_i1_i1_f1_ "mm_write_i1_i1_f1_" - OpName %row_2 "row_2" - OpName %col_2 "col_2" - OpName %value_2 "value_2" - OpName %outCoord "outCoord" - OpName %param_14 "param_14" - OpName %param_15 "param_15" - OpName %param_16 "param_16" - OpName %param_17 "param_17" - OpName %mm_matMul_i1_i1_i1_ "mm_matMul_i1_i1_i1_" - OpName %dimAOuter "dimAOuter" - OpName %dimInner "dimInner" - OpName %dimBOuter "dimBOuter" - OpName %tileRow "tileRow" - OpName %tileCol "tileCol" - OpName %globalRow "globalRow" - OpName %globalCol "globalCol" - OpName %numTiles "numTiles" - OpName %innerRow "innerRow" - OpName %innerCol "innerCol" - OpName %acc "acc" - OpName %tileColA "tileColA" - OpName %tileRowB "tileRowB" - OpName %t "t" - OpName %innerRow_1 "innerRow_1" - OpName %innerCol_1 "innerCol_1" - OpName %inputRow "inputRow" - OpName %inputCol "inputCol" - OpName %param_3 "param_3" - OpName %param_4 "param_4" - OpName %innerRow_2 "innerRow_2" - OpName %innerCol_2 "innerCol_2" - OpName %inputRow_1 "inputRow_1" - OpName %inputCol_1 "inputCol_1" - OpName %param_5 "param_5" - OpName %param_6 "param_6" - OpName %k "k" - OpName %inner "inner" - OpName %BCached "BCached" - OpName %innerRow_3 "innerRow_3" - OpName %ACached "ACached" - OpName %innerCol_3 "innerCol_3" - OpName %innerRow_4 "innerRow_4" - OpName %innerCol_4 "innerCol_4" - OpName %param_7 "param_7" - OpName %param_8 "param_8" - OpName %param_9 "param_9" - OpName %x_393 "x_393" - OpName %x_394 "x_394" - OpName %main_1 "main_1" - OpName %param_18 "param_18" - OpName %param_19 "param_19" - OpName %param_20 "param_20" - OpName %main_inner "main_inner" - OpName %gl_LocalInvocationID_param "gl_LocalInvocationID_param" - OpName %gl_GlobalInvocationID_param "gl_GlobalInvocationID_param" - OpName %local_invocation_index "local_invocation_index" - OpName %idx "idx" - OpName %main "main" - OpDecorate %gl_LocalInvocationID_param_1 BuiltIn LocalInvocationId - OpDecorate %gl_GlobalInvocationID_param_1 BuiltIn GlobalInvocationId - OpDecorate %local_invocation_index_1 BuiltIn LocalInvocationIndex - OpDecorate %Uniforms Block - OpMemberDecorate %Uniforms 0 Offset 0 - OpMemberDecorate %Uniforms 1 Offset 16 - OpMemberDecorate %Uniforms 2 Offset 32 - OpMemberDecorate %Uniforms 3 Offset 48 - OpMemberDecorate %Uniforms 4 Offset 64 - OpDecorate %x_48 NonWritable - OpDecorate %x_48 DescriptorSet 0 - OpDecorate %x_48 Binding 3 - OpDecorate %ssbOut Block - OpMemberDecorate %ssbOut 0 Offset 0 - OpDecorate %_runtimearr_float ArrayStride 4 - OpDecorate %x_54 DescriptorSet 0 - OpDecorate %x_54 Binding 0 - OpDecorate %_arr_float_uint_64 ArrayStride 4 - OpDecorate %_arr__arr_float_uint_64_uint_64 ArrayStride 256 - OpDecorate %_arr_float_uint_1 ArrayStride 4 - OpDecorate %_arr__arr_float_uint_1_uint_64 ArrayStride 4 - OpDecorate %ssbA Block - OpMemberDecorate %ssbA 0 Offset 0 - OpDecorate %x_165 NonWritable - OpDecorate %x_165 DescriptorSet 0 - OpDecorate %x_165 Binding 1 - OpDecorate %ssbB Block - OpMemberDecorate %ssbB 0 Offset 0 - OpDecorate %x_185 NonWritable - OpDecorate %x_185 DescriptorSet 0 - OpDecorate %x_185 Binding 2 - OpDecorate %_arr__arr_float_uint_1_uint_1 ArrayStride 4 - %uint = OpTypeInt 32 0 - %v3uint = OpTypeVector %uint 3 -%_ptr_Input_v3uint = OpTypePointer Input %v3uint -%gl_LocalInvocationID_param_1 = OpVariable %_ptr_Input_v3uint Input -%gl_GlobalInvocationID_param_1 = OpVariable %_ptr_Input_v3uint Input -%_ptr_Input_uint = OpTypePointer Input %uint -%local_invocation_index_1 = OpVariable %_ptr_Input_uint Input - %int = OpTypeInt 32 1 -%_ptr_Private_int = OpTypePointer Private %int - %11 = OpConstantNull %int -%dimAOuter_1 = OpVariable %_ptr_Private_int Private %11 - %float = OpTypeFloat 32 - %v3int = OpTypeVector %int 3 - %v2int = OpTypeVector %int 2 - %Uniforms = OpTypeStruct %float %v3int %v3int %v3int %v2int -%_ptr_Uniform_Uniforms = OpTypePointer Uniform %Uniforms - %x_48 = OpVariable %_ptr_Uniform_Uniforms Uniform - %dimInner_1 = OpVariable %_ptr_Private_int Private %11 -%dimBOuter_1 = OpVariable %_ptr_Private_int Private %11 -%_runtimearr_float = OpTypeRuntimeArray %float - %ssbOut = OpTypeStruct %_runtimearr_float -%_ptr_StorageBuffer_ssbOut = OpTypePointer StorageBuffer %ssbOut - %x_54 = OpVariable %_ptr_StorageBuffer_ssbOut StorageBuffer -%_ptr_Private_v3uint = OpTypePointer Private %v3uint - %26 = OpConstantNull %v3uint -%gl_LocalInvocationID = OpVariable %_ptr_Private_v3uint Private %26 -%gl_GlobalInvocationID = OpVariable %_ptr_Private_v3uint Private %26 - %uint_64 = OpConstant %uint 64 -%_arr_float_uint_64 = OpTypeArray %float %uint_64 -%_arr__arr_float_uint_64_uint_64 = OpTypeArray %_arr_float_uint_64 %uint_64 -%_ptr_Workgroup__arr__arr_float_uint_64_uint_64 = OpTypePointer Workgroup %_arr__arr_float_uint_64_uint_64 - %mm_Asub = OpVariable %_ptr_Workgroup__arr__arr_float_uint_64_uint_64 Workgroup - %uint_1 = OpConstant %uint 1 -%_arr_float_uint_1 = OpTypeArray %float %uint_1 -%_arr__arr_float_uint_1_uint_64 = OpTypeArray %_arr_float_uint_1 %uint_64 -%_ptr_Workgroup__arr__arr_float_uint_1_uint_64 = OpTypePointer Workgroup %_arr__arr_float_uint_1_uint_64 - %mm_Bsub = OpVariable %_ptr_Workgroup__arr__arr_float_uint_1_uint_64 Workgroup - %ssbA = OpTypeStruct %_runtimearr_float -%_ptr_StorageBuffer_ssbA = OpTypePointer StorageBuffer %ssbA - %x_165 = OpVariable %_ptr_StorageBuffer_ssbA StorageBuffer - %batch = OpVariable %_ptr_Private_int Private %11 - %ssbB = OpTypeStruct %_runtimearr_float -%_ptr_StorageBuffer_ssbB = OpTypePointer StorageBuffer %ssbB - %x_185 = OpVariable %_ptr_StorageBuffer_ssbB StorageBuffer - %bool = OpTypeBool -%_ptr_Function_v2int = OpTypePointer Function %v2int - %45 = OpTypeFunction %bool %_ptr_Function_v2int %_ptr_Function_v2int -%_ptr_Function_bool = OpTypePointer Function %bool - %54 = OpConstantNull %bool - %59 = OpConstantNull %v2int - %v2bool = OpTypeVector %bool 2 -%_ptr_Function_int = OpTypePointer Function %int - %72 = OpTypeFunction %float %_ptr_Function_int %_ptr_Function_int -%_ptr_Function_float = OpTypePointer Function %float - %83 = OpConstantNull %float -%_ptr_Uniform_int = OpTypePointer Uniform %int - %uint_2 = OpConstant %uint 2 - %uint_0 = OpConstant %uint 0 -%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float -%_ptr_Function_v3int = OpTypePointer Function %v3int - %162 = OpTypeFunction %int %_ptr_Function_v3int - %uint_4 = OpConstant %uint 4 - %v3float = OpTypeVector %float 3 - %int_1 = OpConstant %int 1 - %void = OpTypeVoid - %181 = OpTypeFunction %void %_ptr_Function_int %_ptr_Function_float - %192 = OpTypeFunction %void %_ptr_Function_int %_ptr_Function_int %_ptr_Function_int %_ptr_Function_float - %201 = OpConstantNull %v3int - %219 = OpTypeFunction %void %_ptr_Function_int %_ptr_Function_int %_ptr_Function_float - %248 = OpTypeFunction %void %_ptr_Function_int %_ptr_Function_int %_ptr_Function_int -%_arr__arr_float_uint_1_uint_1 = OpTypeArray %_arr_float_uint_1 %uint_1 -%_ptr_Function__arr__arr_float_uint_1_uint_1 = OpTypePointer Function %_arr__arr_float_uint_1_uint_1 - %264 = OpConstantNull %_arr__arr_float_uint_1_uint_1 -%_ptr_Function__arr_float_uint_1 = OpTypePointer Function %_arr_float_uint_1 - %284 = OpConstantNull %_arr_float_uint_1 -%_ptr_Private_uint = OpTypePointer Private %uint - %int_64 = OpConstant %int 64 -%_ptr_Workgroup_float = OpTypePointer Workgroup %float - %uint_264 = OpConstant %uint 264 - %572 = OpTypeFunction %void - %594 = OpTypeFunction %void %v3uint %v3uint %uint -%_ptr_Function_uint = OpTypePointer Function %uint - %604 = OpConstantNull %uint - %uint_4096 = OpConstant %uint 4096 -%coordsInBounds_vi2_vi2_ = OpFunction %bool None %45 - %coord = OpFunctionParameter %_ptr_Function_v2int - %shape = OpFunctionParameter %_ptr_Function_v2int - %51 = OpLabel - %x_87 = OpVariable %_ptr_Function_bool Function %54 - %x_88 = OpVariable %_ptr_Function_bool Function %54 - %57 = OpLoad %v2int %coord - %60 = OpSGreaterThanEqual %v2bool %57 %59 - %58 = OpAll %bool %60 - OpStore %x_88 %58 - OpSelectionMerge %62 None - OpBranchConditional %58 %63 %62 - %63 = OpLabel - %65 = OpLoad %v2int %coord - %67 = OpLoad %v2int %shape - %69 = OpSLessThan %v2bool %65 %67 - %68 = OpAll %bool %69 - OpStore %x_87 %68 - %70 = OpLoad %bool %x_87 - OpStore %x_88 %70 - OpBranch %62 - %62 = OpLabel - %71 = OpLoad %bool %x_88 - OpReturnValue %71 - OpFunctionEnd -%mm_readA_i1_i1_ = OpFunction %float None %72 - %row = OpFunctionParameter %_ptr_Function_int - %col = OpFunctionParameter %_ptr_Function_int - %77 = OpLabel - %batchASize = OpVariable %_ptr_Function_int Function %11 - %param_10 = OpVariable %_ptr_Function_v2int Function %59 - %param_11 = OpVariable %_ptr_Function_v2int Function %59 - %x_430 = OpVariable %_ptr_Function_float Function %83 - %85 = OpAccessChain %_ptr_Uniform_int %x_48 %uint_1 %uint_1 - %86 = OpLoad %int %85 - %88 = OpAccessChain %_ptr_Uniform_int %x_48 %uint_1 %uint_2 - %89 = OpLoad %int %88 - %90 = OpIMul %int %86 %89 - OpStore %batchASize %90 - %92 = OpLoad %int %row - %94 = OpLoad %int %col - %95 = OpLoad %int %dimAOuter_1 - %96 = OpLoad %int %dimInner_1 - %97 = OpCompositeConstruct %v2int %92 %94 - OpStore %param_10 %97 - %98 = OpCompositeConstruct %v2int %95 %96 - OpStore %param_11 %98 - %99 = OpFunctionCall %bool %coordsInBounds_vi2_vi2_ %param_10 %param_11 - OpSelectionMerge %102 None - OpBranchConditional %99 %103 %104 - %103 = OpLabel - %105 = OpLoad %int %batch - %106 = OpLoad %int %batchASize - %108 = OpLoad %int %row - %109 = OpLoad %int %dimInner_1 - %111 = OpLoad %int %col - %113 = OpIMul %int %105 %106 - %114 = OpIMul %int %108 %109 - %115 = OpIAdd %int %113 %114 - %116 = OpIAdd %int %115 %111 - %118 = OpAccessChain %_ptr_StorageBuffer_float %x_165 %uint_0 %116 - %119 = OpLoad %float %118 - OpStore %x_430 %119 - OpBranch %102 - %104 = OpLabel - OpStore %x_430 %83 - OpBranch %102 - %102 = OpLabel - %120 = OpLoad %float %x_430 - OpReturnValue %120 - OpFunctionEnd -%mm_readB_i1_i1_ = OpFunction %float None %72 - %row_1 = OpFunctionParameter %_ptr_Function_int - %col_1 = OpFunctionParameter %_ptr_Function_int - %124 = OpLabel - %batchBSize = OpVariable %_ptr_Function_int Function %11 - %param_12 = OpVariable %_ptr_Function_v2int Function %59 - %param_13 = OpVariable %_ptr_Function_v2int Function %59 - %x_468 = OpVariable %_ptr_Function_float Function %83 - %129 = OpAccessChain %_ptr_Uniform_int %x_48 %uint_2 %uint_1 - %130 = OpLoad %int %129 - %131 = OpAccessChain %_ptr_Uniform_int %x_48 %uint_2 %uint_2 - %132 = OpLoad %int %131 - %133 = OpIMul %int %130 %132 - OpStore %batchBSize %133 - %135 = OpLoad %int %row_1 - %137 = OpLoad %int %col_1 - %138 = OpLoad %int %dimInner_1 - %139 = OpLoad %int %dimBOuter_1 - %140 = OpCompositeConstruct %v2int %135 %137 - OpStore %param_12 %140 - %141 = OpCompositeConstruct %v2int %138 %139 - OpStore %param_13 %141 - %142 = OpFunctionCall %bool %coordsInBounds_vi2_vi2_ %param_12 %param_13 - OpSelectionMerge %145 None - OpBranchConditional %142 %146 %147 - %146 = OpLabel - %148 = OpLoad %int %batch - %149 = OpLoad %int %batchBSize - %151 = OpLoad %int %row_1 - %152 = OpLoad %int %dimBOuter_1 - %154 = OpLoad %int %col_1 - %155 = OpIMul %int %148 %149 - %156 = OpIMul %int %151 %152 - %157 = OpIAdd %int %155 %156 - %158 = OpIAdd %int %157 %154 - %159 = OpAccessChain %_ptr_StorageBuffer_float %x_185 %uint_0 %158 - %160 = OpLoad %float %159 - OpStore %x_468 %160 - OpBranch %145 - %147 = OpLabel - OpStore %x_468 %83 - OpBranch %145 - %145 = OpLabel - %161 = OpLoad %float %x_468 - OpReturnValue %161 - OpFunctionEnd -%getOutputFlatIndex_vi3_ = OpFunction %int None %162 - %coords = OpFunctionParameter %_ptr_Function_v3int - %166 = OpLabel - %168 = OpLoad %v3int %coords - %170 = OpAccessChain %_ptr_Uniform_int %x_48 %uint_4 %uint_0 - %171 = OpLoad %int %170 - %172 = OpAccessChain %_ptr_Uniform_int %x_48 %uint_4 %uint_1 - %173 = OpLoad %int %172 - %176 = OpConvertSToF %v3float %168 - %180 = OpCompositeConstruct %v3int %171 %173 %int_1 - %178 = OpConvertSToF %v3float %180 - %175 = OpDot %float %176 %178 - %174 = OpConvertFToS %int %175 - OpReturnValue %174 - OpFunctionEnd -%setOutput_i1_f1_ = OpFunction %void None %181 - %flatIndex = OpFunctionParameter %_ptr_Function_int - %value = OpFunctionParameter %_ptr_Function_float - %186 = OpLabel - %188 = OpLoad %int %flatIndex - %190 = OpLoad %float %value - %191 = OpAccessChain %_ptr_StorageBuffer_float %x_54 %uint_0 %188 - OpStore %191 %190 - OpReturn - OpFunctionEnd -%setOutput_i1_i1_i1_f1_ = OpFunction %void None %192 - %d0 = OpFunctionParameter %_ptr_Function_int - %d1 = OpFunctionParameter %_ptr_Function_int - %d2 = OpFunctionParameter %_ptr_Function_int - %value_1 = OpFunctionParameter %_ptr_Function_float - %198 = OpLabel -%flatIndex_1 = OpVariable %_ptr_Function_int Function %11 - %param = OpVariable %_ptr_Function_v3int Function %201 - %param_1 = OpVariable %_ptr_Function_int Function %11 - %param_2 = OpVariable %_ptr_Function_float Function %83 - %205 = OpLoad %int %d0 - %207 = OpLoad %int %d1 - %209 = OpLoad %int %d2 - %210 = OpCompositeConstruct %v3int %205 %207 %209 - OpStore %param %210 - %211 = OpFunctionCall %int %getOutputFlatIndex_vi3_ %param - OpStore %flatIndex_1 %211 - %213 = OpLoad %int %flatIndex_1 - OpStore %param_1 %213 - %215 = OpLoad %float %value_1 - OpStore %param_2 %215 - %216 = OpFunctionCall %void %setOutput_i1_f1_ %param_1 %param_2 - OpReturn - OpFunctionEnd -%mm_write_i1_i1_f1_ = OpFunction %void None %219 - %row_2 = OpFunctionParameter %_ptr_Function_int - %col_2 = OpFunctionParameter %_ptr_Function_int - %value_2 = OpFunctionParameter %_ptr_Function_float - %224 = OpLabel - %outCoord = OpVariable %_ptr_Function_v3int Function %201 - %param_14 = OpVariable %_ptr_Function_int Function %11 - %param_15 = OpVariable %_ptr_Function_int Function %11 - %param_16 = OpVariable %_ptr_Function_int Function %11 - %param_17 = OpVariable %_ptr_Function_float Function %83 - %230 = OpLoad %int %batch - %232 = OpLoad %int %row_2 - %234 = OpLoad %int %col_2 - %235 = OpCompositeConstruct %v3int %230 %232 %234 - OpStore %outCoord %235 - %236 = OpLoad %int %batch - OpStore %param_14 %236 - %238 = OpLoad %int %row_2 - OpStore %param_15 %238 - %240 = OpLoad %int %col_2 - OpStore %param_16 %240 - %242 = OpLoad %float %value_2 - OpStore %param_17 %242 - %243 = OpFunctionCall %void %setOutput_i1_i1_i1_f1_ %param_14 %param_15 %param_16 %param_17 - OpReturn - OpFunctionEnd -%mm_matMul_i1_i1_i1_ = OpFunction %void None %248 - %dimAOuter = OpFunctionParameter %_ptr_Function_int - %dimInner = OpFunctionParameter %_ptr_Function_int - %dimBOuter = OpFunctionParameter %_ptr_Function_int - %253 = OpLabel - %tileRow = OpVariable %_ptr_Function_int Function %11 - %tileCol = OpVariable %_ptr_Function_int Function %11 - %globalRow = OpVariable %_ptr_Function_int Function %11 - %globalCol = OpVariable %_ptr_Function_int Function %11 - %numTiles = OpVariable %_ptr_Function_int Function %11 - %innerRow = OpVariable %_ptr_Function_int Function %11 - %innerCol = OpVariable %_ptr_Function_int Function %11 - %acc = OpVariable %_ptr_Function__arr__arr_float_uint_1_uint_1 Function %264 - %tileColA = OpVariable %_ptr_Function_int Function %11 - %tileRowB = OpVariable %_ptr_Function_int Function %11 - %t = OpVariable %_ptr_Function_int Function %11 - %innerRow_1 = OpVariable %_ptr_Function_int Function %11 - %innerCol_1 = OpVariable %_ptr_Function_int Function %11 - %inputRow = OpVariable %_ptr_Function_int Function %11 - %inputCol = OpVariable %_ptr_Function_int Function %11 - %param_3 = OpVariable %_ptr_Function_int Function %11 - %param_4 = OpVariable %_ptr_Function_int Function %11 - %innerRow_2 = OpVariable %_ptr_Function_int Function %11 - %innerCol_2 = OpVariable %_ptr_Function_int Function %11 - %inputRow_1 = OpVariable %_ptr_Function_int Function %11 - %inputCol_1 = OpVariable %_ptr_Function_int Function %11 - %param_5 = OpVariable %_ptr_Function_int Function %11 - %param_6 = OpVariable %_ptr_Function_int Function %11 - %k = OpVariable %_ptr_Function_int Function %11 - %inner = OpVariable %_ptr_Function_int Function %11 - %BCached = OpVariable %_ptr_Function__arr_float_uint_1 Function %284 - %innerRow_3 = OpVariable %_ptr_Function_int Function %11 - %ACached = OpVariable %_ptr_Function_float Function %83 - %innerCol_3 = OpVariable %_ptr_Function_int Function %11 - %innerRow_4 = OpVariable %_ptr_Function_int Function %11 - %innerCol_4 = OpVariable %_ptr_Function_int Function %11 - %param_7 = OpVariable %_ptr_Function_int Function %11 - %param_8 = OpVariable %_ptr_Function_int Function %11 - %param_9 = OpVariable %_ptr_Function_float Function %83 - %x_393 = OpVariable %_ptr_Function_bool Function %54 - %x_394 = OpVariable %_ptr_Function_bool Function %54 - %294 = OpAccessChain %_ptr_Private_uint %gl_LocalInvocationID %uint_1 - %295 = OpLoad %uint %294 - %296 = OpBitcast %int %295 - %297 = OpIMul %int %296 %int_1 - OpStore %tileRow %297 - %298 = OpAccessChain %_ptr_Private_uint %gl_LocalInvocationID %uint_0 - %299 = OpLoad %uint %298 - %300 = OpBitcast %int %299 - %301 = OpIMul %int %300 %int_1 - OpStore %tileCol %301 - %302 = OpAccessChain %_ptr_Private_uint %gl_GlobalInvocationID %uint_1 - %303 = OpLoad %uint %302 - %304 = OpBitcast %int %303 - %305 = OpIMul %int %304 %int_1 - OpStore %globalRow %305 - %306 = OpAccessChain %_ptr_Private_uint %gl_GlobalInvocationID %uint_0 - %307 = OpLoad %uint %306 - %308 = OpBitcast %int %307 - %309 = OpIMul %int %308 %int_1 - OpStore %globalCol %309 - %311 = OpLoad %int %dimInner - %312 = OpISub %int %311 %int_1 - %314 = OpSDiv %int %312 %int_64 - %315 = OpIAdd %int %314 %int_1 - OpStore %numTiles %315 - OpStore %innerRow %11 - OpBranch %316 - %316 = OpLabel - OpLoopMerge %317 %318 None - OpBranch %319 - %319 = OpLabel - %320 = OpLoad %int %innerRow - %321 = OpSLessThan %bool %320 %int_1 - OpSelectionMerge %322 None - OpBranchConditional %321 %323 %324 - %323 = OpLabel - OpBranch %322 - %324 = OpLabel - OpBranch %317 - %322 = OpLabel - OpStore %innerCol %11 - OpBranch %325 - %325 = OpLabel - OpLoopMerge %326 %327 None - OpBranch %328 - %328 = OpLabel - %329 = OpLoad %int %innerCol - %330 = OpSLessThan %bool %329 %int_1 - OpSelectionMerge %331 None - OpBranchConditional %330 %332 %333 - %332 = OpLabel - OpBranch %331 - %333 = OpLabel - OpBranch %326 - %331 = OpLabel - %334 = OpLoad %int %innerRow - %335 = OpLoad %int %innerCol - %336 = OpAccessChain %_ptr_Function_float %acc %334 %335 - OpStore %336 %83 - OpBranch %327 - %327 = OpLabel - %337 = OpLoad %int %innerCol - %338 = OpIAdd %int %337 %int_1 - OpStore %innerCol %338 - OpBranch %325 - %326 = OpLabel - OpBranch %318 - %318 = OpLabel - %339 = OpLoad %int %innerRow - %340 = OpIAdd %int %339 %int_1 - OpStore %innerRow %340 - OpBranch %316 - %317 = OpLabel - %341 = OpAccessChain %_ptr_Private_uint %gl_LocalInvocationID %uint_0 - %342 = OpLoad %uint %341 - %343 = OpBitcast %int %342 - %344 = OpIMul %int %343 %int_64 - OpStore %tileColA %344 - %345 = OpAccessChain %_ptr_Private_uint %gl_LocalInvocationID %uint_1 - %346 = OpLoad %uint %345 - %347 = OpBitcast %int %346 - %348 = OpIMul %int %347 %int_1 - OpStore %tileRowB %348 - OpStore %t %11 - OpBranch %349 - %349 = OpLabel - OpLoopMerge %350 %351 None - OpBranch %352 - %352 = OpLabel - %353 = OpLoad %int %t - %354 = OpLoad %int %numTiles - %355 = OpSLessThan %bool %353 %354 - OpSelectionMerge %356 None - OpBranchConditional %355 %357 %358 - %357 = OpLabel - OpBranch %356 - %358 = OpLabel - OpBranch %350 - %356 = OpLabel - OpStore %innerRow_1 %11 - OpBranch %359 - %359 = OpLabel - OpLoopMerge %360 %361 None - OpBranch %362 - %362 = OpLabel - %363 = OpLoad %int %innerRow_1 - %364 = OpSLessThan %bool %363 %int_1 - OpSelectionMerge %365 None - OpBranchConditional %364 %366 %367 - %366 = OpLabel - OpBranch %365 - %367 = OpLabel - OpBranch %360 - %365 = OpLabel - OpStore %innerCol_1 %11 - OpBranch %368 - %368 = OpLabel - OpLoopMerge %369 %370 None - OpBranch %371 - %371 = OpLabel - %372 = OpLoad %int %innerCol_1 - %373 = OpSLessThan %bool %372 %int_64 - OpSelectionMerge %374 None - OpBranchConditional %373 %375 %376 - %375 = OpLabel - OpBranch %374 - %376 = OpLabel - OpBranch %369 - %374 = OpLabel - %377 = OpLoad %int %tileRow - %378 = OpLoad %int %innerRow_1 - %379 = OpIAdd %int %377 %378 - OpStore %inputRow %379 - %380 = OpLoad %int %tileColA - %381 = OpLoad %int %innerCol_1 - %382 = OpIAdd %int %380 %381 - OpStore %inputCol %382 - %383 = OpLoad %int %inputRow - %384 = OpLoad %int %inputCol - %385 = OpLoad %int %globalRow - %386 = OpLoad %int %innerRow_1 - %387 = OpLoad %int %t - %388 = OpLoad %int %inputCol - %389 = OpIAdd %int %385 %386 - OpStore %param_3 %389 - %390 = OpIMul %int %387 %int_64 - %391 = OpIAdd %int %390 %388 - OpStore %param_4 %391 - %392 = OpFunctionCall %float %mm_readA_i1_i1_ %param_3 %param_4 - %396 = OpAccessChain %_ptr_Workgroup_float %mm_Asub %383 %384 - OpStore %396 %392 - OpBranch %370 - %370 = OpLabel - %397 = OpLoad %int %innerCol_1 - %398 = OpIAdd %int %397 %int_1 - OpStore %innerCol_1 %398 - OpBranch %368 - %369 = OpLabel - OpBranch %361 - %361 = OpLabel - %399 = OpLoad %int %innerRow_1 - %400 = OpIAdd %int %399 %int_1 - OpStore %innerRow_1 %400 - OpBranch %359 - %360 = OpLabel - OpStore %innerRow_2 %11 - OpBranch %401 - %401 = OpLabel - OpLoopMerge %402 %403 None - OpBranch %404 - %404 = OpLabel - %405 = OpLoad %int %innerRow_2 - %406 = OpSLessThan %bool %405 %int_1 - OpSelectionMerge %407 None - OpBranchConditional %406 %408 %409 - %408 = OpLabel - OpBranch %407 - %409 = OpLabel - OpBranch %402 - %407 = OpLabel - OpStore %innerCol_2 %11 - OpBranch %410 - %410 = OpLabel - OpLoopMerge %411 %412 None - OpBranch %413 - %413 = OpLabel - %414 = OpLoad %int %innerCol_2 - %415 = OpSLessThan %bool %414 %int_1 - OpSelectionMerge %416 None - OpBranchConditional %415 %417 %418 - %417 = OpLabel - OpBranch %416 - %418 = OpLabel - OpBranch %411 - %416 = OpLabel - %419 = OpLoad %int %tileRowB - %420 = OpLoad %int %innerRow_2 - %421 = OpIAdd %int %419 %420 - OpStore %inputRow_1 %421 - %422 = OpLoad %int %tileCol - %423 = OpLoad %int %innerCol_2 - %424 = OpIAdd %int %422 %423 - OpStore %inputCol_1 %424 - %425 = OpLoad %int %inputRow_1 - %426 = OpLoad %int %inputCol_1 - %427 = OpLoad %int %t - %428 = OpLoad %int %inputRow_1 - %429 = OpLoad %int %globalCol - %430 = OpLoad %int %innerCol_2 - %431 = OpIMul %int %427 %int_64 - %432 = OpIAdd %int %431 %428 - OpStore %param_5 %432 - %433 = OpIAdd %int %429 %430 - OpStore %param_6 %433 - %434 = OpFunctionCall %float %mm_readB_i1_i1_ %param_5 %param_6 - %437 = OpAccessChain %_ptr_Workgroup_float %mm_Bsub %425 %426 - OpStore %437 %434 - OpBranch %412 - %412 = OpLabel - %438 = OpLoad %int %innerCol_2 - %439 = OpIAdd %int %438 %int_1 - OpStore %innerCol_2 %439 - OpBranch %410 - %411 = OpLabel - OpBranch %403 - %403 = OpLabel - %440 = OpLoad %int %innerRow_2 - %441 = OpIAdd %int %440 %int_1 - OpStore %innerRow_2 %441 - OpBranch %401 - %402 = OpLabel - OpControlBarrier %uint_2 %uint_2 %uint_264 - OpStore %k %11 - OpBranch %444 - %444 = OpLabel - OpLoopMerge %445 %446 None - OpBranch %447 - %447 = OpLabel - %448 = OpLoad %int %k - %449 = OpSLessThan %bool %448 %int_64 - OpSelectionMerge %450 None - OpBranchConditional %449 %451 %452 - %451 = OpLabel - OpBranch %450 - %452 = OpLabel - OpBranch %445 - %450 = OpLabel - OpStore %inner %11 - OpBranch %453 - %453 = OpLabel - OpLoopMerge %454 %455 None - OpBranch %456 - %456 = OpLabel - %457 = OpLoad %int %inner - %458 = OpSLessThan %bool %457 %int_1 - OpSelectionMerge %459 None - OpBranchConditional %458 %460 %461 - %460 = OpLabel - OpBranch %459 - %461 = OpLabel - OpBranch %454 - %459 = OpLabel - %462 = OpLoad %int %inner - %463 = OpLoad %int %k - %464 = OpLoad %int %tileCol - %465 = OpLoad %int %inner - %466 = OpIAdd %int %464 %465 - %467 = OpAccessChain %_ptr_Workgroup_float %mm_Bsub %463 %466 - %468 = OpLoad %float %467 - %469 = OpAccessChain %_ptr_Function_float %BCached %462 - OpStore %469 %468 - OpBranch %455 - %455 = OpLabel - %470 = OpLoad %int %inner - %471 = OpIAdd %int %470 %int_1 - OpStore %inner %471 - OpBranch %453 - %454 = OpLabel - OpStore %innerRow_3 %11 - OpBranch %472 - %472 = OpLabel - OpLoopMerge %473 %474 None - OpBranch %475 - %475 = OpLabel - %476 = OpLoad %int %innerRow_3 - %477 = OpSLessThan %bool %476 %int_1 - OpSelectionMerge %478 None - OpBranchConditional %477 %479 %480 - %479 = OpLabel - OpBranch %478 - %480 = OpLabel - OpBranch %473 - %478 = OpLabel - %481 = OpLoad %int %tileRow - %482 = OpLoad %int %innerRow_3 - %483 = OpLoad %int %k - %484 = OpIAdd %int %481 %482 - %485 = OpAccessChain %_ptr_Workgroup_float %mm_Asub %484 %483 - %486 = OpLoad %float %485 - OpStore %ACached %486 - OpStore %innerCol_3 %11 - OpBranch %487 - %487 = OpLabel - OpLoopMerge %488 %489 None - OpBranch %490 - %490 = OpLabel - %491 = OpLoad %int %innerCol_3 - %492 = OpSLessThan %bool %491 %int_1 - OpSelectionMerge %493 None - OpBranchConditional %492 %494 %495 - %494 = OpLabel - OpBranch %493 - %495 = OpLabel - OpBranch %488 - %493 = OpLabel - %496 = OpLoad %int %innerRow_3 - %497 = OpLoad %int %innerCol_3 - %498 = OpLoad %float %ACached - %499 = OpLoad %int %innerCol_3 - %500 = OpAccessChain %_ptr_Function_float %BCached %499 - %501 = OpLoad %float %500 - %502 = OpAccessChain %_ptr_Function_float %acc %496 %497 - %503 = OpLoad %float %502 - %504 = OpAccessChain %_ptr_Function_float %acc %496 %497 - %505 = OpFMul %float %498 %501 - %506 = OpFAdd %float %503 %505 - OpStore %504 %506 - OpBranch %489 - %489 = OpLabel - %507 = OpLoad %int %innerCol_3 - %508 = OpIAdd %int %507 %int_1 - OpStore %innerCol_3 %508 - OpBranch %487 - %488 = OpLabel - OpBranch %474 - %474 = OpLabel - %509 = OpLoad %int %innerRow_3 - %510 = OpIAdd %int %509 %int_1 - OpStore %innerRow_3 %510 - OpBranch %472 - %473 = OpLabel - OpBranch %446 - %446 = OpLabel - %511 = OpLoad %int %k - %512 = OpIAdd %int %511 %int_1 - OpStore %k %512 - OpBranch %444 - %445 = OpLabel - OpControlBarrier %uint_2 %uint_2 %uint_264 - OpBranch %351 - %351 = OpLabel - %514 = OpLoad %int %t - %515 = OpIAdd %int %514 %int_1 - OpStore %t %515 - OpBranch %349 - %350 = OpLabel - OpStore %innerRow_4 %11 - OpBranch %516 - %516 = OpLabel - OpLoopMerge %517 %518 None - OpBranch %519 - %519 = OpLabel - %520 = OpLoad %int %innerRow_4 - %521 = OpSLessThan %bool %520 %int_1 - OpSelectionMerge %522 None - OpBranchConditional %521 %523 %524 - %523 = OpLabel - OpBranch %522 - %524 = OpLabel - OpBranch %517 - %522 = OpLabel - OpStore %innerCol_4 %11 - OpBranch %525 - %525 = OpLabel - OpLoopMerge %526 %527 None - OpBranch %528 - %528 = OpLabel - %531 = OpLoad %int %innerCol_4 - %532 = OpSLessThan %bool %531 %int_1 - OpSelectionMerge %533 None - OpBranchConditional %532 %534 %535 - %534 = OpLabel - OpBranch %533 - %535 = OpLabel - OpBranch %526 - %533 = OpLabel - %536 = OpLoad %int %globalCol - %537 = OpLoad %int %innerCol_4 - %539 = OpLoad %int %dimBOuter - %540 = OpIAdd %int %536 %537 - %541 = OpSLessThan %bool %540 %539 - OpStore %x_394 %541 - OpSelectionMerge %542 None - OpBranchConditional %541 %543 %542 - %543 = OpLabel - %544 = OpLoad %int %globalRow - %545 = OpLoad %int %innerRow_4 - %547 = OpLoad %int %dimAOuter - %548 = OpIAdd %int %544 %545 - %549 = OpSLessThan %bool %548 %547 - OpStore %x_393 %549 - %550 = OpLoad %bool %x_393 - OpStore %x_394 %550 - OpBranch %542 - %542 = OpLabel - %551 = OpLoad %bool %x_394 - OpSelectionMerge %552 None - OpBranchConditional %551 %553 %552 - %553 = OpLabel - %554 = OpLoad %int %globalRow - %555 = OpLoad %int %innerRow_4 - %556 = OpLoad %int %globalCol - %557 = OpLoad %int %innerCol_4 - %558 = OpLoad %int %innerRow_4 - %559 = OpLoad %int %innerCol_4 - %560 = OpIAdd %int %554 %555 - OpStore %param_7 %560 - %561 = OpIAdd %int %556 %557 - OpStore %param_8 %561 - %562 = OpAccessChain %_ptr_Function_float %acc %558 %559 - %563 = OpLoad %float %562 - OpStore %param_9 %563 - %564 = OpFunctionCall %void %mm_write_i1_i1_f1_ %param_7 %param_8 %param_9 - OpBranch %552 - %552 = OpLabel - OpBranch %527 - %527 = OpLabel - %568 = OpLoad %int %innerCol_4 - %569 = OpIAdd %int %568 %int_1 - OpStore %innerCol_4 %569 - OpBranch %525 - %526 = OpLabel - OpBranch %518 - %518 = OpLabel - %570 = OpLoad %int %innerRow_4 - %571 = OpIAdd %int %570 %int_1 - OpStore %innerRow_4 %571 - OpBranch %516 - %517 = OpLabel - OpReturn - OpFunctionEnd - %main_1 = OpFunction %void None %572 - %574 = OpLabel - %param_18 = OpVariable %_ptr_Function_int Function %11 - %param_19 = OpVariable %_ptr_Function_int Function %11 - %param_20 = OpVariable %_ptr_Function_int Function %11 - %578 = OpAccessChain %_ptr_Uniform_int %x_48 %uint_1 %uint_1 - %579 = OpLoad %int %578 - OpStore %dimAOuter_1 %579 - %580 = OpAccessChain %_ptr_Uniform_int %x_48 %uint_1 %uint_2 - %581 = OpLoad %int %580 - OpStore %dimInner_1 %581 - %582 = OpAccessChain %_ptr_Uniform_int %x_48 %uint_2 %uint_2 - %583 = OpLoad %int %582 - OpStore %dimBOuter_1 %583 - %584 = OpAccessChain %_ptr_Private_uint %gl_GlobalInvocationID %uint_2 - %585 = OpLoad %uint %584 - %586 = OpBitcast %int %585 - OpStore %batch %586 - %587 = OpLoad %int %dimAOuter_1 - OpStore %param_18 %587 - %588 = OpLoad %int %dimInner_1 - OpStore %param_19 %588 - %589 = OpLoad %int %dimBOuter_1 - OpStore %param_20 %589 - %590 = OpFunctionCall %void %mm_matMul_i1_i1_i1_ %param_18 %param_19 %param_20 - OpReturn - OpFunctionEnd - %main_inner = OpFunction %void None %594 -%gl_LocalInvocationID_param = OpFunctionParameter %v3uint -%gl_GlobalInvocationID_param = OpFunctionParameter %v3uint -%local_invocation_index = OpFunctionParameter %uint - %599 = OpLabel - %idx = OpVariable %_ptr_Function_uint Function %604 - %600 = OpUMod %uint %local_invocation_index %uint_1 - %601 = OpAccessChain %_ptr_Workgroup_float %mm_Bsub %local_invocation_index %600 - OpStore %601 %83 - OpStore %idx %local_invocation_index - OpBranch %605 - %605 = OpLabel - OpLoopMerge %606 %607 None - OpBranch %608 - %608 = OpLabel - %610 = OpLoad %uint %idx - %612 = OpULessThan %bool %610 %uint_4096 - %609 = OpLogicalNot %bool %612 - OpSelectionMerge %613 None - OpBranchConditional %609 %614 %613 - %614 = OpLabel - OpBranch %606 - %613 = OpLabel - %615 = OpLoad %uint %idx - %616 = OpUDiv %uint %615 %uint_64 - %617 = OpLoad %uint %idx - %618 = OpUMod %uint %617 %uint_64 - %619 = OpAccessChain %_ptr_Workgroup_float %mm_Asub %616 %618 - OpStore %619 %83 - OpBranch %607 - %607 = OpLabel - %620 = OpLoad %uint %idx - %621 = OpIAdd %uint %620 %uint_64 - OpStore %idx %621 - OpBranch %605 - %606 = OpLabel - OpControlBarrier %uint_2 %uint_2 %uint_264 - OpStore %gl_LocalInvocationID %gl_LocalInvocationID_param - OpStore %gl_GlobalInvocationID %gl_GlobalInvocationID_param - %623 = OpFunctionCall %void %main_1 - OpReturn - OpFunctionEnd - %main = OpFunction %void None %572 - %625 = OpLabel - %627 = OpLoad %v3uint %gl_LocalInvocationID_param_1 - %628 = OpLoad %v3uint %gl_GlobalInvocationID_param_1 - %629 = OpLoad %uint %local_invocation_index_1 - %626 = OpFunctionCall %void %main_inner %627 %628 %629 - OpReturn - OpFunctionEnd diff --git a/test/tint/bug/tint/943.spvasm.expected.wgsl b/test/tint/bug/tint/943.spvasm.expected.wgsl deleted file mode 100644 index fbb2eba486..0000000000 --- a/test/tint/bug/tint/943.spvasm.expected.wgsl +++ /dev/null @@ -1,523 +0,0 @@ -warning: parameter 'dimInner' of 'mm_matMul_i1_i1_i1_' must be uniform -note: 'workgroupBarrier' must only be called from uniform control flow -note: reading from module-scope private variable 'dimInner_1' may result in a non-uniform value -struct Uniforms { - NAN : f32, - @size(12) - padding : u32, - aShape : vec3, - @size(4) - padding_1 : u32, - bShape : vec3, - @size(4) - padding_2 : u32, - outShape : vec3, - @size(4) - padding_3 : u32, - outShapeStrides : vec2, -} - -type RTArr = array; - -type RTArr_1 = array; - -struct ssbOut { - result : RTArr_1, -} - -type RTArr_2 = array; - -struct ssbA { - A : RTArr_1, -} - -struct ssbB { - B : RTArr_1, -} - -var dimAOuter_1 : i32; - -@group(0) @binding(3) var x_48 : Uniforms; - -var dimInner_1 : i32; - -var dimBOuter_1 : i32; - -@group(0) @binding(0) var x_54 : ssbOut; - -var gl_LocalInvocationID : vec3; - -var gl_GlobalInvocationID : vec3; - -var mm_Asub : array, 64u>; - -var mm_Bsub : array, 64u>; - -@group(0) @binding(1) var x_165 : ssbA; - -var batch : i32; - -@group(0) @binding(2) var x_185 : ssbB; - -fn coordsInBounds_vi2_vi2_(coord : ptr>, shape : ptr>) -> bool { - var x_87 : bool; - var x_88 : bool; - let x_76 : vec2 = *(coord); - let x_81 : bool = all((x_76 >= vec2(0i, 0i))); - x_88 = x_81; - if (x_81) { - let x_84 : vec2 = *(coord); - let x_85 : vec2 = *(shape); - x_87 = all((x_84 < x_85)); - x_88 = x_87; - } - return x_88; -} - -fn mm_readA_i1_i1_(row : ptr, col : ptr) -> f32 { - var batchASize : i32; - var param_10 : vec2; - var param_11 : vec2; - var x_430 : f32; - let x_417 : i32 = x_48.aShape.y; - let x_419 : i32 = x_48.aShape.z; - batchASize = (x_417 * x_419); - let x_421 : i32 = *(row); - let x_422 : i32 = *(col); - let x_424 : i32 = dimAOuter_1; - let x_425 : i32 = dimInner_1; - param_10 = vec2(x_421, x_422); - param_11 = vec2(x_424, x_425); - let x_429 : bool = coordsInBounds_vi2_vi2_(&(param_10), &(param_11)); - if (x_429) { - let x_438 : i32 = batch; - let x_439 : i32 = batchASize; - let x_441 : i32 = *(row); - let x_442 : i32 = dimInner_1; - let x_445 : i32 = *(col); - let x_448 : f32 = x_165.A[(((x_438 * x_439) + (x_441 * x_442)) + x_445)]; - x_430 = x_448; - } else { - x_430 = 0.0f; - } - let x_450 : f32 = x_430; - return x_450; -} - -fn mm_readB_i1_i1_(row_1 : ptr, col_1 : ptr) -> f32 { - var batchBSize : i32; - var param_12 : vec2; - var param_13 : vec2; - var x_468 : f32; - let x_455 : i32 = x_48.bShape.y; - let x_457 : i32 = x_48.bShape.z; - batchBSize = (x_455 * x_457); - let x_459 : i32 = *(row_1); - let x_460 : i32 = *(col_1); - let x_462 : i32 = dimInner_1; - let x_463 : i32 = dimBOuter_1; - param_12 = vec2(x_459, x_460); - param_13 = vec2(x_462, x_463); - let x_467 : bool = coordsInBounds_vi2_vi2_(&(param_12), &(param_13)); - if (x_467) { - let x_475 : i32 = batch; - let x_476 : i32 = batchBSize; - let x_478 : i32 = *(row_1); - let x_479 : i32 = dimBOuter_1; - let x_482 : i32 = *(col_1); - let x_485 : f32 = x_185.B[(((x_475 * x_476) + (x_478 * x_479)) + x_482)]; - x_468 = x_485; - } else { - x_468 = 0.0f; - } - let x_487 : f32 = x_468; - return x_487; -} - -fn getOutputFlatIndex_vi3_(coords : ptr>) -> i32 { - let x_99 : vec3 = *(coords); - let x_105 : i32 = x_48.outShapeStrides.x; - let x_107 : i32 = x_48.outShapeStrides.y; - return i32(dot(vec3(x_99), vec3(vec3(x_105, x_107, 1i)))); -} - -fn setOutput_i1_f1_(flatIndex : ptr, value : ptr) { - let x_95 : i32 = *(flatIndex); - let x_96 : f32 = *(value); - x_54.result[x_95] = x_96; - return; -} - -fn setOutput_i1_i1_i1_f1_(d0 : ptr, d1 : ptr, d2 : ptr, value_1 : ptr) { - var flatIndex_1 : i32; - var param : vec3; - var param_1 : i32; - var param_2 : f32; - let x_115 : i32 = *(d0); - let x_116 : i32 = *(d1); - let x_117 : i32 = *(d2); - param = vec3(x_115, x_116, x_117); - let x_120 : i32 = getOutputFlatIndex_vi3_(&(param)); - flatIndex_1 = x_120; - let x_122 : i32 = flatIndex_1; - param_1 = x_122; - let x_124 : f32 = *(value_1); - param_2 = x_124; - setOutput_i1_f1_(&(param_1), &(param_2)); - return; -} - -fn mm_write_i1_i1_f1_(row_2 : ptr, col_2 : ptr, value_2 : ptr) { - var outCoord : vec3; - var param_14 : i32; - var param_15 : i32; - var param_16 : i32; - var param_17 : f32; - let x_491 : i32 = batch; - let x_492 : i32 = *(row_2); - let x_493 : i32 = *(col_2); - outCoord = vec3(x_491, x_492, x_493); - let x_496 : i32 = batch; - param_14 = x_496; - let x_498 : i32 = *(row_2); - param_15 = x_498; - let x_500 : i32 = *(col_2); - param_16 = x_500; - let x_502 : f32 = *(value_2); - param_17 = x_502; - setOutput_i1_i1_i1_f1_(&(param_14), &(param_15), &(param_16), &(param_17)); - return; -} - -fn mm_matMul_i1_i1_i1_(dimAOuter : ptr, dimInner : ptr, dimBOuter : ptr) { - var tileRow : i32; - var tileCol : i32; - var globalRow : i32; - var globalCol : i32; - var numTiles : i32; - var innerRow : i32; - var innerCol : i32; - var acc : array, 1u>; - var tileColA : i32; - var tileRowB : i32; - var t : i32; - var innerRow_1 : i32; - var innerCol_1 : i32; - var inputRow : i32; - var inputCol : i32; - var param_3 : i32; - var param_4 : i32; - var innerRow_2 : i32; - var innerCol_2 : i32; - var inputRow_1 : i32; - var inputCol_1 : i32; - var param_5 : i32; - var param_6 : i32; - var k : i32; - var inner : i32; - var BCached : array; - var innerRow_3 : i32; - var ACached : f32; - var innerCol_3 : i32; - var innerRow_4 : i32; - var innerCol_4 : i32; - var param_7 : i32; - var param_8 : i32; - var param_9 : f32; - let x_132 : u32 = gl_LocalInvocationID.y; - tileRow = (bitcast(x_132) * 1i); - let x_137 : u32 = gl_LocalInvocationID.x; - tileCol = (bitcast(x_137) * 1i); - let x_143 : u32 = gl_GlobalInvocationID.y; - globalRow = (bitcast(x_143) * 1i); - let x_148 : u32 = gl_GlobalInvocationID.x; - globalCol = (bitcast(x_148) * 1i); - let x_152 : i32 = *(dimInner); - numTiles = (((x_152 - 1i) / 64i) + 1i); - innerRow = 0i; - loop { - let x_163 : i32 = innerRow; - if ((x_163 < 1i)) { - } else { - break; - } - innerCol = 0i; - loop { - let x_171 : i32 = innerCol; - if ((x_171 < 1i)) { - } else { - break; - } - let x_177 : i32 = innerRow; - let x_178 : i32 = innerCol; - acc[x_177][x_178] = 0.0f; - - continuing { - let x_181 : i32 = innerCol; - innerCol = (x_181 + 1i); - } - } - - continuing { - let x_183 : i32 = innerRow; - innerRow = (x_183 + 1i); - } - } - let x_187 : u32 = gl_LocalInvocationID.x; - tileColA = (bitcast(x_187) * 64i); - let x_192 : u32 = gl_LocalInvocationID.y; - tileRowB = (bitcast(x_192) * 1i); - t = 0i; - loop { - let x_201 : i32 = t; - let x_202 : i32 = numTiles; - if ((x_201 < x_202)) { - } else { - break; - } - innerRow_1 = 0i; - loop { - let x_210 : i32 = innerRow_1; - if ((x_210 < 1i)) { - } else { - break; - } - innerCol_1 = 0i; - loop { - let x_218 : i32 = innerCol_1; - if ((x_218 < 64i)) { - } else { - break; - } - let x_221 : i32 = tileRow; - let x_222 : i32 = innerRow_1; - inputRow = (x_221 + x_222); - let x_225 : i32 = tileColA; - let x_226 : i32 = innerCol_1; - inputCol = (x_225 + x_226); - let x_233 : i32 = inputRow; - let x_234 : i32 = inputCol; - let x_235 : i32 = globalRow; - let x_236 : i32 = innerRow_1; - let x_238 : i32 = t; - let x_240 : i32 = inputCol; - param_3 = (x_235 + x_236); - param_4 = ((x_238 * 64i) + x_240); - let x_244 : f32 = mm_readA_i1_i1_(&(param_3), &(param_4)); - mm_Asub[x_233][x_234] = x_244; - - continuing { - let x_247 : i32 = innerCol_1; - innerCol_1 = (x_247 + 1i); - } - } - - continuing { - let x_249 : i32 = innerRow_1; - innerRow_1 = (x_249 + 1i); - } - } - innerRow_2 = 0i; - loop { - let x_257 : i32 = innerRow_2; - if ((x_257 < 1i)) { - } else { - break; - } - innerCol_2 = 0i; - loop { - let x_265 : i32 = innerCol_2; - if ((x_265 < 1i)) { - } else { - break; - } - let x_268 : i32 = tileRowB; - let x_269 : i32 = innerRow_2; - inputRow_1 = (x_268 + x_269); - let x_272 : i32 = tileCol; - let x_273 : i32 = innerCol_2; - inputCol_1 = (x_272 + x_273); - let x_278 : i32 = inputRow_1; - let x_279 : i32 = inputCol_1; - let x_280 : i32 = t; - let x_282 : i32 = inputRow_1; - let x_284 : i32 = globalCol; - let x_285 : i32 = innerCol_2; - param_5 = ((x_280 * 64i) + x_282); - param_6 = (x_284 + x_285); - let x_289 : f32 = mm_readB_i1_i1_(&(param_5), &(param_6)); - mm_Bsub[x_278][x_279] = x_289; - - continuing { - let x_291 : i32 = innerCol_2; - innerCol_2 = (x_291 + 1i); - } - } - - continuing { - let x_293 : i32 = innerRow_2; - innerRow_2 = (x_293 + 1i); - } - } - workgroupBarrier(); - k = 0i; - loop { - let x_302 : i32 = k; - if ((x_302 < 64i)) { - } else { - break; - } - inner = 0i; - loop { - let x_310 : i32 = inner; - if ((x_310 < 1i)) { - } else { - break; - } - let x_314 : i32 = inner; - let x_315 : i32 = k; - let x_316 : i32 = tileCol; - let x_317 : i32 = inner; - let x_320 : f32 = mm_Bsub[x_315][(x_316 + x_317)]; - BCached[x_314] = x_320; - - continuing { - let x_322 : i32 = inner; - inner = (x_322 + 1i); - } - } - innerRow_3 = 0i; - loop { - let x_330 : i32 = innerRow_3; - if ((x_330 < 1i)) { - } else { - break; - } - let x_333 : i32 = tileRow; - let x_334 : i32 = innerRow_3; - let x_336 : i32 = k; - let x_338 : f32 = mm_Asub[(x_333 + x_334)][x_336]; - ACached = x_338; - innerCol_3 = 0i; - loop { - let x_345 : i32 = innerCol_3; - if ((x_345 < 1i)) { - } else { - break; - } - let x_347 : i32 = innerRow_3; - let x_348 : i32 = innerCol_3; - let x_349 : f32 = ACached; - let x_350 : i32 = innerCol_3; - let x_352 : f32 = BCached[x_350]; - let x_355 : f32 = acc[x_347][x_348]; - acc[x_347][x_348] = (x_355 + (x_349 * x_352)); - - continuing { - let x_358 : i32 = innerCol_3; - innerCol_3 = (x_358 + 1i); - } - } - - continuing { - let x_360 : i32 = innerRow_3; - innerRow_3 = (x_360 + 1i); - } - } - - continuing { - let x_362 : i32 = k; - k = (x_362 + 1i); - } - } - workgroupBarrier(); - - continuing { - let x_364 : i32 = t; - t = (x_364 + 1i); - } - } - innerRow_4 = 0i; - loop { - let x_372 : i32 = innerRow_4; - if ((x_372 < 1i)) { - } else { - break; - } - innerCol_4 = 0i; - loop { - var x_393 : bool; - var x_394 : bool; - let x_380 : i32 = innerCol_4; - if ((x_380 < 1i)) { - } else { - break; - } - let x_382 : i32 = globalCol; - let x_383 : i32 = innerCol_4; - let x_385 : i32 = *(dimBOuter); - let x_386 : bool = ((x_382 + x_383) < x_385); - x_394 = x_386; - if (x_386) { - let x_389 : i32 = globalRow; - let x_390 : i32 = innerRow_4; - let x_392 : i32 = *(dimAOuter); - x_393 = ((x_389 + x_390) < x_392); - x_394 = x_393; - } - if (x_394) { - let x_397 : i32 = globalRow; - let x_398 : i32 = innerRow_4; - let x_400 : i32 = globalCol; - let x_401 : i32 = innerCol_4; - let x_403 : i32 = innerRow_4; - let x_404 : i32 = innerCol_4; - param_7 = (x_397 + x_398); - param_8 = (x_400 + x_401); - let x_409 : f32 = acc[x_403][x_404]; - param_9 = x_409; - mm_write_i1_i1_f1_(&(param_7), &(param_8), &(param_9)); - } - - continuing { - let x_411 : i32 = innerCol_4; - innerCol_4 = (x_411 + 1i); - } - } - - continuing { - let x_413 : i32 = innerRow_4; - innerRow_4 = (x_413 + 1i); - } - } - return; -} - -fn main_1() { - var param_18 : i32; - var param_19 : i32; - var param_20 : i32; - let x_67 : i32 = x_48.aShape.y; - dimAOuter_1 = x_67; - let x_71 : i32 = x_48.aShape.z; - dimInner_1 = x_71; - let x_75 : i32 = x_48.bShape.z; - dimBOuter_1 = x_75; - let x_505 : u32 = gl_GlobalInvocationID.z; - batch = bitcast(x_505); - let x_508 : i32 = dimAOuter_1; - param_18 = x_508; - let x_510 : i32 = dimInner_1; - param_19 = x_510; - let x_512 : i32 = dimBOuter_1; - param_20 = x_512; - mm_matMul_i1_i1_i1_(&(param_18), &(param_19), &(param_20)); - return; -} - -@compute @workgroup_size(1i, 64i, 1i) -fn main(@builtin(local_invocation_id) gl_LocalInvocationID_param : vec3, @builtin(global_invocation_id) gl_GlobalInvocationID_param : vec3) { - gl_LocalInvocationID = gl_LocalInvocationID_param; - gl_GlobalInvocationID = gl_GlobalInvocationID_param; - main_1(); -} diff --git a/test/tint/bug/tint/948.wgsl b/test/tint/bug/tint/948.wgsl index 68432d5f6f..c24fe0f7a8 100644 --- a/test/tint/bug/tint/948.wgsl +++ b/test/tint/bug/tint/948.wgsl @@ -143,7 +143,9 @@ fn main_1() { let x_208 : f32 = frameID_1; let x_211 : f32 = x_20.spriteCount; let x_214 : f32 = f; - let x_217 : vec4 = textureSampleBias(animationMapTexture, animationMapSampler, vec2(((x_208 + 0.5) / x_211), (0.125 * x_214)), 0.0); + // Violates uniformity analysis: + // let x_217 : vec4 = textureSampleBias(animationMapTexture, animationMapSampler, vec2(((x_208 + 0.5) / x_211), (0.125 * x_214)), 0.0); + let x_217 : vec4 = vec4(0); animationData = x_217; continuing { diff --git a/test/tint/bug/tint/948.wgsl.expected.dxc.hlsl b/test/tint/bug/tint/948.wgsl.expected.dxc.hlsl index c19bece746..acc4ad6e6d 100644 --- a/test/tint/bug/tint/948.wgsl.expected.dxc.hlsl +++ b/test/tint/bug/tint/948.wgsl.expected.dxc.hlsl @@ -1,15 +1,3 @@ -bug/tint/948.wgsl:146:33 warning: 'textureSampleBias' must only be called from uniform control flow - let x_217 : vec4 = textureSampleBias(animationMapTexture, animationMapSampler, vec2(((x_208 + 0.5) / x_211), (0.125 * x_214)), 0.0); - ^^^^^^^^^^^^^^^^^ - -bug/tint/948.wgsl:138:9 note: control flow depends on non-uniform value - if ((x_197 > x_198)) { - ^^ - -bug/tint/948.wgsl:137:27 note: reading from module-scope private variable 'mt' may result in a non-uniform value - let x_198 : f32 = mt; - ^^ - cbuffer cbuffer_x_20 : register(b9, space2) { uint4 x_20[8]; }; @@ -130,7 +118,7 @@ void main_1() { const float x_208 = frameID_1; const float x_211 = asfloat(x_20[6].w); const float x_214 = f; - const float4 x_217 = animationMapTexture.SampleBias(animationMapSampler, float2(((x_208 + 0.5f) / x_211), (0.125f * x_214)), 0.0f); + const float4 x_217 = (0.0f).xxxx; animationData = x_217; { const float x_218 = f; diff --git a/test/tint/bug/tint/948.wgsl.expected.fxc.hlsl b/test/tint/bug/tint/948.wgsl.expected.fxc.hlsl index c19bece746..acc4ad6e6d 100644 --- a/test/tint/bug/tint/948.wgsl.expected.fxc.hlsl +++ b/test/tint/bug/tint/948.wgsl.expected.fxc.hlsl @@ -1,15 +1,3 @@ -bug/tint/948.wgsl:146:33 warning: 'textureSampleBias' must only be called from uniform control flow - let x_217 : vec4 = textureSampleBias(animationMapTexture, animationMapSampler, vec2(((x_208 + 0.5) / x_211), (0.125 * x_214)), 0.0); - ^^^^^^^^^^^^^^^^^ - -bug/tint/948.wgsl:138:9 note: control flow depends on non-uniform value - if ((x_197 > x_198)) { - ^^ - -bug/tint/948.wgsl:137:27 note: reading from module-scope private variable 'mt' may result in a non-uniform value - let x_198 : f32 = mt; - ^^ - cbuffer cbuffer_x_20 : register(b9, space2) { uint4 x_20[8]; }; @@ -130,7 +118,7 @@ void main_1() { const float x_208 = frameID_1; const float x_211 = asfloat(x_20[6].w); const float x_214 = f; - const float4 x_217 = animationMapTexture.SampleBias(animationMapSampler, float2(((x_208 + 0.5f) / x_211), (0.125f * x_214)), 0.0f); + const float4 x_217 = (0.0f).xxxx; animationData = x_217; { const float x_218 = f; diff --git a/test/tint/bug/tint/948.wgsl.expected.glsl b/test/tint/bug/tint/948.wgsl.expected.glsl index 991da3288a..7ea6f08ec7 100644 --- a/test/tint/bug/tint/948.wgsl.expected.glsl +++ b/test/tint/bug/tint/948.wgsl.expected.glsl @@ -1,15 +1,3 @@ -bug/tint/948.wgsl:146:33 warning: 'textureSampleBias' must only be called from uniform control flow - let x_217 : vec4 = textureSampleBias(animationMapTexture, animationMapSampler, vec2(((x_208 + 0.5) / x_211), (0.125 * x_214)), 0.0); - ^^^^^^^^^^^^^^^^^ - -bug/tint/948.wgsl:138:9 note: control flow depends on non-uniform value - if ((x_197 > x_198)) { - ^^ - -bug/tint/948.wgsl:137:27 note: reading from module-scope private variable 'mt' may result in a non-uniform value - let x_198 : f32 = mt; - ^^ - #version 310 es precision mediump float; @@ -153,7 +141,7 @@ void main_1() { float x_208 = frameID_1; float x_211 = x_20.spriteCount; float x_214 = f; - vec4 x_217 = texture(animationMapTexture_animationMapSampler, vec2(((x_208 + 0.5f) / x_211), (0.125f * x_214)), 0.0f); + vec4 x_217 = vec4(0.0f); animationData = x_217; { float x_218 = f; diff --git a/test/tint/bug/tint/948.wgsl.expected.msl b/test/tint/bug/tint/948.wgsl.expected.msl index ad556254fa..6113640630 100644 --- a/test/tint/bug/tint/948.wgsl.expected.msl +++ b/test/tint/bug/tint/948.wgsl.expected.msl @@ -1,15 +1,3 @@ -bug/tint/948.wgsl:146:33 warning: 'textureSampleBias' must only be called from uniform control flow - let x_217 : vec4 = textureSampleBias(animationMapTexture, animationMapSampler, vec2(((x_208 + 0.5) / x_211), (0.125 * x_214)), 0.0); - ^^^^^^^^^^^^^^^^^ - -bug/tint/948.wgsl:138:9 note: control flow depends on non-uniform value - if ((x_197 > x_198)) { - ^^ - -bug/tint/948.wgsl:137:27 note: reading from module-scope private variable 'mt' may result in a non-uniform value - let x_198 : f32 = mt; - ^^ - #include using namespace metal; @@ -150,7 +138,7 @@ void main_1(thread float2* const tint_symbol_8, const constant LeftOver* const t float const x_208 = frameID_1; float const x_211 = (*(tint_symbol_9)).spriteCount; float const x_214 = f; - float4 const x_217 = tint_symbol_13.sample(tint_symbol_14, float2(((x_208 + 0.5f) / x_211), (0.125f * x_214)), bias(0.0f)); + float4 const x_217 = float4(0.0f); animationData = x_217; { float const x_218 = f; diff --git a/test/tint/bug/tint/948.wgsl.expected.spvasm b/test/tint/bug/tint/948.wgsl.expected.spvasm index 91c81d8998..11c65fb4c0 100644 --- a/test/tint/bug/tint/948.wgsl.expected.spvasm +++ b/test/tint/bug/tint/948.wgsl.expected.spvasm @@ -1,19 +1,7 @@ -bug/tint/948.wgsl:146:33 warning: 'textureSampleBias' must only be called from uniform control flow - let x_217 : vec4 = textureSampleBias(animationMapTexture, animationMapSampler, vec2(((x_208 + 0.5) / x_211), (0.125 * x_214)), 0.0); - ^^^^^^^^^^^^^^^^^ - -bug/tint/948.wgsl:138:9 note: control flow depends on non-uniform value - if ((x_197 > x_198)) { - ^^ - -bug/tint/948.wgsl:137:27 note: reading from module-scope private variable 'mt' may result in a non-uniform value - let x_198 : f32 = mt; - ^^ - ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 378 +; Bound: 369 ; Schema: 0 OpCapability Shader %131 = OpExtInstImport "GLSL.std.450" @@ -205,13 +193,12 @@ bug/tint/948.wgsl:137:27 note: reading from module-scope private variable 'mt' m %uint_0 = OpConstant %uint 0 %uint_2 = OpConstant %uint 2 %float_8 = OpConstant %float 8 -%float_0_125 = OpConstant %float 0.125 %uint_3 = OpConstant %uint 3 %int_1 = OpConstant %int 1 %uint_8 = OpConstant %uint 8 %_ptr_Uniform_v3float = OpTypePointer Uniform %v3float %main_out = OpTypeStruct %v4float - %355 = OpTypeFunction %main_out %v2float %v2float %v2float %v2float %v3float %v2float + %346 = OpTypeFunction %main_out %v2float %v2float %v2float %v2float %v3float %v2float %getFrameData_f1_ = OpFunction %mat4v4float None %49 %frameID = OpFunctionParameter %_ptr_Function_float %53 = OpLabel @@ -403,76 +390,80 @@ bug/tint/948.wgsl:137:27 note: reading from module-scope private variable 'mt' m %232 = OpAccessChain %_ptr_Uniform_float %x_20 %uint_7 %233 = OpLoad %float %232 %234 = OpLoad %float %f - %236 = OpLoad %26 %animationMapSampler - %237 = OpLoad %23 %animationMapTexture - %238 = OpSampledImage %66 %237 %236 - %239 = OpFAdd %float %231 %float_0_5 - %240 = OpFDiv %float %239 %233 - %242 = OpFMul %float %float_0_125 %234 - %243 = OpCompositeConstruct %v2float %240 %242 - %235 = OpImageSampleImplicitLod %v4float %238 %243 Bias %37 - OpStore %animationData %235 + OpStore %animationData %15 OpBranch %215 %215 = OpLabel - %244 = OpLoad %float %f - %245 = OpFAdd %float %244 %float_1 - OpStore %f %245 + %235 = OpLoad %float %f + %236 = OpFAdd %float %235 %float_1 + OpStore %f %236 OpBranch %213 %214 = OpLabel OpBranch %203 %203 = OpLabel - %246 = OpLoad %float %frameID_1 - %247 = OpFAdd %float %246 %float_0_5 - OpStore %param %247 - %248 = OpFunctionCall %mat4v4float %getFrameData_f1_ %param - OpStore %frameData %248 - %250 = OpAccessChain %_ptr_Function_v4float %frameData %114 - %251 = OpLoad %v4float %250 - %252 = OpAccessChain %_ptr_Uniform_v2float %x_20 %uint_5 - %253 = OpLoad %v2float %252 - %254 = OpCompositeExtract %float %251 3 - %255 = OpCompositeExtract %float %251 2 - %256 = OpCompositeConstruct %v2float %254 %255 - %257 = OpFDiv %v2float %256 %253 - OpStore %frameSize %257 + %237 = OpLoad %float %frameID_1 + %238 = OpFAdd %float %237 %float_0_5 + OpStore %param %238 + %239 = OpFunctionCall %mat4v4float %getFrameData_f1_ %param + OpStore %frameData %239 + %241 = OpAccessChain %_ptr_Function_v4float %frameData %114 + %242 = OpLoad %v4float %241 + %243 = OpAccessChain %_ptr_Uniform_v2float %x_20 %uint_5 + %244 = OpLoad %v2float %243 + %245 = OpCompositeExtract %float %242 3 + %246 = OpCompositeExtract %float %242 2 + %247 = OpCompositeConstruct %v2float %245 %246 + %248 = OpFDiv %v2float %247 %244 + OpStore %frameSize %248 + %249 = OpAccessChain %_ptr_Function_v4float %frameData %114 + %250 = OpLoad %v4float %249 + %251 = OpLoad %v2float %sheetUnits + %252 = OpCompositeExtract %float %250 0 + %253 = OpCompositeExtract %float %250 1 + %254 = OpCompositeConstruct %v2float %252 %253 + %255 = OpFMul %v2float %254 %251 + OpStore %offset_1 %255 + %256 = OpAccessChain %_ptr_Function_v4float %frameData %int_2 + %257 = OpLoad %v4float %256 %258 = OpAccessChain %_ptr_Function_v4float %frameData %114 %259 = OpLoad %v4float %258 - %260 = OpLoad %v2float %sheetUnits - %261 = OpCompositeExtract %float %259 0 - %262 = OpCompositeExtract %float %259 1 - %263 = OpCompositeConstruct %v2float %261 %262 - %264 = OpFMul %v2float %263 %260 - OpStore %offset_1 %264 - %265 = OpAccessChain %_ptr_Function_v4float %frameData %int_2 - %266 = OpLoad %v4float %265 - %267 = OpAccessChain %_ptr_Function_v4float %frameData %114 - %268 = OpLoad %v4float %267 - %269 = OpCompositeExtract %float %266 0 - %270 = OpCompositeExtract %float %266 1 - %271 = OpCompositeConstruct %v2float %269 %270 - %272 = OpCompositeExtract %float %268 3 - %273 = OpCompositeExtract %float %268 2 - %274 = OpCompositeConstruct %v2float %272 %273 - %275 = OpFDiv %v2float %271 %274 - OpStore %ratio %275 - %276 = OpAccessChain %_ptr_Function_float %frameData %int_2 %uint_2 - %277 = OpLoad %float %276 - %278 = OpFOrdEqual %bool %277 %float_1 - OpSelectionMerge %279 None - OpBranchConditional %278 %280 %279 - %280 = OpLabel - %281 = OpLoad %v2float %tileUV - %282 = OpCompositeExtract %float %281 1 - %283 = OpCompositeExtract %float %281 0 - %284 = OpCompositeConstruct %v2float %282 %283 - OpStore %tileUV %284 - OpBranch %279 + %260 = OpCompositeExtract %float %257 0 + %261 = OpCompositeExtract %float %257 1 + %262 = OpCompositeConstruct %v2float %260 %261 + %263 = OpCompositeExtract %float %259 3 + %264 = OpCompositeExtract %float %259 2 + %265 = OpCompositeConstruct %v2float %263 %264 + %266 = OpFDiv %v2float %262 %265 + OpStore %ratio %266 + %267 = OpAccessChain %_ptr_Function_float %frameData %int_2 %uint_2 + %268 = OpLoad %float %267 + %269 = OpFOrdEqual %bool %268 %float_1 + OpSelectionMerge %270 None + OpBranchConditional %269 %271 %270 + %271 = OpLabel + %272 = OpLoad %v2float %tileUV + %273 = OpCompositeExtract %float %272 1 + %274 = OpCompositeExtract %float %272 0 + %275 = OpCompositeConstruct %v2float %273 %274 + OpStore %tileUV %275 + OpBranch %270 + %270 = OpLabel + %276 = OpLoad %int %i + %277 = OpIEqual %bool %276 %114 + OpSelectionMerge %278 None + OpBranchConditional %277 %279 %280 %279 = OpLabel - %285 = OpLoad %int %i - %286 = OpIEqual %bool %285 %114 - OpSelectionMerge %287 None - OpBranchConditional %286 %288 %289 - %288 = OpLabel + %281 = OpLoad %v2float %tileUV + %282 = OpLoad %v2float %frameSize + %283 = OpLoad %v2float %offset_1 + %285 = OpLoad %26 %spriteSheetSampler + %286 = OpLoad %23 %spriteSheetTexture + %287 = OpSampledImage %66 %286 %285 + %288 = OpFMul %v2float %281 %282 + %289 = OpFAdd %v2float %288 %283 + %284 = OpImageSampleImplicitLod %v4float %287 %289 + OpStore %color %284 + OpBranch %278 + %280 = OpLabel %290 = OpLoad %v2float %tileUV %291 = OpLoad %v2float %frameSize %292 = OpLoad %v2float %offset_1 @@ -482,105 +473,93 @@ bug/tint/948.wgsl:137:27 note: reading from module-scope private variable 'mt' m %297 = OpFMul %v2float %290 %291 %298 = OpFAdd %v2float %297 %292 %293 = OpImageSampleImplicitLod %v4float %296 %298 - OpStore %color %293 - OpBranch %287 - %289 = OpLabel - %299 = OpLoad %v2float %tileUV - %300 = OpLoad %v2float %frameSize - %301 = OpLoad %v2float %offset_1 - %303 = OpLoad %26 %spriteSheetSampler - %304 = OpLoad %23 %spriteSheetTexture - %305 = OpSampledImage %66 %304 %303 - %306 = OpFMul %v2float %299 %300 - %307 = OpFAdd %v2float %306 %301 - %302 = OpImageSampleImplicitLod %v4float %305 %307 - OpStore %nc %302 - %309 = OpAccessChain %_ptr_Function_float %color %uint_3 - %310 = OpLoad %float %309 - %311 = OpAccessChain %_ptr_Function_float %nc %uint_3 - %312 = OpLoad %float %311 - %314 = OpFAdd %float %310 %312 - %313 = OpExtInst %float %131 NMin %314 %float_1 - OpStore %alpha %313 - %315 = OpLoad %v4float %color - %316 = OpLoad %v4float %nc - %317 = OpAccessChain %_ptr_Function_float %nc %uint_3 - %318 = OpLoad %float %317 - %320 = OpCompositeExtract %float %315 0 - %321 = OpCompositeExtract %float %315 1 - %322 = OpCompositeExtract %float %315 2 - %323 = OpCompositeConstruct %v3float %320 %321 %322 - %324 = OpCompositeExtract %float %316 0 - %325 = OpCompositeExtract %float %316 1 - %326 = OpCompositeExtract %float %316 2 - %327 = OpCompositeConstruct %v3float %324 %325 %326 - %328 = OpCompositeConstruct %v3float %318 %318 %318 - %319 = OpExtInst %v3float %131 FMix %323 %327 %328 - OpStore %mixed %319 - %329 = OpLoad %v3float %mixed - %330 = OpLoad %float %alpha - %331 = OpCompositeExtract %float %329 0 - %332 = OpCompositeExtract %float %329 1 - %333 = OpCompositeExtract %float %329 2 - %334 = OpCompositeConstruct %v4float %331 %332 %333 %330 - OpStore %color %334 - OpBranch %287 - %287 = OpLabel + OpStore %nc %293 + %300 = OpAccessChain %_ptr_Function_float %color %uint_3 + %301 = OpLoad %float %300 + %302 = OpAccessChain %_ptr_Function_float %nc %uint_3 + %303 = OpLoad %float %302 + %305 = OpFAdd %float %301 %303 + %304 = OpExtInst %float %131 NMin %305 %float_1 + OpStore %alpha %304 + %306 = OpLoad %v4float %color + %307 = OpLoad %v4float %nc + %308 = OpAccessChain %_ptr_Function_float %nc %uint_3 + %309 = OpLoad %float %308 + %311 = OpCompositeExtract %float %306 0 + %312 = OpCompositeExtract %float %306 1 + %313 = OpCompositeExtract %float %306 2 + %314 = OpCompositeConstruct %v3float %311 %312 %313 + %315 = OpCompositeExtract %float %307 0 + %316 = OpCompositeExtract %float %307 1 + %317 = OpCompositeExtract %float %307 2 + %318 = OpCompositeConstruct %v3float %315 %316 %317 + %319 = OpCompositeConstruct %v3float %309 %309 %309 + %310 = OpExtInst %v3float %131 FMix %314 %318 %319 + OpStore %mixed %310 + %320 = OpLoad %v3float %mixed + %321 = OpLoad %float %alpha + %322 = OpCompositeExtract %float %320 0 + %323 = OpCompositeExtract %float %320 1 + %324 = OpCompositeExtract %float %320 2 + %325 = OpCompositeConstruct %v4float %322 %323 %324 %321 + OpStore %color %325 + OpBranch %278 + %278 = OpLabel OpBranch %155 %155 = OpLabel - %335 = OpLoad %int %i - %337 = OpIAdd %int %335 %int_1 - OpStore %i %337 + %326 = OpLoad %int %i + %328 = OpIAdd %int %326 %int_1 + OpStore %i %328 OpBranch %153 %154 = OpLabel - %340 = OpAccessChain %_ptr_Uniform_v3float %x_20 %uint_8 - %341 = OpLoad %v3float %340 - %342 = OpLoad %v4float %color - %343 = OpCompositeExtract %float %342 0 - %344 = OpCompositeExtract %float %342 1 - %345 = OpCompositeExtract %float %342 2 - %346 = OpCompositeConstruct %v3float %343 %344 %345 - %347 = OpFMul %v3float %346 %341 - %348 = OpLoad %v4float %color - %349 = OpCompositeExtract %float %347 0 - %350 = OpCompositeExtract %float %347 1 - %351 = OpCompositeExtract %float %347 2 - %352 = OpCompositeExtract %float %348 3 - %353 = OpCompositeConstruct %v4float %349 %350 %351 %352 - OpStore %color %353 - %354 = OpLoad %v4float %color - OpStore %glFragColor %354 + %331 = OpAccessChain %_ptr_Uniform_v3float %x_20 %uint_8 + %332 = OpLoad %v3float %331 + %333 = OpLoad %v4float %color + %334 = OpCompositeExtract %float %333 0 + %335 = OpCompositeExtract %float %333 1 + %336 = OpCompositeExtract %float %333 2 + %337 = OpCompositeConstruct %v3float %334 %335 %336 + %338 = OpFMul %v3float %337 %332 + %339 = OpLoad %v4float %color + %340 = OpCompositeExtract %float %338 0 + %341 = OpCompositeExtract %float %338 1 + %342 = OpCompositeExtract %float %338 2 + %343 = OpCompositeExtract %float %339 3 + %344 = OpCompositeConstruct %v4float %340 %341 %342 %343 + OpStore %color %344 + %345 = OpLoad %v4float %color + OpStore %glFragColor %345 OpReturn OpFunctionEnd - %main_inner = OpFunction %main_out None %355 + %main_inner = OpFunction %main_out None %346 %tUV_param = OpFunctionParameter %v2float %tileID_1_param = OpFunctionParameter %v2float %levelUnits_param = OpFunctionParameter %v2float %stageUnits_1_param = OpFunctionParameter %v2float %vPosition_param = OpFunctionParameter %v3float %vUV_param = OpFunctionParameter %v2float - %364 = OpLabel + %355 = OpLabel OpStore %tUV %tUV_param OpStore %tileID_1 %tileID_1_param OpStore %levelUnits %levelUnits_param OpStore %stageUnits_1 %stageUnits_1_param OpStore %vPosition %vPosition_param OpStore %vUV %vUV_param - %365 = OpFunctionCall %void %main_1 - %366 = OpLoad %v4float %glFragColor - %367 = OpCompositeConstruct %main_out %366 - OpReturnValue %367 + %356 = OpFunctionCall %void %main_1 + %357 = OpLoad %v4float %glFragColor + %358 = OpCompositeConstruct %main_out %357 + OpReturnValue %358 OpFunctionEnd %main = OpFunction %void None %99 - %369 = OpLabel - %371 = OpLoad %v2float %tUV_param_1 - %372 = OpLoad %v2float %tileID_1_param_1 - %373 = OpLoad %v2float %levelUnits_param_1 - %374 = OpLoad %v2float %stageUnits_1_param_1 - %375 = OpLoad %v3float %vPosition_param_1 - %376 = OpLoad %v2float %vUV_param_1 - %370 = OpFunctionCall %main_out %main_inner %371 %372 %373 %374 %375 %376 - %377 = OpCompositeExtract %v4float %370 0 - OpStore %glFragColor_1_1 %377 + %360 = OpLabel + %362 = OpLoad %v2float %tUV_param_1 + %363 = OpLoad %v2float %tileID_1_param_1 + %364 = OpLoad %v2float %levelUnits_param_1 + %365 = OpLoad %v2float %stageUnits_1_param_1 + %366 = OpLoad %v3float %vPosition_param_1 + %367 = OpLoad %v2float %vUV_param_1 + %361 = OpFunctionCall %main_out %main_inner %362 %363 %364 %365 %366 %367 + %368 = OpCompositeExtract %v4float %361 0 + OpStore %glFragColor_1_1 %368 OpReturn OpFunctionEnd diff --git a/test/tint/bug/tint/948.wgsl.expected.wgsl b/test/tint/bug/tint/948.wgsl.expected.wgsl index a902aec9d7..f03e527a9e 100644 --- a/test/tint/bug/tint/948.wgsl.expected.wgsl +++ b/test/tint/bug/tint/948.wgsl.expected.wgsl @@ -1,15 +1,3 @@ -bug/tint/948.wgsl:146:33 warning: 'textureSampleBias' must only be called from uniform control flow - let x_217 : vec4 = textureSampleBias(animationMapTexture, animationMapSampler, vec2(((x_208 + 0.5) / x_211), (0.125 * x_214)), 0.0); - ^^^^^^^^^^^^^^^^^ - -bug/tint/948.wgsl:138:9 note: control flow depends on non-uniform value - if ((x_197 > x_198)) { - ^^ - -bug/tint/948.wgsl:137:27 note: reading from module-scope private variable 'mt' may result in a non-uniform value - let x_198 : f32 = mt; - ^^ - struct LeftOver { time : f32, @size(12) @@ -155,7 +143,7 @@ fn main_1() { let x_208 : f32 = frameID_1; let x_211 : f32 = x_20.spriteCount; let x_214 : f32 = f; - let x_217 : vec4 = textureSampleBias(animationMapTexture, animationMapSampler, vec2(((x_208 + 0.5) / x_211), (0.125 * x_214)), 0.0); + let x_217 : vec4 = vec4(0); animationData = x_217; continuing { diff --git a/test/tint/bug/tint/949.wgsl b/test/tint/bug/tint/949.wgsl index b06e420b93..63674e1e9f 100644 --- a/test/tint/bug/tint/949.wgsl +++ b/test/tint/bug/tint/949.wgsl @@ -323,7 +323,9 @@ fn main_1() { } let x_394 : vec2 = v_uv; let x_395 : vec2 = vCurrOffset; - let x_397 : vec4 = textureSample(TextureSamplerTexture, TextureSamplerSampler, (x_394 + x_395)); + // Violates uniformity analysis: + // let x_397 : vec4 = textureSample(TextureSamplerTexture, TextureSamplerSampler, (x_394 + x_395)); + let x_397 : vec4 = vec4(); currSampledHeight = x_397.w; let x_400 : f32 = currSampledHeight; let x_401 : f32 = currRayHeight; diff --git a/test/tint/bug/tint/949.wgsl.expected.dxc.hlsl b/test/tint/bug/tint/949.wgsl.expected.dxc.hlsl index 6875497ebc..aeb623dc0e 100644 --- a/test/tint/bug/tint/949.wgsl.expected.dxc.hlsl +++ b/test/tint/bug/tint/949.wgsl.expected.dxc.hlsl @@ -1,15 +1,3 @@ -bug/tint/949.wgsl:326:29 warning: 'textureSample' must only be called from uniform control flow - let x_397 : vec4 = textureSample(TextureSamplerTexture, TextureSamplerSampler, (x_394 + x_395)); - ^^^^^^^^^^^^^ - -bug/tint/949.wgsl:330:5 note: control flow depends on non-uniform value - if ((x_400 > x_401)) { - ^^ - -bug/tint/949.wgsl:308:27 note: reading from module-scope private variable 'v_output2' may result in a non-uniform value - let x_366 : vec4 = v_output2; - ^^^^^^^^^ - struct lightingInfo { float3 diffuse; float3 specular; @@ -298,7 +286,7 @@ void main_1() { } const float2 x_394 = v_uv; const float2 x_395 = vCurrOffset; - const float4 x_397 = TextureSamplerTexture.Sample(TextureSamplerSampler, (x_394 + x_395)); + const float4 x_397 = (0.0f).xxxx; currSampledHeight = x_397.w; const float x_400 = currSampledHeight; const float x_401 = currRayHeight; diff --git a/test/tint/bug/tint/949.wgsl.expected.fxc.hlsl b/test/tint/bug/tint/949.wgsl.expected.fxc.hlsl index 6875497ebc..aeb623dc0e 100644 --- a/test/tint/bug/tint/949.wgsl.expected.fxc.hlsl +++ b/test/tint/bug/tint/949.wgsl.expected.fxc.hlsl @@ -1,15 +1,3 @@ -bug/tint/949.wgsl:326:29 warning: 'textureSample' must only be called from uniform control flow - let x_397 : vec4 = textureSample(TextureSamplerTexture, TextureSamplerSampler, (x_394 + x_395)); - ^^^^^^^^^^^^^ - -bug/tint/949.wgsl:330:5 note: control flow depends on non-uniform value - if ((x_400 > x_401)) { - ^^ - -bug/tint/949.wgsl:308:27 note: reading from module-scope private variable 'v_output2' may result in a non-uniform value - let x_366 : vec4 = v_output2; - ^^^^^^^^^ - struct lightingInfo { float3 diffuse; float3 specular; @@ -298,7 +286,7 @@ void main_1() { } const float2 x_394 = v_uv; const float2 x_395 = vCurrOffset; - const float4 x_397 = TextureSamplerTexture.Sample(TextureSamplerSampler, (x_394 + x_395)); + const float4 x_397 = (0.0f).xxxx; currSampledHeight = x_397.w; const float x_400 = currSampledHeight; const float x_401 = currRayHeight; diff --git a/test/tint/bug/tint/949.wgsl.expected.glsl b/test/tint/bug/tint/949.wgsl.expected.glsl index 4a0b37feb0..2ec8422fb9 100644 --- a/test/tint/bug/tint/949.wgsl.expected.glsl +++ b/test/tint/bug/tint/949.wgsl.expected.glsl @@ -1,15 +1,3 @@ -bug/tint/949.wgsl:326:29 warning: 'textureSample' must only be called from uniform control flow - let x_397 : vec4 = textureSample(TextureSamplerTexture, TextureSamplerSampler, (x_394 + x_395)); - ^^^^^^^^^^^^^ - -bug/tint/949.wgsl:330:5 note: control flow depends on non-uniform value - if ((x_400 > x_401)) { - ^^ - -bug/tint/949.wgsl:308:27 note: reading from module-scope private variable 'v_output2' may result in a non-uniform value - let x_366 : vec4 = v_output2; - ^^^^^^^^^ - #version 310 es precision mediump float; @@ -322,7 +310,7 @@ void main_1() { } vec2 x_394 = v_uv; vec2 x_395 = vCurrOffset; - vec4 x_397 = texture(TextureSamplerTexture_TextureSamplerSampler, (x_394 + x_395)); + vec4 x_397 = vec4(0.0f); currSampledHeight = x_397.w; float x_400 = currSampledHeight; float x_401 = currRayHeight; diff --git a/test/tint/bug/tint/949.wgsl.expected.msl b/test/tint/bug/tint/949.wgsl.expected.msl index 2cd37f5bd0..c7bdad37fe 100644 --- a/test/tint/bug/tint/949.wgsl.expected.msl +++ b/test/tint/bug/tint/949.wgsl.expected.msl @@ -1,15 +1,3 @@ -bug/tint/949.wgsl:326:29 warning: 'textureSample' must only be called from uniform control flow - let x_397 : vec4 = textureSample(TextureSamplerTexture, TextureSamplerSampler, (x_394 + x_395)); - ^^^^^^^^^^^^^ - -bug/tint/949.wgsl:330:5 note: control flow depends on non-uniform value - if ((x_400 > x_401)) { - ^^ - -bug/tint/949.wgsl:308:27 note: reading from module-scope private variable 'v_output2' may result in a non-uniform value - let x_366 : vec4 = v_output2; - ^^^^^^^^^ - #include using namespace metal; @@ -329,7 +317,7 @@ void main_1(thread float2* const tint_symbol_7, texture2d } float2 const x_394 = *(tint_symbol_13); float2 const x_395 = vCurrOffset; - float4 const x_397 = tint_symbol_8.sample(tint_symbol_9, (x_394 + x_395)); + float4 const x_397 = float4(0.0f); currSampledHeight = x_397[3]; float const x_400 = currSampledHeight; float const x_401 = currRayHeight; diff --git a/test/tint/bug/tint/949.wgsl.expected.spvasm b/test/tint/bug/tint/949.wgsl.expected.spvasm index bdee2f548c..68f2093bfe 100644 --- a/test/tint/bug/tint/949.wgsl.expected.spvasm +++ b/test/tint/bug/tint/949.wgsl.expected.spvasm @@ -1,19 +1,7 @@ -bug/tint/949.wgsl:326:29 warning: 'textureSample' must only be called from uniform control flow - let x_397 : vec4 = textureSample(TextureSamplerTexture, TextureSamplerSampler, (x_394 + x_395)); - ^^^^^^^^^^^^^ - -bug/tint/949.wgsl:330:5 note: control flow depends on non-uniform value - if ((x_400 > x_401)) { - ^^ - -bug/tint/949.wgsl:308:27 note: reading from module-scope private variable 'v_output2' may result in a non-uniform value - let x_366 : vec4 = v_output2; - ^^^^^^^^^ - ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 670 +; Bound: 665 ; Schema: 0 OpCapability Shader %88 = OpExtInstImport "GLSL.std.450" @@ -313,7 +301,7 @@ bug/tint/949.wgsl:308:27 note: reading from module-scope private variable 'v_out %_ptr_Uniform_v4float = OpTypePointer Uniform %v4float %uint_3 = OpConstant %uint 3 %main_out = OpTypeStruct %v4float - %649 = OpTypeFunction %main_out %v2float %v4float %bool %v2float %v4float + %644 = OpTypeFunction %main_out %v2float %v4float %bool %v2float %v4float %cotangent_frame_vf3_vf3_vf2_vf2_ = OpFunction %mat3v3float None %52 %normal_1 = OpFunctionParameter %_ptr_Function_v3float %p = OpFunctionParameter %_ptr_Function_v3float @@ -752,226 +740,221 @@ bug/tint/949.wgsl:308:27 note: reading from module-scope private variable 'v_out %488 = OpLabel %491 = OpLoad %v2float %v_uv %492 = OpLoad %v2float %vCurrOffset - %494 = OpLoad %28 %TextureSamplerSampler - %495 = OpLoad %25 %TextureSamplerTexture - %496 = OpSampledImage %374 %495 %494 - %497 = OpFAdd %v2float %491 %492 - %493 = OpImageSampleImplicitLod %v4float %496 %497 - %498 = OpCompositeExtract %float %493 3 - OpStore %currSampledHeight %498 - %499 = OpLoad %float %currSampledHeight - %500 = OpLoad %float %currRayHeight - %501 = OpFOrdGreaterThan %bool %499 %500 - OpSelectionMerge %502 None - OpBranchConditional %501 %503 %504 - %503 = OpLabel - %505 = OpLoad %float %currSampledHeight - %506 = OpLoad %float %currRayHeight - %507 = OpFSub %float %505 %506 - OpStore %delta1 %507 - %508 = OpLoad %float %currRayHeight - %509 = OpLoad %float %stepSize - %510 = OpLoad %float %lastSampledHeight - %511 = OpFAdd %float %508 %509 - %512 = OpFSub %float %511 %510 - OpStore %delta2 %512 - %513 = OpLoad %float %delta1 - %514 = OpLoad %float %delta1 - %515 = OpLoad %float %delta2 - %516 = OpFAdd %float %514 %515 - %517 = OpFDiv %float %513 %516 - OpStore %ratio %517 - %518 = OpLoad %float %ratio - %519 = OpLoad %v2float %vLastOffset - %520 = OpLoad %float %ratio - %521 = OpLoad %v2float %vCurrOffset - %522 = OpVectorTimesScalar %v2float %519 %518 - %523 = OpFSub %float %float_1 %520 - %524 = OpVectorTimesScalar %v2float %521 %523 - %525 = OpFAdd %v2float %522 %524 - OpStore %vCurrOffset %525 + %493 = OpCompositeExtract %float %15 3 + OpStore %currSampledHeight %493 + %494 = OpLoad %float %currSampledHeight + %495 = OpLoad %float %currRayHeight + %496 = OpFOrdGreaterThan %bool %494 %495 + OpSelectionMerge %497 None + OpBranchConditional %496 %498 %499 + %498 = OpLabel + %500 = OpLoad %float %currSampledHeight + %501 = OpLoad %float %currRayHeight + %502 = OpFSub %float %500 %501 + OpStore %delta1 %502 + %503 = OpLoad %float %currRayHeight + %504 = OpLoad %float %stepSize + %505 = OpLoad %float %lastSampledHeight + %506 = OpFAdd %float %503 %504 + %507 = OpFSub %float %506 %505 + OpStore %delta2 %507 + %508 = OpLoad %float %delta1 + %509 = OpLoad %float %delta1 + %510 = OpLoad %float %delta2 + %511 = OpFAdd %float %509 %510 + %512 = OpFDiv %float %508 %511 + OpStore %ratio %512 + %513 = OpLoad %float %ratio + %514 = OpLoad %v2float %vLastOffset + %515 = OpLoad %float %ratio + %516 = OpLoad %v2float %vCurrOffset + %517 = OpVectorTimesScalar %v2float %514 %513 + %518 = OpFSub %float %float_1 %515 + %519 = OpVectorTimesScalar %v2float %516 %518 + %520 = OpFAdd %v2float %517 %519 + OpStore %vCurrOffset %520 OpBranch %482 - %504 = OpLabel - %526 = OpLoad %float %stepSize - %527 = OpLoad %float %currRayHeight - %528 = OpFSub %float %527 %526 - OpStore %currRayHeight %528 - %529 = OpLoad %v2float %vCurrOffset - OpStore %vLastOffset %529 - %530 = OpLoad %float %stepSize - %531 = OpLoad %v2float %vMaxOffset - %532 = OpLoad %v2float %vCurrOffset - %533 = OpVectorTimesScalar %v2float %531 %530 - %534 = OpFAdd %v2float %532 %533 - OpStore %vCurrOffset %534 - %535 = OpLoad %float %currSampledHeight - OpStore %lastSampledHeight %535 - OpBranch %502 - %502 = OpLabel + %499 = OpLabel + %521 = OpLoad %float %stepSize + %522 = OpLoad %float %currRayHeight + %523 = OpFSub %float %522 %521 + OpStore %currRayHeight %523 + %524 = OpLoad %v2float %vCurrOffset + OpStore %vLastOffset %524 + %525 = OpLoad %float %stepSize + %526 = OpLoad %v2float %vMaxOffset + %527 = OpLoad %v2float %vCurrOffset + %528 = OpVectorTimesScalar %v2float %526 %525 + %529 = OpFAdd %v2float %527 %528 + OpStore %vCurrOffset %529 + %530 = OpLoad %float %currSampledHeight + OpStore %lastSampledHeight %530 + OpBranch %497 + %497 = OpLabel OpBranch %483 %483 = OpLabel - %536 = OpLoad %int %i - %537 = OpIAdd %int %536 %int_1 - OpStore %i %537 + %531 = OpLoad %int %i + %532 = OpIAdd %int %531 %int_1 + OpStore %i %532 OpBranch %481 %482 = OpLabel - %538 = OpLoad %v2float %vCurrOffset - OpStore %parallaxOcclusion_0 %538 - %539 = OpLoad %v2float %parallaxOcclusion_0 - OpStore %uvOffset %539 - %540 = OpLoad %v2float %v_uv - %541 = OpLoad %v2float %uvOffset - %543 = OpLoad %28 %TextureSamplerSampler - %544 = OpLoad %25 %TextureSamplerTexture - %545 = OpSampledImage %374 %544 %543 - %546 = OpFAdd %v2float %540 %541 - %542 = OpImageSampleImplicitLod %v4float %545 %546 - %547 = OpAccessChain %_ptr_Uniform_float %x_269 %uint_2 - %548 = OpLoad %float %547 - %549 = OpLoad %mat3v3float %TBN - OpStore %param_8 %549 - %550 = OpCompositeExtract %float %542 0 - %551 = OpCompositeExtract %float %542 1 - %552 = OpCompositeExtract %float %542 2 - %553 = OpCompositeConstruct %v3float %550 %551 %552 - OpStore %param_9 %553 - %554 = OpFDiv %float %float_1 %548 - OpStore %param_10 %554 - %555 = OpFunctionCall %v3float %perturbNormal_mf33_vf3_f1_ %param_8 %param_9 %param_10 - %559 = OpLoad %v4float %output4 - %560 = OpCompositeExtract %float %555 0 - %561 = OpCompositeExtract %float %555 1 - %562 = OpCompositeExtract %float %555 2 - %563 = OpCompositeExtract %float %559 3 - %564 = OpCompositeConstruct %v4float %560 %561 %562 %563 - OpStore %output4 %564 - %565 = OpLoad %v2float %v_uv - %566 = OpLoad %v2float %uvOffset - %567 = OpFAdd %v2float %565 %566 - OpStore %output6 %567 - %568 = OpLoad %v2float %output6 - %570 = OpLoad %28 %TextureSampler1Sampler - %571 = OpLoad %25 %TextureSampler1Texture - %572 = OpSampledImage %374 %571 %570 - %569 = OpImageSampleImplicitLod %v4float %572 %568 - OpStore %tempTextureRead1 %569 - %573 = OpLoad %v4float %tempTextureRead1 - %574 = OpCompositeExtract %float %573 0 - %575 = OpCompositeExtract %float %573 1 - %576 = OpCompositeExtract %float %573 2 - %577 = OpCompositeConstruct %v3float %574 %575 %576 - OpStore %rgb1 %577 - %578 = OpAccessChain %_ptr_Uniform_v3float %x_269 %uint_4 - %579 = OpLoad %v3float %578 - %580 = OpLoad %v4float %v_output1 - %582 = OpCompositeExtract %float %580 0 - %583 = OpCompositeExtract %float %580 1 - %584 = OpCompositeExtract %float %580 2 - %585 = OpCompositeConstruct %v3float %582 %583 %584 - %586 = OpFSub %v3float %579 %585 - %581 = OpExtInst %v3float %88 Normalize %586 - OpStore %viewDirectionW_1 %581 + %533 = OpLoad %v2float %vCurrOffset + OpStore %parallaxOcclusion_0 %533 + %534 = OpLoad %v2float %parallaxOcclusion_0 + OpStore %uvOffset %534 + %535 = OpLoad %v2float %v_uv + %536 = OpLoad %v2float %uvOffset + %538 = OpLoad %28 %TextureSamplerSampler + %539 = OpLoad %25 %TextureSamplerTexture + %540 = OpSampledImage %374 %539 %538 + %541 = OpFAdd %v2float %535 %536 + %537 = OpImageSampleImplicitLod %v4float %540 %541 + %542 = OpAccessChain %_ptr_Uniform_float %x_269 %uint_2 + %543 = OpLoad %float %542 + %544 = OpLoad %mat3v3float %TBN + OpStore %param_8 %544 + %545 = OpCompositeExtract %float %537 0 + %546 = OpCompositeExtract %float %537 1 + %547 = OpCompositeExtract %float %537 2 + %548 = OpCompositeConstruct %v3float %545 %546 %547 + OpStore %param_9 %548 + %549 = OpFDiv %float %float_1 %543 + OpStore %param_10 %549 + %550 = OpFunctionCall %v3float %perturbNormal_mf33_vf3_f1_ %param_8 %param_9 %param_10 + %554 = OpLoad %v4float %output4 + %555 = OpCompositeExtract %float %550 0 + %556 = OpCompositeExtract %float %550 1 + %557 = OpCompositeExtract %float %550 2 + %558 = OpCompositeExtract %float %554 3 + %559 = OpCompositeConstruct %v4float %555 %556 %557 %558 + OpStore %output4 %559 + %560 = OpLoad %v2float %v_uv + %561 = OpLoad %v2float %uvOffset + %562 = OpFAdd %v2float %560 %561 + OpStore %output6 %562 + %563 = OpLoad %v2float %output6 + %565 = OpLoad %28 %TextureSampler1Sampler + %566 = OpLoad %25 %TextureSampler1Texture + %567 = OpSampledImage %374 %566 %565 + %564 = OpImageSampleImplicitLod %v4float %567 %563 + OpStore %tempTextureRead1 %564 + %568 = OpLoad %v4float %tempTextureRead1 + %569 = OpCompositeExtract %float %568 0 + %570 = OpCompositeExtract %float %568 1 + %571 = OpCompositeExtract %float %568 2 + %572 = OpCompositeConstruct %v3float %569 %570 %571 + OpStore %rgb1 %572 + %573 = OpAccessChain %_ptr_Uniform_v3float %x_269 %uint_4 + %574 = OpLoad %v3float %573 + %575 = OpLoad %v4float %v_output1 + %577 = OpCompositeExtract %float %575 0 + %578 = OpCompositeExtract %float %575 1 + %579 = OpCompositeExtract %float %575 2 + %580 = OpCompositeConstruct %v3float %577 %578 %579 + %581 = OpFSub %v3float %574 %580 + %576 = OpExtInst %v3float %88 Normalize %581 + OpStore %viewDirectionW_1 %576 OpStore %shadow %float_1 - %587 = OpLoad %float %u_Float - %588 = OpFMul %float %float_1 %587 - OpStore %glossiness_1 %588 + %582 = OpLoad %float %u_Float + %583 = OpFMul %float %float_1 %582 + OpStore %glossiness_1 %583 OpStore %diffuseBase %22 OpStore %specularBase %22 - %589 = OpLoad %v4float %output4 - %590 = OpCompositeExtract %float %589 0 - %591 = OpCompositeExtract %float %589 1 - %592 = OpCompositeExtract %float %589 2 - %593 = OpCompositeConstruct %v3float %590 %591 %592 - OpStore %normalW %593 - %594 = OpLoad %v3float %viewDirectionW_1 - OpStore %param_11 %594 - %595 = OpLoad %v3float %normalW - OpStore %param_12 %595 - %597 = OpAccessChain %_ptr_Uniform_v4float %light0 %uint_0 - %598 = OpLoad %v4float %597 - OpStore %param_13 %598 - %599 = OpAccessChain %_ptr_Uniform_v4float %light0 %uint_1 - %600 = OpLoad %v4float %599 - %601 = OpCompositeExtract %float %600 0 - %602 = OpCompositeExtract %float %600 1 - %603 = OpCompositeExtract %float %600 2 - %604 = OpCompositeConstruct %v3float %601 %602 %603 - OpStore %param_14 %604 - %605 = OpAccessChain %_ptr_Uniform_v4float %light0 %uint_2 - %606 = OpLoad %v4float %605 - %607 = OpCompositeExtract %float %606 0 - %608 = OpCompositeExtract %float %606 1 - %609 = OpCompositeExtract %float %606 2 - %610 = OpCompositeConstruct %v3float %607 %608 %609 - OpStore %param_15 %610 - %612 = OpAccessChain %_ptr_Uniform_v3float %light0 %uint_3 - %613 = OpLoad %v3float %612 - OpStore %param_16 %613 - %614 = OpLoad %float %glossiness_1 - OpStore %param_17 %614 - %615 = OpFunctionCall %lightingInfo %computeHemisphericLighting_vf3_vf3_vf4_vf3_vf3_vf3_f1_ %param_11 %param_12 %param_13 %param_14 %param_15 %param_16 %param_17 - OpStore %info %615 + %584 = OpLoad %v4float %output4 + %585 = OpCompositeExtract %float %584 0 + %586 = OpCompositeExtract %float %584 1 + %587 = OpCompositeExtract %float %584 2 + %588 = OpCompositeConstruct %v3float %585 %586 %587 + OpStore %normalW %588 + %589 = OpLoad %v3float %viewDirectionW_1 + OpStore %param_11 %589 + %590 = OpLoad %v3float %normalW + OpStore %param_12 %590 + %592 = OpAccessChain %_ptr_Uniform_v4float %light0 %uint_0 + %593 = OpLoad %v4float %592 + OpStore %param_13 %593 + %594 = OpAccessChain %_ptr_Uniform_v4float %light0 %uint_1 + %595 = OpLoad %v4float %594 + %596 = OpCompositeExtract %float %595 0 + %597 = OpCompositeExtract %float %595 1 + %598 = OpCompositeExtract %float %595 2 + %599 = OpCompositeConstruct %v3float %596 %597 %598 + OpStore %param_14 %599 + %600 = OpAccessChain %_ptr_Uniform_v4float %light0 %uint_2 + %601 = OpLoad %v4float %600 + %602 = OpCompositeExtract %float %601 0 + %603 = OpCompositeExtract %float %601 1 + %604 = OpCompositeExtract %float %601 2 + %605 = OpCompositeConstruct %v3float %602 %603 %604 + OpStore %param_15 %605 + %607 = OpAccessChain %_ptr_Uniform_v3float %light0 %uint_3 + %608 = OpLoad %v3float %607 + OpStore %param_16 %608 + %609 = OpLoad %float %glossiness_1 + OpStore %param_17 %609 + %610 = OpFunctionCall %lightingInfo %computeHemisphericLighting_vf3_vf3_vf4_vf3_vf3_vf3_f1_ %param_11 %param_12 %param_13 %param_14 %param_15 %param_16 %param_17 + OpStore %info %610 OpStore %shadow %float_1 - %623 = OpAccessChain %_ptr_Function_v3float %info %uint_0 - %624 = OpLoad %v3float %623 - %625 = OpLoad %float %shadow - %626 = OpLoad %v3float %diffuseBase - %627 = OpVectorTimesScalar %v3float %624 %625 - %628 = OpFAdd %v3float %626 %627 - OpStore %diffuseBase %628 - %629 = OpAccessChain %_ptr_Function_v3float %info %uint_1 - %630 = OpLoad %v3float %629 - %631 = OpLoad %float %shadow - %632 = OpLoad %v3float %specularBase - %633 = OpVectorTimesScalar %v3float %630 %631 - %634 = OpFAdd %v3float %632 %633 - OpStore %specularBase %634 - %635 = OpLoad %v3float %diffuseBase - %636 = OpLoad %v3float %rgb1 - %637 = OpFMul %v3float %635 %636 - OpStore %diffuseOutput %637 - %638 = OpLoad %v3float %specularBase - %639 = OpLoad %v3float %u_Color - %640 = OpFMul %v3float %638 %639 - OpStore %specularOutput %640 - %641 = OpLoad %v3float %diffuseOutput - %642 = OpLoad %v3float %specularOutput - %643 = OpFAdd %v3float %641 %642 - OpStore %output3 %643 - %644 = OpLoad %v3float %output3 - %645 = OpCompositeExtract %float %644 0 - %646 = OpCompositeExtract %float %644 1 - %647 = OpCompositeExtract %float %644 2 - %648 = OpCompositeConstruct %v4float %645 %646 %647 %float_1 - OpStore %glFragColor %648 + %618 = OpAccessChain %_ptr_Function_v3float %info %uint_0 + %619 = OpLoad %v3float %618 + %620 = OpLoad %float %shadow + %621 = OpLoad %v3float %diffuseBase + %622 = OpVectorTimesScalar %v3float %619 %620 + %623 = OpFAdd %v3float %621 %622 + OpStore %diffuseBase %623 + %624 = OpAccessChain %_ptr_Function_v3float %info %uint_1 + %625 = OpLoad %v3float %624 + %626 = OpLoad %float %shadow + %627 = OpLoad %v3float %specularBase + %628 = OpVectorTimesScalar %v3float %625 %626 + %629 = OpFAdd %v3float %627 %628 + OpStore %specularBase %629 + %630 = OpLoad %v3float %diffuseBase + %631 = OpLoad %v3float %rgb1 + %632 = OpFMul %v3float %630 %631 + OpStore %diffuseOutput %632 + %633 = OpLoad %v3float %specularBase + %634 = OpLoad %v3float %u_Color + %635 = OpFMul %v3float %633 %634 + OpStore %specularOutput %635 + %636 = OpLoad %v3float %diffuseOutput + %637 = OpLoad %v3float %specularOutput + %638 = OpFAdd %v3float %636 %637 + OpStore %output3 %638 + %639 = OpLoad %v3float %output3 + %640 = OpCompositeExtract %float %639 0 + %641 = OpCompositeExtract %float %639 1 + %642 = OpCompositeExtract %float %639 2 + %643 = OpCompositeConstruct %v4float %640 %641 %642 %float_1 + OpStore %glFragColor %643 OpReturn OpFunctionEnd - %main_inner = OpFunction %main_out None %649 + %main_inner = OpFunction %main_out None %644 %vMainuv_param = OpFunctionParameter %v2float %v_output1_param = OpFunctionParameter %v4float %gl_FrontFacing_param = OpFunctionParameter %bool %v_uv_param = OpFunctionParameter %v2float %v_output2_param = OpFunctionParameter %v4float - %657 = OpLabel + %652 = OpLabel OpStore %vMainuv %vMainuv_param OpStore %v_output1 %v_output1_param OpStore %gl_FrontFacing %gl_FrontFacing_param OpStore %v_uv %v_uv_param OpStore %v_output2 %v_output2_param - %658 = OpFunctionCall %void %main_1 - %659 = OpLoad %v4float %glFragColor - %660 = OpCompositeConstruct %main_out %659 - OpReturnValue %660 + %653 = OpFunctionCall %void %main_1 + %654 = OpLoad %v4float %glFragColor + %655 = OpCompositeConstruct %main_out %654 + OpReturnValue %655 OpFunctionEnd %main = OpFunction %void None %310 - %662 = OpLabel - %664 = OpLoad %v2float %vMainuv_param_1 - %665 = OpLoad %v4float %v_output1_param_1 - %666 = OpLoad %bool %gl_FrontFacing_param_1 - %667 = OpLoad %v2float %v_uv_param_1 - %668 = OpLoad %v4float %v_output2_param_1 - %663 = OpFunctionCall %main_out %main_inner %664 %665 %666 %667 %668 - %669 = OpCompositeExtract %v4float %663 0 - OpStore %glFragColor_1_1 %669 + %657 = OpLabel + %659 = OpLoad %v2float %vMainuv_param_1 + %660 = OpLoad %v4float %v_output1_param_1 + %661 = OpLoad %bool %gl_FrontFacing_param_1 + %662 = OpLoad %v2float %v_uv_param_1 + %663 = OpLoad %v4float %v_output2_param_1 + %658 = OpFunctionCall %main_out %main_inner %659 %660 %661 %662 %663 + %664 = OpCompositeExtract %v4float %658 0 + OpStore %glFragColor_1_1 %664 OpReturn OpFunctionEnd diff --git a/test/tint/bug/tint/949.wgsl.expected.wgsl b/test/tint/bug/tint/949.wgsl.expected.wgsl index aac23a0797..710e144575 100644 --- a/test/tint/bug/tint/949.wgsl.expected.wgsl +++ b/test/tint/bug/tint/949.wgsl.expected.wgsl @@ -1,15 +1,3 @@ -bug/tint/949.wgsl:326:29 warning: 'textureSample' must only be called from uniform control flow - let x_397 : vec4 = textureSample(TextureSamplerTexture, TextureSamplerSampler, (x_394 + x_395)); - ^^^^^^^^^^^^^ - -bug/tint/949.wgsl:330:5 note: control flow depends on non-uniform value - if ((x_400 > x_401)) { - ^^ - -bug/tint/949.wgsl:308:27 note: reading from module-scope private variable 'v_output2' may result in a non-uniform value - let x_366 : vec4 = v_output2; - ^^^^^^^^^ - struct lightingInfo { diffuse : vec3, specular : vec3, @@ -334,7 +322,7 @@ fn main_1() { } let x_394 : vec2 = v_uv; let x_395 : vec2 = vCurrOffset; - let x_397 : vec4 = textureSample(TextureSamplerTexture, TextureSamplerSampler, (x_394 + x_395)); + let x_397 : vec4 = vec4(); currSampledHeight = x_397.w; let x_400 : f32 = currSampledHeight; let x_401 : f32 = currRayHeight; diff --git a/test/tint/vk-gl-cts/graphicsfuzz/barrier-in-loop-with-break/0-opt.spvasm b/test/tint/vk-gl-cts/graphicsfuzz/barrier-in-loop-with-break/0-opt.spvasm deleted file mode 100644 index ae7a96fc3d..0000000000 --- a/test/tint/vk-gl-cts/graphicsfuzz/barrier-in-loop-with-break/0-opt.spvasm +++ /dev/null @@ -1,125 +0,0 @@ - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint GLCompute %main "main" %gl_LocalInvocationID - OpExecutionMode %main LocalSize 16 1 1 - OpSource ESSL 310 - OpName %main "main" - OpName %lid "lid" - OpName %gl_LocalInvocationID "gl_LocalInvocationID" - OpName %val "val" - OpName %doesNotMatter "doesNotMatter" - OpMemberName %doesNotMatter 0 "global_seed" - OpMemberName %doesNotMatter 1 "data" - OpName %_ "" - OpName %i "i" - OpName %buf1 "buf1" - OpMemberName %buf1 0 "injectionSwitch" - OpName %__0 "" - OpDecorate %gl_LocalInvocationID BuiltIn LocalInvocationId - OpDecorate %_runtimearr_int ArrayStride 4 - OpMemberDecorate %doesNotMatter 0 Offset 0 - OpMemberDecorate %doesNotMatter 1 Offset 4 - OpDecorate %doesNotMatter BufferBlock - OpDecorate %_ DescriptorSet 0 - OpDecorate %_ Binding 0 - OpMemberDecorate %buf1 0 Offset 0 - OpDecorate %buf1 Block - OpDecorate %__0 DescriptorSet 0 - OpDecorate %__0 Binding 1 - OpDecorate %gl_WorkGroupSize BuiltIn WorkgroupSize - %void = OpTypeVoid - %14 = OpTypeFunction %void - %int = OpTypeInt 32 1 -%_ptr_Function_int = OpTypePointer Function %int - %uint = OpTypeInt 32 0 - %v3uint = OpTypeVector %uint 3 -%_ptr_Input_v3uint = OpTypePointer Input %v3uint -%gl_LocalInvocationID = OpVariable %_ptr_Input_v3uint Input - %uint_0 = OpConstant %uint 0 -%_ptr_Input_uint = OpTypePointer Input %uint -%_runtimearr_int = OpTypeRuntimeArray %int -%doesNotMatter = OpTypeStruct %int %_runtimearr_int -%_ptr_Uniform_doesNotMatter = OpTypePointer Uniform %doesNotMatter - %_ = OpVariable %_ptr_Uniform_doesNotMatter Uniform - %int_0 = OpConstant %int 0 -%_ptr_Uniform_int = OpTypePointer Uniform %int - %int_2 = OpConstant %int 2 - %bool = OpTypeBool - %int_1 = OpConstant %int 1 - %float = OpTypeFloat 32 - %v2float = OpTypeVector %float 2 - %buf1 = OpTypeStruct %v2float -%_ptr_Uniform_buf1 = OpTypePointer Uniform %buf1 - %__0 = OpVariable %_ptr_Uniform_buf1 Uniform -%_ptr_Uniform_float = OpTypePointer Uniform %float - %float_100 = OpConstant %float 100 - %uint_2 = OpConstant %uint 2 - %uint_264 = OpConstant %uint 264 - %int_42 = OpConstant %int 42 - %uint_16 = OpConstant %uint 16 - %uint_1 = OpConstant %uint 1 -%gl_WorkGroupSize = OpConstantComposite %v3uint %uint_16 %uint_1 %uint_1 - %main = OpFunction %void None %14 - %38 = OpLabel - %lid = OpVariable %_ptr_Function_int Function - %val = OpVariable %_ptr_Function_int Function - %i = OpVariable %_ptr_Function_int Function - %39 = OpAccessChain %_ptr_Input_uint %gl_LocalInvocationID %uint_0 - %40 = OpLoad %uint %39 - %41 = OpBitcast %int %40 - OpStore %lid %41 - %42 = OpAccessChain %_ptr_Uniform_int %_ %int_0 - %43 = OpLoad %int %42 - OpStore %val %43 - OpStore %i %int_0 - OpBranch %44 - %44 = OpLabel - OpLoopMerge %45 %46 None - OpBranch %47 - %47 = OpLabel - %48 = OpLoad %int %i - %49 = OpSLessThan %bool %48 %int_2 - OpBranchConditional %49 %50 %45 - %50 = OpLabel - %51 = OpLoad %int %lid - %52 = OpSGreaterThan %bool %51 %int_0 - OpSelectionMerge %53 None - OpBranchConditional %52 %54 %53 - %54 = OpLabel - %55 = OpLoad %int %lid - %56 = OpISub %int %55 %int_1 - %57 = OpAccessChain %_ptr_Uniform_int %_ %int_1 %56 - %58 = OpLoad %int %57 - %59 = OpLoad %int %val - %60 = OpIAdd %int %59 %58 - OpStore %val %60 - %61 = OpAccessChain %_ptr_Uniform_float %__0 %int_0 %uint_0 - %62 = OpLoad %float %61 - %63 = OpFOrdGreaterThan %bool %62 %float_100 - OpSelectionMerge %64 None - OpBranchConditional %63 %65 %64 - %65 = OpLabel - OpBranch %45 - %64 = OpLabel - OpBranch %53 - %53 = OpLabel - OpControlBarrier %uint_2 %uint_2 %uint_264 - OpBranch %46 - %46 = OpLabel - %66 = OpLoad %int %i - %67 = OpIAdd %int %66 %int_1 - OpStore %i %67 - OpBranch %44 - %45 = OpLabel - %68 = OpLoad %int %lid - %69 = OpIEqual %bool %68 %int_0 - OpSelectionMerge %70 None - OpBranchConditional %69 %71 %70 - %71 = OpLabel - %72 = OpAccessChain %_ptr_Uniform_int %_ %int_1 %int_0 - OpStore %72 %int_42 - OpBranch %70 - %70 = OpLabel - OpReturn - OpFunctionEnd diff --git a/test/tint/vk-gl-cts/graphicsfuzz/barrier-in-loop-with-break/0-opt.wgsl b/test/tint/vk-gl-cts/graphicsfuzz/barrier-in-loop-with-break/0-opt.wgsl deleted file mode 100644 index eb6d8beec9..0000000000 --- a/test/tint/vk-gl-cts/graphicsfuzz/barrier-in-loop-with-break/0-opt.wgsl +++ /dev/null @@ -1,62 +0,0 @@ -type RTArr = array; - -struct doesNotMatter { - global_seed : i32, - data : RTArr, -} - -struct buf1 { - injectionSwitch : vec2, -} - -var gl_LocalInvocationID : vec3; - -@group(0) @binding(0) var x_7 : doesNotMatter; - -@group(0) @binding(1) var x_10 : buf1; - -fn main_1() { - var lid : i32; - var val : i32; - var i : i32; - let x_40 : u32 = gl_LocalInvocationID.x; - lid = bitcast(x_40); - let x_43 : i32 = x_7.global_seed; - val = x_43; - i = 0; - loop { - let x_48 : i32 = i; - if ((x_48 < 2)) { - } else { - break; - } - let x_51 : i32 = lid; - if ((x_51 > 0)) { - let x_55 : i32 = lid; - let x_58 : i32 = x_7.data[(x_55 - 1)]; - let x_59 : i32 = val; - val = (x_59 + x_58); - let x_62 : f32 = x_10.injectionSwitch.x; - if ((x_62 > 100.0)) { - break; - } - } - workgroupBarrier(); - - continuing { - let x_66 : i32 = i; - i = (x_66 + 1); - } - } - let x_68 : i32 = lid; - if ((x_68 == 0)) { - x_7.data[0] = 42; - } - return; -} - -@compute @workgroup_size(16, 1, 1) -fn main(@builtin(local_invocation_id) gl_LocalInvocationID_param : vec3) { - gl_LocalInvocationID = gl_LocalInvocationID_param; - main_1(); -} diff --git a/test/tint/vk-gl-cts/graphicsfuzz/cov-inst-combine-mul-div-rem-if-undefined-divide-mix/0-opt.spvasm b/test/tint/vk-gl-cts/graphicsfuzz/cov-inst-combine-mul-div-rem-if-undefined-divide-mix/0-opt.spvasm deleted file mode 100644 index e4220be5d0..0000000000 --- a/test/tint/vk-gl-cts/graphicsfuzz/cov-inst-combine-mul-div-rem-if-undefined-divide-mix/0-opt.spvasm +++ /dev/null @@ -1,152 +0,0 @@ - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint Fragment %main "main" %_GLF_color %gl_FragCoord - OpExecutionMode %main OriginUpperLeft - OpSource ESSL 310 - OpName %main "main" - OpName %f1_f1_ "f1(f1;" - OpName %a "a" - OpName %_GLF_color "_GLF_color" - OpName %buf0 "buf0" - OpMemberName %buf0 0 "_GLF_uniform_int_values" - OpName %_ "" - OpName %gl_FragCoord "gl_FragCoord" - OpName %buf1 "buf1" - OpMemberName %buf1 0 "_GLF_uniform_float_values" - OpName %__0 "" - OpName %v2 "v2" - OpName %a_0 "a" - OpName %param "param" - OpDecorate %_GLF_color Location 0 - OpDecorate %_arr_int_uint_2 ArrayStride 16 - OpMemberDecorate %buf0 0 Offset 0 - OpDecorate %buf0 Block - OpDecorate %_ DescriptorSet 0 - OpDecorate %_ Binding 0 - OpDecorate %gl_FragCoord BuiltIn FragCoord - OpDecorate %_arr_float_uint_2 ArrayStride 16 - OpMemberDecorate %buf1 0 Offset 0 - OpDecorate %buf1 Block - OpDecorate %__0 DescriptorSet 0 - OpDecorate %__0 Binding 1 - %void = OpTypeVoid - %17 = OpTypeFunction %void - %float = OpTypeFloat 32 -%_ptr_Function_float = OpTypePointer Function %float - %20 = OpTypeFunction %float %_ptr_Function_float - %v4float = OpTypeVector %float 4 -%_ptr_Output_v4float = OpTypePointer Output %v4float - %_GLF_color = OpVariable %_ptr_Output_v4float Output - %int = OpTypeInt 32 1 - %uint = OpTypeInt 32 0 - %uint_2 = OpConstant %uint 2 -%_arr_int_uint_2 = OpTypeArray %int %uint_2 - %buf0 = OpTypeStruct %_arr_int_uint_2 -%_ptr_Uniform_buf0 = OpTypePointer Uniform %buf0 - %_ = OpVariable %_ptr_Uniform_buf0 Uniform - %int_0 = OpConstant %int 0 -%_ptr_Uniform_int = OpTypePointer Uniform %int - %int_1 = OpConstant %int 1 -%_ptr_Input_v4float = OpTypePointer Input %v4float -%gl_FragCoord = OpVariable %_ptr_Input_v4float Input - %uint_0 = OpConstant %uint 0 -%_ptr_Input_float = OpTypePointer Input %float -%_arr_float_uint_2 = OpTypeArray %float %uint_2 - %buf1 = OpTypeStruct %_arr_float_uint_2 -%_ptr_Uniform_buf1 = OpTypePointer Uniform %buf1 - %__0 = OpVariable %_ptr_Uniform_buf1 Uniform -%_ptr_Uniform_float = OpTypePointer Uniform %float - %bool = OpTypeBool -%_ptr_Function_v4float = OpTypePointer Function %v4float - %float_1 = OpConstant %float 1 - %v3float = OpTypeVector %float 3 - %main = OpFunction %void None %17 - %39 = OpLabel - %v2 = OpVariable %_ptr_Function_v4float Function - %a_0 = OpVariable %_ptr_Function_float Function - %40 = OpVariable %_ptr_Function_float Function - %param = OpVariable %_ptr_Function_float Function - %41 = OpAccessChain %_ptr_Uniform_int %_ %int_0 %int_0 - %42 = OpLoad %int %41 - %43 = OpConvertSToF %float %42 - %44 = OpAccessChain %_ptr_Uniform_int %_ %int_0 %int_1 - %45 = OpLoad %int %44 - %46 = OpConvertSToF %float %45 - %47 = OpAccessChain %_ptr_Uniform_int %_ %int_0 %int_1 - %48 = OpLoad %int %47 - %49 = OpConvertSToF %float %48 - %50 = OpAccessChain %_ptr_Uniform_int %_ %int_0 %int_0 - %51 = OpLoad %int %50 - %52 = OpConvertSToF %float %51 - %53 = OpCompositeConstruct %v4float %43 %46 %49 %52 - OpStore %_GLF_color %53 - %54 = OpAccessChain %_ptr_Input_float %gl_FragCoord %uint_0 - %55 = OpLoad %float %54 - %56 = OpAccessChain %_ptr_Uniform_float %__0 %int_0 %int_1 - %57 = OpLoad %float %56 - %58 = OpFOrdLessThan %bool %55 %57 - OpSelectionMerge %59 None - OpBranchConditional %58 %60 %59 - %60 = OpLabel - %61 = OpAccessChain %_ptr_Function_float %v2 %uint_0 - %62 = OpLoad %float %61 - %63 = OpFOrdLessThan %bool %62 %float_1 - %64 = OpLogicalNot %bool %63 - OpSelectionMerge %65 None - OpBranchConditional %64 %66 %65 - %66 = OpLabel - %67 = OpAccessChain %_ptr_Uniform_float %__0 %int_0 %int_1 - %68 = OpLoad %float %67 - %69 = OpAccessChain %_ptr_Uniform_float %__0 %int_0 %int_1 - %70 = OpLoad %float %69 - %71 = OpAccessChain %_ptr_Uniform_float %__0 %int_0 %int_0 - %72 = OpLoad %float %71 - %73 = OpFOrdGreaterThan %bool %70 %72 - OpSelectionMerge %74 None - OpBranchConditional %73 %75 %76 - %75 = OpLabel - %77 = OpAccessChain %_ptr_Uniform_float %__0 %int_0 %int_0 - %78 = OpLoad %float %77 - OpStore %param %78 - %79 = OpFunctionCall %float %f1_f1_ %param - OpStore %40 %79 - OpBranch %74 - %76 = OpLabel - %80 = OpAccessChain %_ptr_Uniform_float %__0 %int_0 %int_0 - %81 = OpLoad %float %80 - OpStore %40 %81 - OpBranch %74 - %74 = OpLabel - %82 = OpLoad %float %40 - %83 = OpFDiv %float %68 %82 - OpStore %a_0 %83 - %84 = OpAccessChain %_ptr_Uniform_float %__0 %int_0 %int_0 - %85 = OpLoad %float %84 - %86 = OpCompositeConstruct %v3float %85 %85 %85 - %87 = OpAccessChain %_ptr_Uniform_float %__0 %int_0 %int_0 - %88 = OpLoad %float %87 - %89 = OpCompositeConstruct %v3float %88 %88 %88 - %90 = OpLoad %float %a_0 - %91 = OpCompositeConstruct %v3float %90 %90 %90 - %92 = OpExtInst %v3float %1 FMix %86 %89 %91 - %93 = OpAccessChain %_ptr_Uniform_float %__0 %int_0 %int_1 - %94 = OpLoad %float %93 - %95 = OpCompositeExtract %float %92 0 - %96 = OpCompositeExtract %float %92 1 - %97 = OpCompositeExtract %float %92 2 - %98 = OpCompositeConstruct %v4float %95 %96 %97 %94 - OpStore %_GLF_color %98 - OpBranch %65 - %65 = OpLabel - OpBranch %59 - %59 = OpLabel - OpReturn - OpFunctionEnd - %f1_f1_ = OpFunction %float None %20 - %a = OpFunctionParameter %_ptr_Function_float - %99 = OpLabel - %100 = OpLoad %float %a - %101 = OpDPdx %float %100 - OpReturnValue %101 - OpFunctionEnd diff --git a/test/tint/vk-gl-cts/graphicsfuzz/cov-inst-combine-mul-div-rem-if-undefined-divide-mix/0-opt.wgsl b/test/tint/vk-gl-cts/graphicsfuzz/cov-inst-combine-mul-div-rem-if-undefined-divide-mix/0-opt.wgsl deleted file mode 100644 index a50ef0ddf6..0000000000 --- a/test/tint/vk-gl-cts/graphicsfuzz/cov-inst-combine-mul-div-rem-if-undefined-divide-mix/0-opt.wgsl +++ /dev/null @@ -1,86 +0,0 @@ -struct strided_arr { - @size(16) - el : i32, -} - -type Arr = array; - -struct buf0 { - x_GLF_uniform_int_values : Arr, -} - -struct strided_arr_1 { - @size(16) - el : f32, -} - -type Arr_1 = array; - -struct buf1 { - x_GLF_uniform_float_values : Arr_1, -} - -var x_GLF_color : vec4; - -@group(0) @binding(0) var x_8 : buf0; - -var gl_FragCoord : vec4; - -@group(0) @binding(1) var x_10 : buf1; - -fn f1_f1_(a : ptr) -> f32 { - let x_100 : f32 = *(a); - return dpdx(x_100); -} - -fn main_1() { - var v2 : vec4; - var a_1 : f32; - var x_40 : f32; - var param : f32; - let x_42 : i32 = x_8.x_GLF_uniform_int_values[0].el; - let x_45 : i32 = x_8.x_GLF_uniform_int_values[1].el; - let x_48 : i32 = x_8.x_GLF_uniform_int_values[1].el; - let x_51 : i32 = x_8.x_GLF_uniform_int_values[0].el; - x_GLF_color = vec4(f32(x_42), f32(x_45), f32(x_48), f32(x_51)); - let x_55 : f32 = gl_FragCoord.x; - let x_57 : f32 = x_10.x_GLF_uniform_float_values[1].el; - if ((x_55 < x_57)) { - let x_62 : f32 = v2.x; - if (!((x_62 < 1.0))) { - let x_68 : f32 = x_10.x_GLF_uniform_float_values[1].el; - let x_70 : f32 = x_10.x_GLF_uniform_float_values[1].el; - let x_72 : f32 = x_10.x_GLF_uniform_float_values[0].el; - if ((x_70 > x_72)) { - let x_78 : f32 = x_10.x_GLF_uniform_float_values[0].el; - param = x_78; - let x_79 : f32 = f1_f1_(&(param)); - x_40 = x_79; - } else { - let x_81 : f32 = x_10.x_GLF_uniform_float_values[0].el; - x_40 = x_81; - } - let x_82 : f32 = x_40; - a_1 = (x_68 / x_82); - let x_85 : f32 = x_10.x_GLF_uniform_float_values[0].el; - let x_88 : f32 = x_10.x_GLF_uniform_float_values[0].el; - let x_90 : f32 = a_1; - let x_92 : vec3 = mix(vec3(x_85, x_85, x_85), vec3(x_88, x_88, x_88), vec3(x_90, x_90, x_90)); - let x_94 : f32 = x_10.x_GLF_uniform_float_values[1].el; - x_GLF_color = vec4(x_92.x, x_92.y, x_92.z, x_94); - } - } - return; -} - -struct main_out { - @location(0) - x_GLF_color_1 : vec4, -} - -@fragment -fn main(@builtin(position) gl_FragCoord_param : vec4) -> main_out { - gl_FragCoord = gl_FragCoord_param; - main_1(); - return main_out(x_GLF_color); -} diff --git a/test/tint/vk-gl-cts/graphicsfuzz/two-for-loops-with-barrier-function/0-opt.spvasm b/test/tint/vk-gl-cts/graphicsfuzz/two-for-loops-with-barrier-function/0-opt.spvasm deleted file mode 100644 index f4d1bab486..0000000000 --- a/test/tint/vk-gl-cts/graphicsfuzz/two-for-loops-with-barrier-function/0-opt.spvasm +++ /dev/null @@ -1,184 +0,0 @@ - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint GLCompute %main "main" - OpExecutionMode %main LocalSize 1 18 6 - OpSource ESSL 310 - OpName %main "main" - OpName %GLF_live2_looplimiter1 "GLF_live2_looplimiter1" - OpName %i "i" - OpName %j "j" - OpName %GLF_live2gl_FragCoord "GLF_live2gl_FragCoord" - OpName %GLF_dead3x "GLF_dead3x" - OpName %buf0 "buf0" - OpMemberName %buf0 0 "injectionSwitch" - OpName %_ "" - OpName %GLF_dead3k "GLF_dead3k" - OpName %doesNotMatter "doesNotMatter" - OpMemberName %doesNotMatter 0 "_compute_data" - OpName %__0 "" - OpDecorate %GLF_live2gl_FragCoord RelaxedPrecision - OpDecorate %13 RelaxedPrecision - OpMemberDecorate %buf0 0 Offset 0 - OpDecorate %buf0 Block - OpDecorate %_ DescriptorSet 0 - OpDecorate %_ Binding 1 - OpDecorate %14 RelaxedPrecision - OpDecorate %15 RelaxedPrecision - OpDecorate %16 RelaxedPrecision - OpDecorate %_runtimearr_uint ArrayStride 4 - OpMemberDecorate %doesNotMatter 0 Offset 0 - OpDecorate %doesNotMatter BufferBlock - OpDecorate %__0 DescriptorSet 0 - OpDecorate %__0 Binding 0 - OpDecorate %gl_WorkGroupSize BuiltIn WorkgroupSize - %void = OpTypeVoid - %20 = OpTypeFunction %void - %int = OpTypeInt 32 1 -%_ptr_Function_int = OpTypePointer Function %int - %int_0 = OpConstant %int 0 - %int_1 = OpConstant %int 1 - %bool = OpTypeBool - %int_3 = OpConstant %int 3 - %float = OpTypeFloat 32 - %v4float = OpTypeVector %float 4 -%_ptr_Private_v4float = OpTypePointer Private %v4float -%GLF_live2gl_FragCoord = OpVariable %_ptr_Private_v4float Private - %uint = OpTypeInt 32 0 - %uint_0 = OpConstant %uint 0 -%_ptr_Private_float = OpTypePointer Private %float - %int_120 = OpConstant %int 120 - %uint_2 = OpConstant %uint 2 - %uint_264 = OpConstant %uint 264 -%_ptr_Function_float = OpTypePointer Function %float - %v2float = OpTypeVector %float 2 - %buf0 = OpTypeStruct %v2float -%_ptr_Uniform_buf0 = OpTypePointer Uniform %buf0 - %_ = OpVariable %_ptr_Uniform_buf0 Uniform -%_ptr_Uniform_float = OpTypePointer Uniform %float - %uint_1 = OpConstant %uint 1 - %float_0 = OpConstant %float 0 - %int_2 = OpConstant %int 2 - %float_4 = OpConstant %float 4 -%_runtimearr_uint = OpTypeRuntimeArray %uint -%doesNotMatter = OpTypeStruct %_runtimearr_uint -%_ptr_Uniform_doesNotMatter = OpTypePointer Uniform %doesNotMatter - %__0 = OpVariable %_ptr_Uniform_doesNotMatter Uniform - %uint_42 = OpConstant %uint 42 -%_ptr_Uniform_uint = OpTypePointer Uniform %uint - %v3uint = OpTypeVector %uint 3 - %uint_18 = OpConstant %uint 18 - %uint_6 = OpConstant %uint 6 -%gl_WorkGroupSize = OpConstantComposite %v3uint %uint_1 %uint_18 %uint_6 - %main = OpFunction %void None %20 - %50 = OpLabel -%GLF_live2_looplimiter1 = OpVariable %_ptr_Function_int Function - %i = OpVariable %_ptr_Function_int Function - %j = OpVariable %_ptr_Function_int Function - %GLF_dead3x = OpVariable %_ptr_Function_float Function - %51 = OpVariable %_ptr_Function_float Function - %GLF_dead3k = OpVariable %_ptr_Function_int Function - OpStore %GLF_live2_looplimiter1 %int_0 - OpStore %i %int_0 - OpBranch %52 - %52 = OpLabel - OpLoopMerge %53 %54 None - OpBranch %55 - %55 = OpLabel - %56 = OpLoad %int %i - %57 = OpSLessThan %bool %56 %int_1 - OpBranchConditional %57 %58 %53 - %58 = OpLabel - %59 = OpLoad %int %GLF_live2_looplimiter1 - %60 = OpSGreaterThanEqual %bool %59 %int_3 - OpSelectionMerge %61 None - OpBranchConditional %60 %62 %61 - %62 = OpLabel - OpStore %j %int_0 - OpBranch %63 - %63 = OpLabel - OpLoopMerge %64 %65 None - OpBranch %66 - %66 = OpLabel - %67 = OpLoad %int %j - %68 = OpSLessThan %bool %67 %int_1 - OpBranchConditional %68 %69 %64 - %69 = OpLabel - %70 = OpAccessChain %_ptr_Private_float %GLF_live2gl_FragCoord %uint_0 - %13 = OpLoad %float %70 - %71 = OpConvertFToS %int %13 - %72 = OpSLessThan %bool %71 %int_120 - OpSelectionMerge %73 None - OpBranchConditional %72 %74 %75 - %74 = OpLabel - OpBranch %73 - %75 = OpLabel - OpControlBarrier %uint_2 %uint_2 %uint_264 - OpBranch %73 - %73 = OpLabel - OpBranch %65 - %65 = OpLabel - %76 = OpLoad %int %j - %77 = OpIAdd %int %76 %int_1 - OpStore %j %77 - OpBranch %63 - %64 = OpLabel - OpBranch %53 - %61 = OpLabel - OpBranch %54 - %54 = OpLabel - %78 = OpLoad %int %i - %79 = OpIAdd %int %78 %int_1 - OpStore %i %79 - OpBranch %52 - %53 = OpLabel - %80 = OpAccessChain %_ptr_Uniform_float %_ %int_0 %uint_0 - %81 = OpLoad %float %80 - %82 = OpAccessChain %_ptr_Uniform_float %_ %int_0 %uint_1 - %83 = OpLoad %float %82 - %84 = OpFOrdGreaterThan %bool %81 %83 - OpSelectionMerge %85 None - OpBranchConditional %84 %86 %87 - %86 = OpLabel - %88 = OpAccessChain %_ptr_Private_float %GLF_live2gl_FragCoord %uint_0 - %14 = OpLoad %float %88 - OpStore %51 %14 - OpBranch %85 - %87 = OpLabel - OpStore %51 %float_0 - OpBranch %85 - %85 = OpLabel - %15 = OpLoad %float %51 - OpStore %GLF_dead3x %15 - OpStore %GLF_dead3k %int_0 - OpBranch %89 - %89 = OpLabel - OpLoopMerge %90 %91 None - OpBranch %92 - %92 = OpLabel - %93 = OpLoad %int %GLF_dead3k - %94 = OpSLessThan %bool %93 %int_2 - OpBranchConditional %94 %95 %90 - %95 = OpLabel - %96 = OpLoad %float %GLF_dead3x - %97 = OpFOrdGreaterThan %bool %96 %float_4 - OpSelectionMerge %98 None - OpBranchConditional %97 %99 %98 - %99 = OpLabel - OpBranch %90 - %98 = OpLabel - %100 = OpAccessChain %_ptr_Private_float %GLF_live2gl_FragCoord %uint_0 - %16 = OpLoad %float %100 - OpStore %GLF_dead3x %16 - OpControlBarrier %uint_2 %uint_2 %uint_264 - OpBranch %91 - %91 = OpLabel - %101 = OpLoad %int %GLF_dead3k - %102 = OpIAdd %int %101 %int_1 - OpStore %GLF_dead3k %102 - OpBranch %89 - %90 = OpLabel - %103 = OpAccessChain %_ptr_Uniform_uint %__0 %int_0 %int_0 - OpStore %103 %uint_42 - OpReturn - OpFunctionEnd diff --git a/test/tint/vk-gl-cts/graphicsfuzz/two-for-loops-with-barrier-function/0-opt.wgsl b/test/tint/vk-gl-cts/graphicsfuzz/two-for-loops-with-barrier-function/0-opt.wgsl deleted file mode 100644 index 56be7c38dd..0000000000 --- a/test/tint/vk-gl-cts/graphicsfuzz/two-for-loops-with-barrier-function/0-opt.wgsl +++ /dev/null @@ -1,97 +0,0 @@ -struct buf0 { - injectionSwitch : vec2, -} - -type RTArr = array; - -struct doesNotMatter { - x_compute_data : RTArr, -} - -var GLF_live2gl_FragCoord : vec4; - -@group(0) @binding(1) var x_9 : buf0; - -@group(0) @binding(0) var x_12 : doesNotMatter; - -fn main_1() { - var GLF_live2_looplimiter1 : i32; - var i : i32; - var j : i32; - var GLF_dead3x : f32; - var x_51 : f32; - var GLF_dead3k : i32; - GLF_live2_looplimiter1 = 0; - i = 0; - loop { - let x_56 : i32 = i; - if ((x_56 < 1)) { - } else { - break; - } - let x_59 : i32 = GLF_live2_looplimiter1; - if ((x_59 >= 3)) { - j = 0; - loop { - let x_67 : i32 = j; - if ((x_67 < 1)) { - } else { - break; - } - let x_13 : f32 = GLF_live2gl_FragCoord.x; - if ((i32(x_13) < 120)) { - } else { - workgroupBarrier(); - } - - continuing { - let x_76 : i32 = j; - j = (x_76 + 1); - } - } - break; - } - - continuing { - let x_78 : i32 = i; - i = (x_78 + 1); - } - } - let x_81 : f32 = x_9.injectionSwitch.x; - let x_83 : f32 = x_9.injectionSwitch.y; - if ((x_81 > x_83)) { - let x_14 : f32 = GLF_live2gl_FragCoord.x; - x_51 = x_14; - } else { - x_51 = 0.0; - } - let x_15 : f32 = x_51; - GLF_dead3x = x_15; - GLF_dead3k = 0; - loop { - let x_93 : i32 = GLF_dead3k; - if ((x_93 < 2)) { - } else { - break; - } - let x_96 : f32 = GLF_dead3x; - if ((x_96 > 4.0)) { - break; - } - let x_16 : f32 = GLF_live2gl_FragCoord.x; - GLF_dead3x = x_16; - workgroupBarrier(); - - continuing { - let x_101 : i32 = GLF_dead3k; - GLF_dead3k = (x_101 + 1); - } - } - x_12.x_compute_data[0] = 42u; - return; -} - -@compute @workgroup_size(1, 18, 6) -fn main() { - main_1(); -} diff --git a/test/tint/vk-gl-cts/graphicsfuzz/unreachable-barrier-in-loops/0-opt.spvasm b/test/tint/vk-gl-cts/graphicsfuzz/unreachable-barrier-in-loops/0-opt.spvasm deleted file mode 100644 index d6a929a542..0000000000 --- a/test/tint/vk-gl-cts/graphicsfuzz/unreachable-barrier-in-loops/0-opt.spvasm +++ /dev/null @@ -1,269 +0,0 @@ - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint GLCompute %main "main" %gl_GlobalInvocationID - OpExecutionMode %main LocalSize 1 1 1 - OpSource ESSL 310 - OpName %main "main" - OpName %A "A" - OpName %i "i" - OpName %gl_GlobalInvocationID "gl_GlobalInvocationID" - OpName %value "value" - OpName %m "m" - OpName %l "l" - OpName %buf1 "buf1" - OpMemberName %buf1 0 "injectionSwitch" - OpName %_ "" - OpName %n "n" - OpName %buf2 "buf2" - OpMemberName %buf2 0 "resolution" - OpName %__0 "" - OpName %doesNotMatter "doesNotMatter" - OpMemberName %doesNotMatter 0 "_compute_data" - OpName %__1 "" - OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId - OpMemberDecorate %buf1 0 Offset 0 - OpDecorate %buf1 Block - OpDecorate %_ DescriptorSet 0 - OpDecorate %_ Binding 1 - OpMemberDecorate %buf2 0 Offset 0 - OpDecorate %buf2 Block - OpDecorate %__0 DescriptorSet 0 - OpDecorate %__0 Binding 2 - OpDecorate %_runtimearr_int ArrayStride 4 - OpMemberDecorate %doesNotMatter 0 Offset 0 - OpDecorate %doesNotMatter BufferBlock - OpDecorate %__1 DescriptorSet 0 - OpDecorate %__1 Binding 0 - %void = OpTypeVoid - %18 = OpTypeFunction %void - %float = OpTypeFloat 32 - %uint = OpTypeInt 32 0 - %uint_1 = OpConstant %uint 1 -%_arr_float_uint_1 = OpTypeArray %float %uint_1 -%_ptr_Function__arr_float_uint_1 = OpTypePointer Function %_arr_float_uint_1 - %int = OpTypeInt 32 1 - %int_0 = OpConstant %int 0 - %float_0 = OpConstant %float 0 -%_ptr_Function_float = OpTypePointer Function %float -%_ptr_Function_int = OpTypePointer Function %int - %int_50 = OpConstant %int 50 - %bool = OpTypeBool - %int_1 = OpConstant %int 1 - %v3uint = OpTypeVector %uint 3 -%_ptr_Input_v3uint = OpTypePointer Input %v3uint -%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input - %uint_0 = OpConstant %uint 0 -%_ptr_Input_uint = OpTypePointer Input %uint - %uint_100 = OpConstant %uint 100 - %v4float = OpTypeVector %float 4 -%_ptr_Function_v4float = OpTypePointer Function %v4float - %float_1 = OpConstant %float 1 - %40 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_1 - %v2float = OpTypeVector %float 2 - %buf1 = OpTypeStruct %v2float -%_ptr_Uniform_buf1 = OpTypePointer Uniform %buf1 - %_ = OpVariable %_ptr_Uniform_buf1 Uniform -%_ptr_Uniform_float = OpTypePointer Uniform %float - %uint_2 = OpConstant %uint 2 - %uint_264 = OpConstant %uint 264 - %uint_120 = OpConstant %uint 120 - %buf2 = OpTypeStruct %v2float -%_ptr_Uniform_buf2 = OpTypePointer Uniform %buf2 - %__0 = OpVariable %_ptr_Uniform_buf2 Uniform - %false = OpConstantFalse %bool -%_runtimearr_int = OpTypeRuntimeArray %int -%doesNotMatter = OpTypeStruct %_runtimearr_int -%_ptr_Uniform_doesNotMatter = OpTypePointer Uniform %doesNotMatter - %__1 = OpVariable %_ptr_Uniform_doesNotMatter Uniform -%_ptr_Uniform_int = OpTypePointer Uniform %int - %int_2 = OpConstant %int 2 - %int_3 = OpConstant %int 3 - %uint_3 = OpConstant %uint 3 - %main = OpFunction %void None %18 - %54 = OpLabel - %A = OpVariable %_ptr_Function__arr_float_uint_1 Function - %i = OpVariable %_ptr_Function_int Function - %value = OpVariable %_ptr_Function_v4float Function - %m = OpVariable %_ptr_Function_int Function - %l = OpVariable %_ptr_Function_int Function - %n = OpVariable %_ptr_Function_int Function - %55 = OpAccessChain %_ptr_Function_float %A %int_0 - OpStore %55 %float_0 - OpStore %i %int_0 - OpBranch %56 - %56 = OpLabel - OpLoopMerge %57 %58 None - OpBranch %59 - %59 = OpLabel - %60 = OpLoad %int %i - %61 = OpSLessThan %bool %60 %int_50 - OpBranchConditional %61 %62 %57 - %62 = OpLabel - %63 = OpLoad %int %i - %64 = OpSGreaterThan %bool %63 %int_0 - OpSelectionMerge %65 None - OpBranchConditional %64 %66 %65 - %66 = OpLabel - %67 = OpAccessChain %_ptr_Function_float %A %int_0 - %68 = OpLoad %float %67 - %69 = OpAccessChain %_ptr_Function_float %A %int_0 - %70 = OpLoad %float %69 - %71 = OpFAdd %float %70 %68 - %72 = OpAccessChain %_ptr_Function_float %A %int_0 - OpStore %72 %71 - OpBranch %65 - %65 = OpLabel - OpBranch %58 - %58 = OpLabel - %73 = OpLoad %int %i - %74 = OpIAdd %int %73 %int_1 - OpStore %i %74 - OpBranch %56 - %57 = OpLabel - OpBranch %75 - %75 = OpLabel - OpLoopMerge %76 %77 None - OpBranch %78 - %78 = OpLabel - %79 = OpAccessChain %_ptr_Input_uint %gl_GlobalInvocationID %uint_0 - %80 = OpLoad %uint %79 - %81 = OpULessThan %bool %80 %uint_100 - OpSelectionMerge %82 None - OpBranchConditional %81 %83 %84 - %83 = OpLabel - OpStore %value %40 - OpStore %m %int_0 - OpBranch %85 - %85 = OpLabel - OpLoopMerge %86 %87 None - OpBranch %88 - %88 = OpLabel - %89 = OpLoad %int %m - %90 = OpSLessThan %bool %89 %int_1 - OpBranchConditional %90 %91 %86 - %91 = OpLabel - OpStore %l %int_0 - OpBranch %92 - %92 = OpLabel - OpLoopMerge %93 %94 None - OpBranch %95 - %95 = OpLabel - %96 = OpLoad %int %l - %97 = OpSLessThan %bool %96 %int_1 - OpBranchConditional %97 %98 %93 - %98 = OpLabel - %99 = OpAccessChain %_ptr_Uniform_float %_ %int_0 %uint_0 - %100 = OpLoad %float %99 - %101 = OpAccessChain %_ptr_Uniform_float %_ %int_0 %uint_1 - %102 = OpLoad %float %101 - %103 = OpFOrdGreaterThan %bool %100 %102 - OpSelectionMerge %104 None - OpBranchConditional %103 %105 %104 - %105 = OpLabel - OpReturn - %104 = OpLabel - OpBranch %94 - %94 = OpLabel - %106 = OpLoad %int %l - %107 = OpIAdd %int %106 %int_1 - OpStore %l %107 - OpBranch %92 - %93 = OpLabel - OpBranch %87 - %87 = OpLabel - %108 = OpLoad %int %m - %109 = OpIAdd %int %108 %int_1 - OpStore %m %109 - OpBranch %85 - %86 = OpLabel - OpStore %n %int_0 - OpBranch %110 - %110 = OpLabel - OpLoopMerge %111 %112 None - OpBranch %113 - %113 = OpLabel - %114 = OpLoad %int %n - %115 = OpSLessThan %bool %114 %int_1 - OpBranchConditional %115 %116 %111 - %116 = OpLabel - %117 = OpAccessChain %_ptr_Uniform_float %_ %int_0 %uint_0 - %118 = OpLoad %float %117 - %119 = OpAccessChain %_ptr_Uniform_float %_ %int_0 %uint_1 - %120 = OpLoad %float %119 - %121 = OpFOrdGreaterThan %bool %118 %120 - OpSelectionMerge %122 None - OpBranchConditional %121 %123 %122 - %123 = OpLabel - OpControlBarrier %uint_2 %uint_2 %uint_264 - OpBranch %122 - %122 = OpLabel - OpBranch %112 - %112 = OpLabel - %124 = OpLoad %int %n - %125 = OpIAdd %int %124 %int_1 - OpStore %n %125 - OpBranch %110 - %111 = OpLabel - OpBranch %82 - %84 = OpLabel - %126 = OpAccessChain %_ptr_Input_uint %gl_GlobalInvocationID %uint_0 - %127 = OpLoad %uint %126 - %128 = OpULessThan %bool %127 %uint_120 - OpSelectionMerge %129 None - OpBranchConditional %128 %130 %131 - %130 = OpLabel - %132 = OpAccessChain %_ptr_Function_float %A %int_0 - %133 = OpLoad %float %132 - %134 = OpAccessChain %_ptr_Uniform_float %__0 %int_0 %uint_0 - %135 = OpLoad %float %134 - %136 = OpFDiv %float %133 %135 - %137 = OpAccessChain %_ptr_Function_float %A %int_0 - %138 = OpLoad %float %137 - %139 = OpAccessChain %_ptr_Uniform_float %__0 %int_0 %uint_1 - %140 = OpLoad %float %139 - %141 = OpFDiv %float %138 %140 - %142 = OpCompositeConstruct %v4float %136 %141 %float_0 %float_1 - OpStore %value %142 - OpBranch %129 - %131 = OpLabel - %143 = OpAccessChain %_ptr_Uniform_float %_ %int_0 %uint_0 - %144 = OpLoad %float %143 - %145 = OpAccessChain %_ptr_Uniform_float %_ %int_0 %uint_1 - %146 = OpLoad %float %145 - %147 = OpFOrdGreaterThan %bool %144 %146 - OpSelectionMerge %148 None - OpBranchConditional %147 %149 %148 - %149 = OpLabel - OpBranch %77 - %148 = OpLabel - OpBranch %129 - %129 = OpLabel - OpBranch %82 - %82 = OpLabel - OpBranch %77 - %77 = OpLabel - OpBranchConditional %false %75 %76 - %76 = OpLabel - %150 = OpAccessChain %_ptr_Function_float %value %uint_0 - %151 = OpLoad %float %150 - %152 = OpConvertFToS %int %151 - %153 = OpAccessChain %_ptr_Uniform_int %__1 %int_0 %int_0 - OpStore %153 %152 - %154 = OpAccessChain %_ptr_Function_float %value %uint_1 - %155 = OpLoad %float %154 - %156 = OpConvertFToS %int %155 - %157 = OpAccessChain %_ptr_Uniform_int %__1 %int_0 %int_1 - OpStore %157 %156 - %158 = OpAccessChain %_ptr_Function_float %value %uint_2 - %159 = OpLoad %float %158 - %160 = OpConvertFToS %int %159 - %161 = OpAccessChain %_ptr_Uniform_int %__1 %int_0 %int_2 - OpStore %161 %160 - %162 = OpAccessChain %_ptr_Function_float %value %uint_3 - %163 = OpLoad %float %162 - %164 = OpConvertFToS %int %163 - %165 = OpAccessChain %_ptr_Uniform_int %__1 %int_0 %int_3 - OpStore %165 %164 - OpReturn - OpFunctionEnd diff --git a/test/tint/vk-gl-cts/graphicsfuzz/unreachable-barrier-in-loops/0-opt.wgsl b/test/tint/vk-gl-cts/graphicsfuzz/unreachable-barrier-in-loops/0-opt.wgsl deleted file mode 100644 index c3bc1bf4c2..0000000000 --- a/test/tint/vk-gl-cts/graphicsfuzz/unreachable-barrier-in-loops/0-opt.wgsl +++ /dev/null @@ -1,142 +0,0 @@ -struct buf1 { - injectionSwitch : vec2, -} - -struct buf2 { - resolution : vec2, -} - -type RTArr = array; - -struct doesNotMatter { - x_compute_data : RTArr, -} - -var gl_GlobalInvocationID : vec3; - -@group(0) @binding(1) var x_10 : buf1; - -@group(0) @binding(2) var x_13 : buf2; - -@group(0) @binding(0) var x_15 : doesNotMatter; - -fn main_1() { - var A : array; - var i : i32; - var value : vec4; - var m : i32; - var l : i32; - var n : i32; - A[0] = 0.0; - i = 0; - loop { - let x_60 : i32 = i; - if ((x_60 < 50)) { - } else { - break; - } - let x_63 : i32 = i; - if ((x_63 > 0)) { - let x_68 : f32 = A[0]; - let x_70 : f32 = A[0]; - A[0] = (x_70 + x_68); - } - - continuing { - let x_73 : i32 = i; - i = (x_73 + 1); - } - } - loop { - let x_80 : u32 = gl_GlobalInvocationID.x; - if ((x_80 < 100u)) { - value = vec4(0.0, 0.0, 0.0, 1.0); - m = 0; - loop { - let x_89 : i32 = m; - if ((x_89 < 1)) { - } else { - break; - } - l = 0; - loop { - let x_96 : i32 = l; - if ((x_96 < 1)) { - } else { - break; - } - let x_100 : f32 = x_10.injectionSwitch.x; - let x_102 : f32 = x_10.injectionSwitch.y; - if ((x_100 > x_102)) { - return; - } - - continuing { - let x_106 : i32 = l; - l = (x_106 + 1); - } - } - - continuing { - let x_108 : i32 = m; - m = (x_108 + 1); - } - } - n = 0; - loop { - let x_114 : i32 = n; - if ((x_114 < 1)) { - } else { - break; - } - let x_118 : f32 = x_10.injectionSwitch.x; - let x_120 : f32 = x_10.injectionSwitch.y; - if ((x_118 > x_120)) { - workgroupBarrier(); - } - - continuing { - let x_124 : i32 = n; - n = (x_124 + 1); - } - } - } else { - let x_127 : u32 = gl_GlobalInvocationID.x; - if ((x_127 < 120u)) { - let x_133 : f32 = A[0]; - let x_135 : f32 = x_13.resolution.x; - let x_138 : f32 = A[0]; - let x_140 : f32 = x_13.resolution.y; - value = vec4((x_133 / x_135), (x_138 / x_140), 0.0, 1.0); - } else { - let x_144 : f32 = x_10.injectionSwitch.x; - let x_146 : f32 = x_10.injectionSwitch.y; - if ((x_144 > x_146)) { - continue; - } - } - } - - continuing { - if (false) { - } else { - break; - } - } - } - let x_151 : f32 = value.x; - x_15.x_compute_data[0] = i32(x_151); - let x_155 : f32 = value.y; - x_15.x_compute_data[1] = i32(x_155); - let x_159 : f32 = value.z; - x_15.x_compute_data[2] = i32(x_159); - let x_163 : f32 = value.w; - x_15.x_compute_data[3] = i32(x_163); - return; -} - -@compute @workgroup_size(1, 1, 1) -fn main(@builtin(global_invocation_id) gl_GlobalInvocationID_param : vec3) { - gl_GlobalInvocationID = gl_GlobalInvocationID_param; - main_1(); -}