test: Remove many expected files

For these tests, we only really care that we can successfully consume
them and generate valid output for each backend. Having the expected
files in the tree generates significant churn for any change to how we
generate backend code, which makes it hard to inspect diffs.

Change-Id: Ic98c248081144c0fb1791f1303eaf6d459548e3d
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/62720
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: James Price <jrprice@google.com>
This commit is contained in:
James Price
2021-08-24 22:49:42 +00:00
committed by Tint LUCI CQ
parent 568136dd10
commit 87cce20f67
8526 changed files with 12 additions and 613699 deletions

View File

@@ -1,207 +0,0 @@
cbuffer cbuffer_x_8 : register(b0, space0) {
uint4 x_8[1];
};
static float4 x_GLF_color = float4(0.0f, 0.0f, 0.0f, 0.0f);
void main_1() {
bool x_68 = false;
int x_29 = 0;
int x_30 = 0;
int x_31 = 0;
int globalNumbers[10] = (int[10])0;
int x_17 = 0;
int acc = 0;
int i_1 = 0;
int localNumbers[2] = (int[2])0;
int param = 0;
int x_24 = 0;
int x_24_phi = 0;
int x_23_phi = 0;
acc = 0;
i_1 = 0;
x_24_phi = 0;
x_23_phi = 0;
while (true) {
int x_33 = 0;
int x_92 = 0;
bool x_76_phi = false;
int x_34_phi = 0;
int x_25_phi = 0;
x_24 = x_24_phi;
const int x_23 = x_23_phi;
if ((x_23 < 4)) {
} else {
break;
}
x_68 = false;
x_76_phi = false;
while (true) {
bool x_81 = false;
int x_32 = 0;
bool x_81_phi = false;
int x_32_phi = 0;
int x_33_phi = 0;
bool x_90_phi = false;
const bool x_76 = x_76_phi;
x_30 = 0;
x_81_phi = x_76;
x_32_phi = 0;
while (true) {
x_81 = x_81_phi;
x_32 = x_32_phi;
const float x_86 = asfloat(x_8[0].x);
x_33_phi = 0;
x_90_phi = x_81;
if ((x_32 < int(x_86))) {
} else {
break;
}
x_68 = true;
x_29 = x_32;
x_33_phi = x_32;
x_90_phi = true;
break;
{
x_81_phi = false;
x_32_phi = 0;
}
}
x_33 = x_33_phi;
const bool x_90 = x_90_phi;
x_34_phi = x_33;
if (x_90) {
break;
}
x_92 = 0;
x_68 = true;
x_29 = x_92;
x_34_phi = x_92;
break;
{
x_76_phi = false;
}
}
x_31 = x_34_phi;
const int x_93 = x_31;
int x_22_1[2] = localNumbers;
x_22_1[1u] = x_93;
const int x_22[2] = x_22_1;
localNumbers = x_22;
globalNumbers[0] = 0;
const int x_13 = x_22[1u];
param = x_13;
x_17 = 0;
x_25_phi = 0;
while (true) {
const int x_25 = x_25_phi;
if ((x_25 <= x_13)) {
} else {
break;
}
const int x_102_save = x_13;
const int x_18 = globalNumbers[x_102_save];
if ((x_18 <= 1)) {
globalNumbers[x_102_save] = 1;
}
{
const int x_19 = (x_25 + 1);
x_17 = x_19;
x_25_phi = x_19;
}
}
const float x_107 = asfloat(x_8[0].x);
const int x_14 = globalNumbers[(int(x_107) - 1)];
const int x_15 = asint((x_24 + asint(x_14)));
acc = x_15;
{
const int x_16 = (x_23 + 1);
i_1 = x_16;
x_24_phi = x_15;
x_23_phi = x_16;
}
}
if ((x_24 == asint(4))) {
x_GLF_color = float4(1.0f, 0.0f, 0.0f, 1.0f);
} else {
x_GLF_color = float4(0.0f, 0.0f, 0.0f, 1.0f);
}
return;
}
struct main_out {
float4 x_GLF_color_1;
};
struct tint_symbol {
float4 x_GLF_color_1 : SV_Target0;
};
main_out main_inner() {
main_1();
const main_out tint_symbol_2 = {x_GLF_color};
return tint_symbol_2;
}
tint_symbol main() {
const main_out inner_result = main_inner();
tint_symbol wrapper_result = (tint_symbol)0;
wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1;
return wrapper_result;
}
int yieldsZero_() {
bool x_116 = false;
int x_20 = 0;
int i = 0;
int x_26 = 0;
int x_134 = 0;
bool x_118_phi = false;
int x_27_phi = 0;
x_118_phi = false;
while (true) {
bool x_123 = false;
int x_28 = 0;
bool x_123_phi = false;
int x_28_phi = 0;
int x_26_phi = 0;
bool x_132_phi = false;
const bool x_118 = x_118_phi;
i = 0;
x_123_phi = x_118;
x_28_phi = 0;
while (true) {
x_123 = x_123_phi;
x_28 = x_28_phi;
const float x_128 = asfloat(x_8[0].x);
x_26_phi = 0;
x_132_phi = x_123;
if ((x_28 < int(x_128))) {
} else {
break;
}
x_116 = true;
x_20 = x_28;
x_26_phi = x_28;
x_132_phi = true;
break;
{
x_123_phi = false;
x_28_phi = 0;
}
}
x_26 = x_26_phi;
const bool x_132 = x_132_phi;
x_27_phi = x_26;
if (x_132) {
break;
}
x_134 = 0;
x_116 = true;
x_20 = x_134;
x_27_phi = x_134;
break;
{
x_118_phi = false;
}
}
return x_27_phi;
}

View File

@@ -1,219 +0,0 @@
#include <metal_stdlib>
using namespace metal;
struct buf0 {
/* 0x0000 */ float one;
};
struct tint_array_wrapper {
int arr[10];
};
struct tint_array_wrapper_1 {
int arr[2];
};
struct main_out {
float4 x_GLF_color_1;
};
struct tint_symbol_1 {
float4 x_GLF_color_1 [[color(0)]];
};
void main_1(constant buf0& x_8, thread float4* const tint_symbol_3) {
bool x_68 = false;
int x_29 = 0;
int x_30 = 0;
int x_31 = 0;
tint_array_wrapper globalNumbers = {};
int x_17 = 0;
int acc = 0;
int i_1 = 0;
tint_array_wrapper_1 localNumbers = {};
int param = 0;
int x_24 = 0;
int x_24_phi = 0;
int x_23_phi = 0;
acc = 0;
i_1 = 0;
x_24_phi = 0;
x_23_phi = 0;
while (true) {
int x_33 = 0;
int x_92 = 0;
bool x_76_phi = false;
int x_34_phi = 0;
int x_25_phi = 0;
x_24 = x_24_phi;
int const x_23 = x_23_phi;
if ((x_23 < 4)) {
} else {
break;
}
x_68 = false;
x_76_phi = false;
while (true) {
bool x_81 = false;
int x_32 = 0;
bool x_81_phi = false;
int x_32_phi = 0;
int x_33_phi = 0;
bool x_90_phi = false;
bool const x_76 = x_76_phi;
x_30 = 0;
x_81_phi = x_76;
x_32_phi = 0;
while (true) {
x_81 = x_81_phi;
x_32 = x_32_phi;
float const x_86 = x_8.one;
x_33_phi = 0;
x_90_phi = x_81;
if ((x_32 < int(x_86))) {
} else {
break;
}
x_68 = true;
x_29 = x_32;
x_33_phi = x_32;
x_90_phi = true;
break;
{
x_81_phi = false;
x_32_phi = 0;
}
}
x_33 = x_33_phi;
bool const x_90 = x_90_phi;
x_34_phi = x_33;
if (x_90) {
break;
}
x_92 = 0;
x_68 = true;
x_29 = x_92;
x_34_phi = x_92;
break;
{
x_76_phi = false;
}
}
int const x_34 = x_34_phi;
x_31 = x_34;
int const x_93 = x_31;
tint_array_wrapper_1 const x_21 = localNumbers;
tint_array_wrapper_1 x_22_1 = x_21;
x_22_1.arr[1u] = x_93;
tint_array_wrapper_1 const x_22 = x_22_1;
localNumbers = x_22;
globalNumbers.arr[0] = 0;
int const x_13 = x_22.arr[1u];
param = x_13;
x_17 = 0;
x_25_phi = 0;
while (true) {
int const x_25 = x_25_phi;
if ((x_25 <= x_13)) {
} else {
break;
}
int const x_102_save = x_13;
int const x_18 = globalNumbers.arr[x_102_save];
if ((x_18 <= 1)) {
globalNumbers.arr[x_102_save] = 1;
}
{
int const x_19 = as_type<int>((as_type<uint>(x_25) + as_type<uint>(1)));
x_17 = x_19;
x_25_phi = x_19;
}
}
float const x_107 = x_8.one;
int const x_14 = globalNumbers.arr[as_type<int>((as_type<uint>(int(x_107)) - as_type<uint>(1)))];
int const x_15 = as_type<int>(as_type<int>((as_type<uint>(x_24) + as_type<uint>(as_type<int>(x_14)))));
acc = x_15;
{
int const x_16 = as_type<int>((as_type<uint>(x_23) + as_type<uint>(1)));
i_1 = x_16;
x_24_phi = x_15;
x_23_phi = x_16;
}
}
if ((x_24 == as_type<int>(4))) {
*(tint_symbol_3) = float4(1.0f, 0.0f, 0.0f, 1.0f);
} else {
*(tint_symbol_3) = float4(0.0f, 0.0f, 0.0f, 1.0f);
}
return;
}
main_out tint_symbol_inner(constant buf0& x_8, thread float4* const tint_symbol_4) {
main_1(x_8, tint_symbol_4);
main_out const tint_symbol_2 = {.x_GLF_color_1=*(tint_symbol_4)};
return tint_symbol_2;
}
fragment tint_symbol_1 tint_symbol(constant buf0& x_8 [[buffer(0)]]) {
thread float4 tint_symbol_5 = 0.0f;
main_out const inner_result = tint_symbol_inner(x_8, &(tint_symbol_5));
tint_symbol_1 wrapper_result = {};
wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1;
return wrapper_result;
}
int yieldsZero_(constant buf0& x_8) {
bool x_116 = false;
int x_20 = 0;
int i = 0;
int x_26 = 0;
int x_134 = 0;
bool x_118_phi = false;
int x_27_phi = 0;
x_118_phi = false;
while (true) {
bool x_123 = false;
int x_28 = 0;
bool x_123_phi = false;
int x_28_phi = 0;
int x_26_phi = 0;
bool x_132_phi = false;
bool const x_118 = x_118_phi;
i = 0;
x_123_phi = x_118;
x_28_phi = 0;
while (true) {
x_123 = x_123_phi;
x_28 = x_28_phi;
float const x_128 = x_8.one;
x_26_phi = 0;
x_132_phi = x_123;
if ((x_28 < int(x_128))) {
} else {
break;
}
x_116 = true;
x_20 = x_28;
x_26_phi = x_28;
x_132_phi = true;
break;
{
x_123_phi = false;
x_28_phi = 0;
}
}
x_26 = x_26_phi;
bool const x_132 = x_132_phi;
x_27_phi = x_26;
if (x_132) {
break;
}
x_134 = 0;
x_116 = true;
x_20 = x_134;
x_27_phi = x_134;
break;
{
x_118_phi = false;
}
}
int const x_27 = x_27_phi;
return x_27;
}

View File

@@ -1,404 +0,0 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 203
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main" %x_GLF_color_1_1
OpExecutionMode %main OriginUpperLeft
OpName %x_GLF_color_1_1 "x_GLF_color_1_1"
OpName %buf0 "buf0"
OpMemberName %buf0 0 "one"
OpName %x_8 "x_8"
OpName %x_GLF_color "x_GLF_color"
OpName %main_1 "main_1"
OpName %x_68 "x_68"
OpName %x_29 "x_29"
OpName %x_30 "x_30"
OpName %x_31 "x_31"
OpName %globalNumbers "globalNumbers"
OpName %x_17 "x_17"
OpName %acc "acc"
OpName %i_1 "i_1"
OpName %localNumbers "localNumbers"
OpName %param "param"
OpName %x_24 "x_24"
OpName %x_24_phi "x_24_phi"
OpName %x_23_phi "x_23_phi"
OpName %x_33 "x_33"
OpName %x_92 "x_92"
OpName %x_76_phi "x_76_phi"
OpName %x_34_phi "x_34_phi"
OpName %x_25_phi "x_25_phi"
OpName %x_81 "x_81"
OpName %x_32 "x_32"
OpName %x_81_phi "x_81_phi"
OpName %x_32_phi "x_32_phi"
OpName %x_33_phi "x_33_phi"
OpName %x_90_phi "x_90_phi"
OpName %x_22_1 "x_22_1"
OpName %main_out "main_out"
OpMemberName %main_out 0 "x_GLF_color_1"
OpName %main_inner "main_inner"
OpName %main "main"
OpName %yieldsZero_ "yieldsZero_"
OpName %x_116 "x_116"
OpName %x_20 "x_20"
OpName %i "i"
OpName %x_26 "x_26"
OpName %x_134 "x_134"
OpName %x_118_phi "x_118_phi"
OpName %x_27_phi "x_27_phi"
OpName %x_123 "x_123"
OpName %x_28 "x_28"
OpName %x_123_phi "x_123_phi"
OpName %x_28_phi "x_28_phi"
OpName %x_26_phi "x_26_phi"
OpName %x_132_phi "x_132_phi"
OpDecorate %x_GLF_color_1_1 Location 0
OpDecorate %buf0 Block
OpMemberDecorate %buf0 0 Offset 0
OpDecorate %x_8 NonWritable
OpDecorate %x_8 DescriptorSet 0
OpDecorate %x_8 Binding 0
OpDecorate %_arr_int_uint_10 ArrayStride 4
OpDecorate %_arr_int_uint_2 ArrayStride 4
OpMemberDecorate %main_out 0 Offset 0
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
%5 = OpConstantNull %v4float
%x_GLF_color_1_1 = OpVariable %_ptr_Output_v4float Output %5
%buf0 = OpTypeStruct %float
%_ptr_Uniform_buf0 = OpTypePointer Uniform %buf0
%x_8 = OpVariable %_ptr_Uniform_buf0 Uniform
%_ptr_Private_v4float = OpTypePointer Private %v4float
%x_GLF_color = OpVariable %_ptr_Private_v4float Private %5
%void = OpTypeVoid
%11 = OpTypeFunction %void
%bool = OpTypeBool
%false = OpConstantFalse %bool
%_ptr_Function_bool = OpTypePointer Function %bool
%19 = OpConstantNull %bool
%int = OpTypeInt 32 1
%_ptr_Function_int = OpTypePointer Function %int
%23 = OpConstantNull %int
%uint = OpTypeInt 32 0
%uint_10 = OpConstant %uint 10
%_arr_int_uint_10 = OpTypeArray %int %uint_10
%_ptr_Function__arr_int_uint_10 = OpTypePointer Function %_arr_int_uint_10
%31 = OpConstantNull %_arr_int_uint_10
%uint_2 = OpConstant %uint 2
%_arr_int_uint_2 = OpTypeArray %int %uint_2
%_ptr_Function__arr_int_uint_2 = OpTypePointer Function %_arr_int_uint_2
%39 = OpConstantNull %_arr_int_uint_2
%int_0 = OpConstant %int 0
%int_4 = OpConstant %int 4
%uint_0 = OpConstant %uint 0
%_ptr_Uniform_float = OpTypePointer Uniform %float
%true = OpConstantTrue %bool
%uint_1 = OpConstant %uint 1
%int_1 = OpConstant %int 1
%float_1 = OpConstant %float 1
%float_0 = OpConstant %float 0
%144 = OpConstantComposite %v4float %float_1 %float_0 %float_0 %float_1
%145 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_1
%main_out = OpTypeStruct %v4float
%146 = OpTypeFunction %main_out
%157 = OpTypeFunction %int
%main_1 = OpFunction %void None %11
%14 = OpLabel
%x_68 = OpVariable %_ptr_Function_bool Function %19
%x_29 = OpVariable %_ptr_Function_int Function %23
%x_30 = OpVariable %_ptr_Function_int Function %23
%x_31 = OpVariable %_ptr_Function_int Function %23
%globalNumbers = OpVariable %_ptr_Function__arr_int_uint_10 Function %31
%x_17 = OpVariable %_ptr_Function_int Function %23
%acc = OpVariable %_ptr_Function_int Function %23
%i_1 = OpVariable %_ptr_Function_int Function %23
%localNumbers = OpVariable %_ptr_Function__arr_int_uint_2 Function %39
%param = OpVariable %_ptr_Function_int Function %23
%x_24 = OpVariable %_ptr_Function_int Function %23
%x_24_phi = OpVariable %_ptr_Function_int Function %23
%x_23_phi = OpVariable %_ptr_Function_int Function %23
%x_33 = OpVariable %_ptr_Function_int Function %23
%x_92 = OpVariable %_ptr_Function_int Function %23
%x_76_phi = OpVariable %_ptr_Function_bool Function %19
%x_34_phi = OpVariable %_ptr_Function_int Function %23
%x_25_phi = OpVariable %_ptr_Function_int Function %23
%x_81 = OpVariable %_ptr_Function_bool Function %19
%x_32 = OpVariable %_ptr_Function_int Function %23
%x_81_phi = OpVariable %_ptr_Function_bool Function %19
%x_32_phi = OpVariable %_ptr_Function_int Function %23
%x_33_phi = OpVariable %_ptr_Function_int Function %23
%x_90_phi = OpVariable %_ptr_Function_bool Function %19
%x_22_1 = OpVariable %_ptr_Function__arr_int_uint_2 Function %39
OpStore %x_68 %false
OpStore %acc %int_0
OpStore %i_1 %int_0
OpStore %x_24_phi %int_0
OpStore %x_23_phi %int_0
OpBranch %45
%45 = OpLabel
OpLoopMerge %46 %47 None
OpBranch %48
%48 = OpLabel
%54 = OpLoad %int %x_24_phi
OpStore %x_24 %54
%55 = OpLoad %int %x_23_phi
%57 = OpSLessThan %bool %55 %int_4
OpSelectionMerge %58 None
OpBranchConditional %57 %59 %60
%59 = OpLabel
OpBranch %58
%60 = OpLabel
OpBranch %46
%58 = OpLabel
OpStore %x_68 %false
OpStore %x_76_phi %false
OpBranch %61
%61 = OpLabel
OpLoopMerge %62 %63 None
OpBranch %64
%64 = OpLabel
%71 = OpLoad %bool %x_76_phi
OpStore %x_30 %int_0
OpStore %x_81_phi %71
OpStore %x_32_phi %int_0
OpBranch %72
%72 = OpLabel
OpLoopMerge %73 %74 None
OpBranch %75
%75 = OpLabel
%76 = OpLoad %bool %x_81_phi
OpStore %x_81 %76
%77 = OpLoad %int %x_32_phi
OpStore %x_32 %77
%80 = OpAccessChain %_ptr_Uniform_float %x_8 %uint_0
%81 = OpLoad %float %80
OpStore %x_33_phi %int_0
%82 = OpLoad %bool %x_81
OpStore %x_90_phi %82
%83 = OpLoad %int %x_32
%84 = OpConvertFToS %int %81
%85 = OpSLessThan %bool %83 %84
OpSelectionMerge %86 None
OpBranchConditional %85 %87 %88
%87 = OpLabel
OpBranch %86
%88 = OpLabel
OpBranch %73
%86 = OpLabel
OpStore %x_68 %true
%90 = OpLoad %int %x_32
OpStore %x_29 %90
%91 = OpLoad %int %x_32
OpStore %x_33_phi %91
OpStore %x_90_phi %true
OpBranch %73
%74 = OpLabel
OpStore %x_81_phi %false
OpStore %x_32_phi %int_0
OpBranch %72
%73 = OpLabel
%92 = OpLoad %int %x_33_phi
OpStore %x_33 %92
%93 = OpLoad %bool %x_90_phi
%94 = OpLoad %int %x_33
OpStore %x_34_phi %94
OpSelectionMerge %95 None
OpBranchConditional %93 %96 %95
%96 = OpLabel
OpBranch %62
%95 = OpLabel
OpStore %x_92 %int_0
OpStore %x_68 %true
%97 = OpLoad %int %x_92
OpStore %x_29 %97
%98 = OpLoad %int %x_92
OpStore %x_34_phi %98
OpBranch %62
%63 = OpLabel
OpStore %x_76_phi %false
OpBranch %61
%62 = OpLabel
%99 = OpLoad %int %x_34_phi
OpStore %x_31 %99
%100 = OpLoad %int %x_31
%101 = OpLoad %_arr_int_uint_2 %localNumbers
OpStore %x_22_1 %101
%104 = OpAccessChain %_ptr_Function_int %x_22_1 %uint_1
OpStore %104 %100
%105 = OpLoad %_arr_int_uint_2 %x_22_1
OpStore %localNumbers %105
%106 = OpAccessChain %_ptr_Function_int %globalNumbers %int_0
OpStore %106 %int_0
%107 = OpCompositeExtract %int %105 1
OpStore %param %107
OpStore %x_17 %int_0
OpStore %x_25_phi %int_0
OpBranch %108
%108 = OpLabel
OpLoopMerge %109 %110 None
OpBranch %111
%111 = OpLabel
%112 = OpLoad %int %x_25_phi
%113 = OpSLessThanEqual %bool %112 %107
OpSelectionMerge %114 None
OpBranchConditional %113 %115 %116
%115 = OpLabel
OpBranch %114
%116 = OpLabel
OpBranch %109
%114 = OpLabel
%117 = OpAccessChain %_ptr_Function_int %globalNumbers %107
%118 = OpLoad %int %117
%120 = OpSLessThanEqual %bool %118 %int_1
OpSelectionMerge %121 None
OpBranchConditional %120 %122 %121
%122 = OpLabel
%123 = OpAccessChain %_ptr_Function_int %globalNumbers %107
OpStore %123 %int_1
OpBranch %121
%121 = OpLabel
OpBranch %110
%110 = OpLabel
%124 = OpIAdd %int %112 %int_1
OpStore %x_17 %124
OpStore %x_25_phi %124
OpBranch %108
%109 = OpLabel
%125 = OpAccessChain %_ptr_Uniform_float %x_8 %uint_0
%126 = OpLoad %float %125
%127 = OpConvertFToS %int %126
%128 = OpISub %int %127 %int_1
%129 = OpAccessChain %_ptr_Function_int %globalNumbers %128
%130 = OpLoad %int %129
%132 = OpLoad %int %x_24
%133 = OpCopyObject %int %130
%134 = OpIAdd %int %132 %133
%131 = OpCopyObject %int %134
OpStore %acc %131
OpBranch %47
%47 = OpLabel
%135 = OpIAdd %int %55 %int_1
OpStore %i_1 %135
OpStore %x_24_phi %131
OpStore %x_23_phi %135
OpBranch %45
%46 = OpLabel
%136 = OpLoad %int %x_24
%137 = OpCopyObject %int %int_4
%138 = OpIEqual %bool %136 %137
OpSelectionMerge %139 None
OpBranchConditional %138 %140 %141
%140 = OpLabel
OpStore %x_GLF_color %144
OpBranch %139
%141 = OpLabel
OpStore %x_GLF_color %145
OpBranch %139
%139 = OpLabel
OpReturn
OpFunctionEnd
%main_inner = OpFunction %main_out None %146
%149 = OpLabel
%150 = OpFunctionCall %void %main_1
%151 = OpLoad %v4float %x_GLF_color
%152 = OpCompositeConstruct %main_out %151
OpReturnValue %152
OpFunctionEnd
%main = OpFunction %void None %11
%154 = OpLabel
%155 = OpFunctionCall %main_out %main_inner
%156 = OpCompositeExtract %v4float %155 0
OpStore %x_GLF_color_1_1 %156
OpReturn
OpFunctionEnd
%yieldsZero_ = OpFunction %int None %157
%159 = OpLabel
%x_116 = OpVariable %_ptr_Function_bool Function %19
%x_20 = OpVariable %_ptr_Function_int Function %23
%i = OpVariable %_ptr_Function_int Function %23
%x_26 = OpVariable %_ptr_Function_int Function %23
%x_134 = OpVariable %_ptr_Function_int Function %23
%x_118_phi = OpVariable %_ptr_Function_bool Function %19
%x_27_phi = OpVariable %_ptr_Function_int Function %23
%x_123 = OpVariable %_ptr_Function_bool Function %19
%x_28 = OpVariable %_ptr_Function_int Function %23
%x_123_phi = OpVariable %_ptr_Function_bool Function %19
%x_28_phi = OpVariable %_ptr_Function_int Function %23
%x_26_phi = OpVariable %_ptr_Function_int Function %23
%x_132_phi = OpVariable %_ptr_Function_bool Function %19
OpStore %x_116 %false
OpStore %x_118_phi %false
OpBranch %167
%167 = OpLabel
OpLoopMerge %168 %169 None
OpBranch %170
%170 = OpLabel
%177 = OpLoad %bool %x_118_phi
OpStore %i %int_0
OpStore %x_123_phi %177
OpStore %x_28_phi %int_0
OpBranch %178
%178 = OpLabel
OpLoopMerge %179 %180 None
OpBranch %181
%181 = OpLabel
%182 = OpLoad %bool %x_123_phi
OpStore %x_123 %182
%183 = OpLoad %int %x_28_phi
OpStore %x_28 %183
%184 = OpAccessChain %_ptr_Uniform_float %x_8 %uint_0
%185 = OpLoad %float %184
OpStore %x_26_phi %int_0
%186 = OpLoad %bool %x_123
OpStore %x_132_phi %186
%187 = OpLoad %int %x_28
%188 = OpConvertFToS %int %185
%189 = OpSLessThan %bool %187 %188
OpSelectionMerge %190 None
OpBranchConditional %189 %191 %192
%191 = OpLabel
OpBranch %190
%192 = OpLabel
OpBranch %179
%190 = OpLabel
OpStore %x_116 %true
%193 = OpLoad %int %x_28
OpStore %x_20 %193
%194 = OpLoad %int %x_28
OpStore %x_26_phi %194
OpStore %x_132_phi %true
OpBranch %179
%180 = OpLabel
OpStore %x_123_phi %false
OpStore %x_28_phi %int_0
OpBranch %178
%179 = OpLabel
%195 = OpLoad %int %x_26_phi
OpStore %x_26 %195
%196 = OpLoad %bool %x_132_phi
%197 = OpLoad %int %x_26
OpStore %x_27_phi %197
OpSelectionMerge %198 None
OpBranchConditional %196 %199 %198
%199 = OpLabel
OpBranch %168
%198 = OpLabel
OpStore %x_134 %int_0
OpStore %x_116 %true
%200 = OpLoad %int %x_134
OpStore %x_20 %200
%201 = OpLoad %int %x_134
OpStore %x_27_phi %201
OpBranch %168
%169 = OpLabel
OpStore %x_118_phi %false
OpBranch %167
%168 = OpLabel
%202 = OpLoad %int %x_27_phi
OpReturnValue %202
OpFunctionEnd

View File

@@ -1,212 +0,0 @@
[[block]]
struct buf0 {
one : f32;
};
[[group(0), binding(0)]] var<uniform> x_8 : buf0;
var<private> x_GLF_color : vec4<f32>;
fn main_1() {
var x_68 : bool = false;
var x_29 : i32;
var x_30 : i32;
var x_31 : i32;
var globalNumbers : array<i32, 10>;
var x_17 : i32;
var acc : i32;
var i_1 : i32;
var localNumbers : array<i32, 2>;
var param : i32;
var x_24 : i32;
var x_24_phi : i32;
var x_23_phi : i32;
acc = 0;
i_1 = 0;
x_24_phi = 0;
x_23_phi = 0;
loop {
var x_33 : i32;
var x_92 : i32;
var x_76_phi : bool;
var x_34_phi : i32;
var x_25_phi : i32;
x_24 = x_24_phi;
let x_23 : i32 = x_23_phi;
if ((x_23 < 4)) {
} else {
break;
}
x_68 = false;
x_76_phi = false;
loop {
var x_81 : bool;
var x_32 : i32;
var x_81_phi : bool;
var x_32_phi : i32;
var x_33_phi : i32;
var x_90_phi : bool;
let x_76 : bool = x_76_phi;
x_30 = 0;
x_81_phi = x_76;
x_32_phi = 0;
loop {
x_81 = x_81_phi;
x_32 = x_32_phi;
let x_86 : f32 = x_8.one;
x_33_phi = 0;
x_90_phi = x_81;
if ((x_32 < i32(x_86))) {
} else {
break;
}
x_68 = true;
x_29 = x_32;
x_33_phi = x_32;
x_90_phi = true;
break;
continuing {
x_81_phi = false;
x_32_phi = 0;
}
}
x_33 = x_33_phi;
let x_90 : bool = x_90_phi;
x_34_phi = x_33;
if (x_90) {
break;
}
x_92 = 0;
x_68 = true;
x_29 = x_92;
x_34_phi = x_92;
break;
continuing {
x_76_phi = false;
}
}
let x_34 : i32 = x_34_phi;
x_31 = x_34;
let x_93 : i32 = x_31;
let x_21 : array<i32, 2> = localNumbers;
var x_22_1 : array<i32, 2> = x_21;
x_22_1[1u] = x_93;
let x_22 : array<i32, 2> = x_22_1;
localNumbers = x_22;
globalNumbers[0] = 0;
let x_95 : ptr<function, i32> = &(localNumbers[1]);
let x_13 : i32 = x_22[1u];
param = x_13;
x_17 = 0;
x_25_phi = 0;
loop {
let x_25 : i32 = x_25_phi;
if ((x_25 <= x_13)) {
} else {
break;
}
let x_102 : ptr<function, i32> = &(globalNumbers[x_13]);
let x_18 : i32 = *(x_102);
if ((x_18 <= 1)) {
*(x_102) = 1;
}
continuing {
let x_19 : i32 = (x_25 + 1);
x_17 = x_19;
x_25_phi = x_19;
}
}
let x_107 : f32 = x_8.one;
let x_14 : i32 = globalNumbers[(i32(x_107) - 1)];
let x_15 : i32 = bitcast<i32>((x_24 + bitcast<i32>(x_14)));
acc = x_15;
continuing {
let x_16 : i32 = (x_23 + 1);
i_1 = x_16;
x_24_phi = x_15;
x_23_phi = x_16;
}
}
if ((x_24 == bitcast<i32>(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, 1.0);
}
return;
}
struct main_out {
[[location(0)]]
x_GLF_color_1 : vec4<f32>;
};
[[stage(fragment)]]
fn main() -> main_out {
main_1();
return main_out(x_GLF_color);
}
fn yieldsZero_() -> i32 {
var x_116 : bool = false;
var x_20 : i32;
var i : i32;
var x_26 : i32;
var x_134 : i32;
var x_118_phi : bool;
var x_27_phi : i32;
x_118_phi = false;
loop {
var x_123 : bool;
var x_28 : i32;
var x_123_phi : bool;
var x_28_phi : i32;
var x_26_phi : i32;
var x_132_phi : bool;
let x_118 : bool = x_118_phi;
i = 0;
x_123_phi = x_118;
x_28_phi = 0;
loop {
x_123 = x_123_phi;
x_28 = x_28_phi;
let x_128 : f32 = x_8.one;
x_26_phi = 0;
x_132_phi = x_123;
if ((x_28 < i32(x_128))) {
} else {
break;
}
x_116 = true;
x_20 = x_28;
x_26_phi = x_28;
x_132_phi = true;
break;
continuing {
x_123_phi = false;
x_28_phi = 0;
}
}
x_26 = x_26_phi;
let x_132 : bool = x_132_phi;
x_27_phi = x_26;
if (x_132) {
break;
}
x_134 = 0;
x_116 = true;
x_20 = x_134;
x_27_phi = x_134;
break;
continuing {
x_118_phi = false;
}
}
let x_27 : i32 = x_27_phi;
return x_27;
}

View File

@@ -1,207 +0,0 @@
cbuffer cbuffer_x_8 : register(b0, space0) {
uint4 x_8[1];
};
static float4 x_GLF_color = float4(0.0f, 0.0f, 0.0f, 0.0f);
void main_1() {
bool x_68 = false;
int x_29 = 0;
int x_30 = 0;
int x_31 = 0;
int globalNumbers[10] = (int[10])0;
int x_17 = 0;
int acc = 0;
int i_1 = 0;
int localNumbers[2] = (int[2])0;
int param = 0;
int x_24 = 0;
int x_24_phi = 0;
int x_23_phi = 0;
acc = 0;
i_1 = 0;
x_24_phi = 0;
x_23_phi = 0;
while (true) {
int x_33 = 0;
int x_92 = 0;
bool x_76_phi = false;
int x_34_phi = 0;
int x_25_phi = 0;
x_24 = x_24_phi;
const int x_23 = x_23_phi;
if ((x_23 < 4)) {
} else {
break;
}
x_68 = false;
x_76_phi = false;
while (true) {
bool x_81 = false;
int x_32 = 0;
bool x_81_phi = false;
int x_32_phi = 0;
int x_33_phi = 0;
bool x_90_phi = false;
const bool x_76 = x_76_phi;
x_30 = 0;
x_81_phi = x_76;
x_32_phi = 0;
while (true) {
x_81 = x_81_phi;
x_32 = x_32_phi;
const float x_86 = asfloat(x_8[0].x);
x_33_phi = 0;
x_90_phi = x_81;
if ((x_32 < int(x_86))) {
} else {
break;
}
x_68 = true;
x_29 = x_32;
x_33_phi = x_32;
x_90_phi = true;
break;
{
x_81_phi = false;
x_32_phi = 0;
}
}
x_33 = x_33_phi;
const bool x_90 = x_90_phi;
x_34_phi = x_33;
if (x_90) {
break;
}
x_92 = 0;
x_68 = true;
x_29 = x_92;
x_34_phi = x_92;
break;
{
x_76_phi = false;
}
}
x_31 = x_34_phi;
const int x_93 = x_31;
int x_22_1[2] = localNumbers;
x_22_1[1u] = x_93;
const int x_22[2] = x_22_1;
localNumbers = x_22;
globalNumbers[0] = 0;
const int x_13 = x_22[1u];
param = x_13;
x_17 = 0;
x_25_phi = 0;
while (true) {
const int x_25 = x_25_phi;
if ((x_25 <= x_13)) {
} else {
break;
}
const int x_102_save = x_13;
const int x_18 = globalNumbers[x_102_save];
if ((x_18 <= 1)) {
globalNumbers[x_102_save] = 1;
}
{
const int x_19 = (x_25 + 1);
x_17 = x_19;
x_25_phi = x_19;
}
}
const float x_107 = asfloat(x_8[0].x);
const int x_14 = globalNumbers[(int(x_107) - 1)];
const int x_15 = asint((x_24 + asint(x_14)));
acc = x_15;
{
const int x_16 = (x_23 + 1);
i_1 = x_16;
x_24_phi = x_15;
x_23_phi = x_16;
}
}
if ((x_24 == asint(4))) {
x_GLF_color = float4(1.0f, 0.0f, 0.0f, 1.0f);
} else {
x_GLF_color = float4(0.0f, 0.0f, 0.0f, 1.0f);
}
return;
}
struct main_out {
float4 x_GLF_color_1;
};
struct tint_symbol {
float4 x_GLF_color_1 : SV_Target0;
};
main_out main_inner() {
main_1();
const main_out tint_symbol_2 = {x_GLF_color};
return tint_symbol_2;
}
tint_symbol main() {
const main_out inner_result = main_inner();
tint_symbol wrapper_result = (tint_symbol)0;
wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1;
return wrapper_result;
}
int yieldsZero_() {
bool x_116 = false;
int x_20 = 0;
int i = 0;
int x_26 = 0;
int x_134 = 0;
bool x_118_phi = false;
int x_27_phi = 0;
x_118_phi = false;
while (true) {
bool x_123 = false;
int x_28 = 0;
bool x_123_phi = false;
int x_28_phi = 0;
int x_26_phi = 0;
bool x_132_phi = false;
const bool x_118 = x_118_phi;
i = 0;
x_123_phi = x_118;
x_28_phi = 0;
while (true) {
x_123 = x_123_phi;
x_28 = x_28_phi;
const float x_128 = asfloat(x_8[0].x);
x_26_phi = 0;
x_132_phi = x_123;
if ((x_28 < int(x_128))) {
} else {
break;
}
x_116 = true;
x_20 = x_28;
x_26_phi = x_28;
x_132_phi = true;
break;
{
x_123_phi = false;
x_28_phi = 0;
}
}
x_26 = x_26_phi;
const bool x_132 = x_132_phi;
x_27_phi = x_26;
if (x_132) {
break;
}
x_134 = 0;
x_116 = true;
x_20 = x_134;
x_27_phi = x_134;
break;
{
x_118_phi = false;
}
}
return x_27_phi;
}

View File

@@ -1,219 +0,0 @@
#include <metal_stdlib>
using namespace metal;
struct buf0 {
/* 0x0000 */ float one;
};
struct tint_array_wrapper {
int arr[10];
};
struct tint_array_wrapper_1 {
int arr[2];
};
struct main_out {
float4 x_GLF_color_1;
};
struct tint_symbol_1 {
float4 x_GLF_color_1 [[color(0)]];
};
void main_1(constant buf0& x_8, thread float4* const tint_symbol_3) {
bool x_68 = false;
int x_29 = 0;
int x_30 = 0;
int x_31 = 0;
tint_array_wrapper globalNumbers = {};
int x_17 = 0;
int acc = 0;
int i_1 = 0;
tint_array_wrapper_1 localNumbers = {};
int param = 0;
int x_24 = 0;
int x_24_phi = 0;
int x_23_phi = 0;
acc = 0;
i_1 = 0;
x_24_phi = 0;
x_23_phi = 0;
while (true) {
int x_33 = 0;
int x_92 = 0;
bool x_76_phi = false;
int x_34_phi = 0;
int x_25_phi = 0;
x_24 = x_24_phi;
int const x_23 = x_23_phi;
if ((x_23 < 4)) {
} else {
break;
}
x_68 = false;
x_76_phi = false;
while (true) {
bool x_81 = false;
int x_32 = 0;
bool x_81_phi = false;
int x_32_phi = 0;
int x_33_phi = 0;
bool x_90_phi = false;
bool const x_76 = x_76_phi;
x_30 = 0;
x_81_phi = x_76;
x_32_phi = 0;
while (true) {
x_81 = x_81_phi;
x_32 = x_32_phi;
float const x_86 = x_8.one;
x_33_phi = 0;
x_90_phi = x_81;
if ((x_32 < int(x_86))) {
} else {
break;
}
x_68 = true;
x_29 = x_32;
x_33_phi = x_32;
x_90_phi = true;
break;
{
x_81_phi = false;
x_32_phi = 0;
}
}
x_33 = x_33_phi;
bool const x_90 = x_90_phi;
x_34_phi = x_33;
if (x_90) {
break;
}
x_92 = 0;
x_68 = true;
x_29 = x_92;
x_34_phi = x_92;
break;
{
x_76_phi = false;
}
}
int const x_34 = x_34_phi;
x_31 = x_34;
int const x_93 = x_31;
tint_array_wrapper_1 const x_21 = localNumbers;
tint_array_wrapper_1 x_22_1 = x_21;
x_22_1.arr[1u] = x_93;
tint_array_wrapper_1 const x_22 = x_22_1;
localNumbers = x_22;
globalNumbers.arr[0] = 0;
int const x_13 = x_22.arr[1u];
param = x_13;
x_17 = 0;
x_25_phi = 0;
while (true) {
int const x_25 = x_25_phi;
if ((x_25 <= x_13)) {
} else {
break;
}
int const x_102_save = x_13;
int const x_18 = globalNumbers.arr[x_102_save];
if ((x_18 <= 1)) {
globalNumbers.arr[x_102_save] = 1;
}
{
int const x_19 = as_type<int>((as_type<uint>(x_25) + as_type<uint>(1)));
x_17 = x_19;
x_25_phi = x_19;
}
}
float const x_107 = x_8.one;
int const x_14 = globalNumbers.arr[as_type<int>((as_type<uint>(int(x_107)) - as_type<uint>(1)))];
int const x_15 = as_type<int>(as_type<int>((as_type<uint>(x_24) + as_type<uint>(as_type<int>(x_14)))));
acc = x_15;
{
int const x_16 = as_type<int>((as_type<uint>(x_23) + as_type<uint>(1)));
i_1 = x_16;
x_24_phi = x_15;
x_23_phi = x_16;
}
}
if ((x_24 == as_type<int>(4))) {
*(tint_symbol_3) = float4(1.0f, 0.0f, 0.0f, 1.0f);
} else {
*(tint_symbol_3) = float4(0.0f, 0.0f, 0.0f, 1.0f);
}
return;
}
main_out tint_symbol_inner(constant buf0& x_8, thread float4* const tint_symbol_4) {
main_1(x_8, tint_symbol_4);
main_out const tint_symbol_2 = {.x_GLF_color_1=*(tint_symbol_4)};
return tint_symbol_2;
}
fragment tint_symbol_1 tint_symbol(constant buf0& x_8 [[buffer(0)]]) {
thread float4 tint_symbol_5 = 0.0f;
main_out const inner_result = tint_symbol_inner(x_8, &(tint_symbol_5));
tint_symbol_1 wrapper_result = {};
wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1;
return wrapper_result;
}
int yieldsZero_(constant buf0& x_8) {
bool x_116 = false;
int x_20 = 0;
int i = 0;
int x_26 = 0;
int x_134 = 0;
bool x_118_phi = false;
int x_27_phi = 0;
x_118_phi = false;
while (true) {
bool x_123 = false;
int x_28 = 0;
bool x_123_phi = false;
int x_28_phi = 0;
int x_26_phi = 0;
bool x_132_phi = false;
bool const x_118 = x_118_phi;
i = 0;
x_123_phi = x_118;
x_28_phi = 0;
while (true) {
x_123 = x_123_phi;
x_28 = x_28_phi;
float const x_128 = x_8.one;
x_26_phi = 0;
x_132_phi = x_123;
if ((x_28 < int(x_128))) {
} else {
break;
}
x_116 = true;
x_20 = x_28;
x_26_phi = x_28;
x_132_phi = true;
break;
{
x_123_phi = false;
x_28_phi = 0;
}
}
x_26 = x_26_phi;
bool const x_132 = x_132_phi;
x_27_phi = x_26;
if (x_132) {
break;
}
x_134 = 0;
x_116 = true;
x_20 = x_134;
x_27_phi = x_134;
break;
{
x_118_phi = false;
}
}
int const x_27 = x_27_phi;
return x_27;
}

View File

@@ -1,404 +0,0 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 203
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main" %x_GLF_color_1_1
OpExecutionMode %main OriginUpperLeft
OpName %x_GLF_color_1_1 "x_GLF_color_1_1"
OpName %buf0 "buf0"
OpMemberName %buf0 0 "one"
OpName %x_8 "x_8"
OpName %x_GLF_color "x_GLF_color"
OpName %main_1 "main_1"
OpName %x_68 "x_68"
OpName %x_29 "x_29"
OpName %x_30 "x_30"
OpName %x_31 "x_31"
OpName %globalNumbers "globalNumbers"
OpName %x_17 "x_17"
OpName %acc "acc"
OpName %i_1 "i_1"
OpName %localNumbers "localNumbers"
OpName %param "param"
OpName %x_24 "x_24"
OpName %x_24_phi "x_24_phi"
OpName %x_23_phi "x_23_phi"
OpName %x_33 "x_33"
OpName %x_92 "x_92"
OpName %x_76_phi "x_76_phi"
OpName %x_34_phi "x_34_phi"
OpName %x_25_phi "x_25_phi"
OpName %x_81 "x_81"
OpName %x_32 "x_32"
OpName %x_81_phi "x_81_phi"
OpName %x_32_phi "x_32_phi"
OpName %x_33_phi "x_33_phi"
OpName %x_90_phi "x_90_phi"
OpName %x_22_1 "x_22_1"
OpName %main_out "main_out"
OpMemberName %main_out 0 "x_GLF_color_1"
OpName %main_inner "main_inner"
OpName %main "main"
OpName %yieldsZero_ "yieldsZero_"
OpName %x_116 "x_116"
OpName %x_20 "x_20"
OpName %i "i"
OpName %x_26 "x_26"
OpName %x_134 "x_134"
OpName %x_118_phi "x_118_phi"
OpName %x_27_phi "x_27_phi"
OpName %x_123 "x_123"
OpName %x_28 "x_28"
OpName %x_123_phi "x_123_phi"
OpName %x_28_phi "x_28_phi"
OpName %x_26_phi "x_26_phi"
OpName %x_132_phi "x_132_phi"
OpDecorate %x_GLF_color_1_1 Location 0
OpDecorate %buf0 Block
OpMemberDecorate %buf0 0 Offset 0
OpDecorate %x_8 NonWritable
OpDecorate %x_8 DescriptorSet 0
OpDecorate %x_8 Binding 0
OpDecorate %_arr_int_uint_10 ArrayStride 4
OpDecorate %_arr_int_uint_2 ArrayStride 4
OpMemberDecorate %main_out 0 Offset 0
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
%5 = OpConstantNull %v4float
%x_GLF_color_1_1 = OpVariable %_ptr_Output_v4float Output %5
%buf0 = OpTypeStruct %float
%_ptr_Uniform_buf0 = OpTypePointer Uniform %buf0
%x_8 = OpVariable %_ptr_Uniform_buf0 Uniform
%_ptr_Private_v4float = OpTypePointer Private %v4float
%x_GLF_color = OpVariable %_ptr_Private_v4float Private %5
%void = OpTypeVoid
%11 = OpTypeFunction %void
%bool = OpTypeBool
%false = OpConstantFalse %bool
%_ptr_Function_bool = OpTypePointer Function %bool
%19 = OpConstantNull %bool
%int = OpTypeInt 32 1
%_ptr_Function_int = OpTypePointer Function %int
%23 = OpConstantNull %int
%uint = OpTypeInt 32 0
%uint_10 = OpConstant %uint 10
%_arr_int_uint_10 = OpTypeArray %int %uint_10
%_ptr_Function__arr_int_uint_10 = OpTypePointer Function %_arr_int_uint_10
%31 = OpConstantNull %_arr_int_uint_10
%uint_2 = OpConstant %uint 2
%_arr_int_uint_2 = OpTypeArray %int %uint_2
%_ptr_Function__arr_int_uint_2 = OpTypePointer Function %_arr_int_uint_2
%39 = OpConstantNull %_arr_int_uint_2
%int_0 = OpConstant %int 0
%int_4 = OpConstant %int 4
%uint_0 = OpConstant %uint 0
%_ptr_Uniform_float = OpTypePointer Uniform %float
%true = OpConstantTrue %bool
%uint_1 = OpConstant %uint 1
%int_1 = OpConstant %int 1
%float_1 = OpConstant %float 1
%float_0 = OpConstant %float 0
%144 = OpConstantComposite %v4float %float_1 %float_0 %float_0 %float_1
%145 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_1
%main_out = OpTypeStruct %v4float
%146 = OpTypeFunction %main_out
%157 = OpTypeFunction %int
%main_1 = OpFunction %void None %11
%14 = OpLabel
%x_68 = OpVariable %_ptr_Function_bool Function %19
%x_29 = OpVariable %_ptr_Function_int Function %23
%x_30 = OpVariable %_ptr_Function_int Function %23
%x_31 = OpVariable %_ptr_Function_int Function %23
%globalNumbers = OpVariable %_ptr_Function__arr_int_uint_10 Function %31
%x_17 = OpVariable %_ptr_Function_int Function %23
%acc = OpVariable %_ptr_Function_int Function %23
%i_1 = OpVariable %_ptr_Function_int Function %23
%localNumbers = OpVariable %_ptr_Function__arr_int_uint_2 Function %39
%param = OpVariable %_ptr_Function_int Function %23
%x_24 = OpVariable %_ptr_Function_int Function %23
%x_24_phi = OpVariable %_ptr_Function_int Function %23
%x_23_phi = OpVariable %_ptr_Function_int Function %23
%x_33 = OpVariable %_ptr_Function_int Function %23
%x_92 = OpVariable %_ptr_Function_int Function %23
%x_76_phi = OpVariable %_ptr_Function_bool Function %19
%x_34_phi = OpVariable %_ptr_Function_int Function %23
%x_25_phi = OpVariable %_ptr_Function_int Function %23
%x_81 = OpVariable %_ptr_Function_bool Function %19
%x_32 = OpVariable %_ptr_Function_int Function %23
%x_81_phi = OpVariable %_ptr_Function_bool Function %19
%x_32_phi = OpVariable %_ptr_Function_int Function %23
%x_33_phi = OpVariable %_ptr_Function_int Function %23
%x_90_phi = OpVariable %_ptr_Function_bool Function %19
%x_22_1 = OpVariable %_ptr_Function__arr_int_uint_2 Function %39
OpStore %x_68 %false
OpStore %acc %int_0
OpStore %i_1 %int_0
OpStore %x_24_phi %int_0
OpStore %x_23_phi %int_0
OpBranch %45
%45 = OpLabel
OpLoopMerge %46 %47 None
OpBranch %48
%48 = OpLabel
%54 = OpLoad %int %x_24_phi
OpStore %x_24 %54
%55 = OpLoad %int %x_23_phi
%57 = OpSLessThan %bool %55 %int_4
OpSelectionMerge %58 None
OpBranchConditional %57 %59 %60
%59 = OpLabel
OpBranch %58
%60 = OpLabel
OpBranch %46
%58 = OpLabel
OpStore %x_68 %false
OpStore %x_76_phi %false
OpBranch %61
%61 = OpLabel
OpLoopMerge %62 %63 None
OpBranch %64
%64 = OpLabel
%71 = OpLoad %bool %x_76_phi
OpStore %x_30 %int_0
OpStore %x_81_phi %71
OpStore %x_32_phi %int_0
OpBranch %72
%72 = OpLabel
OpLoopMerge %73 %74 None
OpBranch %75
%75 = OpLabel
%76 = OpLoad %bool %x_81_phi
OpStore %x_81 %76
%77 = OpLoad %int %x_32_phi
OpStore %x_32 %77
%80 = OpAccessChain %_ptr_Uniform_float %x_8 %uint_0
%81 = OpLoad %float %80
OpStore %x_33_phi %int_0
%82 = OpLoad %bool %x_81
OpStore %x_90_phi %82
%83 = OpLoad %int %x_32
%84 = OpConvertFToS %int %81
%85 = OpSLessThan %bool %83 %84
OpSelectionMerge %86 None
OpBranchConditional %85 %87 %88
%87 = OpLabel
OpBranch %86
%88 = OpLabel
OpBranch %73
%86 = OpLabel
OpStore %x_68 %true
%90 = OpLoad %int %x_32
OpStore %x_29 %90
%91 = OpLoad %int %x_32
OpStore %x_33_phi %91
OpStore %x_90_phi %true
OpBranch %73
%74 = OpLabel
OpStore %x_81_phi %false
OpStore %x_32_phi %int_0
OpBranch %72
%73 = OpLabel
%92 = OpLoad %int %x_33_phi
OpStore %x_33 %92
%93 = OpLoad %bool %x_90_phi
%94 = OpLoad %int %x_33
OpStore %x_34_phi %94
OpSelectionMerge %95 None
OpBranchConditional %93 %96 %95
%96 = OpLabel
OpBranch %62
%95 = OpLabel
OpStore %x_92 %int_0
OpStore %x_68 %true
%97 = OpLoad %int %x_92
OpStore %x_29 %97
%98 = OpLoad %int %x_92
OpStore %x_34_phi %98
OpBranch %62
%63 = OpLabel
OpStore %x_76_phi %false
OpBranch %61
%62 = OpLabel
%99 = OpLoad %int %x_34_phi
OpStore %x_31 %99
%100 = OpLoad %int %x_31
%101 = OpLoad %_arr_int_uint_2 %localNumbers
OpStore %x_22_1 %101
%104 = OpAccessChain %_ptr_Function_int %x_22_1 %uint_1
OpStore %104 %100
%105 = OpLoad %_arr_int_uint_2 %x_22_1
OpStore %localNumbers %105
%106 = OpAccessChain %_ptr_Function_int %globalNumbers %int_0
OpStore %106 %int_0
%107 = OpCompositeExtract %int %105 1
OpStore %param %107
OpStore %x_17 %int_0
OpStore %x_25_phi %int_0
OpBranch %108
%108 = OpLabel
OpLoopMerge %109 %110 None
OpBranch %111
%111 = OpLabel
%112 = OpLoad %int %x_25_phi
%113 = OpSLessThanEqual %bool %112 %107
OpSelectionMerge %114 None
OpBranchConditional %113 %115 %116
%115 = OpLabel
OpBranch %114
%116 = OpLabel
OpBranch %109
%114 = OpLabel
%117 = OpAccessChain %_ptr_Function_int %globalNumbers %107
%118 = OpLoad %int %117
%120 = OpSLessThanEqual %bool %118 %int_1
OpSelectionMerge %121 None
OpBranchConditional %120 %122 %121
%122 = OpLabel
%123 = OpAccessChain %_ptr_Function_int %globalNumbers %107
OpStore %123 %int_1
OpBranch %121
%121 = OpLabel
OpBranch %110
%110 = OpLabel
%124 = OpIAdd %int %112 %int_1
OpStore %x_17 %124
OpStore %x_25_phi %124
OpBranch %108
%109 = OpLabel
%125 = OpAccessChain %_ptr_Uniform_float %x_8 %uint_0
%126 = OpLoad %float %125
%127 = OpConvertFToS %int %126
%128 = OpISub %int %127 %int_1
%129 = OpAccessChain %_ptr_Function_int %globalNumbers %128
%130 = OpLoad %int %129
%132 = OpLoad %int %x_24
%133 = OpCopyObject %int %130
%134 = OpIAdd %int %132 %133
%131 = OpCopyObject %int %134
OpStore %acc %131
OpBranch %47
%47 = OpLabel
%135 = OpIAdd %int %55 %int_1
OpStore %i_1 %135
OpStore %x_24_phi %131
OpStore %x_23_phi %135
OpBranch %45
%46 = OpLabel
%136 = OpLoad %int %x_24
%137 = OpCopyObject %int %int_4
%138 = OpIEqual %bool %136 %137
OpSelectionMerge %139 None
OpBranchConditional %138 %140 %141
%140 = OpLabel
OpStore %x_GLF_color %144
OpBranch %139
%141 = OpLabel
OpStore %x_GLF_color %145
OpBranch %139
%139 = OpLabel
OpReturn
OpFunctionEnd
%main_inner = OpFunction %main_out None %146
%149 = OpLabel
%150 = OpFunctionCall %void %main_1
%151 = OpLoad %v4float %x_GLF_color
%152 = OpCompositeConstruct %main_out %151
OpReturnValue %152
OpFunctionEnd
%main = OpFunction %void None %11
%154 = OpLabel
%155 = OpFunctionCall %main_out %main_inner
%156 = OpCompositeExtract %v4float %155 0
OpStore %x_GLF_color_1_1 %156
OpReturn
OpFunctionEnd
%yieldsZero_ = OpFunction %int None %157
%159 = OpLabel
%x_116 = OpVariable %_ptr_Function_bool Function %19
%x_20 = OpVariable %_ptr_Function_int Function %23
%i = OpVariable %_ptr_Function_int Function %23
%x_26 = OpVariable %_ptr_Function_int Function %23
%x_134 = OpVariable %_ptr_Function_int Function %23
%x_118_phi = OpVariable %_ptr_Function_bool Function %19
%x_27_phi = OpVariable %_ptr_Function_int Function %23
%x_123 = OpVariable %_ptr_Function_bool Function %19
%x_28 = OpVariable %_ptr_Function_int Function %23
%x_123_phi = OpVariable %_ptr_Function_bool Function %19
%x_28_phi = OpVariable %_ptr_Function_int Function %23
%x_26_phi = OpVariable %_ptr_Function_int Function %23
%x_132_phi = OpVariable %_ptr_Function_bool Function %19
OpStore %x_116 %false
OpStore %x_118_phi %false
OpBranch %167
%167 = OpLabel
OpLoopMerge %168 %169 None
OpBranch %170
%170 = OpLabel
%177 = OpLoad %bool %x_118_phi
OpStore %i %int_0
OpStore %x_123_phi %177
OpStore %x_28_phi %int_0
OpBranch %178
%178 = OpLabel
OpLoopMerge %179 %180 None
OpBranch %181
%181 = OpLabel
%182 = OpLoad %bool %x_123_phi
OpStore %x_123 %182
%183 = OpLoad %int %x_28_phi
OpStore %x_28 %183
%184 = OpAccessChain %_ptr_Uniform_float %x_8 %uint_0
%185 = OpLoad %float %184
OpStore %x_26_phi %int_0
%186 = OpLoad %bool %x_123
OpStore %x_132_phi %186
%187 = OpLoad %int %x_28
%188 = OpConvertFToS %int %185
%189 = OpSLessThan %bool %187 %188
OpSelectionMerge %190 None
OpBranchConditional %189 %191 %192
%191 = OpLabel
OpBranch %190
%192 = OpLabel
OpBranch %179
%190 = OpLabel
OpStore %x_116 %true
%193 = OpLoad %int %x_28
OpStore %x_20 %193
%194 = OpLoad %int %x_28
OpStore %x_26_phi %194
OpStore %x_132_phi %true
OpBranch %179
%180 = OpLabel
OpStore %x_123_phi %false
OpStore %x_28_phi %int_0
OpBranch %178
%179 = OpLabel
%195 = OpLoad %int %x_26_phi
OpStore %x_26 %195
%196 = OpLoad %bool %x_132_phi
%197 = OpLoad %int %x_26
OpStore %x_27_phi %197
OpSelectionMerge %198 None
OpBranchConditional %196 %199 %198
%199 = OpLabel
OpBranch %168
%198 = OpLabel
OpStore %x_134 %int_0
OpStore %x_116 %true
%200 = OpLoad %int %x_134
OpStore %x_20 %200
%201 = OpLoad %int %x_134
OpStore %x_27_phi %201
OpBranch %168
%169 = OpLabel
OpStore %x_118_phi %false
OpBranch %167
%168 = OpLabel
%202 = OpLoad %int %x_27_phi
OpReturnValue %202
OpFunctionEnd

View File

@@ -1,212 +0,0 @@
[[block]]
struct buf0 {
one : f32;
};
[[group(0), binding(0)]] var<uniform> x_8 : buf0;
var<private> x_GLF_color : vec4<f32>;
fn main_1() {
var x_68 : bool = false;
var x_29 : i32;
var x_30 : i32;
var x_31 : i32;
var globalNumbers : array<i32, 10>;
var x_17 : i32;
var acc : i32;
var i_1 : i32;
var localNumbers : array<i32, 2>;
var param : i32;
var x_24 : i32;
var x_24_phi : i32;
var x_23_phi : i32;
acc = 0;
i_1 = 0;
x_24_phi = 0;
x_23_phi = 0;
loop {
var x_33 : i32;
var x_92 : i32;
var x_76_phi : bool;
var x_34_phi : i32;
var x_25_phi : i32;
x_24 = x_24_phi;
let x_23 : i32 = x_23_phi;
if ((x_23 < 4)) {
} else {
break;
}
x_68 = false;
x_76_phi = false;
loop {
var x_81 : bool;
var x_32 : i32;
var x_81_phi : bool;
var x_32_phi : i32;
var x_33_phi : i32;
var x_90_phi : bool;
let x_76 : bool = x_76_phi;
x_30 = 0;
x_81_phi = x_76;
x_32_phi = 0;
loop {
x_81 = x_81_phi;
x_32 = x_32_phi;
let x_86 : f32 = x_8.one;
x_33_phi = 0;
x_90_phi = x_81;
if ((x_32 < i32(x_86))) {
} else {
break;
}
x_68 = true;
x_29 = x_32;
x_33_phi = x_32;
x_90_phi = true;
break;
continuing {
x_81_phi = false;
x_32_phi = 0;
}
}
x_33 = x_33_phi;
let x_90 : bool = x_90_phi;
x_34_phi = x_33;
if (x_90) {
break;
}
x_92 = 0;
x_68 = true;
x_29 = x_92;
x_34_phi = x_92;
break;
continuing {
x_76_phi = false;
}
}
let x_34 : i32 = x_34_phi;
x_31 = x_34;
let x_93 : i32 = x_31;
let x_21 : array<i32, 2> = localNumbers;
var x_22_1 : array<i32, 2> = x_21;
x_22_1[1u] = x_93;
let x_22 : array<i32, 2> = x_22_1;
localNumbers = x_22;
globalNumbers[0] = 0;
let x_95 : ptr<function, i32> = &(localNumbers[1]);
let x_13 : i32 = x_22[1u];
param = x_13;
x_17 = 0;
x_25_phi = 0;
loop {
let x_25 : i32 = x_25_phi;
if ((x_25 <= x_13)) {
} else {
break;
}
let x_102 : ptr<function, i32> = &(globalNumbers[x_13]);
let x_18 : i32 = *(x_102);
if ((x_18 <= 1)) {
*(x_102) = 1;
}
continuing {
let x_19 : i32 = (x_25 + 1);
x_17 = x_19;
x_25_phi = x_19;
}
}
let x_107 : f32 = x_8.one;
let x_14 : i32 = globalNumbers[(i32(x_107) - 1)];
let x_15 : i32 = bitcast<i32>((x_24 + bitcast<i32>(x_14)));
acc = x_15;
continuing {
let x_16 : i32 = (x_23 + 1);
i_1 = x_16;
x_24_phi = x_15;
x_23_phi = x_16;
}
}
if ((x_24 == bitcast<i32>(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, 1.0);
}
return;
}
struct main_out {
[[location(0)]]
x_GLF_color_1 : vec4<f32>;
};
[[stage(fragment)]]
fn main() -> main_out {
main_1();
return main_out(x_GLF_color);
}
fn yieldsZero_() -> i32 {
var x_116 : bool = false;
var x_20 : i32;
var i : i32;
var x_26 : i32;
var x_134 : i32;
var x_118_phi : bool;
var x_27_phi : i32;
x_118_phi = false;
loop {
var x_123 : bool;
var x_28 : i32;
var x_123_phi : bool;
var x_28_phi : i32;
var x_26_phi : i32;
var x_132_phi : bool;
let x_118 : bool = x_118_phi;
i = 0;
x_123_phi = x_118;
x_28_phi = 0;
loop {
x_123 = x_123_phi;
x_28 = x_28_phi;
let x_128 : f32 = x_8.one;
x_26_phi = 0;
x_132_phi = x_123;
if ((x_28 < i32(x_128))) {
} else {
break;
}
x_116 = true;
x_20 = x_28;
x_26_phi = x_28;
x_132_phi = true;
break;
continuing {
x_123_phi = false;
x_28_phi = 0;
}
}
x_26 = x_26_phi;
let x_132 : bool = x_132_phi;
x_27_phi = x_26;
if (x_132) {
break;
}
x_134 = 0;
x_116 = true;
x_20 = x_134;
x_27_phi = x_134;
break;
continuing {
x_118_phi = false;
}
}
let x_27 : i32 = x_27_phi;
return x_27;
}