writer/hlsl: Inline fallthrough case statements
FXC does not support fallthrough case statements (DXC does). Fixed: tint:1082 Change-Id: I82e1add5455e438056259f773f34bf9db05970b4 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/60480 Kokoro: Kokoro <noreply+kokoro@google.com> Commit-Queue: Ben Clayton <bclayton@chromium.org> Auto-Submit: Ben Clayton <bclayton@google.com> Reviewed-by: David Neto <dneto@google.com>
This commit is contained in:
parent
8ebff3dc85
commit
c0fbce65d8
|
@ -58,15 +58,6 @@ namespace {
|
|||
const char kTempNamePrefix[] = "tint_tmp";
|
||||
const char kSpecConstantPrefix[] = "WGSL_SPEC_CONSTANT_";
|
||||
|
||||
bool last_is_break_or_fallthrough(const ast::BlockStatement* stmts) {
|
||||
if (stmts->empty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return stmts->last()->Is<ast::BreakStatement>() ||
|
||||
stmts->last()->Is<ast::FallthroughStatement>();
|
||||
}
|
||||
|
||||
const char* image_format_to_rwtexture_type(ast::ImageFormat image_format) {
|
||||
switch (image_format) {
|
||||
case ast::ImageFormat::kRgba8Unorm:
|
||||
|
@ -2019,7 +2010,8 @@ std::string GeneratorImpl::generate_builtin_name(
|
|||
return "";
|
||||
}
|
||||
|
||||
bool GeneratorImpl::EmitCase(ast::CaseStatement* stmt) {
|
||||
bool GeneratorImpl::EmitCase(ast::SwitchStatement* s, size_t case_idx) {
|
||||
auto* stmt = s->body()[case_idx];
|
||||
if (stmt->IsDefault()) {
|
||||
line() << "default: {";
|
||||
} else {
|
||||
|
@ -2036,17 +2028,32 @@ bool GeneratorImpl::EmitCase(ast::CaseStatement* stmt) {
|
|||
}
|
||||
}
|
||||
|
||||
{
|
||||
ScopedIndent si(this);
|
||||
increment_indent();
|
||||
TINT_DEFER({
|
||||
decrement_indent();
|
||||
line() << "}";
|
||||
});
|
||||
|
||||
// Emit the case statement
|
||||
if (!EmitStatements(stmt->body()->statements())) {
|
||||
return false;
|
||||
}
|
||||
if (!last_is_break_or_fallthrough(stmt->body())) {
|
||||
line() << "break;";
|
||||
|
||||
// Inline all fallthrough case statements. FXC cannot handle fallthroughs.
|
||||
while (tint::Is<ast::FallthroughStatement>(stmt->body()->last())) {
|
||||
case_idx++;
|
||||
stmt = s->body()[case_idx];
|
||||
// Generate each fallthrough case statement in a new block. This is done to
|
||||
// prevent symbol collision of variables declared in these cases statements.
|
||||
if (!EmitBlock(stmt->body())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
line() << "}";
|
||||
if (!tint::IsAnyOf<ast::BreakStatement, ast::FallthroughStatement>(
|
||||
stmt->body()->last())) {
|
||||
line() << "break;";
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -2900,8 +2907,8 @@ bool GeneratorImpl::EmitSwitch(ast::SwitchStatement* stmt) {
|
|||
|
||||
{
|
||||
ScopedIndent si(this);
|
||||
for (auto* s : stmt->body()) {
|
||||
if (!EmitCase(s)) {
|
||||
for (size_t i = 0; i < stmt->body().size(); i++) {
|
||||
if (!EmitCase(stmt, i)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -196,9 +196,10 @@ class GeneratorImpl : public TextGenerator {
|
|||
ast::CallExpression* expr,
|
||||
const sem::Intrinsic* intrinsic);
|
||||
/// Handles a case statement
|
||||
/// @param stmt the statement
|
||||
/// @param s the switch statement
|
||||
/// @param case_idx the index of the switch case in the switch statement
|
||||
/// @returns true if the statement was emitted successfully
|
||||
bool EmitCase(ast::CaseStatement* stmt);
|
||||
bool EmitCase(ast::SwitchStatement* s, size_t case_idx);
|
||||
/// Handles generating constructor expressions
|
||||
/// @param out the output of the expression stream
|
||||
/// @param expr the constructor expression
|
||||
|
|
|
@ -31,7 +31,7 @@ TEST_F(HlslGeneratorImplTest_Case, Emit_Case) {
|
|||
|
||||
gen.increment_indent();
|
||||
|
||||
ASSERT_TRUE(gen.EmitCase(s->body()[0])) << gen.error();
|
||||
ASSERT_TRUE(gen.EmitCase(s, 0)) << gen.error();
|
||||
EXPECT_EQ(gen.result(), R"( case 5: {
|
||||
break;
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ TEST_F(HlslGeneratorImplTest_Case, Emit_Case_BreaksByDefault) {
|
|||
|
||||
gen.increment_indent();
|
||||
|
||||
ASSERT_TRUE(gen.EmitCase(s->body()[0])) << gen.error();
|
||||
ASSERT_TRUE(gen.EmitCase(s, 0)) << gen.error();
|
||||
EXPECT_EQ(gen.result(), R"( case 5: {
|
||||
break;
|
||||
}
|
||||
|
@ -55,7 +55,9 @@ TEST_F(HlslGeneratorImplTest_Case, Emit_Case_BreaksByDefault) {
|
|||
|
||||
TEST_F(HlslGeneratorImplTest_Case, Emit_Case_WithFallthrough) {
|
||||
auto* s =
|
||||
Switch(1, Case(Literal(5), Block(create<ast::FallthroughStatement>())),
|
||||
Switch(1, //
|
||||
Case(Literal(4), Block(create<ast::FallthroughStatement>())), //
|
||||
Case(Literal(5), Block(create<ast::ReturnStatement>())), //
|
||||
DefaultCase());
|
||||
WrapInFunction(s);
|
||||
|
||||
|
@ -63,9 +65,13 @@ TEST_F(HlslGeneratorImplTest_Case, Emit_Case_WithFallthrough) {
|
|||
|
||||
gen.increment_indent();
|
||||
|
||||
ASSERT_TRUE(gen.EmitCase(s->body()[0])) << gen.error();
|
||||
EXPECT_EQ(gen.result(), R"( case 5: {
|
||||
ASSERT_TRUE(gen.EmitCase(s, 0)) << gen.error();
|
||||
EXPECT_EQ(gen.result(), R"( case 4: {
|
||||
/* fallthrough */
|
||||
{
|
||||
return;
|
||||
}
|
||||
break;
|
||||
}
|
||||
)");
|
||||
}
|
||||
|
@ -80,7 +86,7 @@ TEST_F(HlslGeneratorImplTest_Case, Emit_Case_MultipleSelectors) {
|
|||
|
||||
gen.increment_indent();
|
||||
|
||||
ASSERT_TRUE(gen.EmitCase(s->body()[0])) << gen.error();
|
||||
ASSERT_TRUE(gen.EmitCase(s, 0)) << gen.error();
|
||||
EXPECT_EQ(gen.result(), R"( case 5:
|
||||
case 6: {
|
||||
break;
|
||||
|
@ -96,7 +102,7 @@ TEST_F(HlslGeneratorImplTest_Case, Emit_Case_Default) {
|
|||
|
||||
gen.increment_indent();
|
||||
|
||||
ASSERT_TRUE(gen.EmitCase(s->body()[0])) << gen.error();
|
||||
ASSERT_TRUE(gen.EmitCase(s, 0)) << gen.error();
|
||||
EXPECT_EQ(gen.result(), R"( default: {
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
SKIP: FAILED
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void f() {
|
||||
int i = 0;
|
||||
switch(i) {
|
||||
case 0: {
|
||||
/* fallthrough */
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
default: {
|
||||
break;
|
||||
|
@ -13,5 +14,3 @@ void f() {
|
|||
}
|
||||
return;
|
||||
}
|
||||
C:\src\tint\test\Shader@0x000001AF1A4F6940(5,5): error X3533: non-empty case statements must have break or return
|
||||
|
||||
|
|
|
@ -4,6 +4,9 @@ void main_1() {
|
|||
switch(42u) {
|
||||
case 20u: {
|
||||
/* fallthrough */
|
||||
{
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 40u: {
|
||||
break;
|
||||
|
|
|
@ -4,6 +4,9 @@ void main_1() {
|
|||
switch(42u) {
|
||||
case 20u: {
|
||||
/* fallthrough */
|
||||
{
|
||||
}
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
break;
|
||||
|
|
|
@ -4,6 +4,9 @@ void main_1() {
|
|||
switch(42u) {
|
||||
default: {
|
||||
/* fallthrough */
|
||||
{
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 40u: {
|
||||
break;
|
||||
|
|
|
@ -10,6 +10,13 @@ void main_1() {
|
|||
}
|
||||
default: {
|
||||
/* fallthrough */
|
||||
{
|
||||
if (false) {
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 50u: {
|
||||
if (false) {
|
||||
|
|
|
@ -9,9 +9,22 @@ void main_1() {
|
|||
break;
|
||||
}
|
||||
/* fallthrough */
|
||||
{
|
||||
/* fallthrough */
|
||||
}
|
||||
{
|
||||
if (false) {
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
/* fallthrough */
|
||||
{
|
||||
if (false) {
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 50u: {
|
||||
if (false) {
|
||||
|
|
|
@ -9,6 +9,11 @@ void main_1() {
|
|||
}
|
||||
default: {
|
||||
/* fallthrough */
|
||||
{
|
||||
if (false) {
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 50u: {
|
||||
if (false) {
|
||||
|
|
|
@ -4,12 +4,18 @@ void main_1() {
|
|||
switch(42u) {
|
||||
case 30u: {
|
||||
/* fallthrough */
|
||||
{
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 50u: {
|
||||
break;
|
||||
}
|
||||
case 20u: {
|
||||
/* fallthrough */
|
||||
{
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 40u: {
|
||||
break;
|
||||
|
|
|
@ -4,9 +4,18 @@ void main_1() {
|
|||
switch(42u) {
|
||||
case 20u: {
|
||||
/* fallthrough */
|
||||
{
|
||||
/* fallthrough */
|
||||
}
|
||||
{
|
||||
}
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
/* fallthrough */
|
||||
{
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 30u: {
|
||||
break;
|
||||
|
|
|
@ -7,9 +7,18 @@ void main_1() {
|
|||
}
|
||||
default: {
|
||||
/* fallthrough */
|
||||
{
|
||||
/* fallthrough */
|
||||
}
|
||||
{
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 30u: {
|
||||
/* fallthrough */
|
||||
{
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 40u: {
|
||||
break;
|
||||
|
|
|
@ -4,12 +4,18 @@ void main_1() {
|
|||
switch(42u) {
|
||||
case 30u: {
|
||||
/* fallthrough */
|
||||
{
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 50u: {
|
||||
break;
|
||||
}
|
||||
case 20u: {
|
||||
/* fallthrough */
|
||||
{
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 40u: {
|
||||
break;
|
||||
|
|
|
@ -10,6 +10,9 @@ void main_1() {
|
|||
}
|
||||
default: {
|
||||
/* fallthrough */
|
||||
{
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 30u: {
|
||||
break;
|
||||
|
|
|
@ -6,6 +6,10 @@ void main_1() {
|
|||
case 20u: {
|
||||
var_1 = 20u;
|
||||
/* fallthrough */
|
||||
{
|
||||
var_1 = 30u;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 30u: {
|
||||
var_1 = 30u;
|
||||
|
|
|
@ -9,6 +9,10 @@ void main_1() {
|
|||
break;
|
||||
}
|
||||
/* fallthrough */
|
||||
{
|
||||
var_1 = 30u;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 30u: {
|
||||
var_1 = 30u;
|
||||
|
|
|
@ -10,6 +10,10 @@ void main_1() {
|
|||
break;
|
||||
}
|
||||
/* fallthrough */
|
||||
{
|
||||
var_1 = 30u;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 30u: {
|
||||
var_1 = 30u;
|
||||
|
|
|
@ -6,6 +6,10 @@ void main_1() {
|
|||
case 20u: {
|
||||
var_1 = 20u;
|
||||
/* fallthrough */
|
||||
{
|
||||
var_1 = 30u;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 30u: {
|
||||
var_1 = 30u;
|
||||
|
|
|
@ -13,6 +13,10 @@ void main_1() {
|
|||
}
|
||||
default: {
|
||||
/* fallthrough */
|
||||
{
|
||||
var_1 = 30u;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 30u: {
|
||||
var_1 = 30u;
|
||||
|
|
|
@ -4,6 +4,9 @@ void main_1() {
|
|||
switch(42u) {
|
||||
default: {
|
||||
/* fallthrough */
|
||||
{
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 200u: {
|
||||
break;
|
||||
|
|
|
@ -4,6 +4,9 @@ void main_1() {
|
|||
switch(42u) {
|
||||
case 20u: {
|
||||
/* fallthrough */
|
||||
{
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 30u: {
|
||||
break;
|
||||
|
|
|
@ -7,9 +7,30 @@ void main_1() {
|
|||
switch(1u) {
|
||||
default: {
|
||||
/* fallthrough */
|
||||
{
|
||||
/* fallthrough */
|
||||
}
|
||||
{
|
||||
if (true) {
|
||||
} else {
|
||||
x_41_phi = 0u;
|
||||
break;
|
||||
}
|
||||
x_41_phi = 1u;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 0u: {
|
||||
/* fallthrough */
|
||||
{
|
||||
if (true) {
|
||||
} else {
|
||||
x_41_phi = 0u;
|
||||
break;
|
||||
}
|
||||
x_41_phi = 1u;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 1u: {
|
||||
if (true) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
SKIP: FAILED
|
||||
SKIP: https://github.com/microsoft/DirectXShaderCompiler/issues/3894
|
||||
|
||||
static float4 gl_FragCoord = float4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
static float array0[3] = (float[3])0;
|
||||
|
@ -31,6 +31,11 @@ void main_1() {
|
|||
}
|
||||
array0[c] = 1.0f;
|
||||
/* fallthrough */
|
||||
{
|
||||
array1[0] = 1.0f;
|
||||
array1[c] = 1.0f;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 61: {
|
||||
array1[0] = 1.0f;
|
||||
|
@ -72,13 +77,3 @@ tint_symbol_2 main(tint_symbol_1 tint_symbol) {
|
|||
const tint_symbol_2 tint_symbol_5 = {tint_symbol_3.x_GLF_color_1};
|
||||
return tint_symbol_5;
|
||||
}
|
||||
C:\src\tint\test\Shader@0x0000019491823870(15,8-20): warning X3556: integer modulus may be much slower, try using uints if possible.
|
||||
C:\src\tint\test\Shader@0x0000019491823870(24,11-22): warning X3557: loop doesn't seem to do anything, forcing loop to unroll
|
||||
C:\src\tint\test\Shader@0x0000019491823870(24,11-22): warning X3557: loop doesn't seem to do anything, forcing loop to unroll
|
||||
C:\src\tint\test\Shader@0x0000019491823870(24,11-22): warning X3557: loop doesn't seem to do anything, forcing loop to unroll
|
||||
C:\src\tint\test\Shader@0x0000019491823870(24,11-22): warning X3557: loop doesn't seem to do anything, forcing loop to unroll
|
||||
C:\src\tint\test\Shader@0x0000019491823870(24,11-22): warning X3557: loop doesn't seem to do anything, forcing loop to unroll
|
||||
C:\src\tint\test\Shader@0x0000019491823870(24,11-22): warning X3557: loop doesn't seem to do anything, forcing loop to unroll
|
||||
C:\src\tint\test\Shader@0x0000019491823870(23,9): error X3533: non-empty case statements must have break or return
|
||||
C:\src\tint\test\Shader@0x0000019491823870(24,11-22): warning X3557: loop doesn't seem to do anything, forcing loop to unroll
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
SKIP: FAILED
|
||||
SKIP: https://github.com/microsoft/DirectXShaderCompiler/issues/3894
|
||||
|
||||
static float4 gl_FragCoord = float4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
static float array0[3] = (float[3])0;
|
||||
|
@ -31,6 +31,11 @@ void main_1() {
|
|||
}
|
||||
array0[c] = 1.0f;
|
||||
/* fallthrough */
|
||||
{
|
||||
array1[0] = 1.0f;
|
||||
array1[c] = 1.0f;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 61: {
|
||||
array1[0] = 1.0f;
|
||||
|
@ -72,13 +77,3 @@ tint_symbol_2 main(tint_symbol_1 tint_symbol) {
|
|||
const tint_symbol_2 tint_symbol_5 = {tint_symbol_3.x_GLF_color_1};
|
||||
return tint_symbol_5;
|
||||
}
|
||||
C:\src\tint\test\Shader@0x0000026803D7D2F0(15,8-20): warning X3556: integer modulus may be much slower, try using uints if possible.
|
||||
C:\src\tint\test\Shader@0x0000026803D7D2F0(24,11-22): warning X3557: loop doesn't seem to do anything, forcing loop to unroll
|
||||
C:\src\tint\test\Shader@0x0000026803D7D2F0(24,11-22): warning X3557: loop doesn't seem to do anything, forcing loop to unroll
|
||||
C:\src\tint\test\Shader@0x0000026803D7D2F0(24,11-22): warning X3557: loop doesn't seem to do anything, forcing loop to unroll
|
||||
C:\src\tint\test\Shader@0x0000026803D7D2F0(24,11-22): warning X3557: loop doesn't seem to do anything, forcing loop to unroll
|
||||
C:\src\tint\test\Shader@0x0000026803D7D2F0(24,11-22): warning X3557: loop doesn't seem to do anything, forcing loop to unroll
|
||||
C:\src\tint\test\Shader@0x0000026803D7D2F0(24,11-22): warning X3557: loop doesn't seem to do anything, forcing loop to unroll
|
||||
C:\src\tint\test\Shader@0x0000026803D7D2F0(23,9): error X3533: non-empty case statements must have break or return
|
||||
C:\src\tint\test\Shader@0x0000026803D7D2F0(24,11-22): warning X3557: loop doesn't seem to do anything, forcing loop to unroll
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
SKIP: FAILED
|
||||
|
||||
cbuffer cbuffer_x_6 : register(b0, space0) {
|
||||
uint4 x_6[5];
|
||||
};
|
||||
|
@ -27,6 +25,10 @@ void main_1() {
|
|||
case 1: {
|
||||
count0 = (count0 + 1);
|
||||
/* fallthrough */
|
||||
{
|
||||
count1 = (count1 + 1);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
case 3: {
|
||||
|
@ -78,6 +80,3 @@ tint_symbol main() {
|
|||
const tint_symbol tint_symbol_3 = {tint_symbol_1.x_GLF_color_1};
|
||||
return tint_symbol_3;
|
||||
}
|
||||
C:\src\tint\test\Shader@0x000001CD53C8DD00(24,7): error X3533: non-empty case statements must have break or return
|
||||
C:\src\tint\test\Shader@0x000001CD53C8DD00(28,7): error X3537: Fall-throughs in switch statements are not allowed.
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
SKIP: FAILED
|
||||
|
||||
cbuffer cbuffer_x_6 : register(b0, space0) {
|
||||
uint4 x_6[5];
|
||||
};
|
||||
|
@ -27,6 +25,10 @@ void main_1() {
|
|||
case 1: {
|
||||
count0 = (count0 + 1);
|
||||
/* fallthrough */
|
||||
{
|
||||
count1 = (count1 + 1);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
case 3: {
|
||||
|
@ -78,6 +80,3 @@ tint_symbol main() {
|
|||
const tint_symbol tint_symbol_3 = {tint_symbol_1.x_GLF_color_1};
|
||||
return tint_symbol_3;
|
||||
}
|
||||
C:\src\tint\test\Shader@0x000001A41A83AF00(24,7): error X3533: non-empty case statements must have break or return
|
||||
C:\src\tint\test\Shader@0x000001A41A83AF00(28,7): error X3537: Fall-throughs in switch statements are not allowed.
|
||||
|
||||
|
|
|
@ -17,8 +17,7 @@ void main_1() {
|
|||
return;
|
||||
}
|
||||
/* fallthrough */
|
||||
}
|
||||
case 1: {
|
||||
{
|
||||
if (true) {
|
||||
const uint scalar_offset_1 = ((16u * uint(0))) / 4;
|
||||
const int x_40 = asint(x_6[scalar_offset_1 / 4][scalar_offset_1 % 4]);
|
||||
|
@ -49,6 +48,40 @@ void main_1() {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
if (true) {
|
||||
const uint scalar_offset_4 = ((16u * uint(0))) / 4;
|
||||
const int x_40 = asint(x_6[scalar_offset_4 / 4][scalar_offset_4 % 4]);
|
||||
const int x_43 = asint(x_6[1].x);
|
||||
const int x_46 = asint(x_6[1].x);
|
||||
const uint scalar_offset_5 = ((16u * uint(0))) / 4;
|
||||
const int x_49 = asint(x_6[scalar_offset_5 / 4][scalar_offset_5 % 4]);
|
||||
x_GLF_color = float4(float(x_40), float(x_43), float(x_46), float(x_49));
|
||||
if (false) {
|
||||
const uint scalar_offset_6 = ((16u * uint(0))) / 4;
|
||||
const int x_55 = asint(x_6[scalar_offset_6 / 4][scalar_offset_6 % 4]);
|
||||
const float x_56 = float(x_55);
|
||||
x_GLF_color = float4(x_56, x_56, x_56, x_56);
|
||||
while (true) {
|
||||
x_GLF_global_loop_count = (x_GLF_global_loop_count + 1);
|
||||
if (false) {
|
||||
return;
|
||||
}
|
||||
if (true) {
|
||||
return;
|
||||
}
|
||||
{
|
||||
if ((x_GLF_global_loop_count < 100)) {
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
|
|
|
@ -17,8 +17,7 @@ void main_1() {
|
|||
return;
|
||||
}
|
||||
/* fallthrough */
|
||||
}
|
||||
case 1: {
|
||||
{
|
||||
if (true) {
|
||||
const uint scalar_offset_1 = ((16u * uint(0))) / 4;
|
||||
const int x_40 = asint(x_6[scalar_offset_1 / 4][scalar_offset_1 % 4]);
|
||||
|
@ -49,6 +48,40 @@ void main_1() {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
if (true) {
|
||||
const uint scalar_offset_4 = ((16u * uint(0))) / 4;
|
||||
const int x_40 = asint(x_6[scalar_offset_4 / 4][scalar_offset_4 % 4]);
|
||||
const int x_43 = asint(x_6[1].x);
|
||||
const int x_46 = asint(x_6[1].x);
|
||||
const uint scalar_offset_5 = ((16u * uint(0))) / 4;
|
||||
const int x_49 = asint(x_6[scalar_offset_5 / 4][scalar_offset_5 % 4]);
|
||||
x_GLF_color = float4(float(x_40), float(x_43), float(x_46), float(x_49));
|
||||
if (false) {
|
||||
const uint scalar_offset_6 = ((16u * uint(0))) / 4;
|
||||
const int x_55 = asint(x_6[scalar_offset_6 / 4][scalar_offset_6 % 4]);
|
||||
const float x_56 = float(x_55);
|
||||
x_GLF_color = float4(x_56, x_56, x_56, x_56);
|
||||
while (true) {
|
||||
x_GLF_global_loop_count = (x_GLF_global_loop_count + 1);
|
||||
if (false) {
|
||||
return;
|
||||
}
|
||||
if (true) {
|
||||
return;
|
||||
}
|
||||
{
|
||||
if ((x_GLF_global_loop_count < 100)) {
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
SKIP: FAILED
|
||||
|
||||
cbuffer cbuffer_x_6 : register(b0, space0) {
|
||||
uint4 x_6[1];
|
||||
};
|
||||
|
@ -31,9 +29,20 @@ void main_1() {
|
|||
const float4 x_43 = func_();
|
||||
x_GLF_color = x_43;
|
||||
/* fallthrough */
|
||||
{
|
||||
/* fallthrough */
|
||||
}
|
||||
{
|
||||
x_GLF_color.y = 0.0f;
|
||||
}
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
/* fallthrough */
|
||||
{
|
||||
x_GLF_color.y = 0.0f;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 0: {
|
||||
x_GLF_color.y = 0.0f;
|
||||
|
@ -60,8 +69,3 @@ tint_symbol main() {
|
|||
const tint_symbol tint_symbol_3 = {tint_symbol_1.x_GLF_color_1};
|
||||
return tint_symbol_3;
|
||||
}
|
||||
C:\src\tint\test\Shader@0x00000183AD3AB240(28,7): error X3533: non-empty case statements must have break or return
|
||||
C:\src\tint\test\Shader@0x00000183AD3AB240(33,7): error X3533: non-empty case statements must have break or return
|
||||
C:\src\tint\test\Shader@0x00000183AD3AB240(32,7): error X3537: Fall-throughs in switch statements are not allowed.
|
||||
C:\src\tint\test\Shader@0x00000183AD3AB240(35,7): error X3537: Fall-throughs in switch statements are not allowed.
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
SKIP: FAILED
|
||||
|
||||
cbuffer cbuffer_x_6 : register(b0, space0) {
|
||||
uint4 x_6[1];
|
||||
};
|
||||
|
@ -31,9 +29,20 @@ void main_1() {
|
|||
const float4 x_43 = func_();
|
||||
x_GLF_color = x_43;
|
||||
/* fallthrough */
|
||||
{
|
||||
/* fallthrough */
|
||||
}
|
||||
{
|
||||
x_GLF_color.y = 0.0f;
|
||||
}
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
/* fallthrough */
|
||||
{
|
||||
x_GLF_color.y = 0.0f;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 0: {
|
||||
x_GLF_color.y = 0.0f;
|
||||
|
@ -60,8 +69,3 @@ tint_symbol main() {
|
|||
const tint_symbol tint_symbol_3 = {tint_symbol_1.x_GLF_color_1};
|
||||
return tint_symbol_3;
|
||||
}
|
||||
C:\src\tint\test\Shader@0x0000021C30D8F880(28,7): error X3533: non-empty case statements must have break or return
|
||||
C:\src\tint\test\Shader@0x0000021C30D8F880(33,7): error X3533: non-empty case statements must have break or return
|
||||
C:\src\tint\test\Shader@0x0000021C30D8F880(32,7): error X3537: Fall-throughs in switch statements are not allowed.
|
||||
C:\src\tint\test\Shader@0x0000021C30D8F880(35,7): error X3537: Fall-throughs in switch statements are not allowed.
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
SKIP: FAILED
|
||||
|
||||
cbuffer cbuffer_x_6 : register(b0, space0) {
|
||||
uint4 x_6[1];
|
||||
};
|
||||
|
@ -14,6 +12,9 @@ void main_1() {
|
|||
case 3: {
|
||||
a = 1;
|
||||
/* fallthrough */
|
||||
{
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 4: {
|
||||
break;
|
||||
|
@ -44,6 +45,3 @@ tint_symbol main() {
|
|||
const tint_symbol tint_symbol_3 = {tint_symbol_1.x_GLF_color_1};
|
||||
return tint_symbol_3;
|
||||
}
|
||||
C:\src\tint\test\Shader@0x0000025EFE826FC0(11,5): error X3533: non-empty case statements must have break or return
|
||||
C:\src\tint\test\Shader@0x0000025EFE826FC0(15,5): error X3537: Fall-throughs in switch statements are not allowed.
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
SKIP: FAILED
|
||||
|
||||
cbuffer cbuffer_x_6 : register(b0, space0) {
|
||||
uint4 x_6[1];
|
||||
};
|
||||
|
@ -14,6 +12,9 @@ void main_1() {
|
|||
case 3: {
|
||||
a = 1;
|
||||
/* fallthrough */
|
||||
{
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 4: {
|
||||
break;
|
||||
|
@ -44,6 +45,3 @@ tint_symbol main() {
|
|||
const tint_symbol tint_symbol_3 = {tint_symbol_1.x_GLF_color_1};
|
||||
return tint_symbol_3;
|
||||
}
|
||||
C:\src\tint\test\Shader@0x000001FDE7828C30(11,5): error X3533: non-empty case statements must have break or return
|
||||
C:\src\tint\test\Shader@0x000001FDE7828C30(15,5): error X3537: Fall-throughs in switch statements are not allowed.
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
SKIP: FAILED
|
||||
|
||||
cbuffer cbuffer_x_6 : register(b0, space0) {
|
||||
uint4 x_6[1];
|
||||
};
|
||||
|
@ -21,6 +19,11 @@ void main_1() {
|
|||
case 0: {
|
||||
x_43_phi = 1.0f;
|
||||
/* fallthrough */
|
||||
{
|
||||
data[x_39] = x_43_phi;
|
||||
x_GLF_color = float4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
data[x_39] = x_43_phi;
|
||||
|
@ -48,6 +51,3 @@ tint_symbol main() {
|
|||
const tint_symbol tint_symbol_3 = {tint_symbol_1.x_GLF_color_1};
|
||||
return tint_symbol_3;
|
||||
}
|
||||
C:\src\tint\test\Shader@0x0000027AB59F7F40(19,7): error X3533: non-empty case statements must have break or return
|
||||
C:\src\tint\test\Shader@0x0000027AB59F7F40(22,7): error X3537: Fall-throughs in switch statements are not allowed.
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
SKIP: FAILED
|
||||
|
||||
cbuffer cbuffer_x_6 : register(b0, space0) {
|
||||
uint4 x_6[1];
|
||||
};
|
||||
|
@ -21,6 +19,11 @@ void main_1() {
|
|||
case 0: {
|
||||
x_43_phi = 1.0f;
|
||||
/* fallthrough */
|
||||
{
|
||||
data[x_39] = x_43_phi;
|
||||
x_GLF_color = float4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
data[x_39] = x_43_phi;
|
||||
|
@ -48,6 +51,3 @@ tint_symbol main() {
|
|||
const tint_symbol tint_symbol_3 = {tint_symbol_1.x_GLF_color_1};
|
||||
return tint_symbol_3;
|
||||
}
|
||||
C:\src\tint\test\Shader@0x0000020777179050(19,7): error X3533: non-empty case statements must have break or return
|
||||
C:\src\tint\test\Shader@0x0000020777179050(22,7): error X3537: Fall-throughs in switch statements are not allowed.
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
SKIP: FAILED
|
||||
|
||||
static float4 x_GLF_color = float4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
cbuffer cbuffer_x_6 : register(b0, space0) {
|
||||
uint4 x_6[1];
|
||||
|
@ -26,6 +24,9 @@ void main_1() {
|
|||
}
|
||||
}
|
||||
/* fallthrough */
|
||||
{
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 42: {
|
||||
break;
|
||||
|
@ -55,6 +56,3 @@ tint_symbol_2 main(tint_symbol_1 tint_symbol) {
|
|||
const tint_symbol_2 tint_symbol_5 = {tint_symbol_3.x_GLF_color_1};
|
||||
return tint_symbol_5;
|
||||
}
|
||||
C:\src\tint\test\Shader@0x000001A268ED57F0(11,5): error X3533: non-empty case statements must have break or return
|
||||
C:\src\tint\test\Shader@0x000001A268ED57F0(27,5): error X3537: Fall-throughs in switch statements are not allowed.
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
SKIP: FAILED
|
||||
|
||||
static float4 x_GLF_color = float4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
cbuffer cbuffer_x_6 : register(b0, space0) {
|
||||
uint4 x_6[1];
|
||||
|
@ -26,6 +24,9 @@ void main_1() {
|
|||
}
|
||||
}
|
||||
/* fallthrough */
|
||||
{
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 42: {
|
||||
break;
|
||||
|
@ -55,6 +56,3 @@ tint_symbol_2 main(tint_symbol_1 tint_symbol) {
|
|||
const tint_symbol_2 tint_symbol_5 = {tint_symbol_3.x_GLF_color_1};
|
||||
return tint_symbol_5;
|
||||
}
|
||||
C:\src\tint\test\Shader@0x00000267DEB27120(11,5): error X3533: non-empty case statements must have break or return
|
||||
C:\src\tint\test\Shader@0x00000267DEB27120(27,5): error X3537: Fall-throughs in switch statements are not allowed.
|
||||
|
||||
|
|
|
@ -45,6 +45,10 @@ void main_1() {
|
|||
break;
|
||||
}
|
||||
/* fallthrough */
|
||||
{
|
||||
i = (i - 3);
|
||||
}
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
i = (i - 3);
|
||||
|
@ -72,6 +76,5 @@ tint_symbol main() {
|
|||
const tint_symbol tint_symbol_3 = {tint_symbol_1.x_GLF_color_1};
|
||||
return tint_symbol_3;
|
||||
}
|
||||
C:\src\tint\test\Shader@0x00000259291CFD70(11,5): error X3533: non-empty case statements must have break or return
|
||||
C:\src\tint\test\Shader@0x00000259291CFD70(26,13-21): error X3708: continue cannot be used in a switch
|
||||
O:\src\chrome\src\third_party\dawn\third_party\tint\test\Shader@0x0000028C1CDAABD0(26,13-21): error X3708: continue cannot be used in a switch
|
||||
|
||||
|
|
|
@ -45,6 +45,10 @@ void main_1() {
|
|||
break;
|
||||
}
|
||||
/* fallthrough */
|
||||
{
|
||||
i = (i - 3);
|
||||
}
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
i = (i - 3);
|
||||
|
@ -72,6 +76,5 @@ tint_symbol main() {
|
|||
const tint_symbol tint_symbol_3 = {tint_symbol_1.x_GLF_color_1};
|
||||
return tint_symbol_3;
|
||||
}
|
||||
C:\src\tint\test\Shader@0x000001E28E944DC0(11,5): error X3533: non-empty case statements must have break or return
|
||||
C:\src\tint\test\Shader@0x000001E28E944DC0(26,13-21): error X3708: continue cannot be used in a switch
|
||||
O:\src\chrome\src\third_party\dawn\third_party\tint\test\Shader@0x0000015D2C356900(26,13-21): error X3708: continue cannot be used in a switch
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
SKIP: FAILED
|
||||
|
||||
cbuffer cbuffer_x_6 : register(b0, space0) {
|
||||
uint4 x_6[1];
|
||||
};
|
||||
|
@ -31,15 +29,48 @@ void main_1() {
|
|||
y = x_54;
|
||||
x_55_phi = x_54;
|
||||
/* fallthrough */
|
||||
{
|
||||
const float x_47 = clamp(1.0f, 0.5f, x_55_phi);
|
||||
y = x_47;
|
||||
x_46_phi = x_47;
|
||||
/* fallthrough */
|
||||
}
|
||||
{
|
||||
/* fallthrough */
|
||||
}
|
||||
{
|
||||
if ((x_46_phi == 1.0f)) {
|
||||
x_GLF_color = float4(float((x_31 + 1)), 0.0f, 0.0f, 1.0f);
|
||||
return;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
const float x_47 = clamp(1.0f, 0.5f, x_55_phi);
|
||||
y = x_47;
|
||||
x_46_phi = x_47;
|
||||
/* fallthrough */
|
||||
{
|
||||
/* fallthrough */
|
||||
}
|
||||
{
|
||||
if ((x_46_phi == 1.0f)) {
|
||||
x_GLF_color = float4(float((x_31 + 1)), 0.0f, 0.0f, 1.0f);
|
||||
return;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
/* fallthrough */
|
||||
{
|
||||
if ((x_46_phi == 1.0f)) {
|
||||
x_GLF_color = float4(float((x_31 + 1)), 0.0f, 0.0f, 1.0f);
|
||||
return;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
if ((x_46_phi == 1.0f)) {
|
||||
|
@ -71,10 +102,3 @@ tint_symbol main() {
|
|||
const tint_symbol tint_symbol_3 = {tint_symbol_1.x_GLF_color_1};
|
||||
return tint_symbol_3;
|
||||
}
|
||||
C:\src\tint\test\Shader@0x000002EAE8878270(27,7): error X3533: non-empty case statements must have break or return
|
||||
C:\src\tint\test\Shader@0x000002EAE8878270(33,7): error X3533: non-empty case statements must have break or return
|
||||
C:\src\tint\test\Shader@0x000002EAE8878270(39,7): error X3533: non-empty case statements must have break or return
|
||||
C:\src\tint\test\Shader@0x000002EAE8878270(32,7): error X3537: Fall-throughs in switch statements are not allowed.
|
||||
C:\src\tint\test\Shader@0x000002EAE8878270(38,7): error X3537: Fall-throughs in switch statements are not allowed.
|
||||
C:\src\tint\test\Shader@0x000002EAE8878270(41,7): error X3537: Fall-throughs in switch statements are not allowed.
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
SKIP: FAILED
|
||||
|
||||
cbuffer cbuffer_x_6 : register(b0, space0) {
|
||||
uint4 x_6[1];
|
||||
};
|
||||
|
@ -31,15 +29,48 @@ void main_1() {
|
|||
y = x_54;
|
||||
x_55_phi = x_54;
|
||||
/* fallthrough */
|
||||
{
|
||||
const float x_47 = clamp(1.0f, 0.5f, x_55_phi);
|
||||
y = x_47;
|
||||
x_46_phi = x_47;
|
||||
/* fallthrough */
|
||||
}
|
||||
{
|
||||
/* fallthrough */
|
||||
}
|
||||
{
|
||||
if ((x_46_phi == 1.0f)) {
|
||||
x_GLF_color = float4(float((x_31 + 1)), 0.0f, 0.0f, 1.0f);
|
||||
return;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
const float x_47 = clamp(1.0f, 0.5f, x_55_phi);
|
||||
y = x_47;
|
||||
x_46_phi = x_47;
|
||||
/* fallthrough */
|
||||
{
|
||||
/* fallthrough */
|
||||
}
|
||||
{
|
||||
if ((x_46_phi == 1.0f)) {
|
||||
x_GLF_color = float4(float((x_31 + 1)), 0.0f, 0.0f, 1.0f);
|
||||
return;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
/* fallthrough */
|
||||
{
|
||||
if ((x_46_phi == 1.0f)) {
|
||||
x_GLF_color = float4(float((x_31 + 1)), 0.0f, 0.0f, 1.0f);
|
||||
return;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
if ((x_46_phi == 1.0f)) {
|
||||
|
@ -71,10 +102,3 @@ tint_symbol main() {
|
|||
const tint_symbol tint_symbol_3 = {tint_symbol_1.x_GLF_color_1};
|
||||
return tint_symbol_3;
|
||||
}
|
||||
C:\src\tint\test\Shader@0x000001B3F8915FF0(27,7): error X3533: non-empty case statements must have break or return
|
||||
C:\src\tint\test\Shader@0x000001B3F8915FF0(33,7): error X3533: non-empty case statements must have break or return
|
||||
C:\src\tint\test\Shader@0x000001B3F8915FF0(39,7): error X3533: non-empty case statements must have break or return
|
||||
C:\src\tint\test\Shader@0x000001B3F8915FF0(32,7): error X3537: Fall-throughs in switch statements are not allowed.
|
||||
C:\src\tint\test\Shader@0x000001B3F8915FF0(38,7): error X3537: Fall-throughs in switch statements are not allowed.
|
||||
C:\src\tint\test\Shader@0x000001B3F8915FF0(41,7): error X3537: Fall-throughs in switch statements are not allowed.
|
||||
|
||||
|
|
|
@ -25,6 +25,10 @@ void main_1() {
|
|||
while (true) {
|
||||
}
|
||||
/* fallthrough */
|
||||
{
|
||||
data[0] = 2.0f;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 0: {
|
||||
data[0] = 2.0f;
|
||||
|
|
|
@ -25,6 +25,10 @@ void main_1() {
|
|||
while (true) {
|
||||
}
|
||||
/* fallthrough */
|
||||
{
|
||||
data[0] = 2.0f;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 0: {
|
||||
data[0] = 2.0f;
|
||||
|
|
Loading…
Reference in New Issue