Add tests derived from VK-GL-CTS

This adds SPIR-V assembly and WGSL tests derived from VK-GL-CTS commit
571256871c2e2f03995373e1e4a02958d8cd8cf5. The following procedure was
followed:

- Those .amber files in VK-GL-CTS wholly owned by Google were
  identified

- All GLSL and SPIR-V shaders were extracted from the Amber files and
  converted into SPIR-V binaries

- The compact-ids pass of spirv-opt was applied to each binary

- Duplicate binaries were removed

- spirv-opt -O was used to obtain an optimized version of each remaining
  binary, with duplicates discarded

- Binaries that failed validation using spirv-val with target
  environment SPIR-V 1.3 were discarded

- Those binaries that tint could not successfully convert into WGSL were
  put aside for further investigation

- SPIR-V assembly versions of the remaining binaries are included in
  this CL

- test-runner with -generate-expected and -generate-skip was used to
  generate expected .spvasm, .msl, .hlsl and .wgsl outputs for these
  SPIR-V assembly tests

- Each successfully-generated .expected.wgsl is included in this CL
  again, as a WGLSL test

- test-runner with -generate-expected and -generate-skip was used again,
  to generate expected outputs for these WGSL tests

Change-Id: Ibe9baf2729cf97e0b633db9a426f53362a5de540
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/58842
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
This commit is contained in:
Alastair Donaldson
2021-07-23 13:10:12 +00:00
committed by Tint LUCI CQ
parent bd3edb564f
commit f7e73d4ee3
5160 changed files with 621458 additions and 0 deletions

View File

@@ -0,0 +1,275 @@
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main" %gl_FragCoord %_GLF_color
OpExecutionMode %main OriginUpperLeft
OpSource ESSL 310
OpName %main "main"
OpName %gl_FragCoord "gl_FragCoord"
OpName %buf0 "buf0"
OpMemberName %buf0 0 "injectionSwitch"
OpName %_ ""
OpName %_GLF_color "_GLF_color"
OpDecorate %gl_FragCoord BuiltIn FragCoord
OpMemberDecorate %buf0 0 Offset 0
OpDecorate %buf0 Block
OpDecorate %_ DescriptorSet 0
OpDecorate %_ Binding 0
OpDecorate %_GLF_color Location 0
%void = OpTypeVoid
%8 = OpTypeFunction %void
%int = OpTypeInt 32 1
%bool = OpTypeBool
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Input_v4float = OpTypePointer Input %v4float
%gl_FragCoord = OpVariable %_ptr_Input_v4float Input
%uint = OpTypeInt 32 0
%uint_0 = OpConstant %uint 0
%_ptr_Input_float = OpTypePointer Input %float
%float_n1 = OpConstant %float -1
%v2float = OpTypeVector %float 2
%buf0 = OpTypeStruct %v2float
%_ptr_Uniform_buf0 = OpTypePointer Uniform %buf0
%_ = OpVariable %_ptr_Uniform_buf0 Uniform
%int_0 = OpConstant %int 0
%_ptr_Uniform_float = OpTypePointer Uniform %float
%float_0 = OpConstant %float 0
%int_1 = OpConstant %int 1
%uint_1 = OpConstant %uint 1
%int_10 = OpConstant %int 10
%int_100 = OpConstant %int 100
%int_2 = OpConstant %int 2
%int_3 = OpConstant %int 3
%_ptr_Output_v4float = OpTypePointer Output %v4float
%_GLF_color = OpVariable %_ptr_Output_v4float Output
%float_1 = OpConstant %float 1
%int_4 = OpConstant %int 4
%32 = OpConstantComposite %v4float %float_1 %float_0 %float_0 %float_1
%33 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0
%false = OpConstantFalse %bool
%true = OpConstantTrue %bool
%36 = OpUndef %int
%main = OpFunction %void None %8
%37 = OpLabel
OpBranch %38
%38 = OpLabel
%39 = OpAccessChain %_ptr_Uniform_float %_ %int_0 %uint_0
%40 = OpLoad %float %39
%41 = OpFOrdLessThan %bool %40 %float_n1
OpLoopMerge %42 %43 None
OpBranch %44
%44 = OpLabel
%45 = OpPhi %bool %false %38 %46 %47
%48 = OpPhi %int %int_0 %38 %49 %47
%50 = OpPhi %int %36 %38 %51 %47
%52 = OpPhi %int %int_0 %38 %53 %47
%54 = OpAccessChain %_ptr_Input_float %gl_FragCoord %uint_1
%55 = OpLoad %float %54
%56 = OpFOrdGreaterThan %bool %55 %float_n1
%57 = OpSelect %int %56 %int_10 %int_100
%58 = OpSLessThan %bool %52 %57
OpLoopMerge %59 %47 None
OpBranchConditional %58 %60 %59
%60 = OpLabel
OpBranch %61
%61 = OpLabel
%62 = OpPhi %int %48 %60 %63 %64
%65 = OpPhi %int %50 %60 %66 %64
%67 = OpPhi %int %int_0 %60 %68 %64
%69 = OpSLessThan %bool %67 %int_2
OpLoopMerge %70 %64 None
OpBranchConditional %69 %71 %70
%71 = OpLabel
OpBranch %72
%72 = OpLabel
OpLoopMerge %73 %74 None
OpBranch %75
%75 = OpLabel
%76 = OpAccessChain %_ptr_Input_float %gl_FragCoord %uint_0
%77 = OpLoad %float %76
%78 = OpFOrdLessThan %bool %77 %float_n1
%79 = OpFOrdLessThan %bool %40 %float_0
%80 = OpLogicalNot %bool %79
OpSelectionMerge %81 None
OpBranchConditional %80 %82 %81
%82 = OpLabel
OpSelectionMerge %83 None
OpBranchConditional %78 %84 %83
%84 = OpLabel
OpBranch %73
%83 = OpLabel
OpBranch %85
%85 = OpLabel
%86 = OpPhi %int %int_1 %83 %87 %88
%89 = OpSLessThan %bool %86 %int_3
OpLoopMerge %90 %88 None
OpBranchConditional %89 %91 %90
%91 = OpLabel
OpSelectionMerge %92 None
OpBranchConditional %78 %93 %92
%93 = OpLabel
OpBranch %88
%92 = OpLabel
%94 = OpSGreaterThan %bool %86 %int_0
OpSelectionMerge %95 None
OpBranchConditional %94 %96 %95
%96 = OpLabel
OpBranch %90
%95 = OpLabel
OpBranch %88
%88 = OpLabel
%87 = OpIAdd %int %86 %int_1
OpBranch %85
%90 = OpLabel
%97 = OpPhi %int %65 %85 %int_1 %96
%98 = OpPhi %bool %false %85 %true %96
OpSelectionMerge %99 None
OpBranchConditional %98 %73 %99
%99 = OpLabel
OpBranch %81
%81 = OpLabel
OpBranch %73
%74 = OpLabel
OpBranch %72
%73 = OpLabel
%66 = OpPhi %int %int_0 %84 %97 %90 %int_0 %81
%63 = OpIAdd %int %62 %66
OpSelectionMerge %100 None
OpBranchConditional %41 %101 %100
%101 = OpLabel
OpBranch %102
%102 = OpLabel
OpLoopMerge %103 %104 None
OpBranchConditional %41 %104 %103
%104 = OpLabel
%105 = OpConvertSToF %float %52
%106 = OpCompositeConstruct %v4float %105 %105 %105 %105
OpStore %_GLF_color %106
OpBranch %102
%103 = OpLabel
OpBranch %70
%100 = OpLabel
OpBranch %64
%64 = OpLabel
%68 = OpIAdd %int %67 %int_1
OpBranch %61
%70 = OpLabel
%51 = OpPhi %int %65 %61 %66 %103
%49 = OpPhi %int %62 %61 %63 %103
%46 = OpPhi %bool %45 %61 %true %103
OpSelectionMerge %107 None
OpBranchConditional %46 %59 %107
%107 = OpLabel
%108 = OpLogicalNot %bool %41
OpSelectionMerge %109 None
OpBranchConditional %108 %110 %109
%110 = OpLabel
OpBranch %59
%109 = OpLabel
OpBranch %47
%47 = OpLabel
%53 = OpIAdd %int %52 %int_1
OpBranch %44
%59 = OpLabel
%111 = OpPhi %int %48 %44 %49 %70 %49 %110
%112 = OpPhi %bool %45 %44 %46 %70 %46 %110
OpSelectionMerge %113 None
OpBranchConditional %112 %42 %113
%113 = OpLabel
OpBranch %114
%114 = OpLabel
%115 = OpPhi %int %111 %113 %116 %117
%118 = OpPhi %int %36 %113 %119 %117
%120 = OpPhi %int %int_0 %113 %121 %117
%122 = OpAccessChain %_ptr_Uniform_float %_ %int_0 %uint_1
%123 = OpLoad %float %122
%124 = OpFAdd %float %123 %float_1
%125 = OpConvertFToS %int %124
%126 = OpSLessThan %bool %120 %125
OpLoopMerge %127 %117 None
OpBranchConditional %126 %128 %127
%128 = OpLabel
OpBranch %129
%129 = OpLabel
OpLoopMerge %130 %131 None
OpBranch %132
%132 = OpLabel
%133 = OpAccessChain %_ptr_Input_float %gl_FragCoord %uint_0
%134 = OpLoad %float %133
%135 = OpFOrdLessThan %bool %134 %float_n1
%136 = OpFOrdLessThan %bool %40 %float_0
%137 = OpLogicalNot %bool %136
OpSelectionMerge %138 None
OpBranchConditional %137 %139 %138
%139 = OpLabel
OpSelectionMerge %140 None
OpBranchConditional %135 %141 %140
%141 = OpLabel
OpBranch %130
%140 = OpLabel
OpBranch %142
%142 = OpLabel
%143 = OpPhi %int %int_1 %140 %144 %145
%146 = OpSLessThan %bool %143 %int_3
OpLoopMerge %147 %145 None
OpBranchConditional %146 %148 %147
%148 = OpLabel
OpSelectionMerge %149 None
OpBranchConditional %135 %150 %149
%150 = OpLabel
OpBranch %145
%149 = OpLabel
%151 = OpSGreaterThan %bool %143 %int_0
OpSelectionMerge %152 None
OpBranchConditional %151 %153 %152
%153 = OpLabel
OpBranch %147
%152 = OpLabel
OpBranch %145
%145 = OpLabel
%144 = OpIAdd %int %143 %int_1
OpBranch %142
%147 = OpLabel
%154 = OpPhi %int %118 %142 %int_1 %153
%155 = OpPhi %bool %false %142 %true %153
OpSelectionMerge %156 None
OpBranchConditional %155 %130 %156
%156 = OpLabel
OpBranch %138
%138 = OpLabel
OpBranch %130
%131 = OpLabel
OpBranch %129
%130 = OpLabel
%119 = OpPhi %int %int_0 %141 %154 %147 %int_0 %138
%116 = OpIAdd %int %115 %119
%157 = OpLogicalNot %bool %41
%158 = OpSelect %bool %157 %false %41
OpSelectionMerge %159 None
OpBranchConditional %158 %160 %159
%160 = OpLabel
OpBranch %127
%159 = OpLabel
OpBranch %117
%117 = OpLabel
%121 = OpIAdd %int %120 %int_1
OpBranch %114
%127 = OpLabel
%161 = OpPhi %int %115 %114 %116 %160
%162 = OpIEqual %bool %161 %int_4
OpSelectionMerge %163 None
OpBranchConditional %162 %164 %165
%165 = OpLabel
OpStore %_GLF_color %33
OpBranch %163
%164 = OpLabel
OpStore %_GLF_color %32
OpBranch %163
%163 = OpLabel
OpBranch %42
%43 = OpLabel
OpBranch %38
%42 = OpLabel
OpReturn
OpFunctionEnd

View File

@@ -0,0 +1,276 @@
static float4 gl_FragCoord = float4(0.0f, 0.0f, 0.0f, 0.0f);
cbuffer cbuffer_x_6 : register(b0, space0) {
uint4 x_6[1];
};
static float4 x_GLF_color = float4(0.0f, 0.0f, 0.0f, 0.0f);
void main_1() {
while (true) {
bool x_45 = false;
int x_48 = 0;
int x_49 = 0;
bool x_46 = false;
int x_115 = 0;
int x_116 = 0;
bool x_45_phi = false;
int x_48_phi = 0;
int x_50_phi = 0;
int x_52_phi = 0;
int x_111_phi = 0;
bool x_112_phi = false;
int x_115_phi = 0;
int x_118_phi = 0;
int x_120_phi = 0;
int x_161_phi = 0;
const float x_40 = asfloat(x_6[0].x);
const bool x_41 = (x_40 < -1.0f);
x_45_phi = false;
x_48_phi = 0;
x_50_phi = 0;
x_52_phi = 0;
while (true) {
int x_62 = 0;
int x_65 = 0;
int x_66 = 0;
int x_63 = 0;
int x_53 = 0;
int x_62_phi = 0;
int x_65_phi = 0;
int x_67_phi = 0;
int x_51_phi = 0;
int x_49_phi = 0;
bool x_46_phi = false;
x_45 = x_45_phi;
x_48 = x_48_phi;
const int x_50 = x_50_phi;
const int x_52 = x_52_phi;
const float x_55 = gl_FragCoord.y;
x_111_phi = x_48;
x_112_phi = x_45;
if ((x_52 < ((x_55 > -1.0f) ? 10 : 100))) {
} else {
break;
}
x_62_phi = x_48;
x_65_phi = x_50;
x_67_phi = 0;
while (true) {
int x_97 = 0;
int x_68 = 0;
int x_66_phi = 0;
x_62 = x_62_phi;
x_65 = x_65_phi;
const int x_67 = x_67_phi;
x_51_phi = x_65;
x_49_phi = x_62;
x_46_phi = x_45;
if ((x_67 < 2)) {
} else {
break;
}
while (true) {
bool x_78 = false;
int x_86_phi = 0;
int x_97_phi = 0;
bool x_98_phi = false;
const float x_77 = gl_FragCoord.x;
x_78 = (x_77 < -1.0f);
if (!((x_40 < 0.0f))) {
if (x_78) {
x_66_phi = 0;
break;
}
x_86_phi = 1;
while (true) {
int x_87 = 0;
const int x_86 = x_86_phi;
x_97_phi = x_65;
x_98_phi = false;
if ((x_86 < 3)) {
} else {
break;
}
if (x_78) {
{
x_87 = (x_86 + 1);
x_86_phi = x_87;
}
continue;
}
if ((x_86 > 0)) {
x_97_phi = 1;
x_98_phi = true;
break;
}
{
x_87 = (x_86 + 1);
x_86_phi = x_87;
}
}
x_97 = x_97_phi;
const bool x_98 = x_98_phi;
x_66_phi = x_97;
if (x_98) {
break;
}
}
x_66_phi = 0;
break;
}
x_66 = x_66_phi;
x_63 = asint((x_62 + x_66));
if (x_41) {
while (true) {
if (x_41) {
} else {
break;
}
{
const float x_105 = float(x_52);
x_GLF_color = float4(x_105, x_105, x_105, x_105);
}
}
x_51_phi = x_66;
x_49_phi = x_63;
x_46_phi = true;
break;
}
{
x_68 = (x_67 + 1);
x_62_phi = x_63;
x_65_phi = x_66;
x_67_phi = x_68;
}
}
const int x_51 = x_51_phi;
x_49 = x_49_phi;
x_46 = x_46_phi;
x_111_phi = x_49;
x_112_phi = x_46;
if (x_46) {
break;
}
if (!(x_41)) {
x_111_phi = x_49;
x_112_phi = x_46;
break;
}
{
x_53 = (x_52 + 1);
x_45_phi = x_46;
x_48_phi = x_49;
x_50_phi = x_51;
x_52_phi = x_53;
}
}
const int x_111 = x_111_phi;
if (x_112_phi) {
break;
}
x_115_phi = x_111;
x_118_phi = 0;
x_120_phi = 0;
while (true) {
int x_154 = 0;
int x_121 = 0;
int x_119_phi = 0;
x_115 = x_115_phi;
const int x_118 = x_118_phi;
const int x_120 = x_120_phi;
const float x_123 = asfloat(x_6[0].y);
x_161_phi = x_115;
if ((x_120 < int((x_123 + 1.0f)))) {
} else {
break;
}
while (true) {
bool x_135 = false;
int x_143_phi = 0;
int x_154_phi = 0;
bool x_155_phi = false;
const float x_134 = gl_FragCoord.x;
x_135 = (x_134 < -1.0f);
if (!((x_40 < 0.0f))) {
if (x_135) {
x_119_phi = 0;
break;
}
x_143_phi = 1;
while (true) {
int x_144 = 0;
const int x_143 = x_143_phi;
x_154_phi = x_118;
x_155_phi = false;
if ((x_143 < 3)) {
} else {
break;
}
if (x_135) {
{
x_144 = (x_143 + 1);
x_143_phi = x_144;
}
continue;
}
if ((x_143 > 0)) {
x_154_phi = 1;
x_155_phi = true;
break;
}
{
x_144 = (x_143 + 1);
x_143_phi = x_144;
}
}
x_154 = x_154_phi;
const bool x_155 = x_155_phi;
x_119_phi = x_154;
if (x_155) {
break;
}
}
x_119_phi = 0;
break;
}
int x_119 = 0;
x_119 = x_119_phi;
x_116 = asint((x_115 + x_119));
if ((!(x_41) ? false : x_41)) {
x_161_phi = x_116;
break;
}
{
x_121 = (x_120 + 1);
x_115_phi = x_116;
x_118_phi = x_119;
x_120_phi = x_121;
}
}
if ((x_161_phi == 4)) {
x_GLF_color = float4(1.0f, 0.0f, 0.0f, 1.0f);
} else {
x_GLF_color = float4(0.0f, 0.0f, 0.0f, 0.0f);
}
break;
}
return;
}
struct main_out {
float4 x_GLF_color_1;
};
struct tint_symbol_1 {
float4 gl_FragCoord_param : SV_Position;
};
struct tint_symbol_2 {
float4 x_GLF_color_1 : SV_Target0;
};
tint_symbol_2 main(tint_symbol_1 tint_symbol) {
const float4 gl_FragCoord_param = tint_symbol.gl_FragCoord_param;
gl_FragCoord = gl_FragCoord_param;
main_1();
const main_out tint_symbol_3 = {x_GLF_color};
const tint_symbol_2 tint_symbol_5 = {tint_symbol_3.x_GLF_color_1};
return tint_symbol_5;
}

View File

@@ -0,0 +1,277 @@
#include <metal_stdlib>
using namespace metal;
struct buf0 {
/* 0x0000 */ packed_float2 injectionSwitch;
};
struct main_out {
float4 x_GLF_color_1;
};
struct tint_symbol_2 {
float4 x_GLF_color_1 [[color(0)]];
};
void main_1(constant buf0& x_6, thread float4* const tint_symbol_5, thread float4* const tint_symbol_6) {
while (true) {
bool x_45 = false;
int x_48 = 0;
int x_49 = 0;
bool x_46 = false;
int x_115 = 0;
int x_116 = 0;
bool x_45_phi = false;
int x_48_phi = 0;
int x_50_phi = 0;
int x_52_phi = 0;
int x_111_phi = 0;
bool x_112_phi = false;
int x_115_phi = 0;
int x_118_phi = 0;
int x_120_phi = 0;
int x_161_phi = 0;
float const x_40 = x_6.injectionSwitch.x;
bool const x_41 = (x_40 < -1.0f);
x_45_phi = false;
x_48_phi = 0;
x_50_phi = 0;
x_52_phi = 0;
while (true) {
int x_62 = 0;
int x_65 = 0;
int x_66 = 0;
int x_63 = 0;
int x_53 = 0;
int x_62_phi = 0;
int x_65_phi = 0;
int x_67_phi = 0;
int x_51_phi = 0;
int x_49_phi = 0;
bool x_46_phi = false;
x_45 = x_45_phi;
x_48 = x_48_phi;
int const x_50 = x_50_phi;
int const x_52 = x_52_phi;
float const x_55 = (*(tint_symbol_5)).y;
x_111_phi = x_48;
x_112_phi = x_45;
if ((x_52 < select(100, 10, (x_55 > -1.0f)))) {
} else {
break;
}
x_62_phi = x_48;
x_65_phi = x_50;
x_67_phi = 0;
while (true) {
int x_97 = 0;
int x_68 = 0;
int x_66_phi = 0;
x_62 = x_62_phi;
x_65 = x_65_phi;
int const x_67 = x_67_phi;
x_51_phi = x_65;
x_49_phi = x_62;
x_46_phi = x_45;
if ((x_67 < 2)) {
} else {
break;
}
while (true) {
bool x_78 = false;
int x_86_phi = 0;
int x_97_phi = 0;
bool x_98_phi = false;
float const x_77 = (*(tint_symbol_5)).x;
x_78 = (x_77 < -1.0f);
if (!((x_40 < 0.0f))) {
if (x_78) {
x_66_phi = 0;
break;
}
x_86_phi = 1;
while (true) {
int x_87 = 0;
int const x_86 = x_86_phi;
x_97_phi = x_65;
x_98_phi = false;
if ((x_86 < 3)) {
} else {
break;
}
if (x_78) {
{
x_87 = (x_86 + 1);
x_86_phi = x_87;
}
continue;
}
if ((x_86 > 0)) {
x_97_phi = 1;
x_98_phi = true;
break;
}
{
x_87 = (x_86 + 1);
x_86_phi = x_87;
}
}
x_97 = x_97_phi;
bool const x_98 = x_98_phi;
x_66_phi = x_97;
if (x_98) {
break;
}
}
x_66_phi = 0;
break;
}
x_66 = x_66_phi;
x_63 = as_type<int>((x_62 + x_66));
if (x_41) {
while (true) {
if (x_41) {
} else {
break;
}
{
float const x_105 = float(x_52);
*(tint_symbol_6) = float4(x_105, x_105, x_105, x_105);
}
}
x_51_phi = x_66;
x_49_phi = x_63;
x_46_phi = true;
break;
}
{
x_68 = (x_67 + 1);
x_62_phi = x_63;
x_65_phi = x_66;
x_67_phi = x_68;
}
}
int const x_51 = x_51_phi;
x_49 = x_49_phi;
x_46 = x_46_phi;
x_111_phi = x_49;
x_112_phi = x_46;
if (x_46) {
break;
}
if (!(x_41)) {
x_111_phi = x_49;
x_112_phi = x_46;
break;
}
{
x_53 = (x_52 + 1);
x_45_phi = x_46;
x_48_phi = x_49;
x_50_phi = x_51;
x_52_phi = x_53;
}
}
int const x_111 = x_111_phi;
bool const x_112 = x_112_phi;
if (x_112) {
break;
}
x_115_phi = x_111;
x_118_phi = 0;
x_120_phi = 0;
while (true) {
int x_154 = 0;
int x_121 = 0;
int x_119_phi = 0;
x_115 = x_115_phi;
int const x_118 = x_118_phi;
int const x_120 = x_120_phi;
float const x_123 = x_6.injectionSwitch.y;
x_161_phi = x_115;
if ((x_120 < int((x_123 + 1.0f)))) {
} else {
break;
}
while (true) {
bool x_135 = false;
int x_143_phi = 0;
int x_154_phi = 0;
bool x_155_phi = false;
float const x_134 = (*(tint_symbol_5)).x;
x_135 = (x_134 < -1.0f);
if (!((x_40 < 0.0f))) {
if (x_135) {
x_119_phi = 0;
break;
}
x_143_phi = 1;
while (true) {
int x_144 = 0;
int const x_143 = x_143_phi;
x_154_phi = x_118;
x_155_phi = false;
if ((x_143 < 3)) {
} else {
break;
}
if (x_135) {
{
x_144 = (x_143 + 1);
x_143_phi = x_144;
}
continue;
}
if ((x_143 > 0)) {
x_154_phi = 1;
x_155_phi = true;
break;
}
{
x_144 = (x_143 + 1);
x_143_phi = x_144;
}
}
x_154 = x_154_phi;
bool const x_155 = x_155_phi;
x_119_phi = x_154;
if (x_155) {
break;
}
}
x_119_phi = 0;
break;
}
int x_119 = 0;
x_119 = x_119_phi;
x_116 = as_type<int>((x_115 + x_119));
if (select(x_41, false, !(x_41))) {
x_161_phi = x_116;
break;
}
{
x_121 = (x_120 + 1);
x_115_phi = x_116;
x_118_phi = x_119;
x_120_phi = x_121;
}
}
int const x_161 = x_161_phi;
if ((x_161 == 4)) {
*(tint_symbol_6) = float4(1.0f, 0.0f, 0.0f, 1.0f);
} else {
*(tint_symbol_6) = float4(0.0f, 0.0f, 0.0f, 0.0f);
}
break;
}
return;
}
fragment tint_symbol_2 tint_symbol(float4 gl_FragCoord_param [[position]], constant buf0& x_6 [[buffer(0)]]) {
thread float4 tint_symbol_7 = 0.0f;
thread float4 tint_symbol_8 = 0.0f;
tint_symbol_7 = gl_FragCoord_param;
main_1(x_6, &(tint_symbol_7), &(tint_symbol_8));
main_out const tint_symbol_3 = {.x_GLF_color_1=tint_symbol_8};
tint_symbol_2 const tint_symbol_4 = {.x_GLF_color_1=tint_symbol_3.x_GLF_color_1};
return tint_symbol_4;
}

View File

@@ -0,0 +1,566 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 292
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main" %tint_symbol %tint_symbol_2
OpExecutionMode %main OriginUpperLeft
OpName %gl_FragCoord "gl_FragCoord"
OpName %buf0 "buf0"
OpMemberName %buf0 0 "injectionSwitch"
OpName %x_6 "x_6"
OpName %x_GLF_color "x_GLF_color"
OpName %tint_symbol "tint_symbol"
OpName %tint_symbol_2 "tint_symbol_2"
OpName %main_1 "main_1"
OpName %x_45 "x_45"
OpName %x_48 "x_48"
OpName %x_49 "x_49"
OpName %x_46 "x_46"
OpName %x_115 "x_115"
OpName %x_116 "x_116"
OpName %x_45_phi "x_45_phi"
OpName %x_48_phi "x_48_phi"
OpName %x_50_phi "x_50_phi"
OpName %x_52_phi "x_52_phi"
OpName %x_111_phi "x_111_phi"
OpName %x_112_phi "x_112_phi"
OpName %x_115_phi "x_115_phi"
OpName %x_118_phi "x_118_phi"
OpName %x_120_phi "x_120_phi"
OpName %x_161_phi "x_161_phi"
OpName %x_62 "x_62"
OpName %x_65 "x_65"
OpName %x_66 "x_66"
OpName %x_63 "x_63"
OpName %x_53 "x_53"
OpName %x_62_phi "x_62_phi"
OpName %x_65_phi "x_65_phi"
OpName %x_67_phi "x_67_phi"
OpName %x_51_phi "x_51_phi"
OpName %x_49_phi "x_49_phi"
OpName %x_46_phi "x_46_phi"
OpName %x_97 "x_97"
OpName %x_68 "x_68"
OpName %x_66_phi "x_66_phi"
OpName %x_78 "x_78"
OpName %x_86_phi "x_86_phi"
OpName %x_97_phi "x_97_phi"
OpName %x_98_phi "x_98_phi"
OpName %x_87 "x_87"
OpName %x_154 "x_154"
OpName %x_121 "x_121"
OpName %x_119_phi "x_119_phi"
OpName %x_135 "x_135"
OpName %x_143_phi "x_143_phi"
OpName %x_154_phi "x_154_phi"
OpName %x_155_phi "x_155_phi"
OpName %x_144 "x_144"
OpName %x_119 "x_119"
OpName %main_out "main_out"
OpMemberName %main_out 0 "x_GLF_color_1"
OpName %tint_symbol_3 "tint_symbol_3"
OpName %tint_symbol_1 "tint_symbol_1"
OpName %main "main"
OpDecorate %buf0 Block
OpMemberDecorate %buf0 0 Offset 0
OpDecorate %x_6 NonWritable
OpDecorate %x_6 DescriptorSet 0
OpDecorate %x_6 Binding 0
OpDecorate %tint_symbol BuiltIn FragCoord
OpDecorate %tint_symbol_2 Location 0
OpMemberDecorate %main_out 0 Offset 0
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Private_v4float = OpTypePointer Private %v4float
%5 = OpConstantNull %v4float
%gl_FragCoord = OpVariable %_ptr_Private_v4float Private %5
%v2float = OpTypeVector %float 2
%buf0 = OpTypeStruct %v2float
%_ptr_Uniform_buf0 = OpTypePointer Uniform %buf0
%x_6 = OpVariable %_ptr_Uniform_buf0 Uniform
%x_GLF_color = OpVariable %_ptr_Private_v4float Private %5
%_ptr_Input_v4float = OpTypePointer Input %v4float
%tint_symbol = OpVariable %_ptr_Input_v4float Input
%_ptr_Output_v4float = OpTypePointer Output %v4float
%tint_symbol_2 = OpVariable %_ptr_Output_v4float Output %5
%void = OpTypeVoid
%15 = OpTypeFunction %void
%bool = OpTypeBool
%_ptr_Function_bool = OpTypePointer Function %bool
%26 = OpConstantNull %bool
%int = OpTypeInt 32 1
%_ptr_Function_int = OpTypePointer Function %int
%30 = OpConstantNull %int
%uint = OpTypeInt 32 0
%uint_0 = OpConstant %uint 0
%_ptr_Uniform_float = OpTypePointer Uniform %float
%float_n1 = OpConstant %float -1
%false = OpConstantFalse %bool
%int_0 = OpConstant %int 0
%uint_1 = OpConstant %uint 1
%_ptr_Private_float = OpTypePointer Private %float
%int_10 = OpConstant %int 10
%int_100 = OpConstant %int 100
%int_2 = OpConstant %int 2
%float_0 = OpConstant %float 0
%int_1 = OpConstant %int 1
%int_3 = OpConstant %int 3
%true = OpConstantTrue %bool
%float_1 = OpConstant %float 1
%int_4 = OpConstant %int 4
%277 = OpConstantComposite %v4float %float_1 %float_0 %float_0 %float_1
%278 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0
%main_out = OpTypeStruct %v4float
%279 = OpTypeFunction %void %main_out
%main_1 = OpFunction %void None %15
%18 = OpLabel
%x_45 = OpVariable %_ptr_Function_bool Function %26
%x_48 = OpVariable %_ptr_Function_int Function %30
%x_49 = OpVariable %_ptr_Function_int Function %30
%x_46 = OpVariable %_ptr_Function_bool Function %26
%x_115 = OpVariable %_ptr_Function_int Function %30
%x_116 = OpVariable %_ptr_Function_int Function %30
%x_45_phi = OpVariable %_ptr_Function_bool Function %26
%x_48_phi = OpVariable %_ptr_Function_int Function %30
%x_50_phi = OpVariable %_ptr_Function_int Function %30
%x_52_phi = OpVariable %_ptr_Function_int Function %30
%x_111_phi = OpVariable %_ptr_Function_int Function %30
%x_112_phi = OpVariable %_ptr_Function_bool Function %26
%x_115_phi = OpVariable %_ptr_Function_int Function %30
%x_118_phi = OpVariable %_ptr_Function_int Function %30
%x_120_phi = OpVariable %_ptr_Function_int Function %30
%x_161_phi = OpVariable %_ptr_Function_int Function %30
%x_62 = OpVariable %_ptr_Function_int Function %30
%x_65 = OpVariable %_ptr_Function_int Function %30
%x_66 = OpVariable %_ptr_Function_int Function %30
%x_63 = OpVariable %_ptr_Function_int Function %30
%x_53 = OpVariable %_ptr_Function_int Function %30
%x_62_phi = OpVariable %_ptr_Function_int Function %30
%x_65_phi = OpVariable %_ptr_Function_int Function %30
%x_67_phi = OpVariable %_ptr_Function_int Function %30
%x_51_phi = OpVariable %_ptr_Function_int Function %30
%x_49_phi = OpVariable %_ptr_Function_int Function %30
%x_46_phi = OpVariable %_ptr_Function_bool Function %26
%x_97 = OpVariable %_ptr_Function_int Function %30
%x_68 = OpVariable %_ptr_Function_int Function %30
%x_66_phi = OpVariable %_ptr_Function_int Function %30
%x_78 = OpVariable %_ptr_Function_bool Function %26
%x_86_phi = OpVariable %_ptr_Function_int Function %30
%x_97_phi = OpVariable %_ptr_Function_int Function %30
%x_98_phi = OpVariable %_ptr_Function_bool Function %26
%x_87 = OpVariable %_ptr_Function_int Function %30
%x_154 = OpVariable %_ptr_Function_int Function %30
%x_121 = OpVariable %_ptr_Function_int Function %30
%x_119_phi = OpVariable %_ptr_Function_int Function %30
%x_135 = OpVariable %_ptr_Function_bool Function %26
%x_143_phi = OpVariable %_ptr_Function_int Function %30
%x_154_phi = OpVariable %_ptr_Function_int Function %30
%x_155_phi = OpVariable %_ptr_Function_bool Function %26
%x_144 = OpVariable %_ptr_Function_int Function %30
%x_119 = OpVariable %_ptr_Function_int Function %30
OpBranch %19
%19 = OpLabel
OpLoopMerge %20 %21 None
OpBranch %22
%22 = OpLabel
%48 = OpAccessChain %_ptr_Uniform_float %x_6 %uint_0 %uint_0
%49 = OpLoad %float %48
%51 = OpFOrdLessThan %bool %49 %float_n1
OpStore %x_45_phi %false
OpStore %x_48_phi %int_0
OpStore %x_50_phi %int_0
OpStore %x_52_phi %int_0
OpBranch %54
%54 = OpLabel
OpLoopMerge %55 %56 None
OpBranch %57
%57 = OpLabel
%69 = OpLoad %bool %x_45_phi
OpStore %x_45 %69
%70 = OpLoad %int %x_48_phi
OpStore %x_48 %70
%71 = OpLoad %int %x_50_phi
%72 = OpLoad %int %x_52_phi
%75 = OpAccessChain %_ptr_Private_float %gl_FragCoord %uint_1
%76 = OpLoad %float %75
%77 = OpLoad %int %x_48
OpStore %x_111_phi %77
%78 = OpLoad %bool %x_45
OpStore %x_112_phi %78
%80 = OpFOrdGreaterThan %bool %76 %float_n1
%79 = OpSelect %int %80 %int_10 %int_100
%83 = OpSLessThan %bool %72 %79
OpSelectionMerge %84 None
OpBranchConditional %83 %85 %86
%85 = OpLabel
OpBranch %84
%86 = OpLabel
OpBranch %55
%84 = OpLabel
%87 = OpLoad %int %x_48
OpStore %x_62_phi %87
OpStore %x_65_phi %71
OpStore %x_67_phi %int_0
OpBranch %88
%88 = OpLabel
OpLoopMerge %89 %90 None
OpBranch %91
%91 = OpLabel
%95 = OpLoad %int %x_62_phi
OpStore %x_62 %95
%96 = OpLoad %int %x_65_phi
OpStore %x_65 %96
%97 = OpLoad %int %x_67_phi
%98 = OpLoad %int %x_65
OpStore %x_51_phi %98
%99 = OpLoad %int %x_62
OpStore %x_49_phi %99
%100 = OpLoad %bool %x_45
OpStore %x_46_phi %100
%102 = OpSLessThan %bool %97 %int_2
OpSelectionMerge %103 None
OpBranchConditional %102 %104 %105
%104 = OpLabel
OpBranch %103
%105 = OpLabel
OpBranch %89
%103 = OpLabel
OpBranch %106
%106 = OpLabel
OpLoopMerge %107 %108 None
OpBranch %109
%109 = OpLabel
%114 = OpAccessChain %_ptr_Private_float %gl_FragCoord %uint_0
%115 = OpLoad %float %114
%116 = OpFOrdLessThan %bool %115 %float_n1
OpStore %x_78 %116
%119 = OpFOrdLessThan %bool %49 %float_0
%117 = OpLogicalNot %bool %119
OpSelectionMerge %120 None
OpBranchConditional %117 %121 %120
%121 = OpLabel
%122 = OpLoad %bool %x_78
OpSelectionMerge %123 None
OpBranchConditional %122 %124 %123
%124 = OpLabel
OpStore %x_66_phi %int_0
OpBranch %107
%123 = OpLabel
OpStore %x_86_phi %int_1
OpBranch %126
%126 = OpLabel
OpLoopMerge %127 %128 None
OpBranch %129
%129 = OpLabel
%131 = OpLoad %int %x_86_phi
%132 = OpLoad %int %x_65
OpStore %x_97_phi %132
OpStore %x_98_phi %false
%134 = OpSLessThan %bool %131 %int_3
OpSelectionMerge %135 None
OpBranchConditional %134 %136 %137
%136 = OpLabel
OpBranch %135
%137 = OpLabel
OpBranch %127
%135 = OpLabel
%138 = OpLoad %bool %x_78
OpSelectionMerge %139 None
OpBranchConditional %138 %140 %139
%140 = OpLabel
OpBranch %128
%139 = OpLabel
%141 = OpSGreaterThan %bool %131 %int_0
OpSelectionMerge %142 None
OpBranchConditional %141 %143 %142
%143 = OpLabel
OpStore %x_97_phi %int_1
OpStore %x_98_phi %true
OpBranch %127
%142 = OpLabel
OpBranch %128
%128 = OpLabel
%145 = OpIAdd %int %131 %int_1
OpStore %x_87 %145
%146 = OpLoad %int %x_87
OpStore %x_86_phi %146
OpBranch %126
%127 = OpLabel
%147 = OpLoad %int %x_97_phi
OpStore %x_97 %147
%148 = OpLoad %bool %x_98_phi
%149 = OpLoad %int %x_97
OpStore %x_66_phi %149
OpSelectionMerge %150 None
OpBranchConditional %148 %151 %150
%151 = OpLabel
OpBranch %107
%150 = OpLabel
OpBranch %120
%120 = OpLabel
OpStore %x_66_phi %int_0
OpBranch %107
%108 = OpLabel
OpBranch %106
%107 = OpLabel
%152 = OpLoad %int %x_66_phi
OpStore %x_66 %152
%154 = OpLoad %int %x_62
%155 = OpLoad %int %x_66
%156 = OpIAdd %int %154 %155
%153 = OpCopyObject %int %156
OpStore %x_63 %153
OpSelectionMerge %157 None
OpBranchConditional %51 %158 %157
%158 = OpLabel
OpBranch %159
%159 = OpLabel
OpLoopMerge %160 %161 None
OpBranch %162
%162 = OpLabel
OpSelectionMerge %163 None
OpBranchConditional %51 %164 %165
%164 = OpLabel
OpBranch %163
%165 = OpLabel
OpBranch %160
%163 = OpLabel
OpBranch %161
%161 = OpLabel
%166 = OpConvertSToF %float %72
%167 = OpCompositeConstruct %v4float %166 %166 %166 %166
OpStore %x_GLF_color %167
OpBranch %159
%160 = OpLabel
%168 = OpLoad %int %x_66
OpStore %x_51_phi %168
%169 = OpLoad %int %x_63
OpStore %x_49_phi %169
OpStore %x_46_phi %true
OpBranch %89
%157 = OpLabel
OpBranch %90
%90 = OpLabel
%170 = OpIAdd %int %97 %int_1
OpStore %x_68 %170
%171 = OpLoad %int %x_63
OpStore %x_62_phi %171
%172 = OpLoad %int %x_66
OpStore %x_65_phi %172
%173 = OpLoad %int %x_68
OpStore %x_67_phi %173
OpBranch %88
%89 = OpLabel
%174 = OpLoad %int %x_51_phi
%175 = OpLoad %int %x_49_phi
OpStore %x_49 %175
%176 = OpLoad %bool %x_46_phi
OpStore %x_46 %176
%177 = OpLoad %int %x_49
OpStore %x_111_phi %177
%178 = OpLoad %bool %x_46
OpStore %x_112_phi %178
%179 = OpLoad %bool %x_46
OpSelectionMerge %180 None
OpBranchConditional %179 %181 %180
%181 = OpLabel
OpBranch %55
%180 = OpLabel
%182 = OpLogicalNot %bool %51
OpSelectionMerge %183 None
OpBranchConditional %182 %184 %183
%184 = OpLabel
%185 = OpLoad %int %x_49
OpStore %x_111_phi %185
%186 = OpLoad %bool %x_46
OpStore %x_112_phi %186
OpBranch %55
%183 = OpLabel
OpBranch %56
%56 = OpLabel
%187 = OpIAdd %int %72 %int_1
OpStore %x_53 %187
%188 = OpLoad %bool %x_46
OpStore %x_45_phi %188
%189 = OpLoad %int %x_49
OpStore %x_48_phi %189
OpStore %x_50_phi %174
%190 = OpLoad %int %x_53
OpStore %x_52_phi %190
OpBranch %54
%55 = OpLabel
%191 = OpLoad %int %x_111_phi
%192 = OpLoad %bool %x_112_phi
OpSelectionMerge %193 None
OpBranchConditional %192 %194 %193
%194 = OpLabel
OpBranch %20
%193 = OpLabel
OpStore %x_115_phi %191
OpStore %x_118_phi %int_0
OpStore %x_120_phi %int_0
OpBranch %195
%195 = OpLabel
OpLoopMerge %196 %197 None
OpBranch %198
%198 = OpLabel
%202 = OpLoad %int %x_115_phi
OpStore %x_115 %202
%203 = OpLoad %int %x_118_phi
%204 = OpLoad %int %x_120_phi
%205 = OpAccessChain %_ptr_Uniform_float %x_6 %uint_0 %uint_1
%206 = OpLoad %float %205
%207 = OpLoad %int %x_115
OpStore %x_161_phi %207
%210 = OpFAdd %float %206 %float_1
%208 = OpConvertFToS %int %210
%211 = OpSLessThan %bool %204 %208
OpSelectionMerge %212 None
OpBranchConditional %211 %213 %214
%213 = OpLabel
OpBranch %212
%214 = OpLabel
OpBranch %196
%212 = OpLabel
OpBranch %215
%215 = OpLabel
OpLoopMerge %216 %217 None
OpBranch %218
%218 = OpLabel
%223 = OpAccessChain %_ptr_Private_float %gl_FragCoord %uint_0
%224 = OpLoad %float %223
%225 = OpFOrdLessThan %bool %224 %float_n1
OpStore %x_135 %225
%227 = OpFOrdLessThan %bool %49 %float_0
%226 = OpLogicalNot %bool %227
OpSelectionMerge %228 None
OpBranchConditional %226 %229 %228
%229 = OpLabel
%230 = OpLoad %bool %x_135
OpSelectionMerge %231 None
OpBranchConditional %230 %232 %231
%232 = OpLabel
OpStore %x_119_phi %int_0
OpBranch %216
%231 = OpLabel
OpStore %x_143_phi %int_1
OpBranch %233
%233 = OpLabel
OpLoopMerge %234 %235 None
OpBranch %236
%236 = OpLabel
%238 = OpLoad %int %x_143_phi
OpStore %x_154_phi %203
OpStore %x_155_phi %false
%239 = OpSLessThan %bool %238 %int_3
OpSelectionMerge %240 None
OpBranchConditional %239 %241 %242
%241 = OpLabel
OpBranch %240
%242 = OpLabel
OpBranch %234
%240 = OpLabel
%243 = OpLoad %bool %x_135
OpSelectionMerge %244 None
OpBranchConditional %243 %245 %244
%245 = OpLabel
OpBranch %235
%244 = OpLabel
%246 = OpSGreaterThan %bool %238 %int_0
OpSelectionMerge %247 None
OpBranchConditional %246 %248 %247
%248 = OpLabel
OpStore %x_154_phi %int_1
OpStore %x_155_phi %true
OpBranch %234
%247 = OpLabel
OpBranch %235
%235 = OpLabel
%249 = OpIAdd %int %238 %int_1
OpStore %x_144 %249
%250 = OpLoad %int %x_144
OpStore %x_143_phi %250
OpBranch %233
%234 = OpLabel
%251 = OpLoad %int %x_154_phi
OpStore %x_154 %251
%252 = OpLoad %bool %x_155_phi
%253 = OpLoad %int %x_154
OpStore %x_119_phi %253
OpSelectionMerge %254 None
OpBranchConditional %252 %255 %254
%255 = OpLabel
OpBranch %216
%254 = OpLabel
OpBranch %228
%228 = OpLabel
OpStore %x_119_phi %int_0
OpBranch %216
%217 = OpLabel
OpBranch %215
%216 = OpLabel
%257 = OpLoad %int %x_119_phi
OpStore %x_119 %257
%259 = OpLoad %int %x_115
%260 = OpLoad %int %x_119
%261 = OpIAdd %int %259 %260
%258 = OpCopyObject %int %261
OpStore %x_116 %258
%263 = OpLogicalNot %bool %51
%262 = OpSelect %bool %263 %false %51
OpSelectionMerge %264 None
OpBranchConditional %262 %265 %264
%265 = OpLabel
%266 = OpLoad %int %x_116
OpStore %x_161_phi %266
OpBranch %196
%264 = OpLabel
OpBranch %197
%197 = OpLabel
%267 = OpIAdd %int %204 %int_1
OpStore %x_121 %267
%268 = OpLoad %int %x_116
OpStore %x_115_phi %268
%269 = OpLoad %int %x_119
OpStore %x_118_phi %269
%270 = OpLoad %int %x_121
OpStore %x_120_phi %270
OpBranch %195
%196 = OpLabel
%271 = OpLoad %int %x_161_phi
%273 = OpIEqual %bool %271 %int_4
OpSelectionMerge %274 None
OpBranchConditional %273 %275 %276
%275 = OpLabel
OpStore %x_GLF_color %277
OpBranch %274
%276 = OpLabel
OpStore %x_GLF_color %278
OpBranch %274
%274 = OpLabel
OpBranch %20
%21 = OpLabel
OpBranch %19
%20 = OpLabel
OpReturn
OpFunctionEnd
%tint_symbol_3 = OpFunction %void None %279
%tint_symbol_1 = OpFunctionParameter %main_out
%283 = OpLabel
%284 = OpCompositeExtract %v4float %tint_symbol_1 0
OpStore %tint_symbol_2 %284
OpReturn
OpFunctionEnd
%main = OpFunction %void None %15
%286 = OpLabel
%287 = OpLoad %v4float %tint_symbol
OpStore %gl_FragCoord %287
%288 = OpFunctionCall %void %main_1
%290 = OpLoad %v4float %x_GLF_color
%291 = OpCompositeConstruct %main_out %290
%289 = OpFunctionCall %void %tint_symbol_3 %291
OpReturn
OpFunctionEnd

View File

@@ -0,0 +1,274 @@
[[block]]
struct buf0 {
injectionSwitch : vec2<f32>;
};
var<private> gl_FragCoord : vec4<f32>;
[[group(0), binding(0)]] var<uniform> x_6 : buf0;
var<private> x_GLF_color : vec4<f32>;
fn main_1() {
loop {
var x_45 : bool;
var x_48 : i32;
var x_49 : i32;
var x_46 : bool;
var x_115 : i32;
var x_116 : i32;
var x_45_phi : bool;
var x_48_phi : i32;
var x_50_phi : i32;
var x_52_phi : i32;
var x_111_phi : i32;
var x_112_phi : bool;
var x_115_phi : i32;
var x_118_phi : i32;
var x_120_phi : i32;
var x_161_phi : i32;
let x_40 : f32 = x_6.injectionSwitch.x;
let x_41 : bool = (x_40 < -1.0);
x_45_phi = false;
x_48_phi = 0;
x_50_phi = 0;
x_52_phi = 0;
loop {
var x_62 : i32;
var x_65 : i32;
var x_66 : i32;
var x_63 : i32;
var x_53 : i32;
var x_62_phi : i32;
var x_65_phi : i32;
var x_67_phi : i32;
var x_51_phi : i32;
var x_49_phi : i32;
var x_46_phi : bool;
x_45 = x_45_phi;
x_48 = x_48_phi;
let x_50 : i32 = x_50_phi;
let x_52 : i32 = x_52_phi;
let x_55 : f32 = gl_FragCoord.y;
x_111_phi = x_48;
x_112_phi = x_45;
if ((x_52 < select(100, 10, (x_55 > -1.0)))) {
} else {
break;
}
x_62_phi = x_48;
x_65_phi = x_50;
x_67_phi = 0;
loop {
var x_97 : i32;
var x_68 : i32;
var x_66_phi : i32;
x_62 = x_62_phi;
x_65 = x_65_phi;
let x_67 : i32 = x_67_phi;
x_51_phi = x_65;
x_49_phi = x_62;
x_46_phi = x_45;
if ((x_67 < 2)) {
} else {
break;
}
loop {
var x_78 : bool;
var x_86_phi : i32;
var x_97_phi : i32;
var x_98_phi : bool;
let x_77 : f32 = gl_FragCoord.x;
x_78 = (x_77 < -1.0);
if (!((x_40 < 0.0))) {
if (x_78) {
x_66_phi = 0;
break;
}
x_86_phi = 1;
loop {
var x_87 : i32;
let x_86 : i32 = x_86_phi;
x_97_phi = x_65;
x_98_phi = false;
if ((x_86 < 3)) {
} else {
break;
}
if (x_78) {
continue;
}
if ((x_86 > 0)) {
x_97_phi = 1;
x_98_phi = true;
break;
}
continuing {
x_87 = (x_86 + 1);
x_86_phi = x_87;
}
}
x_97 = x_97_phi;
let x_98 : bool = x_98_phi;
x_66_phi = x_97;
if (x_98) {
break;
}
}
x_66_phi = 0;
break;
}
x_66 = x_66_phi;
x_63 = bitcast<i32>((x_62 + x_66));
if (x_41) {
loop {
if (x_41) {
} else {
break;
}
continuing {
let x_105 : f32 = f32(x_52);
x_GLF_color = vec4<f32>(x_105, x_105, x_105, x_105);
}
}
x_51_phi = x_66;
x_49_phi = x_63;
x_46_phi = true;
break;
}
continuing {
x_68 = (x_67 + 1);
x_62_phi = x_63;
x_65_phi = x_66;
x_67_phi = x_68;
}
}
let x_51 : i32 = x_51_phi;
x_49 = x_49_phi;
x_46 = x_46_phi;
x_111_phi = x_49;
x_112_phi = x_46;
if (x_46) {
break;
}
if (!(x_41)) {
x_111_phi = x_49;
x_112_phi = x_46;
break;
}
continuing {
x_53 = (x_52 + 1);
x_45_phi = x_46;
x_48_phi = x_49;
x_50_phi = x_51;
x_52_phi = x_53;
}
}
let x_111 : i32 = x_111_phi;
let x_112 : bool = x_112_phi;
if (x_112) {
break;
}
x_115_phi = x_111;
x_118_phi = 0;
x_120_phi = 0;
loop {
var x_154 : i32;
var x_121 : i32;
var x_119_phi : i32;
x_115 = x_115_phi;
let x_118 : i32 = x_118_phi;
let x_120 : i32 = x_120_phi;
let x_123 : f32 = x_6.injectionSwitch.y;
x_161_phi = x_115;
if ((x_120 < i32((x_123 + 1.0)))) {
} else {
break;
}
loop {
var x_135 : bool;
var x_143_phi : i32;
var x_154_phi : i32;
var x_155_phi : bool;
let x_134 : f32 = gl_FragCoord.x;
x_135 = (x_134 < -1.0);
if (!((x_40 < 0.0))) {
if (x_135) {
x_119_phi = 0;
break;
}
x_143_phi = 1;
loop {
var x_144 : i32;
let x_143 : i32 = x_143_phi;
x_154_phi = x_118;
x_155_phi = false;
if ((x_143 < 3)) {
} else {
break;
}
if (x_135) {
continue;
}
if ((x_143 > 0)) {
x_154_phi = 1;
x_155_phi = true;
break;
}
continuing {
x_144 = (x_143 + 1);
x_143_phi = x_144;
}
}
x_154 = x_154_phi;
let x_155 : bool = x_155_phi;
x_119_phi = x_154;
if (x_155) {
break;
}
}
x_119_phi = 0;
break;
}
var x_119 : i32;
x_119 = x_119_phi;
x_116 = bitcast<i32>((x_115 + x_119));
if (select(x_41, false, !(x_41))) {
x_161_phi = x_116;
break;
}
continuing {
x_121 = (x_120 + 1);
x_115_phi = x_116;
x_118_phi = x_119;
x_120_phi = x_121;
}
}
let x_161 : i32 = x_161_phi;
if ((x_161 == 4)) {
x_GLF_color = vec4<f32>(1.0, 0.0, 0.0, 1.0);
} else {
x_GLF_color = vec4<f32>(0.0, 0.0, 0.0, 0.0);
}
break;
}
return;
}
struct main_out {
[[location(0)]]
x_GLF_color_1 : vec4<f32>;
};
[[stage(fragment)]]
fn main([[builtin(position)]] gl_FragCoord_param : vec4<f32>) -> main_out {
gl_FragCoord = gl_FragCoord_param;
main_1();
return main_out(x_GLF_color);
}

View File

@@ -0,0 +1,274 @@
[[block]]
struct buf0 {
injectionSwitch : vec2<f32>;
};
var<private> gl_FragCoord : vec4<f32>;
[[group(0), binding(0)]] var<uniform> x_6 : buf0;
var<private> x_GLF_color : vec4<f32>;
fn main_1() {
loop {
var x_45 : bool;
var x_48 : i32;
var x_49 : i32;
var x_46 : bool;
var x_115 : i32;
var x_116 : i32;
var x_45_phi : bool;
var x_48_phi : i32;
var x_50_phi : i32;
var x_52_phi : i32;
var x_111_phi : i32;
var x_112_phi : bool;
var x_115_phi : i32;
var x_118_phi : i32;
var x_120_phi : i32;
var x_161_phi : i32;
let x_40 : f32 = x_6.injectionSwitch.x;
let x_41 : bool = (x_40 < -1.0);
x_45_phi = false;
x_48_phi = 0;
x_50_phi = 0;
x_52_phi = 0;
loop {
var x_62 : i32;
var x_65 : i32;
var x_66 : i32;
var x_63 : i32;
var x_53 : i32;
var x_62_phi : i32;
var x_65_phi : i32;
var x_67_phi : i32;
var x_51_phi : i32;
var x_49_phi : i32;
var x_46_phi : bool;
x_45 = x_45_phi;
x_48 = x_48_phi;
let x_50 : i32 = x_50_phi;
let x_52 : i32 = x_52_phi;
let x_55 : f32 = gl_FragCoord.y;
x_111_phi = x_48;
x_112_phi = x_45;
if ((x_52 < select(100, 10, (x_55 > -1.0)))) {
} else {
break;
}
x_62_phi = x_48;
x_65_phi = x_50;
x_67_phi = 0;
loop {
var x_97 : i32;
var x_68 : i32;
var x_66_phi : i32;
x_62 = x_62_phi;
x_65 = x_65_phi;
let x_67 : i32 = x_67_phi;
x_51_phi = x_65;
x_49_phi = x_62;
x_46_phi = x_45;
if ((x_67 < 2)) {
} else {
break;
}
loop {
var x_78 : bool;
var x_86_phi : i32;
var x_97_phi : i32;
var x_98_phi : bool;
let x_77 : f32 = gl_FragCoord.x;
x_78 = (x_77 < -1.0);
if (!((x_40 < 0.0))) {
if (x_78) {
x_66_phi = 0;
break;
}
x_86_phi = 1;
loop {
var x_87 : i32;
let x_86 : i32 = x_86_phi;
x_97_phi = x_65;
x_98_phi = false;
if ((x_86 < 3)) {
} else {
break;
}
if (x_78) {
continue;
}
if ((x_86 > 0)) {
x_97_phi = 1;
x_98_phi = true;
break;
}
continuing {
x_87 = (x_86 + 1);
x_86_phi = x_87;
}
}
x_97 = x_97_phi;
let x_98 : bool = x_98_phi;
x_66_phi = x_97;
if (x_98) {
break;
}
}
x_66_phi = 0;
break;
}
x_66 = x_66_phi;
x_63 = bitcast<i32>((x_62 + x_66));
if (x_41) {
loop {
if (x_41) {
} else {
break;
}
continuing {
let x_105 : f32 = f32(x_52);
x_GLF_color = vec4<f32>(x_105, x_105, x_105, x_105);
}
}
x_51_phi = x_66;
x_49_phi = x_63;
x_46_phi = true;
break;
}
continuing {
x_68 = (x_67 + 1);
x_62_phi = x_63;
x_65_phi = x_66;
x_67_phi = x_68;
}
}
let x_51 : i32 = x_51_phi;
x_49 = x_49_phi;
x_46 = x_46_phi;
x_111_phi = x_49;
x_112_phi = x_46;
if (x_46) {
break;
}
if (!(x_41)) {
x_111_phi = x_49;
x_112_phi = x_46;
break;
}
continuing {
x_53 = (x_52 + 1);
x_45_phi = x_46;
x_48_phi = x_49;
x_50_phi = x_51;
x_52_phi = x_53;
}
}
let x_111 : i32 = x_111_phi;
let x_112 : bool = x_112_phi;
if (x_112) {
break;
}
x_115_phi = x_111;
x_118_phi = 0;
x_120_phi = 0;
loop {
var x_154 : i32;
var x_121 : i32;
var x_119_phi : i32;
x_115 = x_115_phi;
let x_118 : i32 = x_118_phi;
let x_120 : i32 = x_120_phi;
let x_123 : f32 = x_6.injectionSwitch.y;
x_161_phi = x_115;
if ((x_120 < i32((x_123 + 1.0)))) {
} else {
break;
}
loop {
var x_135 : bool;
var x_143_phi : i32;
var x_154_phi : i32;
var x_155_phi : bool;
let x_134 : f32 = gl_FragCoord.x;
x_135 = (x_134 < -1.0);
if (!((x_40 < 0.0))) {
if (x_135) {
x_119_phi = 0;
break;
}
x_143_phi = 1;
loop {
var x_144 : i32;
let x_143 : i32 = x_143_phi;
x_154_phi = x_118;
x_155_phi = false;
if ((x_143 < 3)) {
} else {
break;
}
if (x_135) {
continue;
}
if ((x_143 > 0)) {
x_154_phi = 1;
x_155_phi = true;
break;
}
continuing {
x_144 = (x_143 + 1);
x_143_phi = x_144;
}
}
x_154 = x_154_phi;
let x_155 : bool = x_155_phi;
x_119_phi = x_154;
if (x_155) {
break;
}
}
x_119_phi = 0;
break;
}
var x_119 : i32;
x_119 = x_119_phi;
x_116 = bitcast<i32>((x_115 + x_119));
if (select(x_41, false, !(x_41))) {
x_161_phi = x_116;
break;
}
continuing {
x_121 = (x_120 + 1);
x_115_phi = x_116;
x_118_phi = x_119;
x_120_phi = x_121;
}
}
let x_161 : i32 = x_161_phi;
if ((x_161 == 4)) {
x_GLF_color = vec4<f32>(1.0, 0.0, 0.0, 1.0);
} else {
x_GLF_color = vec4<f32>(0.0, 0.0, 0.0, 0.0);
}
break;
}
return;
}
struct main_out {
[[location(0)]]
x_GLF_color_1 : vec4<f32>;
};
[[stage(fragment)]]
fn main([[builtin(position)]] gl_FragCoord_param : vec4<f32>) -> main_out {
gl_FragCoord = gl_FragCoord_param;
main_1();
return main_out(x_GLF_color);
}

View File

@@ -0,0 +1,276 @@
static float4 gl_FragCoord = float4(0.0f, 0.0f, 0.0f, 0.0f);
cbuffer cbuffer_x_6 : register(b0, space0) {
uint4 x_6[1];
};
static float4 x_GLF_color = float4(0.0f, 0.0f, 0.0f, 0.0f);
void main_1() {
while (true) {
bool x_45 = false;
int x_48 = 0;
int x_49 = 0;
bool x_46 = false;
int x_115 = 0;
int x_116 = 0;
bool x_45_phi = false;
int x_48_phi = 0;
int x_50_phi = 0;
int x_52_phi = 0;
int x_111_phi = 0;
bool x_112_phi = false;
int x_115_phi = 0;
int x_118_phi = 0;
int x_120_phi = 0;
int x_161_phi = 0;
const float x_40 = asfloat(x_6[0].x);
const bool x_41 = (x_40 < -1.0f);
x_45_phi = false;
x_48_phi = 0;
x_50_phi = 0;
x_52_phi = 0;
while (true) {
int x_62 = 0;
int x_65 = 0;
int x_66 = 0;
int x_63 = 0;
int x_53 = 0;
int x_62_phi = 0;
int x_65_phi = 0;
int x_67_phi = 0;
int x_51_phi = 0;
int x_49_phi = 0;
bool x_46_phi = false;
x_45 = x_45_phi;
x_48 = x_48_phi;
const int x_50 = x_50_phi;
const int x_52 = x_52_phi;
const float x_55 = gl_FragCoord.y;
x_111_phi = x_48;
x_112_phi = x_45;
if ((x_52 < ((x_55 > -1.0f) ? 10 : 100))) {
} else {
break;
}
x_62_phi = x_48;
x_65_phi = x_50;
x_67_phi = 0;
while (true) {
int x_97 = 0;
int x_68 = 0;
int x_66_phi = 0;
x_62 = x_62_phi;
x_65 = x_65_phi;
const int x_67 = x_67_phi;
x_51_phi = x_65;
x_49_phi = x_62;
x_46_phi = x_45;
if ((x_67 < 2)) {
} else {
break;
}
while (true) {
bool x_78 = false;
int x_86_phi = 0;
int x_97_phi = 0;
bool x_98_phi = false;
const float x_77 = gl_FragCoord.x;
x_78 = (x_77 < -1.0f);
if (!((x_40 < 0.0f))) {
if (x_78) {
x_66_phi = 0;
break;
}
x_86_phi = 1;
while (true) {
int x_87 = 0;
const int x_86 = x_86_phi;
x_97_phi = x_65;
x_98_phi = false;
if ((x_86 < 3)) {
} else {
break;
}
if (x_78) {
{
x_87 = (x_86 + 1);
x_86_phi = x_87;
}
continue;
}
if ((x_86 > 0)) {
x_97_phi = 1;
x_98_phi = true;
break;
}
{
x_87 = (x_86 + 1);
x_86_phi = x_87;
}
}
x_97 = x_97_phi;
const bool x_98 = x_98_phi;
x_66_phi = x_97;
if (x_98) {
break;
}
}
x_66_phi = 0;
break;
}
x_66 = x_66_phi;
x_63 = asint((x_62 + x_66));
if (x_41) {
while (true) {
if (x_41) {
} else {
break;
}
{
const float x_105 = float(x_52);
x_GLF_color = float4(x_105, x_105, x_105, x_105);
}
}
x_51_phi = x_66;
x_49_phi = x_63;
x_46_phi = true;
break;
}
{
x_68 = (x_67 + 1);
x_62_phi = x_63;
x_65_phi = x_66;
x_67_phi = x_68;
}
}
const int x_51 = x_51_phi;
x_49 = x_49_phi;
x_46 = x_46_phi;
x_111_phi = x_49;
x_112_phi = x_46;
if (x_46) {
break;
}
if (!(x_41)) {
x_111_phi = x_49;
x_112_phi = x_46;
break;
}
{
x_53 = (x_52 + 1);
x_45_phi = x_46;
x_48_phi = x_49;
x_50_phi = x_51;
x_52_phi = x_53;
}
}
const int x_111 = x_111_phi;
if (x_112_phi) {
break;
}
x_115_phi = x_111;
x_118_phi = 0;
x_120_phi = 0;
while (true) {
int x_154 = 0;
int x_121 = 0;
int x_119_phi = 0;
x_115 = x_115_phi;
const int x_118 = x_118_phi;
const int x_120 = x_120_phi;
const float x_123 = asfloat(x_6[0].y);
x_161_phi = x_115;
if ((x_120 < int((x_123 + 1.0f)))) {
} else {
break;
}
while (true) {
bool x_135 = false;
int x_143_phi = 0;
int x_154_phi = 0;
bool x_155_phi = false;
const float x_134 = gl_FragCoord.x;
x_135 = (x_134 < -1.0f);
if (!((x_40 < 0.0f))) {
if (x_135) {
x_119_phi = 0;
break;
}
x_143_phi = 1;
while (true) {
int x_144 = 0;
const int x_143 = x_143_phi;
x_154_phi = x_118;
x_155_phi = false;
if ((x_143 < 3)) {
} else {
break;
}
if (x_135) {
{
x_144 = (x_143 + 1);
x_143_phi = x_144;
}
continue;
}
if ((x_143 > 0)) {
x_154_phi = 1;
x_155_phi = true;
break;
}
{
x_144 = (x_143 + 1);
x_143_phi = x_144;
}
}
x_154 = x_154_phi;
const bool x_155 = x_155_phi;
x_119_phi = x_154;
if (x_155) {
break;
}
}
x_119_phi = 0;
break;
}
int x_119 = 0;
x_119 = x_119_phi;
x_116 = asint((x_115 + x_119));
if ((!(x_41) ? false : x_41)) {
x_161_phi = x_116;
break;
}
{
x_121 = (x_120 + 1);
x_115_phi = x_116;
x_118_phi = x_119;
x_120_phi = x_121;
}
}
if ((x_161_phi == 4)) {
x_GLF_color = float4(1.0f, 0.0f, 0.0f, 1.0f);
} else {
x_GLF_color = float4(0.0f, 0.0f, 0.0f, 0.0f);
}
break;
}
return;
}
struct main_out {
float4 x_GLF_color_1;
};
struct tint_symbol_1 {
float4 gl_FragCoord_param : SV_Position;
};
struct tint_symbol_2 {
float4 x_GLF_color_1 : SV_Target0;
};
tint_symbol_2 main(tint_symbol_1 tint_symbol) {
const float4 gl_FragCoord_param = tint_symbol.gl_FragCoord_param;
gl_FragCoord = gl_FragCoord_param;
main_1();
const main_out tint_symbol_3 = {x_GLF_color};
const tint_symbol_2 tint_symbol_5 = {tint_symbol_3.x_GLF_color_1};
return tint_symbol_5;
}

View File

@@ -0,0 +1,277 @@
#include <metal_stdlib>
using namespace metal;
struct buf0 {
/* 0x0000 */ packed_float2 injectionSwitch;
};
struct main_out {
float4 x_GLF_color_1;
};
struct tint_symbol_2 {
float4 x_GLF_color_1 [[color(0)]];
};
void main_1(constant buf0& x_6, thread float4* const tint_symbol_5, thread float4* const tint_symbol_6) {
while (true) {
bool x_45 = false;
int x_48 = 0;
int x_49 = 0;
bool x_46 = false;
int x_115 = 0;
int x_116 = 0;
bool x_45_phi = false;
int x_48_phi = 0;
int x_50_phi = 0;
int x_52_phi = 0;
int x_111_phi = 0;
bool x_112_phi = false;
int x_115_phi = 0;
int x_118_phi = 0;
int x_120_phi = 0;
int x_161_phi = 0;
float const x_40 = x_6.injectionSwitch.x;
bool const x_41 = (x_40 < -1.0f);
x_45_phi = false;
x_48_phi = 0;
x_50_phi = 0;
x_52_phi = 0;
while (true) {
int x_62 = 0;
int x_65 = 0;
int x_66 = 0;
int x_63 = 0;
int x_53 = 0;
int x_62_phi = 0;
int x_65_phi = 0;
int x_67_phi = 0;
int x_51_phi = 0;
int x_49_phi = 0;
bool x_46_phi = false;
x_45 = x_45_phi;
x_48 = x_48_phi;
int const x_50 = x_50_phi;
int const x_52 = x_52_phi;
float const x_55 = (*(tint_symbol_5)).y;
x_111_phi = x_48;
x_112_phi = x_45;
if ((x_52 < select(100, 10, (x_55 > -1.0f)))) {
} else {
break;
}
x_62_phi = x_48;
x_65_phi = x_50;
x_67_phi = 0;
while (true) {
int x_97 = 0;
int x_68 = 0;
int x_66_phi = 0;
x_62 = x_62_phi;
x_65 = x_65_phi;
int const x_67 = x_67_phi;
x_51_phi = x_65;
x_49_phi = x_62;
x_46_phi = x_45;
if ((x_67 < 2)) {
} else {
break;
}
while (true) {
bool x_78 = false;
int x_86_phi = 0;
int x_97_phi = 0;
bool x_98_phi = false;
float const x_77 = (*(tint_symbol_5)).x;
x_78 = (x_77 < -1.0f);
if (!((x_40 < 0.0f))) {
if (x_78) {
x_66_phi = 0;
break;
}
x_86_phi = 1;
while (true) {
int x_87 = 0;
int const x_86 = x_86_phi;
x_97_phi = x_65;
x_98_phi = false;
if ((x_86 < 3)) {
} else {
break;
}
if (x_78) {
{
x_87 = (x_86 + 1);
x_86_phi = x_87;
}
continue;
}
if ((x_86 > 0)) {
x_97_phi = 1;
x_98_phi = true;
break;
}
{
x_87 = (x_86 + 1);
x_86_phi = x_87;
}
}
x_97 = x_97_phi;
bool const x_98 = x_98_phi;
x_66_phi = x_97;
if (x_98) {
break;
}
}
x_66_phi = 0;
break;
}
x_66 = x_66_phi;
x_63 = as_type<int>((x_62 + x_66));
if (x_41) {
while (true) {
if (x_41) {
} else {
break;
}
{
float const x_105 = float(x_52);
*(tint_symbol_6) = float4(x_105, x_105, x_105, x_105);
}
}
x_51_phi = x_66;
x_49_phi = x_63;
x_46_phi = true;
break;
}
{
x_68 = (x_67 + 1);
x_62_phi = x_63;
x_65_phi = x_66;
x_67_phi = x_68;
}
}
int const x_51 = x_51_phi;
x_49 = x_49_phi;
x_46 = x_46_phi;
x_111_phi = x_49;
x_112_phi = x_46;
if (x_46) {
break;
}
if (!(x_41)) {
x_111_phi = x_49;
x_112_phi = x_46;
break;
}
{
x_53 = (x_52 + 1);
x_45_phi = x_46;
x_48_phi = x_49;
x_50_phi = x_51;
x_52_phi = x_53;
}
}
int const x_111 = x_111_phi;
bool const x_112 = x_112_phi;
if (x_112) {
break;
}
x_115_phi = x_111;
x_118_phi = 0;
x_120_phi = 0;
while (true) {
int x_154 = 0;
int x_121 = 0;
int x_119_phi = 0;
x_115 = x_115_phi;
int const x_118 = x_118_phi;
int const x_120 = x_120_phi;
float const x_123 = x_6.injectionSwitch.y;
x_161_phi = x_115;
if ((x_120 < int((x_123 + 1.0f)))) {
} else {
break;
}
while (true) {
bool x_135 = false;
int x_143_phi = 0;
int x_154_phi = 0;
bool x_155_phi = false;
float const x_134 = (*(tint_symbol_5)).x;
x_135 = (x_134 < -1.0f);
if (!((x_40 < 0.0f))) {
if (x_135) {
x_119_phi = 0;
break;
}
x_143_phi = 1;
while (true) {
int x_144 = 0;
int const x_143 = x_143_phi;
x_154_phi = x_118;
x_155_phi = false;
if ((x_143 < 3)) {
} else {
break;
}
if (x_135) {
{
x_144 = (x_143 + 1);
x_143_phi = x_144;
}
continue;
}
if ((x_143 > 0)) {
x_154_phi = 1;
x_155_phi = true;
break;
}
{
x_144 = (x_143 + 1);
x_143_phi = x_144;
}
}
x_154 = x_154_phi;
bool const x_155 = x_155_phi;
x_119_phi = x_154;
if (x_155) {
break;
}
}
x_119_phi = 0;
break;
}
int x_119 = 0;
x_119 = x_119_phi;
x_116 = as_type<int>((x_115 + x_119));
if (select(x_41, false, !(x_41))) {
x_161_phi = x_116;
break;
}
{
x_121 = (x_120 + 1);
x_115_phi = x_116;
x_118_phi = x_119;
x_120_phi = x_121;
}
}
int const x_161 = x_161_phi;
if ((x_161 == 4)) {
*(tint_symbol_6) = float4(1.0f, 0.0f, 0.0f, 1.0f);
} else {
*(tint_symbol_6) = float4(0.0f, 0.0f, 0.0f, 0.0f);
}
break;
}
return;
}
fragment tint_symbol_2 tint_symbol(float4 gl_FragCoord_param [[position]], constant buf0& x_6 [[buffer(0)]]) {
thread float4 tint_symbol_7 = 0.0f;
thread float4 tint_symbol_8 = 0.0f;
tint_symbol_7 = gl_FragCoord_param;
main_1(x_6, &(tint_symbol_7), &(tint_symbol_8));
main_out const tint_symbol_3 = {.x_GLF_color_1=tint_symbol_8};
tint_symbol_2 const tint_symbol_4 = {.x_GLF_color_1=tint_symbol_3.x_GLF_color_1};
return tint_symbol_4;
}

View File

@@ -0,0 +1,566 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 292
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main" %tint_symbol %tint_symbol_2
OpExecutionMode %main OriginUpperLeft
OpName %gl_FragCoord "gl_FragCoord"
OpName %buf0 "buf0"
OpMemberName %buf0 0 "injectionSwitch"
OpName %x_6 "x_6"
OpName %x_GLF_color "x_GLF_color"
OpName %tint_symbol "tint_symbol"
OpName %tint_symbol_2 "tint_symbol_2"
OpName %main_1 "main_1"
OpName %x_45 "x_45"
OpName %x_48 "x_48"
OpName %x_49 "x_49"
OpName %x_46 "x_46"
OpName %x_115 "x_115"
OpName %x_116 "x_116"
OpName %x_45_phi "x_45_phi"
OpName %x_48_phi "x_48_phi"
OpName %x_50_phi "x_50_phi"
OpName %x_52_phi "x_52_phi"
OpName %x_111_phi "x_111_phi"
OpName %x_112_phi "x_112_phi"
OpName %x_115_phi "x_115_phi"
OpName %x_118_phi "x_118_phi"
OpName %x_120_phi "x_120_phi"
OpName %x_161_phi "x_161_phi"
OpName %x_62 "x_62"
OpName %x_65 "x_65"
OpName %x_66 "x_66"
OpName %x_63 "x_63"
OpName %x_53 "x_53"
OpName %x_62_phi "x_62_phi"
OpName %x_65_phi "x_65_phi"
OpName %x_67_phi "x_67_phi"
OpName %x_51_phi "x_51_phi"
OpName %x_49_phi "x_49_phi"
OpName %x_46_phi "x_46_phi"
OpName %x_97 "x_97"
OpName %x_68 "x_68"
OpName %x_66_phi "x_66_phi"
OpName %x_78 "x_78"
OpName %x_86_phi "x_86_phi"
OpName %x_97_phi "x_97_phi"
OpName %x_98_phi "x_98_phi"
OpName %x_87 "x_87"
OpName %x_154 "x_154"
OpName %x_121 "x_121"
OpName %x_119_phi "x_119_phi"
OpName %x_135 "x_135"
OpName %x_143_phi "x_143_phi"
OpName %x_154_phi "x_154_phi"
OpName %x_155_phi "x_155_phi"
OpName %x_144 "x_144"
OpName %x_119 "x_119"
OpName %main_out "main_out"
OpMemberName %main_out 0 "x_GLF_color_1"
OpName %tint_symbol_3 "tint_symbol_3"
OpName %tint_symbol_1 "tint_symbol_1"
OpName %main "main"
OpDecorate %buf0 Block
OpMemberDecorate %buf0 0 Offset 0
OpDecorate %x_6 NonWritable
OpDecorate %x_6 DescriptorSet 0
OpDecorate %x_6 Binding 0
OpDecorate %tint_symbol BuiltIn FragCoord
OpDecorate %tint_symbol_2 Location 0
OpMemberDecorate %main_out 0 Offset 0
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Private_v4float = OpTypePointer Private %v4float
%5 = OpConstantNull %v4float
%gl_FragCoord = OpVariable %_ptr_Private_v4float Private %5
%v2float = OpTypeVector %float 2
%buf0 = OpTypeStruct %v2float
%_ptr_Uniform_buf0 = OpTypePointer Uniform %buf0
%x_6 = OpVariable %_ptr_Uniform_buf0 Uniform
%x_GLF_color = OpVariable %_ptr_Private_v4float Private %5
%_ptr_Input_v4float = OpTypePointer Input %v4float
%tint_symbol = OpVariable %_ptr_Input_v4float Input
%_ptr_Output_v4float = OpTypePointer Output %v4float
%tint_symbol_2 = OpVariable %_ptr_Output_v4float Output %5
%void = OpTypeVoid
%15 = OpTypeFunction %void
%bool = OpTypeBool
%_ptr_Function_bool = OpTypePointer Function %bool
%26 = OpConstantNull %bool
%int = OpTypeInt 32 1
%_ptr_Function_int = OpTypePointer Function %int
%30 = OpConstantNull %int
%uint = OpTypeInt 32 0
%uint_0 = OpConstant %uint 0
%_ptr_Uniform_float = OpTypePointer Uniform %float
%float_n1 = OpConstant %float -1
%false = OpConstantFalse %bool
%int_0 = OpConstant %int 0
%uint_1 = OpConstant %uint 1
%_ptr_Private_float = OpTypePointer Private %float
%int_10 = OpConstant %int 10
%int_100 = OpConstant %int 100
%int_2 = OpConstant %int 2
%float_0 = OpConstant %float 0
%int_1 = OpConstant %int 1
%int_3 = OpConstant %int 3
%true = OpConstantTrue %bool
%float_1 = OpConstant %float 1
%int_4 = OpConstant %int 4
%277 = OpConstantComposite %v4float %float_1 %float_0 %float_0 %float_1
%278 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0
%main_out = OpTypeStruct %v4float
%279 = OpTypeFunction %void %main_out
%main_1 = OpFunction %void None %15
%18 = OpLabel
%x_45 = OpVariable %_ptr_Function_bool Function %26
%x_48 = OpVariable %_ptr_Function_int Function %30
%x_49 = OpVariable %_ptr_Function_int Function %30
%x_46 = OpVariable %_ptr_Function_bool Function %26
%x_115 = OpVariable %_ptr_Function_int Function %30
%x_116 = OpVariable %_ptr_Function_int Function %30
%x_45_phi = OpVariable %_ptr_Function_bool Function %26
%x_48_phi = OpVariable %_ptr_Function_int Function %30
%x_50_phi = OpVariable %_ptr_Function_int Function %30
%x_52_phi = OpVariable %_ptr_Function_int Function %30
%x_111_phi = OpVariable %_ptr_Function_int Function %30
%x_112_phi = OpVariable %_ptr_Function_bool Function %26
%x_115_phi = OpVariable %_ptr_Function_int Function %30
%x_118_phi = OpVariable %_ptr_Function_int Function %30
%x_120_phi = OpVariable %_ptr_Function_int Function %30
%x_161_phi = OpVariable %_ptr_Function_int Function %30
%x_62 = OpVariable %_ptr_Function_int Function %30
%x_65 = OpVariable %_ptr_Function_int Function %30
%x_66 = OpVariable %_ptr_Function_int Function %30
%x_63 = OpVariable %_ptr_Function_int Function %30
%x_53 = OpVariable %_ptr_Function_int Function %30
%x_62_phi = OpVariable %_ptr_Function_int Function %30
%x_65_phi = OpVariable %_ptr_Function_int Function %30
%x_67_phi = OpVariable %_ptr_Function_int Function %30
%x_51_phi = OpVariable %_ptr_Function_int Function %30
%x_49_phi = OpVariable %_ptr_Function_int Function %30
%x_46_phi = OpVariable %_ptr_Function_bool Function %26
%x_97 = OpVariable %_ptr_Function_int Function %30
%x_68 = OpVariable %_ptr_Function_int Function %30
%x_66_phi = OpVariable %_ptr_Function_int Function %30
%x_78 = OpVariable %_ptr_Function_bool Function %26
%x_86_phi = OpVariable %_ptr_Function_int Function %30
%x_97_phi = OpVariable %_ptr_Function_int Function %30
%x_98_phi = OpVariable %_ptr_Function_bool Function %26
%x_87 = OpVariable %_ptr_Function_int Function %30
%x_154 = OpVariable %_ptr_Function_int Function %30
%x_121 = OpVariable %_ptr_Function_int Function %30
%x_119_phi = OpVariable %_ptr_Function_int Function %30
%x_135 = OpVariable %_ptr_Function_bool Function %26
%x_143_phi = OpVariable %_ptr_Function_int Function %30
%x_154_phi = OpVariable %_ptr_Function_int Function %30
%x_155_phi = OpVariable %_ptr_Function_bool Function %26
%x_144 = OpVariable %_ptr_Function_int Function %30
%x_119 = OpVariable %_ptr_Function_int Function %30
OpBranch %19
%19 = OpLabel
OpLoopMerge %20 %21 None
OpBranch %22
%22 = OpLabel
%48 = OpAccessChain %_ptr_Uniform_float %x_6 %uint_0 %uint_0
%49 = OpLoad %float %48
%51 = OpFOrdLessThan %bool %49 %float_n1
OpStore %x_45_phi %false
OpStore %x_48_phi %int_0
OpStore %x_50_phi %int_0
OpStore %x_52_phi %int_0
OpBranch %54
%54 = OpLabel
OpLoopMerge %55 %56 None
OpBranch %57
%57 = OpLabel
%69 = OpLoad %bool %x_45_phi
OpStore %x_45 %69
%70 = OpLoad %int %x_48_phi
OpStore %x_48 %70
%71 = OpLoad %int %x_50_phi
%72 = OpLoad %int %x_52_phi
%75 = OpAccessChain %_ptr_Private_float %gl_FragCoord %uint_1
%76 = OpLoad %float %75
%77 = OpLoad %int %x_48
OpStore %x_111_phi %77
%78 = OpLoad %bool %x_45
OpStore %x_112_phi %78
%80 = OpFOrdGreaterThan %bool %76 %float_n1
%79 = OpSelect %int %80 %int_10 %int_100
%83 = OpSLessThan %bool %72 %79
OpSelectionMerge %84 None
OpBranchConditional %83 %85 %86
%85 = OpLabel
OpBranch %84
%86 = OpLabel
OpBranch %55
%84 = OpLabel
%87 = OpLoad %int %x_48
OpStore %x_62_phi %87
OpStore %x_65_phi %71
OpStore %x_67_phi %int_0
OpBranch %88
%88 = OpLabel
OpLoopMerge %89 %90 None
OpBranch %91
%91 = OpLabel
%95 = OpLoad %int %x_62_phi
OpStore %x_62 %95
%96 = OpLoad %int %x_65_phi
OpStore %x_65 %96
%97 = OpLoad %int %x_67_phi
%98 = OpLoad %int %x_65
OpStore %x_51_phi %98
%99 = OpLoad %int %x_62
OpStore %x_49_phi %99
%100 = OpLoad %bool %x_45
OpStore %x_46_phi %100
%102 = OpSLessThan %bool %97 %int_2
OpSelectionMerge %103 None
OpBranchConditional %102 %104 %105
%104 = OpLabel
OpBranch %103
%105 = OpLabel
OpBranch %89
%103 = OpLabel
OpBranch %106
%106 = OpLabel
OpLoopMerge %107 %108 None
OpBranch %109
%109 = OpLabel
%114 = OpAccessChain %_ptr_Private_float %gl_FragCoord %uint_0
%115 = OpLoad %float %114
%116 = OpFOrdLessThan %bool %115 %float_n1
OpStore %x_78 %116
%119 = OpFOrdLessThan %bool %49 %float_0
%117 = OpLogicalNot %bool %119
OpSelectionMerge %120 None
OpBranchConditional %117 %121 %120
%121 = OpLabel
%122 = OpLoad %bool %x_78
OpSelectionMerge %123 None
OpBranchConditional %122 %124 %123
%124 = OpLabel
OpStore %x_66_phi %int_0
OpBranch %107
%123 = OpLabel
OpStore %x_86_phi %int_1
OpBranch %126
%126 = OpLabel
OpLoopMerge %127 %128 None
OpBranch %129
%129 = OpLabel
%131 = OpLoad %int %x_86_phi
%132 = OpLoad %int %x_65
OpStore %x_97_phi %132
OpStore %x_98_phi %false
%134 = OpSLessThan %bool %131 %int_3
OpSelectionMerge %135 None
OpBranchConditional %134 %136 %137
%136 = OpLabel
OpBranch %135
%137 = OpLabel
OpBranch %127
%135 = OpLabel
%138 = OpLoad %bool %x_78
OpSelectionMerge %139 None
OpBranchConditional %138 %140 %139
%140 = OpLabel
OpBranch %128
%139 = OpLabel
%141 = OpSGreaterThan %bool %131 %int_0
OpSelectionMerge %142 None
OpBranchConditional %141 %143 %142
%143 = OpLabel
OpStore %x_97_phi %int_1
OpStore %x_98_phi %true
OpBranch %127
%142 = OpLabel
OpBranch %128
%128 = OpLabel
%145 = OpIAdd %int %131 %int_1
OpStore %x_87 %145
%146 = OpLoad %int %x_87
OpStore %x_86_phi %146
OpBranch %126
%127 = OpLabel
%147 = OpLoad %int %x_97_phi
OpStore %x_97 %147
%148 = OpLoad %bool %x_98_phi
%149 = OpLoad %int %x_97
OpStore %x_66_phi %149
OpSelectionMerge %150 None
OpBranchConditional %148 %151 %150
%151 = OpLabel
OpBranch %107
%150 = OpLabel
OpBranch %120
%120 = OpLabel
OpStore %x_66_phi %int_0
OpBranch %107
%108 = OpLabel
OpBranch %106
%107 = OpLabel
%152 = OpLoad %int %x_66_phi
OpStore %x_66 %152
%154 = OpLoad %int %x_62
%155 = OpLoad %int %x_66
%156 = OpIAdd %int %154 %155
%153 = OpCopyObject %int %156
OpStore %x_63 %153
OpSelectionMerge %157 None
OpBranchConditional %51 %158 %157
%158 = OpLabel
OpBranch %159
%159 = OpLabel
OpLoopMerge %160 %161 None
OpBranch %162
%162 = OpLabel
OpSelectionMerge %163 None
OpBranchConditional %51 %164 %165
%164 = OpLabel
OpBranch %163
%165 = OpLabel
OpBranch %160
%163 = OpLabel
OpBranch %161
%161 = OpLabel
%166 = OpConvertSToF %float %72
%167 = OpCompositeConstruct %v4float %166 %166 %166 %166
OpStore %x_GLF_color %167
OpBranch %159
%160 = OpLabel
%168 = OpLoad %int %x_66
OpStore %x_51_phi %168
%169 = OpLoad %int %x_63
OpStore %x_49_phi %169
OpStore %x_46_phi %true
OpBranch %89
%157 = OpLabel
OpBranch %90
%90 = OpLabel
%170 = OpIAdd %int %97 %int_1
OpStore %x_68 %170
%171 = OpLoad %int %x_63
OpStore %x_62_phi %171
%172 = OpLoad %int %x_66
OpStore %x_65_phi %172
%173 = OpLoad %int %x_68
OpStore %x_67_phi %173
OpBranch %88
%89 = OpLabel
%174 = OpLoad %int %x_51_phi
%175 = OpLoad %int %x_49_phi
OpStore %x_49 %175
%176 = OpLoad %bool %x_46_phi
OpStore %x_46 %176
%177 = OpLoad %int %x_49
OpStore %x_111_phi %177
%178 = OpLoad %bool %x_46
OpStore %x_112_phi %178
%179 = OpLoad %bool %x_46
OpSelectionMerge %180 None
OpBranchConditional %179 %181 %180
%181 = OpLabel
OpBranch %55
%180 = OpLabel
%182 = OpLogicalNot %bool %51
OpSelectionMerge %183 None
OpBranchConditional %182 %184 %183
%184 = OpLabel
%185 = OpLoad %int %x_49
OpStore %x_111_phi %185
%186 = OpLoad %bool %x_46
OpStore %x_112_phi %186
OpBranch %55
%183 = OpLabel
OpBranch %56
%56 = OpLabel
%187 = OpIAdd %int %72 %int_1
OpStore %x_53 %187
%188 = OpLoad %bool %x_46
OpStore %x_45_phi %188
%189 = OpLoad %int %x_49
OpStore %x_48_phi %189
OpStore %x_50_phi %174
%190 = OpLoad %int %x_53
OpStore %x_52_phi %190
OpBranch %54
%55 = OpLabel
%191 = OpLoad %int %x_111_phi
%192 = OpLoad %bool %x_112_phi
OpSelectionMerge %193 None
OpBranchConditional %192 %194 %193
%194 = OpLabel
OpBranch %20
%193 = OpLabel
OpStore %x_115_phi %191
OpStore %x_118_phi %int_0
OpStore %x_120_phi %int_0
OpBranch %195
%195 = OpLabel
OpLoopMerge %196 %197 None
OpBranch %198
%198 = OpLabel
%202 = OpLoad %int %x_115_phi
OpStore %x_115 %202
%203 = OpLoad %int %x_118_phi
%204 = OpLoad %int %x_120_phi
%205 = OpAccessChain %_ptr_Uniform_float %x_6 %uint_0 %uint_1
%206 = OpLoad %float %205
%207 = OpLoad %int %x_115
OpStore %x_161_phi %207
%210 = OpFAdd %float %206 %float_1
%208 = OpConvertFToS %int %210
%211 = OpSLessThan %bool %204 %208
OpSelectionMerge %212 None
OpBranchConditional %211 %213 %214
%213 = OpLabel
OpBranch %212
%214 = OpLabel
OpBranch %196
%212 = OpLabel
OpBranch %215
%215 = OpLabel
OpLoopMerge %216 %217 None
OpBranch %218
%218 = OpLabel
%223 = OpAccessChain %_ptr_Private_float %gl_FragCoord %uint_0
%224 = OpLoad %float %223
%225 = OpFOrdLessThan %bool %224 %float_n1
OpStore %x_135 %225
%227 = OpFOrdLessThan %bool %49 %float_0
%226 = OpLogicalNot %bool %227
OpSelectionMerge %228 None
OpBranchConditional %226 %229 %228
%229 = OpLabel
%230 = OpLoad %bool %x_135
OpSelectionMerge %231 None
OpBranchConditional %230 %232 %231
%232 = OpLabel
OpStore %x_119_phi %int_0
OpBranch %216
%231 = OpLabel
OpStore %x_143_phi %int_1
OpBranch %233
%233 = OpLabel
OpLoopMerge %234 %235 None
OpBranch %236
%236 = OpLabel
%238 = OpLoad %int %x_143_phi
OpStore %x_154_phi %203
OpStore %x_155_phi %false
%239 = OpSLessThan %bool %238 %int_3
OpSelectionMerge %240 None
OpBranchConditional %239 %241 %242
%241 = OpLabel
OpBranch %240
%242 = OpLabel
OpBranch %234
%240 = OpLabel
%243 = OpLoad %bool %x_135
OpSelectionMerge %244 None
OpBranchConditional %243 %245 %244
%245 = OpLabel
OpBranch %235
%244 = OpLabel
%246 = OpSGreaterThan %bool %238 %int_0
OpSelectionMerge %247 None
OpBranchConditional %246 %248 %247
%248 = OpLabel
OpStore %x_154_phi %int_1
OpStore %x_155_phi %true
OpBranch %234
%247 = OpLabel
OpBranch %235
%235 = OpLabel
%249 = OpIAdd %int %238 %int_1
OpStore %x_144 %249
%250 = OpLoad %int %x_144
OpStore %x_143_phi %250
OpBranch %233
%234 = OpLabel
%251 = OpLoad %int %x_154_phi
OpStore %x_154 %251
%252 = OpLoad %bool %x_155_phi
%253 = OpLoad %int %x_154
OpStore %x_119_phi %253
OpSelectionMerge %254 None
OpBranchConditional %252 %255 %254
%255 = OpLabel
OpBranch %216
%254 = OpLabel
OpBranch %228
%228 = OpLabel
OpStore %x_119_phi %int_0
OpBranch %216
%217 = OpLabel
OpBranch %215
%216 = OpLabel
%257 = OpLoad %int %x_119_phi
OpStore %x_119 %257
%259 = OpLoad %int %x_115
%260 = OpLoad %int %x_119
%261 = OpIAdd %int %259 %260
%258 = OpCopyObject %int %261
OpStore %x_116 %258
%263 = OpLogicalNot %bool %51
%262 = OpSelect %bool %263 %false %51
OpSelectionMerge %264 None
OpBranchConditional %262 %265 %264
%265 = OpLabel
%266 = OpLoad %int %x_116
OpStore %x_161_phi %266
OpBranch %196
%264 = OpLabel
OpBranch %197
%197 = OpLabel
%267 = OpIAdd %int %204 %int_1
OpStore %x_121 %267
%268 = OpLoad %int %x_116
OpStore %x_115_phi %268
%269 = OpLoad %int %x_119
OpStore %x_118_phi %269
%270 = OpLoad %int %x_121
OpStore %x_120_phi %270
OpBranch %195
%196 = OpLabel
%271 = OpLoad %int %x_161_phi
%273 = OpIEqual %bool %271 %int_4
OpSelectionMerge %274 None
OpBranchConditional %273 %275 %276
%275 = OpLabel
OpStore %x_GLF_color %277
OpBranch %274
%276 = OpLabel
OpStore %x_GLF_color %278
OpBranch %274
%274 = OpLabel
OpBranch %20
%21 = OpLabel
OpBranch %19
%20 = OpLabel
OpReturn
OpFunctionEnd
%tint_symbol_3 = OpFunction %void None %279
%tint_symbol_1 = OpFunctionParameter %main_out
%283 = OpLabel
%284 = OpCompositeExtract %v4float %tint_symbol_1 0
OpStore %tint_symbol_2 %284
OpReturn
OpFunctionEnd
%main = OpFunction %void None %15
%286 = OpLabel
%287 = OpLoad %v4float %tint_symbol
OpStore %gl_FragCoord %287
%288 = OpFunctionCall %void %main_1
%290 = OpLoad %v4float %x_GLF_color
%291 = OpCompositeConstruct %main_out %290
%289 = OpFunctionCall %void %tint_symbol_3 %291
OpReturn
OpFunctionEnd

View File

@@ -0,0 +1,274 @@
[[block]]
struct buf0 {
injectionSwitch : vec2<f32>;
};
var<private> gl_FragCoord : vec4<f32>;
[[group(0), binding(0)]] var<uniform> x_6 : buf0;
var<private> x_GLF_color : vec4<f32>;
fn main_1() {
loop {
var x_45 : bool;
var x_48 : i32;
var x_49 : i32;
var x_46 : bool;
var x_115 : i32;
var x_116 : i32;
var x_45_phi : bool;
var x_48_phi : i32;
var x_50_phi : i32;
var x_52_phi : i32;
var x_111_phi : i32;
var x_112_phi : bool;
var x_115_phi : i32;
var x_118_phi : i32;
var x_120_phi : i32;
var x_161_phi : i32;
let x_40 : f32 = x_6.injectionSwitch.x;
let x_41 : bool = (x_40 < -1.0);
x_45_phi = false;
x_48_phi = 0;
x_50_phi = 0;
x_52_phi = 0;
loop {
var x_62 : i32;
var x_65 : i32;
var x_66 : i32;
var x_63 : i32;
var x_53 : i32;
var x_62_phi : i32;
var x_65_phi : i32;
var x_67_phi : i32;
var x_51_phi : i32;
var x_49_phi : i32;
var x_46_phi : bool;
x_45 = x_45_phi;
x_48 = x_48_phi;
let x_50 : i32 = x_50_phi;
let x_52 : i32 = x_52_phi;
let x_55 : f32 = gl_FragCoord.y;
x_111_phi = x_48;
x_112_phi = x_45;
if ((x_52 < select(100, 10, (x_55 > -1.0)))) {
} else {
break;
}
x_62_phi = x_48;
x_65_phi = x_50;
x_67_phi = 0;
loop {
var x_97 : i32;
var x_68 : i32;
var x_66_phi : i32;
x_62 = x_62_phi;
x_65 = x_65_phi;
let x_67 : i32 = x_67_phi;
x_51_phi = x_65;
x_49_phi = x_62;
x_46_phi = x_45;
if ((x_67 < 2)) {
} else {
break;
}
loop {
var x_78 : bool;
var x_86_phi : i32;
var x_97_phi : i32;
var x_98_phi : bool;
let x_77 : f32 = gl_FragCoord.x;
x_78 = (x_77 < -1.0);
if (!((x_40 < 0.0))) {
if (x_78) {
x_66_phi = 0;
break;
}
x_86_phi = 1;
loop {
var x_87 : i32;
let x_86 : i32 = x_86_phi;
x_97_phi = x_65;
x_98_phi = false;
if ((x_86 < 3)) {
} else {
break;
}
if (x_78) {
continue;
}
if ((x_86 > 0)) {
x_97_phi = 1;
x_98_phi = true;
break;
}
continuing {
x_87 = (x_86 + 1);
x_86_phi = x_87;
}
}
x_97 = x_97_phi;
let x_98 : bool = x_98_phi;
x_66_phi = x_97;
if (x_98) {
break;
}
}
x_66_phi = 0;
break;
}
x_66 = x_66_phi;
x_63 = bitcast<i32>((x_62 + x_66));
if (x_41) {
loop {
if (x_41) {
} else {
break;
}
continuing {
let x_105 : f32 = f32(x_52);
x_GLF_color = vec4<f32>(x_105, x_105, x_105, x_105);
}
}
x_51_phi = x_66;
x_49_phi = x_63;
x_46_phi = true;
break;
}
continuing {
x_68 = (x_67 + 1);
x_62_phi = x_63;
x_65_phi = x_66;
x_67_phi = x_68;
}
}
let x_51 : i32 = x_51_phi;
x_49 = x_49_phi;
x_46 = x_46_phi;
x_111_phi = x_49;
x_112_phi = x_46;
if (x_46) {
break;
}
if (!(x_41)) {
x_111_phi = x_49;
x_112_phi = x_46;
break;
}
continuing {
x_53 = (x_52 + 1);
x_45_phi = x_46;
x_48_phi = x_49;
x_50_phi = x_51;
x_52_phi = x_53;
}
}
let x_111 : i32 = x_111_phi;
let x_112 : bool = x_112_phi;
if (x_112) {
break;
}
x_115_phi = x_111;
x_118_phi = 0;
x_120_phi = 0;
loop {
var x_154 : i32;
var x_121 : i32;
var x_119_phi : i32;
x_115 = x_115_phi;
let x_118 : i32 = x_118_phi;
let x_120 : i32 = x_120_phi;
let x_123 : f32 = x_6.injectionSwitch.y;
x_161_phi = x_115;
if ((x_120 < i32((x_123 + 1.0)))) {
} else {
break;
}
loop {
var x_135 : bool;
var x_143_phi : i32;
var x_154_phi : i32;
var x_155_phi : bool;
let x_134 : f32 = gl_FragCoord.x;
x_135 = (x_134 < -1.0);
if (!((x_40 < 0.0))) {
if (x_135) {
x_119_phi = 0;
break;
}
x_143_phi = 1;
loop {
var x_144 : i32;
let x_143 : i32 = x_143_phi;
x_154_phi = x_118;
x_155_phi = false;
if ((x_143 < 3)) {
} else {
break;
}
if (x_135) {
continue;
}
if ((x_143 > 0)) {
x_154_phi = 1;
x_155_phi = true;
break;
}
continuing {
x_144 = (x_143 + 1);
x_143_phi = x_144;
}
}
x_154 = x_154_phi;
let x_155 : bool = x_155_phi;
x_119_phi = x_154;
if (x_155) {
break;
}
}
x_119_phi = 0;
break;
}
var x_119 : i32;
x_119 = x_119_phi;
x_116 = bitcast<i32>((x_115 + x_119));
if (select(x_41, false, !(x_41))) {
x_161_phi = x_116;
break;
}
continuing {
x_121 = (x_120 + 1);
x_115_phi = x_116;
x_118_phi = x_119;
x_120_phi = x_121;
}
}
let x_161 : i32 = x_161_phi;
if ((x_161 == 4)) {
x_GLF_color = vec4<f32>(1.0, 0.0, 0.0, 1.0);
} else {
x_GLF_color = vec4<f32>(0.0, 0.0, 0.0, 0.0);
}
break;
}
return;
}
struct main_out {
[[location(0)]]
x_GLF_color_1 : vec4<f32>;
};
[[stage(fragment)]]
fn main([[builtin(position)]] gl_FragCoord_param : vec4<f32>) -> main_out {
gl_FragCoord = gl_FragCoord_param;
main_1();
return main_out(x_GLF_color);
}