mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-11 14:41:50 +00:00
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:
committed by
Tint LUCI CQ
parent
568136dd10
commit
87cce20f67
@@ -1,101 +0,0 @@
|
||||
static int data[9] = (int[9])0;
|
||||
static float4 gl_FragCoord = float4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
static int temp[7] = (int[7])0;
|
||||
static float4 x_GLF_color = float4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
|
||||
float func_i1_(inout int a) {
|
||||
int b = 0;
|
||||
int i = 0;
|
||||
bool x_115 = false;
|
||||
bool x_116_phi = false;
|
||||
b = 0;
|
||||
data[0] = 5;
|
||||
data[2] = 0;
|
||||
data[4] = 0;
|
||||
data[6] = 0;
|
||||
data[8] = 0;
|
||||
const float x_71 = gl_FragCoord.x;
|
||||
if ((x_71 >= 0.0f)) {
|
||||
while (true) {
|
||||
const int x_79 = b;
|
||||
const int x_80 = a;
|
||||
if ((x_79 <= x_80)) {
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
if ((b <= 5)) {
|
||||
const int x_87 = b;
|
||||
const int x_90 = data[b];
|
||||
temp[x_87] = x_90;
|
||||
b = (b + 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
i = 0;
|
||||
{
|
||||
for(; (i < 3); i = (i + 1)) {
|
||||
const int x_101 = i;
|
||||
const int x_103 = temp[0];
|
||||
data[x_101] = (x_103 + 1);
|
||||
}
|
||||
}
|
||||
const int x_109 = temp[0];
|
||||
const bool x_110 = (x_109 == 5);
|
||||
x_116_phi = x_110;
|
||||
if (x_110) {
|
||||
const int x_114 = data[0];
|
||||
x_115 = (x_114 == 6);
|
||||
x_116_phi = x_115;
|
||||
}
|
||||
if (x_116_phi) {
|
||||
return 1.0f;
|
||||
} else {
|
||||
return 0.0f;
|
||||
}
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
void main_1() {
|
||||
int i_1 = 0;
|
||||
int param = 0;
|
||||
int param_1 = 0;
|
||||
i_1 = 0;
|
||||
{
|
||||
for(; (i_1 < 6); i_1 = (i_1 + 1)) {
|
||||
param = i_1;
|
||||
const float x_55 = func_i1_(param);
|
||||
param_1 = i_1;
|
||||
const float x_57 = func_i1_(param_1);
|
||||
if ((x_57 == 1.0f)) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
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;
|
||||
};
|
||||
|
||||
main_out main_inner(float4 gl_FragCoord_param) {
|
||||
gl_FragCoord = gl_FragCoord_param;
|
||||
main_1();
|
||||
const main_out tint_symbol_3 = {x_GLF_color};
|
||||
return tint_symbol_3;
|
||||
}
|
||||
|
||||
tint_symbol_2 main(tint_symbol_1 tint_symbol) {
|
||||
const main_out inner_result = main_inner(tint_symbol.gl_FragCoord_param);
|
||||
tint_symbol_2 wrapper_result = (tint_symbol_2)0;
|
||||
wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1;
|
||||
return wrapper_result;
|
||||
}
|
||||
@@ -1,127 +0,0 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct tint_array_wrapper {
|
||||
int arr[9];
|
||||
};
|
||||
struct tint_array_wrapper_1 {
|
||||
int arr[7];
|
||||
};
|
||||
struct main_out {
|
||||
float4 x_GLF_color_1;
|
||||
};
|
||||
struct tint_symbol_1 {
|
||||
float4 x_GLF_color_1 [[color(0)]];
|
||||
};
|
||||
|
||||
float func_i1_(thread int* const a, thread tint_array_wrapper* const tint_symbol_3, thread float4* const tint_symbol_4, thread tint_array_wrapper_1* const tint_symbol_5) {
|
||||
int b = 0;
|
||||
int i = 0;
|
||||
bool x_115 = false;
|
||||
bool x_116_phi = false;
|
||||
b = 0;
|
||||
(*(tint_symbol_3)).arr[0] = 5;
|
||||
(*(tint_symbol_3)).arr[2] = 0;
|
||||
(*(tint_symbol_3)).arr[4] = 0;
|
||||
(*(tint_symbol_3)).arr[6] = 0;
|
||||
(*(tint_symbol_3)).arr[8] = 0;
|
||||
float const x_71 = (*(tint_symbol_4)).x;
|
||||
if ((x_71 >= 0.0f)) {
|
||||
while (true) {
|
||||
int const x_79 = b;
|
||||
int const x_80 = *(a);
|
||||
if ((x_79 <= x_80)) {
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
int const x_83 = b;
|
||||
if ((x_83 <= 5)) {
|
||||
int const x_87 = b;
|
||||
int const x_88 = b;
|
||||
int const x_90 = (*(tint_symbol_3)).arr[x_88];
|
||||
(*(tint_symbol_5)).arr[x_87] = x_90;
|
||||
int const x_92 = b;
|
||||
b = as_type<int>((as_type<uint>(x_92) + as_type<uint>(2)));
|
||||
}
|
||||
}
|
||||
}
|
||||
i = 0;
|
||||
while (true) {
|
||||
int const x_98 = i;
|
||||
if ((x_98 < 3)) {
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
int const x_101 = i;
|
||||
int const x_103 = (*(tint_symbol_5)).arr[0];
|
||||
(*(tint_symbol_3)).arr[x_101] = as_type<int>((as_type<uint>(x_103) + as_type<uint>(1)));
|
||||
{
|
||||
int const x_106 = i;
|
||||
i = as_type<int>((as_type<uint>(x_106) + as_type<uint>(1)));
|
||||
}
|
||||
}
|
||||
int const x_109 = (*(tint_symbol_5)).arr[0];
|
||||
bool const x_110 = (x_109 == 5);
|
||||
x_116_phi = x_110;
|
||||
if (x_110) {
|
||||
int const x_114 = (*(tint_symbol_3)).arr[0];
|
||||
x_115 = (x_114 == 6);
|
||||
x_116_phi = x_115;
|
||||
}
|
||||
bool const x_116 = x_116_phi;
|
||||
if (x_116) {
|
||||
return 1.0f;
|
||||
} else {
|
||||
return 0.0f;
|
||||
}
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
void main_1(thread tint_array_wrapper* const tint_symbol_6, thread float4* const tint_symbol_7, thread tint_array_wrapper_1* const tint_symbol_8, thread float4* const tint_symbol_9) {
|
||||
int i_1 = 0;
|
||||
int param = 0;
|
||||
int param_1 = 0;
|
||||
i_1 = 0;
|
||||
while (true) {
|
||||
int const x_51 = i_1;
|
||||
if ((x_51 < 6)) {
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
int const x_54 = i_1;
|
||||
param = x_54;
|
||||
float const x_55 = func_i1_(&(param), tint_symbol_6, tint_symbol_7, tint_symbol_8);
|
||||
int const x_56 = i_1;
|
||||
param_1 = x_56;
|
||||
float const x_57 = func_i1_(&(param_1), tint_symbol_6, tint_symbol_7, tint_symbol_8);
|
||||
if ((x_57 == 1.0f)) {
|
||||
*(tint_symbol_9) = float4(1.0f, 0.0f, 0.0f, 1.0f);
|
||||
} else {
|
||||
*(tint_symbol_9) = float4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
}
|
||||
{
|
||||
int const x_62 = i_1;
|
||||
i_1 = as_type<int>((as_type<uint>(x_62) + as_type<uint>(1)));
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
main_out tint_symbol_inner(float4 gl_FragCoord_param, thread float4* const tint_symbol_10, thread tint_array_wrapper* const tint_symbol_11, thread tint_array_wrapper_1* const tint_symbol_12, thread float4* const tint_symbol_13) {
|
||||
*(tint_symbol_10) = gl_FragCoord_param;
|
||||
main_1(tint_symbol_11, tint_symbol_10, tint_symbol_12, tint_symbol_13);
|
||||
main_out const tint_symbol_2 = {.x_GLF_color_1=*(tint_symbol_13)};
|
||||
return tint_symbol_2;
|
||||
}
|
||||
|
||||
fragment tint_symbol_1 tint_symbol(float4 gl_FragCoord_param [[position]]) {
|
||||
thread float4 tint_symbol_14 = 0.0f;
|
||||
thread tint_array_wrapper tint_symbol_15 = {};
|
||||
thread tint_array_wrapper_1 tint_symbol_16 = {};
|
||||
thread float4 tint_symbol_17 = 0.0f;
|
||||
main_out const inner_result = tint_symbol_inner(gl_FragCoord_param, &(tint_symbol_14), &(tint_symbol_15), &(tint_symbol_16), &(tint_symbol_17));
|
||||
tint_symbol_1 wrapper_result = {};
|
||||
wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1;
|
||||
return wrapper_result;
|
||||
}
|
||||
|
||||
@@ -1,258 +0,0 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 153
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Fragment %main "main" %gl_FragCoord_param_1 %x_GLF_color_1_1
|
||||
OpExecutionMode %main OriginUpperLeft
|
||||
OpName %gl_FragCoord_param_1 "gl_FragCoord_param_1"
|
||||
OpName %x_GLF_color_1_1 "x_GLF_color_1_1"
|
||||
OpName %data "data"
|
||||
OpName %gl_FragCoord "gl_FragCoord"
|
||||
OpName %temp "temp"
|
||||
OpName %x_GLF_color "x_GLF_color"
|
||||
OpName %func_i1_ "func_i1_"
|
||||
OpName %a "a"
|
||||
OpName %b "b"
|
||||
OpName %i "i"
|
||||
OpName %x_115 "x_115"
|
||||
OpName %x_116_phi "x_116_phi"
|
||||
OpName %main_1 "main_1"
|
||||
OpName %i_1 "i_1"
|
||||
OpName %param "param"
|
||||
OpName %param_1 "param_1"
|
||||
OpName %main_out "main_out"
|
||||
OpMemberName %main_out 0 "x_GLF_color_1"
|
||||
OpName %main_inner "main_inner"
|
||||
OpName %gl_FragCoord_param "gl_FragCoord_param"
|
||||
OpName %main "main"
|
||||
OpDecorate %gl_FragCoord_param_1 BuiltIn FragCoord
|
||||
OpDecorate %x_GLF_color_1_1 Location 0
|
||||
OpDecorate %_arr_int_uint_9 ArrayStride 4
|
||||
OpDecorate %_arr_int_uint_7 ArrayStride 4
|
||||
OpMemberDecorate %main_out 0 Offset 0
|
||||
%float = OpTypeFloat 32
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Input_v4float = OpTypePointer Input %v4float
|
||||
%gl_FragCoord_param_1 = OpVariable %_ptr_Input_v4float Input
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%7 = OpConstantNull %v4float
|
||||
%x_GLF_color_1_1 = OpVariable %_ptr_Output_v4float Output %7
|
||||
%int = OpTypeInt 32 1
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_9 = OpConstant %uint 9
|
||||
%_arr_int_uint_9 = OpTypeArray %int %uint_9
|
||||
%_ptr_Private__arr_int_uint_9 = OpTypePointer Private %_arr_int_uint_9
|
||||
%14 = OpConstantNull %_arr_int_uint_9
|
||||
%data = OpVariable %_ptr_Private__arr_int_uint_9 Private %14
|
||||
%_ptr_Private_v4float = OpTypePointer Private %v4float
|
||||
%gl_FragCoord = OpVariable %_ptr_Private_v4float Private %7
|
||||
%uint_7 = OpConstant %uint 7
|
||||
%_arr_int_uint_7 = OpTypeArray %int %uint_7
|
||||
%_ptr_Private__arr_int_uint_7 = OpTypePointer Private %_arr_int_uint_7
|
||||
%21 = OpConstantNull %_arr_int_uint_7
|
||||
%temp = OpVariable %_ptr_Private__arr_int_uint_7 Private %21
|
||||
%x_GLF_color = OpVariable %_ptr_Private_v4float Private %7
|
||||
%_ptr_Function_int = OpTypePointer Function %int
|
||||
%23 = OpTypeFunction %float %_ptr_Function_int
|
||||
%29 = OpConstantNull %int
|
||||
%bool = OpTypeBool
|
||||
%_ptr_Function_bool = OpTypePointer Function %bool
|
||||
%34 = OpConstantNull %bool
|
||||
%int_0 = OpConstant %int 0
|
||||
%_ptr_Private_int = OpTypePointer Private %int
|
||||
%int_5 = OpConstant %int 5
|
||||
%int_2 = OpConstant %int 2
|
||||
%int_4 = OpConstant %int 4
|
||||
%int_6 = OpConstant %int 6
|
||||
%int_8 = OpConstant %int 8
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%_ptr_Private_float = OpTypePointer Private %float
|
||||
%float_0 = OpConstant %float 0
|
||||
%int_3 = OpConstant %int 3
|
||||
%int_1 = OpConstant %int 1
|
||||
%float_1 = OpConstant %float 1
|
||||
%void = OpTypeVoid
|
||||
%110 = OpTypeFunction %void
|
||||
%136 = OpConstantComposite %v4float %float_1 %float_0 %float_0 %float_1
|
||||
%137 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0
|
||||
%main_out = OpTypeStruct %v4float
|
||||
%140 = OpTypeFunction %main_out %v4float
|
||||
%func_i1_ = OpFunction %float None %23
|
||||
%a = OpFunctionParameter %_ptr_Function_int
|
||||
%27 = OpLabel
|
||||
%b = OpVariable %_ptr_Function_int Function %29
|
||||
%i = OpVariable %_ptr_Function_int Function %29
|
||||
%x_115 = OpVariable %_ptr_Function_bool Function %34
|
||||
%x_116_phi = OpVariable %_ptr_Function_bool Function %34
|
||||
OpStore %b %int_0
|
||||
%38 = OpAccessChain %_ptr_Private_int %data %int_0
|
||||
OpStore %38 %int_5
|
||||
%41 = OpAccessChain %_ptr_Private_int %data %int_2
|
||||
OpStore %41 %int_0
|
||||
%43 = OpAccessChain %_ptr_Private_int %data %int_4
|
||||
OpStore %43 %int_0
|
||||
%45 = OpAccessChain %_ptr_Private_int %data %int_6
|
||||
OpStore %45 %int_0
|
||||
%47 = OpAccessChain %_ptr_Private_int %data %int_8
|
||||
OpStore %47 %int_0
|
||||
%50 = OpAccessChain %_ptr_Private_float %gl_FragCoord %uint_0
|
||||
%51 = OpLoad %float %50
|
||||
%53 = OpFOrdGreaterThanEqual %bool %51 %float_0
|
||||
OpSelectionMerge %54 None
|
||||
OpBranchConditional %53 %55 %54
|
||||
%55 = OpLabel
|
||||
OpBranch %56
|
||||
%56 = OpLabel
|
||||
OpLoopMerge %57 %58 None
|
||||
OpBranch %59
|
||||
%59 = OpLabel
|
||||
%60 = OpLoad %int %b
|
||||
%62 = OpLoad %int %a
|
||||
%63 = OpSLessThanEqual %bool %60 %62
|
||||
OpSelectionMerge %64 None
|
||||
OpBranchConditional %63 %65 %66
|
||||
%65 = OpLabel
|
||||
OpBranch %64
|
||||
%66 = OpLabel
|
||||
OpBranch %57
|
||||
%64 = OpLabel
|
||||
%67 = OpLoad %int %b
|
||||
%68 = OpSLessThanEqual %bool %67 %int_5
|
||||
OpSelectionMerge %69 None
|
||||
OpBranchConditional %68 %70 %69
|
||||
%70 = OpLabel
|
||||
%71 = OpLoad %int %b
|
||||
%72 = OpLoad %int %b
|
||||
%73 = OpAccessChain %_ptr_Private_int %data %72
|
||||
%74 = OpLoad %int %73
|
||||
%75 = OpAccessChain %_ptr_Private_int %temp %71
|
||||
OpStore %75 %74
|
||||
%76 = OpLoad %int %b
|
||||
%77 = OpIAdd %int %76 %int_2
|
||||
OpStore %b %77
|
||||
OpBranch %69
|
||||
%69 = OpLabel
|
||||
OpBranch %58
|
||||
%58 = OpLabel
|
||||
OpBranch %56
|
||||
%57 = OpLabel
|
||||
OpBranch %54
|
||||
%54 = OpLabel
|
||||
OpStore %i %int_0
|
||||
OpBranch %78
|
||||
%78 = OpLabel
|
||||
OpLoopMerge %79 %80 None
|
||||
OpBranch %81
|
||||
%81 = OpLabel
|
||||
%82 = OpLoad %int %i
|
||||
%84 = OpSLessThan %bool %82 %int_3
|
||||
OpSelectionMerge %85 None
|
||||
OpBranchConditional %84 %86 %87
|
||||
%86 = OpLabel
|
||||
OpBranch %85
|
||||
%87 = OpLabel
|
||||
OpBranch %79
|
||||
%85 = OpLabel
|
||||
%88 = OpLoad %int %i
|
||||
%89 = OpAccessChain %_ptr_Private_int %temp %int_0
|
||||
%90 = OpLoad %int %89
|
||||
%91 = OpAccessChain %_ptr_Private_int %data %88
|
||||
%93 = OpIAdd %int %90 %int_1
|
||||
OpStore %91 %93
|
||||
OpBranch %80
|
||||
%80 = OpLabel
|
||||
%94 = OpLoad %int %i
|
||||
%95 = OpIAdd %int %94 %int_1
|
||||
OpStore %i %95
|
||||
OpBranch %78
|
||||
%79 = OpLabel
|
||||
%96 = OpAccessChain %_ptr_Private_int %temp %int_0
|
||||
%97 = OpLoad %int %96
|
||||
%98 = OpIEqual %bool %97 %int_5
|
||||
OpStore %x_116_phi %98
|
||||
OpSelectionMerge %99 None
|
||||
OpBranchConditional %98 %100 %99
|
||||
%100 = OpLabel
|
||||
%101 = OpAccessChain %_ptr_Private_int %data %int_0
|
||||
%102 = OpLoad %int %101
|
||||
%103 = OpIEqual %bool %102 %int_6
|
||||
OpStore %x_115 %103
|
||||
%104 = OpLoad %bool %x_115
|
||||
OpStore %x_116_phi %104
|
||||
OpBranch %99
|
||||
%99 = OpLabel
|
||||
%105 = OpLoad %bool %x_116_phi
|
||||
OpSelectionMerge %106 None
|
||||
OpBranchConditional %105 %107 %108
|
||||
%107 = OpLabel
|
||||
OpReturnValue %float_1
|
||||
%108 = OpLabel
|
||||
OpReturnValue %float_0
|
||||
%106 = OpLabel
|
||||
OpReturnValue %float_0
|
||||
OpFunctionEnd
|
||||
%main_1 = OpFunction %void None %110
|
||||
%113 = OpLabel
|
||||
%i_1 = OpVariable %_ptr_Function_int Function %29
|
||||
%param = OpVariable %_ptr_Function_int Function %29
|
||||
%param_1 = OpVariable %_ptr_Function_int Function %29
|
||||
OpStore %i_1 %int_0
|
||||
OpBranch %117
|
||||
%117 = OpLabel
|
||||
OpLoopMerge %118 %119 None
|
||||
OpBranch %120
|
||||
%120 = OpLabel
|
||||
%121 = OpLoad %int %i_1
|
||||
%122 = OpSLessThan %bool %121 %int_6
|
||||
OpSelectionMerge %123 None
|
||||
OpBranchConditional %122 %124 %125
|
||||
%124 = OpLabel
|
||||
OpBranch %123
|
||||
%125 = OpLabel
|
||||
OpBranch %118
|
||||
%123 = OpLabel
|
||||
%126 = OpLoad %int %i_1
|
||||
OpStore %param %126
|
||||
%127 = OpFunctionCall %float %func_i1_ %param
|
||||
%129 = OpLoad %int %i_1
|
||||
OpStore %param_1 %129
|
||||
%130 = OpFunctionCall %float %func_i1_ %param_1
|
||||
%132 = OpFOrdEqual %bool %130 %float_1
|
||||
OpSelectionMerge %133 None
|
||||
OpBranchConditional %132 %134 %135
|
||||
%134 = OpLabel
|
||||
OpStore %x_GLF_color %136
|
||||
OpBranch %133
|
||||
%135 = OpLabel
|
||||
OpStore %x_GLF_color %137
|
||||
OpBranch %133
|
||||
%133 = OpLabel
|
||||
OpBranch %119
|
||||
%119 = OpLabel
|
||||
%138 = OpLoad %int %i_1
|
||||
%139 = OpIAdd %int %138 %int_1
|
||||
OpStore %i_1 %139
|
||||
OpBranch %117
|
||||
%118 = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%main_inner = OpFunction %main_out None %140
|
||||
%gl_FragCoord_param = OpFunctionParameter %v4float
|
||||
%144 = OpLabel
|
||||
OpStore %gl_FragCoord %gl_FragCoord_param
|
||||
%145 = OpFunctionCall %void %main_1
|
||||
%146 = OpLoad %v4float %x_GLF_color
|
||||
%147 = OpCompositeConstruct %main_out %146
|
||||
OpReturnValue %147
|
||||
OpFunctionEnd
|
||||
%main = OpFunction %void None %110
|
||||
%149 = OpLabel
|
||||
%151 = OpLoad %v4float %gl_FragCoord_param_1
|
||||
%150 = OpFunctionCall %main_out %main_inner %151
|
||||
%152 = OpCompositeExtract %v4float %150 0
|
||||
OpStore %x_GLF_color_1_1 %152
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -1,114 +0,0 @@
|
||||
var<private> data : array<i32, 9>;
|
||||
|
||||
var<private> gl_FragCoord : vec4<f32>;
|
||||
|
||||
var<private> temp : array<i32, 7>;
|
||||
|
||||
var<private> x_GLF_color : vec4<f32>;
|
||||
|
||||
fn func_i1_(a : ptr<function, i32>) -> f32 {
|
||||
var b : i32;
|
||||
var i : i32;
|
||||
var x_115 : bool;
|
||||
var x_116_phi : bool;
|
||||
b = 0;
|
||||
data[0] = 5;
|
||||
data[2] = 0;
|
||||
data[4] = 0;
|
||||
data[6] = 0;
|
||||
data[8] = 0;
|
||||
let x_71 : f32 = gl_FragCoord.x;
|
||||
if ((x_71 >= 0.0)) {
|
||||
loop {
|
||||
let x_79 : i32 = b;
|
||||
let x_80 : i32 = *(a);
|
||||
if ((x_79 <= x_80)) {
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
let x_83 : i32 = b;
|
||||
if ((x_83 <= 5)) {
|
||||
let x_87 : i32 = b;
|
||||
let x_88 : i32 = b;
|
||||
let x_90 : i32 = data[x_88];
|
||||
temp[x_87] = x_90;
|
||||
let x_92 : i32 = b;
|
||||
b = (x_92 + 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
i = 0;
|
||||
loop {
|
||||
let x_98 : i32 = i;
|
||||
if ((x_98 < 3)) {
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
let x_101 : i32 = i;
|
||||
let x_103 : i32 = temp[0];
|
||||
data[x_101] = (x_103 + 1);
|
||||
|
||||
continuing {
|
||||
let x_106 : i32 = i;
|
||||
i = (x_106 + 1);
|
||||
}
|
||||
}
|
||||
let x_109 : i32 = temp[0];
|
||||
let x_110 : bool = (x_109 == 5);
|
||||
x_116_phi = x_110;
|
||||
if (x_110) {
|
||||
let x_114 : i32 = data[0];
|
||||
x_115 = (x_114 == 6);
|
||||
x_116_phi = x_115;
|
||||
}
|
||||
let x_116 : bool = x_116_phi;
|
||||
if (x_116) {
|
||||
return 1.0;
|
||||
} else {
|
||||
return 0.0;
|
||||
}
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
fn main_1() {
|
||||
var i_1 : i32;
|
||||
var param : i32;
|
||||
var param_1 : i32;
|
||||
i_1 = 0;
|
||||
loop {
|
||||
let x_51 : i32 = i_1;
|
||||
if ((x_51 < 6)) {
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
let x_54 : i32 = i_1;
|
||||
param = x_54;
|
||||
let x_55 : f32 = func_i1_(&(param));
|
||||
let x_56 : i32 = i_1;
|
||||
param_1 = x_56;
|
||||
let x_57 : f32 = func_i1_(&(param_1));
|
||||
if ((x_57 == 1.0)) {
|
||||
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);
|
||||
}
|
||||
|
||||
continuing {
|
||||
let x_62 : i32 = i_1;
|
||||
i_1 = (x_62 + 1);
|
||||
}
|
||||
}
|
||||
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);
|
||||
}
|
||||
@@ -1,101 +0,0 @@
|
||||
static int data[9] = (int[9])0;
|
||||
static float4 gl_FragCoord = float4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
static int temp[7] = (int[7])0;
|
||||
static float4 x_GLF_color = float4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
|
||||
float func_i1_(inout int a) {
|
||||
int b = 0;
|
||||
int i = 0;
|
||||
bool x_115 = false;
|
||||
bool x_116_phi = false;
|
||||
b = 0;
|
||||
data[0] = 5;
|
||||
data[2] = 0;
|
||||
data[4] = 0;
|
||||
data[6] = 0;
|
||||
data[8] = 0;
|
||||
const float x_71 = gl_FragCoord.x;
|
||||
if ((x_71 >= 0.0f)) {
|
||||
while (true) {
|
||||
const int x_79 = b;
|
||||
const int x_80 = a;
|
||||
if ((x_79 <= x_80)) {
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
if ((b <= 5)) {
|
||||
const int x_87 = b;
|
||||
const int x_90 = data[b];
|
||||
temp[x_87] = x_90;
|
||||
b = (b + 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
i = 0;
|
||||
{
|
||||
for(; (i < 3); i = (i + 1)) {
|
||||
const int x_101 = i;
|
||||
const int x_103 = temp[0];
|
||||
data[x_101] = (x_103 + 1);
|
||||
}
|
||||
}
|
||||
const int x_109 = temp[0];
|
||||
const bool x_110 = (x_109 == 5);
|
||||
x_116_phi = x_110;
|
||||
if (x_110) {
|
||||
const int x_114 = data[0];
|
||||
x_115 = (x_114 == 6);
|
||||
x_116_phi = x_115;
|
||||
}
|
||||
if (x_116_phi) {
|
||||
return 1.0f;
|
||||
} else {
|
||||
return 0.0f;
|
||||
}
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
void main_1() {
|
||||
int i_1 = 0;
|
||||
int param = 0;
|
||||
int param_1 = 0;
|
||||
i_1 = 0;
|
||||
{
|
||||
for(; (i_1 < 6); i_1 = (i_1 + 1)) {
|
||||
param = i_1;
|
||||
const float x_55 = func_i1_(param);
|
||||
param_1 = i_1;
|
||||
const float x_57 = func_i1_(param_1);
|
||||
if ((x_57 == 1.0f)) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
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;
|
||||
};
|
||||
|
||||
main_out main_inner(float4 gl_FragCoord_param) {
|
||||
gl_FragCoord = gl_FragCoord_param;
|
||||
main_1();
|
||||
const main_out tint_symbol_3 = {x_GLF_color};
|
||||
return tint_symbol_3;
|
||||
}
|
||||
|
||||
tint_symbol_2 main(tint_symbol_1 tint_symbol) {
|
||||
const main_out inner_result = main_inner(tint_symbol.gl_FragCoord_param);
|
||||
tint_symbol_2 wrapper_result = (tint_symbol_2)0;
|
||||
wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1;
|
||||
return wrapper_result;
|
||||
}
|
||||
@@ -1,127 +0,0 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct tint_array_wrapper {
|
||||
int arr[9];
|
||||
};
|
||||
struct tint_array_wrapper_1 {
|
||||
int arr[7];
|
||||
};
|
||||
struct main_out {
|
||||
float4 x_GLF_color_1;
|
||||
};
|
||||
struct tint_symbol_1 {
|
||||
float4 x_GLF_color_1 [[color(0)]];
|
||||
};
|
||||
|
||||
float func_i1_(thread int* const a, thread tint_array_wrapper* const tint_symbol_3, thread float4* const tint_symbol_4, thread tint_array_wrapper_1* const tint_symbol_5) {
|
||||
int b = 0;
|
||||
int i = 0;
|
||||
bool x_115 = false;
|
||||
bool x_116_phi = false;
|
||||
b = 0;
|
||||
(*(tint_symbol_3)).arr[0] = 5;
|
||||
(*(tint_symbol_3)).arr[2] = 0;
|
||||
(*(tint_symbol_3)).arr[4] = 0;
|
||||
(*(tint_symbol_3)).arr[6] = 0;
|
||||
(*(tint_symbol_3)).arr[8] = 0;
|
||||
float const x_71 = (*(tint_symbol_4)).x;
|
||||
if ((x_71 >= 0.0f)) {
|
||||
while (true) {
|
||||
int const x_79 = b;
|
||||
int const x_80 = *(a);
|
||||
if ((x_79 <= x_80)) {
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
int const x_83 = b;
|
||||
if ((x_83 <= 5)) {
|
||||
int const x_87 = b;
|
||||
int const x_88 = b;
|
||||
int const x_90 = (*(tint_symbol_3)).arr[x_88];
|
||||
(*(tint_symbol_5)).arr[x_87] = x_90;
|
||||
int const x_92 = b;
|
||||
b = as_type<int>((as_type<uint>(x_92) + as_type<uint>(2)));
|
||||
}
|
||||
}
|
||||
}
|
||||
i = 0;
|
||||
while (true) {
|
||||
int const x_98 = i;
|
||||
if ((x_98 < 3)) {
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
int const x_101 = i;
|
||||
int const x_103 = (*(tint_symbol_5)).arr[0];
|
||||
(*(tint_symbol_3)).arr[x_101] = as_type<int>((as_type<uint>(x_103) + as_type<uint>(1)));
|
||||
{
|
||||
int const x_106 = i;
|
||||
i = as_type<int>((as_type<uint>(x_106) + as_type<uint>(1)));
|
||||
}
|
||||
}
|
||||
int const x_109 = (*(tint_symbol_5)).arr[0];
|
||||
bool const x_110 = (x_109 == 5);
|
||||
x_116_phi = x_110;
|
||||
if (x_110) {
|
||||
int const x_114 = (*(tint_symbol_3)).arr[0];
|
||||
x_115 = (x_114 == 6);
|
||||
x_116_phi = x_115;
|
||||
}
|
||||
bool const x_116 = x_116_phi;
|
||||
if (x_116) {
|
||||
return 1.0f;
|
||||
} else {
|
||||
return 0.0f;
|
||||
}
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
void main_1(thread tint_array_wrapper* const tint_symbol_6, thread float4* const tint_symbol_7, thread tint_array_wrapper_1* const tint_symbol_8, thread float4* const tint_symbol_9) {
|
||||
int i_1 = 0;
|
||||
int param = 0;
|
||||
int param_1 = 0;
|
||||
i_1 = 0;
|
||||
while (true) {
|
||||
int const x_51 = i_1;
|
||||
if ((x_51 < 6)) {
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
int const x_54 = i_1;
|
||||
param = x_54;
|
||||
float const x_55 = func_i1_(&(param), tint_symbol_6, tint_symbol_7, tint_symbol_8);
|
||||
int const x_56 = i_1;
|
||||
param_1 = x_56;
|
||||
float const x_57 = func_i1_(&(param_1), tint_symbol_6, tint_symbol_7, tint_symbol_8);
|
||||
if ((x_57 == 1.0f)) {
|
||||
*(tint_symbol_9) = float4(1.0f, 0.0f, 0.0f, 1.0f);
|
||||
} else {
|
||||
*(tint_symbol_9) = float4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
}
|
||||
{
|
||||
int const x_62 = i_1;
|
||||
i_1 = as_type<int>((as_type<uint>(x_62) + as_type<uint>(1)));
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
main_out tint_symbol_inner(float4 gl_FragCoord_param, thread float4* const tint_symbol_10, thread tint_array_wrapper* const tint_symbol_11, thread tint_array_wrapper_1* const tint_symbol_12, thread float4* const tint_symbol_13) {
|
||||
*(tint_symbol_10) = gl_FragCoord_param;
|
||||
main_1(tint_symbol_11, tint_symbol_10, tint_symbol_12, tint_symbol_13);
|
||||
main_out const tint_symbol_2 = {.x_GLF_color_1=*(tint_symbol_13)};
|
||||
return tint_symbol_2;
|
||||
}
|
||||
|
||||
fragment tint_symbol_1 tint_symbol(float4 gl_FragCoord_param [[position]]) {
|
||||
thread float4 tint_symbol_14 = 0.0f;
|
||||
thread tint_array_wrapper tint_symbol_15 = {};
|
||||
thread tint_array_wrapper_1 tint_symbol_16 = {};
|
||||
thread float4 tint_symbol_17 = 0.0f;
|
||||
main_out const inner_result = tint_symbol_inner(gl_FragCoord_param, &(tint_symbol_14), &(tint_symbol_15), &(tint_symbol_16), &(tint_symbol_17));
|
||||
tint_symbol_1 wrapper_result = {};
|
||||
wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1;
|
||||
return wrapper_result;
|
||||
}
|
||||
|
||||
@@ -1,258 +0,0 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 153
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Fragment %main "main" %gl_FragCoord_param_1 %x_GLF_color_1_1
|
||||
OpExecutionMode %main OriginUpperLeft
|
||||
OpName %gl_FragCoord_param_1 "gl_FragCoord_param_1"
|
||||
OpName %x_GLF_color_1_1 "x_GLF_color_1_1"
|
||||
OpName %data "data"
|
||||
OpName %gl_FragCoord "gl_FragCoord"
|
||||
OpName %temp "temp"
|
||||
OpName %x_GLF_color "x_GLF_color"
|
||||
OpName %func_i1_ "func_i1_"
|
||||
OpName %a "a"
|
||||
OpName %b "b"
|
||||
OpName %i "i"
|
||||
OpName %x_115 "x_115"
|
||||
OpName %x_116_phi "x_116_phi"
|
||||
OpName %main_1 "main_1"
|
||||
OpName %i_1 "i_1"
|
||||
OpName %param "param"
|
||||
OpName %param_1 "param_1"
|
||||
OpName %main_out "main_out"
|
||||
OpMemberName %main_out 0 "x_GLF_color_1"
|
||||
OpName %main_inner "main_inner"
|
||||
OpName %gl_FragCoord_param "gl_FragCoord_param"
|
||||
OpName %main "main"
|
||||
OpDecorate %gl_FragCoord_param_1 BuiltIn FragCoord
|
||||
OpDecorate %x_GLF_color_1_1 Location 0
|
||||
OpDecorate %_arr_int_uint_9 ArrayStride 4
|
||||
OpDecorate %_arr_int_uint_7 ArrayStride 4
|
||||
OpMemberDecorate %main_out 0 Offset 0
|
||||
%float = OpTypeFloat 32
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Input_v4float = OpTypePointer Input %v4float
|
||||
%gl_FragCoord_param_1 = OpVariable %_ptr_Input_v4float Input
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%7 = OpConstantNull %v4float
|
||||
%x_GLF_color_1_1 = OpVariable %_ptr_Output_v4float Output %7
|
||||
%int = OpTypeInt 32 1
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_9 = OpConstant %uint 9
|
||||
%_arr_int_uint_9 = OpTypeArray %int %uint_9
|
||||
%_ptr_Private__arr_int_uint_9 = OpTypePointer Private %_arr_int_uint_9
|
||||
%14 = OpConstantNull %_arr_int_uint_9
|
||||
%data = OpVariable %_ptr_Private__arr_int_uint_9 Private %14
|
||||
%_ptr_Private_v4float = OpTypePointer Private %v4float
|
||||
%gl_FragCoord = OpVariable %_ptr_Private_v4float Private %7
|
||||
%uint_7 = OpConstant %uint 7
|
||||
%_arr_int_uint_7 = OpTypeArray %int %uint_7
|
||||
%_ptr_Private__arr_int_uint_7 = OpTypePointer Private %_arr_int_uint_7
|
||||
%21 = OpConstantNull %_arr_int_uint_7
|
||||
%temp = OpVariable %_ptr_Private__arr_int_uint_7 Private %21
|
||||
%x_GLF_color = OpVariable %_ptr_Private_v4float Private %7
|
||||
%_ptr_Function_int = OpTypePointer Function %int
|
||||
%23 = OpTypeFunction %float %_ptr_Function_int
|
||||
%29 = OpConstantNull %int
|
||||
%bool = OpTypeBool
|
||||
%_ptr_Function_bool = OpTypePointer Function %bool
|
||||
%34 = OpConstantNull %bool
|
||||
%int_0 = OpConstant %int 0
|
||||
%_ptr_Private_int = OpTypePointer Private %int
|
||||
%int_5 = OpConstant %int 5
|
||||
%int_2 = OpConstant %int 2
|
||||
%int_4 = OpConstant %int 4
|
||||
%int_6 = OpConstant %int 6
|
||||
%int_8 = OpConstant %int 8
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%_ptr_Private_float = OpTypePointer Private %float
|
||||
%float_0 = OpConstant %float 0
|
||||
%int_3 = OpConstant %int 3
|
||||
%int_1 = OpConstant %int 1
|
||||
%float_1 = OpConstant %float 1
|
||||
%void = OpTypeVoid
|
||||
%110 = OpTypeFunction %void
|
||||
%136 = OpConstantComposite %v4float %float_1 %float_0 %float_0 %float_1
|
||||
%137 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0
|
||||
%main_out = OpTypeStruct %v4float
|
||||
%140 = OpTypeFunction %main_out %v4float
|
||||
%func_i1_ = OpFunction %float None %23
|
||||
%a = OpFunctionParameter %_ptr_Function_int
|
||||
%27 = OpLabel
|
||||
%b = OpVariable %_ptr_Function_int Function %29
|
||||
%i = OpVariable %_ptr_Function_int Function %29
|
||||
%x_115 = OpVariable %_ptr_Function_bool Function %34
|
||||
%x_116_phi = OpVariable %_ptr_Function_bool Function %34
|
||||
OpStore %b %int_0
|
||||
%38 = OpAccessChain %_ptr_Private_int %data %int_0
|
||||
OpStore %38 %int_5
|
||||
%41 = OpAccessChain %_ptr_Private_int %data %int_2
|
||||
OpStore %41 %int_0
|
||||
%43 = OpAccessChain %_ptr_Private_int %data %int_4
|
||||
OpStore %43 %int_0
|
||||
%45 = OpAccessChain %_ptr_Private_int %data %int_6
|
||||
OpStore %45 %int_0
|
||||
%47 = OpAccessChain %_ptr_Private_int %data %int_8
|
||||
OpStore %47 %int_0
|
||||
%50 = OpAccessChain %_ptr_Private_float %gl_FragCoord %uint_0
|
||||
%51 = OpLoad %float %50
|
||||
%53 = OpFOrdGreaterThanEqual %bool %51 %float_0
|
||||
OpSelectionMerge %54 None
|
||||
OpBranchConditional %53 %55 %54
|
||||
%55 = OpLabel
|
||||
OpBranch %56
|
||||
%56 = OpLabel
|
||||
OpLoopMerge %57 %58 None
|
||||
OpBranch %59
|
||||
%59 = OpLabel
|
||||
%60 = OpLoad %int %b
|
||||
%62 = OpLoad %int %a
|
||||
%63 = OpSLessThanEqual %bool %60 %62
|
||||
OpSelectionMerge %64 None
|
||||
OpBranchConditional %63 %65 %66
|
||||
%65 = OpLabel
|
||||
OpBranch %64
|
||||
%66 = OpLabel
|
||||
OpBranch %57
|
||||
%64 = OpLabel
|
||||
%67 = OpLoad %int %b
|
||||
%68 = OpSLessThanEqual %bool %67 %int_5
|
||||
OpSelectionMerge %69 None
|
||||
OpBranchConditional %68 %70 %69
|
||||
%70 = OpLabel
|
||||
%71 = OpLoad %int %b
|
||||
%72 = OpLoad %int %b
|
||||
%73 = OpAccessChain %_ptr_Private_int %data %72
|
||||
%74 = OpLoad %int %73
|
||||
%75 = OpAccessChain %_ptr_Private_int %temp %71
|
||||
OpStore %75 %74
|
||||
%76 = OpLoad %int %b
|
||||
%77 = OpIAdd %int %76 %int_2
|
||||
OpStore %b %77
|
||||
OpBranch %69
|
||||
%69 = OpLabel
|
||||
OpBranch %58
|
||||
%58 = OpLabel
|
||||
OpBranch %56
|
||||
%57 = OpLabel
|
||||
OpBranch %54
|
||||
%54 = OpLabel
|
||||
OpStore %i %int_0
|
||||
OpBranch %78
|
||||
%78 = OpLabel
|
||||
OpLoopMerge %79 %80 None
|
||||
OpBranch %81
|
||||
%81 = OpLabel
|
||||
%82 = OpLoad %int %i
|
||||
%84 = OpSLessThan %bool %82 %int_3
|
||||
OpSelectionMerge %85 None
|
||||
OpBranchConditional %84 %86 %87
|
||||
%86 = OpLabel
|
||||
OpBranch %85
|
||||
%87 = OpLabel
|
||||
OpBranch %79
|
||||
%85 = OpLabel
|
||||
%88 = OpLoad %int %i
|
||||
%89 = OpAccessChain %_ptr_Private_int %temp %int_0
|
||||
%90 = OpLoad %int %89
|
||||
%91 = OpAccessChain %_ptr_Private_int %data %88
|
||||
%93 = OpIAdd %int %90 %int_1
|
||||
OpStore %91 %93
|
||||
OpBranch %80
|
||||
%80 = OpLabel
|
||||
%94 = OpLoad %int %i
|
||||
%95 = OpIAdd %int %94 %int_1
|
||||
OpStore %i %95
|
||||
OpBranch %78
|
||||
%79 = OpLabel
|
||||
%96 = OpAccessChain %_ptr_Private_int %temp %int_0
|
||||
%97 = OpLoad %int %96
|
||||
%98 = OpIEqual %bool %97 %int_5
|
||||
OpStore %x_116_phi %98
|
||||
OpSelectionMerge %99 None
|
||||
OpBranchConditional %98 %100 %99
|
||||
%100 = OpLabel
|
||||
%101 = OpAccessChain %_ptr_Private_int %data %int_0
|
||||
%102 = OpLoad %int %101
|
||||
%103 = OpIEqual %bool %102 %int_6
|
||||
OpStore %x_115 %103
|
||||
%104 = OpLoad %bool %x_115
|
||||
OpStore %x_116_phi %104
|
||||
OpBranch %99
|
||||
%99 = OpLabel
|
||||
%105 = OpLoad %bool %x_116_phi
|
||||
OpSelectionMerge %106 None
|
||||
OpBranchConditional %105 %107 %108
|
||||
%107 = OpLabel
|
||||
OpReturnValue %float_1
|
||||
%108 = OpLabel
|
||||
OpReturnValue %float_0
|
||||
%106 = OpLabel
|
||||
OpReturnValue %float_0
|
||||
OpFunctionEnd
|
||||
%main_1 = OpFunction %void None %110
|
||||
%113 = OpLabel
|
||||
%i_1 = OpVariable %_ptr_Function_int Function %29
|
||||
%param = OpVariable %_ptr_Function_int Function %29
|
||||
%param_1 = OpVariable %_ptr_Function_int Function %29
|
||||
OpStore %i_1 %int_0
|
||||
OpBranch %117
|
||||
%117 = OpLabel
|
||||
OpLoopMerge %118 %119 None
|
||||
OpBranch %120
|
||||
%120 = OpLabel
|
||||
%121 = OpLoad %int %i_1
|
||||
%122 = OpSLessThan %bool %121 %int_6
|
||||
OpSelectionMerge %123 None
|
||||
OpBranchConditional %122 %124 %125
|
||||
%124 = OpLabel
|
||||
OpBranch %123
|
||||
%125 = OpLabel
|
||||
OpBranch %118
|
||||
%123 = OpLabel
|
||||
%126 = OpLoad %int %i_1
|
||||
OpStore %param %126
|
||||
%127 = OpFunctionCall %float %func_i1_ %param
|
||||
%129 = OpLoad %int %i_1
|
||||
OpStore %param_1 %129
|
||||
%130 = OpFunctionCall %float %func_i1_ %param_1
|
||||
%132 = OpFOrdEqual %bool %130 %float_1
|
||||
OpSelectionMerge %133 None
|
||||
OpBranchConditional %132 %134 %135
|
||||
%134 = OpLabel
|
||||
OpStore %x_GLF_color %136
|
||||
OpBranch %133
|
||||
%135 = OpLabel
|
||||
OpStore %x_GLF_color %137
|
||||
OpBranch %133
|
||||
%133 = OpLabel
|
||||
OpBranch %119
|
||||
%119 = OpLabel
|
||||
%138 = OpLoad %int %i_1
|
||||
%139 = OpIAdd %int %138 %int_1
|
||||
OpStore %i_1 %139
|
||||
OpBranch %117
|
||||
%118 = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%main_inner = OpFunction %main_out None %140
|
||||
%gl_FragCoord_param = OpFunctionParameter %v4float
|
||||
%144 = OpLabel
|
||||
OpStore %gl_FragCoord %gl_FragCoord_param
|
||||
%145 = OpFunctionCall %void %main_1
|
||||
%146 = OpLoad %v4float %x_GLF_color
|
||||
%147 = OpCompositeConstruct %main_out %146
|
||||
OpReturnValue %147
|
||||
OpFunctionEnd
|
||||
%main = OpFunction %void None %110
|
||||
%149 = OpLabel
|
||||
%151 = OpLoad %v4float %gl_FragCoord_param_1
|
||||
%150 = OpFunctionCall %main_out %main_inner %151
|
||||
%152 = OpCompositeExtract %v4float %150 0
|
||||
OpStore %x_GLF_color_1_1 %152
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -1,114 +0,0 @@
|
||||
var<private> data : array<i32, 9>;
|
||||
|
||||
var<private> gl_FragCoord : vec4<f32>;
|
||||
|
||||
var<private> temp : array<i32, 7>;
|
||||
|
||||
var<private> x_GLF_color : vec4<f32>;
|
||||
|
||||
fn func_i1_(a : ptr<function, i32>) -> f32 {
|
||||
var b : i32;
|
||||
var i : i32;
|
||||
var x_115 : bool;
|
||||
var x_116_phi : bool;
|
||||
b = 0;
|
||||
data[0] = 5;
|
||||
data[2] = 0;
|
||||
data[4] = 0;
|
||||
data[6] = 0;
|
||||
data[8] = 0;
|
||||
let x_71 : f32 = gl_FragCoord.x;
|
||||
if ((x_71 >= 0.0)) {
|
||||
loop {
|
||||
let x_79 : i32 = b;
|
||||
let x_80 : i32 = *(a);
|
||||
if ((x_79 <= x_80)) {
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
let x_83 : i32 = b;
|
||||
if ((x_83 <= 5)) {
|
||||
let x_87 : i32 = b;
|
||||
let x_88 : i32 = b;
|
||||
let x_90 : i32 = data[x_88];
|
||||
temp[x_87] = x_90;
|
||||
let x_92 : i32 = b;
|
||||
b = (x_92 + 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
i = 0;
|
||||
loop {
|
||||
let x_98 : i32 = i;
|
||||
if ((x_98 < 3)) {
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
let x_101 : i32 = i;
|
||||
let x_103 : i32 = temp[0];
|
||||
data[x_101] = (x_103 + 1);
|
||||
|
||||
continuing {
|
||||
let x_106 : i32 = i;
|
||||
i = (x_106 + 1);
|
||||
}
|
||||
}
|
||||
let x_109 : i32 = temp[0];
|
||||
let x_110 : bool = (x_109 == 5);
|
||||
x_116_phi = x_110;
|
||||
if (x_110) {
|
||||
let x_114 : i32 = data[0];
|
||||
x_115 = (x_114 == 6);
|
||||
x_116_phi = x_115;
|
||||
}
|
||||
let x_116 : bool = x_116_phi;
|
||||
if (x_116) {
|
||||
return 1.0;
|
||||
} else {
|
||||
return 0.0;
|
||||
}
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
fn main_1() {
|
||||
var i_1 : i32;
|
||||
var param : i32;
|
||||
var param_1 : i32;
|
||||
i_1 = 0;
|
||||
loop {
|
||||
let x_51 : i32 = i_1;
|
||||
if ((x_51 < 6)) {
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
let x_54 : i32 = i_1;
|
||||
param = x_54;
|
||||
let x_55 : f32 = func_i1_(&(param));
|
||||
let x_56 : i32 = i_1;
|
||||
param_1 = x_56;
|
||||
let x_57 : f32 = func_i1_(&(param_1));
|
||||
if ((x_57 == 1.0)) {
|
||||
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);
|
||||
}
|
||||
|
||||
continuing {
|
||||
let x_62 : i32 = i_1;
|
||||
i_1 = (x_62 + 1);
|
||||
}
|
||||
}
|
||||
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);
|
||||
}
|
||||
Reference in New Issue
Block a user