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,147 @@
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main" %_GLF_color
OpExecutionMode %main OriginUpperLeft
OpSource ESSL 320
OpName %main "main"
OpName %arr "arr"
OpName %buf1 "buf1"
OpMemberName %buf1 0 "_GLF_uniform_float_values"
OpName %_ ""
OpName %a "a"
OpName %buf0 "buf0"
OpMemberName %buf0 0 "_GLF_uniform_int_values"
OpName %__0 ""
OpName %_GLF_color "_GLF_color"
OpDecorate %_arr_float_uint_3_0 ArrayStride 16
OpMemberDecorate %buf1 0 Offset 0
OpDecorate %buf1 Block
OpDecorate %_ DescriptorSet 0
OpDecorate %_ Binding 1
OpDecorate %_arr_int_uint_3 ArrayStride 16
OpMemberDecorate %buf0 0 Offset 0
OpDecorate %buf0 Block
OpDecorate %__0 DescriptorSet 0
OpDecorate %__0 Binding 0
OpDecorate %_GLF_color Location 0
%void = OpTypeVoid
%13 = OpTypeFunction %void
%float = OpTypeFloat 32
%uint = OpTypeInt 32 0
%uint_3 = OpConstant %uint 3
%_arr_float_uint_3 = OpTypeArray %float %uint_3
%_ptr_Function__arr_float_uint_3 = OpTypePointer Function %_arr_float_uint_3
%_arr_float_uint_3_0 = OpTypeArray %float %uint_3
%buf1 = OpTypeStruct %_arr_float_uint_3_0
%_ptr_Uniform_buf1 = OpTypePointer Uniform %buf1
%_ = OpVariable %_ptr_Uniform_buf1 Uniform
%int = OpTypeInt 32 1
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
%_ptr_Uniform_float = OpTypePointer Uniform %float
%int_2 = OpConstant %int 2
%_ptr_Function_int = OpTypePointer Function %int
%_arr_int_uint_3 = OpTypeArray %int %uint_3
%buf0 = OpTypeStruct %_arr_int_uint_3
%_ptr_Uniform_buf0 = OpTypePointer Uniform %buf0
%__0 = OpVariable %_ptr_Uniform_buf0 Uniform
%_ptr_Uniform_int = OpTypePointer Uniform %int
%bool = OpTypeBool
%_ptr_Function_float = OpTypePointer Function %float
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
%_GLF_color = OpVariable %_ptr_Output_v4float Output
%main = OpFunction %void None %13
%32 = OpLabel
%arr = OpVariable %_ptr_Function__arr_float_uint_3 Function
%a = OpVariable %_ptr_Function_int Function
%33 = OpAccessChain %_ptr_Uniform_float %_ %int_0 %int_1
%34 = OpLoad %float %33
%35 = OpAccessChain %_ptr_Uniform_float %_ %int_0 %int_0
%36 = OpLoad %float %35
%37 = OpAccessChain %_ptr_Uniform_float %_ %int_0 %int_2
%38 = OpLoad %float %37
%39 = OpCompositeConstruct %_arr_float_uint_3 %34 %36 %38
OpStore %arr %39
OpStore %a %int_0
OpBranch %40
%40 = OpLabel
OpLoopMerge %41 %42 None
OpBranch %43
%43 = OpLabel
%44 = OpLoad %int %a
%45 = OpAccessChain %_ptr_Uniform_int %__0 %int_0 %int_1
%46 = OpLoad %int %45
%47 = OpSLessThanEqual %bool %44 %46
OpBranchConditional %47 %48 %41
%48 = OpLabel
%49 = OpLoad %int %a
%50 = OpIAdd %int %49 %int_1
OpStore %a %50
%51 = OpAccessChain %_ptr_Uniform_float %_ %int_0 %int_0
%52 = OpLoad %float %51
%53 = OpAccessChain %_ptr_Function_float %arr %49
OpStore %53 %52
OpBranch %42
%42 = OpLabel
OpBranch %40
%41 = OpLabel
%54 = OpAccessChain %_ptr_Uniform_int %__0 %int_0 %int_1
%55 = OpLoad %int %54
%56 = OpAccessChain %_ptr_Function_float %arr %55
%57 = OpLoad %float %56
%58 = OpAccessChain %_ptr_Uniform_float %_ %int_0 %int_0
%59 = OpLoad %float %58
%60 = OpFOrdEqual %bool %57 %59
OpSelectionMerge %61 None
OpBranchConditional %60 %62 %61
%62 = OpLabel
%63 = OpAccessChain %_ptr_Uniform_int %__0 %int_0 %int_2
%64 = OpLoad %int %63
%65 = OpAccessChain %_ptr_Function_float %arr %64
%66 = OpLoad %float %65
%67 = OpAccessChain %_ptr_Uniform_float %_ %int_0 %int_0
%68 = OpLoad %float %67
%69 = OpFOrdEqual %bool %66 %68
OpBranch %61
%61 = OpLabel
%70 = OpPhi %bool %60 %41 %69 %62
OpSelectionMerge %71 None
OpBranchConditional %70 %72 %71
%72 = OpLabel
%73 = OpAccessChain %_ptr_Uniform_int %__0 %int_0 %int_0
%74 = OpLoad %int %73
%75 = OpAccessChain %_ptr_Function_float %arr %74
%76 = OpLoad %float %75
%77 = OpAccessChain %_ptr_Uniform_float %_ %int_0 %int_2
%78 = OpLoad %float %77
%79 = OpFOrdEqual %bool %76 %78
OpBranch %71
%71 = OpLabel
%80 = OpPhi %bool %70 %61 %79 %72
OpSelectionMerge %81 None
OpBranchConditional %80 %82 %83
%82 = OpLabel
%84 = OpAccessChain %_ptr_Uniform_int %__0 %int_0 %int_1
%85 = OpLoad %int %84
%86 = OpAccessChain %_ptr_Function_float %arr %85
%87 = OpLoad %float %86
%88 = OpAccessChain %_ptr_Uniform_float %_ %int_0 %int_1
%89 = OpLoad %float %88
%90 = OpAccessChain %_ptr_Uniform_float %_ %int_0 %int_1
%91 = OpLoad %float %90
%92 = OpAccessChain %_ptr_Uniform_float %_ %int_0 %int_0
%93 = OpLoad %float %92
%94 = OpCompositeConstruct %v4float %87 %89 %91 %93
OpStore %_GLF_color %94
OpBranch %81
%83 = OpLabel
%95 = OpAccessChain %_ptr_Uniform_float %_ %int_0 %int_1
%96 = OpLoad %float %95
%97 = OpCompositeConstruct %v4float %96 %96 %96 %96
OpStore %_GLF_color %97
OpBranch %81
%81 = OpLabel
OpReturn
OpFunctionEnd

View File

@@ -0,0 +1,87 @@
cbuffer cbuffer_x_6 : register(b1, space0) {
uint4 x_6[3];
};
cbuffer cbuffer_x_9 : register(b0, space0) {
uint4 x_9[3];
};
static float4 x_GLF_color = float4(0.0f, 0.0f, 0.0f, 0.0f);
void main_1() {
float arr[3] = (float[3])0;
int a = 0;
bool x_69 = false;
bool x_79 = false;
bool x_70_phi = false;
bool x_80_phi = false;
const float x_34 = asfloat(x_6[1].x);
const uint scalar_offset = ((16u * uint(0))) / 4;
const float x_36 = asfloat(x_6[scalar_offset / 4][scalar_offset % 4]);
const float x_38 = asfloat(x_6[2].x);
const float tint_symbol_4[3] = {x_34, x_36, x_38};
arr = tint_symbol_4;
a = 0;
while (true) {
const int x_44 = a;
const int x_46 = asint(x_9[1].x);
if ((x_44 <= x_46)) {
} else {
break;
}
const int x_49 = a;
a = (x_49 + 1);
const uint scalar_offset_1 = ((16u * uint(0))) / 4;
const float x_52 = asfloat(x_6[scalar_offset_1 / 4][scalar_offset_1 % 4]);
arr[x_49] = x_52;
}
const int x_55 = asint(x_9[1].x);
const float x_57 = arr[x_55];
const uint scalar_offset_2 = ((16u * uint(0))) / 4;
const float x_59 = asfloat(x_6[scalar_offset_2 / 4][scalar_offset_2 % 4]);
const bool x_60 = (x_57 == x_59);
x_70_phi = x_60;
if (x_60) {
const int x_64 = asint(x_9[2].x);
const float x_66 = arr[x_64];
const uint scalar_offset_3 = ((16u * uint(0))) / 4;
const float x_68 = asfloat(x_6[scalar_offset_3 / 4][scalar_offset_3 % 4]);
x_69 = (x_66 == x_68);
x_70_phi = x_69;
}
const bool x_70 = x_70_phi;
x_80_phi = x_70;
if (x_70) {
const uint scalar_offset_4 = ((16u * uint(0))) / 4;
const int x_74 = asint(x_9[scalar_offset_4 / 4][scalar_offset_4 % 4]);
const float x_76 = arr[x_74];
const float x_78 = asfloat(x_6[2].x);
x_79 = (x_76 == x_78);
x_80_phi = x_79;
}
if (x_80_phi) {
const int x_85 = asint(x_9[1].x);
const float x_87 = arr[x_85];
const float x_89 = asfloat(x_6[1].x);
const float x_91 = asfloat(x_6[1].x);
const uint scalar_offset_5 = ((16u * uint(0))) / 4;
const float x_93 = asfloat(x_6[scalar_offset_5 / 4][scalar_offset_5 % 4]);
x_GLF_color = float4(x_87, x_89, x_91, x_93);
} else {
const float x_96 = asfloat(x_6[1].x);
x_GLF_color = float4(x_96, x_96, x_96, x_96);
}
return;
}
struct main_out {
float4 x_GLF_color_1;
};
struct tint_symbol {
float4 x_GLF_color_1 : SV_Target0;
};
tint_symbol main() {
main_1();
const main_out tint_symbol_1 = {x_GLF_color};
const tint_symbol tint_symbol_5 = {tint_symbol_1.x_GLF_color_1};
return tint_symbol_5;
}

View File

@@ -0,0 +1,102 @@
#include <metal_stdlib>
using namespace metal;
struct tint_padded_array_element {
/* 0x0000 */ float el;
/* 0x0004 */ int8_t tint_pad[12];
};
struct tint_array_wrapper {
/* 0x0000 */ tint_padded_array_element arr[3];
};
struct buf1 {
/* 0x0000 */ tint_array_wrapper x_GLF_uniform_float_values;
};
struct tint_padded_array_element_1 {
/* 0x0000 */ int el;
/* 0x0004 */ int8_t tint_pad_1[12];
};
struct tint_array_wrapper_1 {
/* 0x0000 */ tint_padded_array_element_1 arr[3];
};
struct buf0 {
/* 0x0000 */ tint_array_wrapper_1 x_GLF_uniform_int_values;
};
struct tint_array_wrapper_2 {
float arr[3];
};
struct main_out {
float4 x_GLF_color_1;
};
struct tint_symbol_1 {
float4 x_GLF_color_1 [[color(0)]];
};
void main_1(constant buf1& x_6, constant buf0& x_9, thread float4* const tint_symbol_5) {
tint_array_wrapper_2 arr = {};
int a = 0;
bool x_69 = false;
bool x_79 = false;
bool x_70_phi = false;
bool x_80_phi = false;
float const x_34 = x_6.x_GLF_uniform_float_values.arr[1].el;
float const x_36 = x_6.x_GLF_uniform_float_values.arr[0].el;
float const x_38 = x_6.x_GLF_uniform_float_values.arr[2].el;
tint_array_wrapper_2 const tint_symbol_3 = {.arr={x_34, x_36, x_38}};
arr = tint_symbol_3;
a = 0;
while (true) {
int const x_44 = a;
int const x_46 = x_9.x_GLF_uniform_int_values.arr[1].el;
if ((x_44 <= x_46)) {
} else {
break;
}
int const x_49 = a;
a = (x_49 + 1);
float const x_52 = x_6.x_GLF_uniform_float_values.arr[0].el;
arr.arr[x_49] = x_52;
}
int const x_55 = x_9.x_GLF_uniform_int_values.arr[1].el;
float const x_57 = arr.arr[x_55];
float const x_59 = x_6.x_GLF_uniform_float_values.arr[0].el;
bool const x_60 = (x_57 == x_59);
x_70_phi = x_60;
if (x_60) {
int const x_64 = x_9.x_GLF_uniform_int_values.arr[2].el;
float const x_66 = arr.arr[x_64];
float const x_68 = x_6.x_GLF_uniform_float_values.arr[0].el;
x_69 = (x_66 == x_68);
x_70_phi = x_69;
}
bool const x_70 = x_70_phi;
x_80_phi = x_70;
if (x_70) {
int const x_74 = x_9.x_GLF_uniform_int_values.arr[0].el;
float const x_76 = arr.arr[x_74];
float const x_78 = x_6.x_GLF_uniform_float_values.arr[2].el;
x_79 = (x_76 == x_78);
x_80_phi = x_79;
}
bool const x_80 = x_80_phi;
if (x_80) {
int const x_85 = x_9.x_GLF_uniform_int_values.arr[1].el;
float const x_87 = arr.arr[x_85];
float const x_89 = x_6.x_GLF_uniform_float_values.arr[1].el;
float const x_91 = x_6.x_GLF_uniform_float_values.arr[1].el;
float const x_93 = x_6.x_GLF_uniform_float_values.arr[0].el;
*(tint_symbol_5) = float4(x_87, x_89, x_91, x_93);
} else {
float const x_96 = x_6.x_GLF_uniform_float_values.arr[1].el;
*(tint_symbol_5) = float4(x_96, x_96, x_96, x_96);
}
return;
}
fragment tint_symbol_1 tint_symbol(constant buf1& x_6 [[buffer(1)]], constant buf0& x_9 [[buffer(0)]]) {
thread float4 tint_symbol_6 = 0.0f;
main_1(x_6, x_9, &(tint_symbol_6));
main_out const tint_symbol_2 = {.x_GLF_color_1=tint_symbol_6};
tint_symbol_1 const tint_symbol_4 = {.x_GLF_color_1=tint_symbol_2.x_GLF_color_1};
return tint_symbol_4;
}

View File

@@ -0,0 +1,206 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 125
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main" %tint_symbol_1
OpExecutionMode %main OriginUpperLeft
OpName %buf1 "buf1"
OpMemberName %buf1 0 "x_GLF_uniform_float_values"
OpName %x_6 "x_6"
OpName %buf0 "buf0"
OpMemberName %buf0 0 "x_GLF_uniform_int_values"
OpName %x_9 "x_9"
OpName %x_GLF_color "x_GLF_color"
OpName %tint_symbol_1 "tint_symbol_1"
OpName %main_1 "main_1"
OpName %arr "arr"
OpName %a "a"
OpName %x_69 "x_69"
OpName %x_79 "x_79"
OpName %x_70_phi "x_70_phi"
OpName %x_80_phi "x_80_phi"
OpName %main_out "main_out"
OpMemberName %main_out 0 "x_GLF_color_1"
OpName %tint_symbol_2 "tint_symbol_2"
OpName %tint_symbol "tint_symbol"
OpName %main "main"
OpDecorate %buf1 Block
OpMemberDecorate %buf1 0 Offset 0
OpDecorate %_arr_float_uint_3 ArrayStride 16
OpDecorate %x_6 NonWritable
OpDecorate %x_6 DescriptorSet 0
OpDecorate %x_6 Binding 1
OpDecorate %buf0 Block
OpMemberDecorate %buf0 0 Offset 0
OpDecorate %_arr_int_uint_3 ArrayStride 16
OpDecorate %x_9 NonWritable
OpDecorate %x_9 DescriptorSet 0
OpDecorate %x_9 Binding 0
OpDecorate %tint_symbol_1 Location 0
OpDecorate %_arr_float_uint_3_0 ArrayStride 4
OpMemberDecorate %main_out 0 Offset 0
%float = OpTypeFloat 32
%uint = OpTypeInt 32 0
%uint_3 = OpConstant %uint 3
%_arr_float_uint_3 = OpTypeArray %float %uint_3
%buf1 = OpTypeStruct %_arr_float_uint_3
%_ptr_Uniform_buf1 = OpTypePointer Uniform %buf1
%x_6 = OpVariable %_ptr_Uniform_buf1 Uniform
%int = OpTypeInt 32 1
%_arr_int_uint_3 = OpTypeArray %int %uint_3
%buf0 = OpTypeStruct %_arr_int_uint_3
%_ptr_Uniform_buf0 = OpTypePointer Uniform %buf0
%x_9 = OpVariable %_ptr_Uniform_buf0 Uniform
%v4float = OpTypeVector %float 4
%_ptr_Private_v4float = OpTypePointer Private %v4float
%16 = OpConstantNull %v4float
%x_GLF_color = OpVariable %_ptr_Private_v4float Private %16
%_ptr_Output_v4float = OpTypePointer Output %v4float
%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %16
%void = OpTypeVoid
%19 = OpTypeFunction %void
%_arr_float_uint_3_0 = OpTypeArray %float %uint_3
%_ptr_Function__arr_float_uint_3_0 = OpTypePointer Function %_arr_float_uint_3_0
%26 = OpConstantNull %_arr_float_uint_3_0
%_ptr_Function_int = OpTypePointer Function %int
%29 = OpConstantNull %int
%bool = OpTypeBool
%_ptr_Function_bool = OpTypePointer Function %bool
%33 = OpConstantNull %bool
%uint_0 = OpConstant %uint 0
%int_1 = OpConstant %int 1
%_ptr_Uniform_float = OpTypePointer Uniform %float
%int_0 = OpConstant %int 0
%int_2 = OpConstant %int 2
%_ptr_Uniform_int = OpTypePointer Uniform %int
%_ptr_Function_float = OpTypePointer Function %float
%main_out = OpTypeStruct %v4float
%113 = OpTypeFunction %void %main_out
%main_1 = OpFunction %void None %19
%22 = OpLabel
%arr = OpVariable %_ptr_Function__arr_float_uint_3_0 Function %26
%a = OpVariable %_ptr_Function_int Function %29
%x_69 = OpVariable %_ptr_Function_bool Function %33
%x_79 = OpVariable %_ptr_Function_bool Function %33
%x_70_phi = OpVariable %_ptr_Function_bool Function %33
%x_80_phi = OpVariable %_ptr_Function_bool Function %33
%40 = OpAccessChain %_ptr_Uniform_float %x_6 %uint_0 %int_1
%41 = OpLoad %float %40
%43 = OpAccessChain %_ptr_Uniform_float %x_6 %uint_0 %int_0
%44 = OpLoad %float %43
%46 = OpAccessChain %_ptr_Uniform_float %x_6 %uint_0 %int_2
%47 = OpLoad %float %46
%48 = OpCompositeConstruct %_arr_float_uint_3_0 %41 %44 %47
OpStore %arr %48
OpStore %a %int_0
OpBranch %49
%49 = OpLabel
OpLoopMerge %50 %51 None
OpBranch %52
%52 = OpLabel
%53 = OpLoad %int %a
%55 = OpAccessChain %_ptr_Uniform_int %x_9 %uint_0 %int_1
%56 = OpLoad %int %55
%57 = OpSLessThanEqual %bool %53 %56
OpSelectionMerge %58 None
OpBranchConditional %57 %59 %60
%59 = OpLabel
OpBranch %58
%60 = OpLabel
OpBranch %50
%58 = OpLabel
%61 = OpLoad %int %a
%62 = OpIAdd %int %61 %int_1
OpStore %a %62
%63 = OpAccessChain %_ptr_Uniform_float %x_6 %uint_0 %int_0
%64 = OpLoad %float %63
%66 = OpAccessChain %_ptr_Function_float %arr %61
OpStore %66 %64
OpBranch %51
%51 = OpLabel
OpBranch %49
%50 = OpLabel
%67 = OpAccessChain %_ptr_Uniform_int %x_9 %uint_0 %int_1
%68 = OpLoad %int %67
%69 = OpAccessChain %_ptr_Function_float %arr %68
%70 = OpLoad %float %69
%71 = OpAccessChain %_ptr_Uniform_float %x_6 %uint_0 %int_0
%72 = OpLoad %float %71
%73 = OpFOrdEqual %bool %70 %72
OpStore %x_70_phi %73
OpSelectionMerge %74 None
OpBranchConditional %73 %75 %74
%75 = OpLabel
%76 = OpAccessChain %_ptr_Uniform_int %x_9 %uint_0 %int_2
%77 = OpLoad %int %76
%78 = OpAccessChain %_ptr_Function_float %arr %77
%79 = OpLoad %float %78
%80 = OpAccessChain %_ptr_Uniform_float %x_6 %uint_0 %int_0
%81 = OpLoad %float %80
%82 = OpFOrdEqual %bool %79 %81
OpStore %x_69 %82
%83 = OpLoad %bool %x_69
OpStore %x_70_phi %83
OpBranch %74
%74 = OpLabel
%84 = OpLoad %bool %x_70_phi
OpStore %x_80_phi %84
OpSelectionMerge %85 None
OpBranchConditional %84 %86 %85
%86 = OpLabel
%87 = OpAccessChain %_ptr_Uniform_int %x_9 %uint_0 %int_0
%88 = OpLoad %int %87
%89 = OpAccessChain %_ptr_Function_float %arr %88
%90 = OpLoad %float %89
%91 = OpAccessChain %_ptr_Uniform_float %x_6 %uint_0 %int_2
%92 = OpLoad %float %91
%93 = OpFOrdEqual %bool %90 %92
OpStore %x_79 %93
%94 = OpLoad %bool %x_79
OpStore %x_80_phi %94
OpBranch %85
%85 = OpLabel
%95 = OpLoad %bool %x_80_phi
OpSelectionMerge %96 None
OpBranchConditional %95 %97 %98
%97 = OpLabel
%99 = OpAccessChain %_ptr_Uniform_int %x_9 %uint_0 %int_1
%100 = OpLoad %int %99
%101 = OpAccessChain %_ptr_Function_float %arr %100
%102 = OpLoad %float %101
%103 = OpAccessChain %_ptr_Uniform_float %x_6 %uint_0 %int_1
%104 = OpLoad %float %103
%105 = OpAccessChain %_ptr_Uniform_float %x_6 %uint_0 %int_1
%106 = OpLoad %float %105
%107 = OpAccessChain %_ptr_Uniform_float %x_6 %uint_0 %int_0
%108 = OpLoad %float %107
%109 = OpCompositeConstruct %v4float %102 %104 %106 %108
OpStore %x_GLF_color %109
OpBranch %96
%98 = OpLabel
%110 = OpAccessChain %_ptr_Uniform_float %x_6 %uint_0 %int_1
%111 = OpLoad %float %110
%112 = OpCompositeConstruct %v4float %111 %111 %111 %111
OpStore %x_GLF_color %112
OpBranch %96
%96 = OpLabel
OpReturn
OpFunctionEnd
%tint_symbol_2 = OpFunction %void None %113
%tint_symbol = OpFunctionParameter %main_out
%117 = OpLabel
%118 = OpCompositeExtract %v4float %tint_symbol 0
OpStore %tint_symbol_1 %118
OpReturn
OpFunctionEnd
%main = OpFunction %void None %19
%120 = OpLabel
%121 = OpFunctionCall %void %main_1
%123 = OpLoad %v4float %x_GLF_color
%124 = OpCompositeConstruct %main_out %123
%122 = OpFunctionCall %void %tint_symbol_2 %124
OpReturn
OpFunctionEnd

View File

@@ -0,0 +1,90 @@
type Arr = [[stride(16)]] array<f32, 3>;
[[block]]
struct buf1 {
x_GLF_uniform_float_values : Arr;
};
type Arr_1 = [[stride(16)]] array<i32, 3>;
[[block]]
struct buf0 {
x_GLF_uniform_int_values : Arr_1;
};
[[group(0), binding(1)]] var<uniform> x_6 : buf1;
[[group(0), binding(0)]] var<uniform> x_9 : buf0;
var<private> x_GLF_color : vec4<f32>;
fn main_1() {
var arr : array<f32, 3>;
var a : i32;
var x_69 : bool;
var x_79 : bool;
var x_70_phi : bool;
var x_80_phi : bool;
let x_34 : f32 = x_6.x_GLF_uniform_float_values[1];
let x_36 : f32 = x_6.x_GLF_uniform_float_values[0];
let x_38 : f32 = x_6.x_GLF_uniform_float_values[2];
arr = array<f32, 3>(x_34, x_36, x_38);
a = 0;
loop {
let x_44 : i32 = a;
let x_46 : i32 = x_9.x_GLF_uniform_int_values[1];
if ((x_44 <= x_46)) {
} else {
break;
}
let x_49 : i32 = a;
a = (x_49 + 1);
let x_52 : f32 = x_6.x_GLF_uniform_float_values[0];
arr[x_49] = x_52;
}
let x_55 : i32 = x_9.x_GLF_uniform_int_values[1];
let x_57 : f32 = arr[x_55];
let x_59 : f32 = x_6.x_GLF_uniform_float_values[0];
let x_60 : bool = (x_57 == x_59);
x_70_phi = x_60;
if (x_60) {
let x_64 : i32 = x_9.x_GLF_uniform_int_values[2];
let x_66 : f32 = arr[x_64];
let x_68 : f32 = x_6.x_GLF_uniform_float_values[0];
x_69 = (x_66 == x_68);
x_70_phi = x_69;
}
let x_70 : bool = x_70_phi;
x_80_phi = x_70;
if (x_70) {
let x_74 : i32 = x_9.x_GLF_uniform_int_values[0];
let x_76 : f32 = arr[x_74];
let x_78 : f32 = x_6.x_GLF_uniform_float_values[2];
x_79 = (x_76 == x_78);
x_80_phi = x_79;
}
let x_80 : bool = x_80_phi;
if (x_80) {
let x_85 : i32 = x_9.x_GLF_uniform_int_values[1];
let x_87 : f32 = arr[x_85];
let x_89 : f32 = x_6.x_GLF_uniform_float_values[1];
let x_91 : f32 = x_6.x_GLF_uniform_float_values[1];
let x_93 : f32 = x_6.x_GLF_uniform_float_values[0];
x_GLF_color = vec4<f32>(x_87, x_89, x_91, x_93);
} else {
let x_96 : f32 = x_6.x_GLF_uniform_float_values[1];
x_GLF_color = vec4<f32>(x_96, x_96, x_96, x_96);
}
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);
}

View File

@@ -0,0 +1,90 @@
type Arr = [[stride(16)]] array<f32, 3>;
[[block]]
struct buf1 {
x_GLF_uniform_float_values : Arr;
};
type Arr_1 = [[stride(16)]] array<i32, 3>;
[[block]]
struct buf0 {
x_GLF_uniform_int_values : Arr_1;
};
[[group(0), binding(1)]] var<uniform> x_6 : buf1;
[[group(0), binding(0)]] var<uniform> x_9 : buf0;
var<private> x_GLF_color : vec4<f32>;
fn main_1() {
var arr : array<f32, 3>;
var a : i32;
var x_69 : bool;
var x_79 : bool;
var x_70_phi : bool;
var x_80_phi : bool;
let x_34 : f32 = x_6.x_GLF_uniform_float_values[1];
let x_36 : f32 = x_6.x_GLF_uniform_float_values[0];
let x_38 : f32 = x_6.x_GLF_uniform_float_values[2];
arr = array<f32, 3>(x_34, x_36, x_38);
a = 0;
loop {
let x_44 : i32 = a;
let x_46 : i32 = x_9.x_GLF_uniform_int_values[1];
if ((x_44 <= x_46)) {
} else {
break;
}
let x_49 : i32 = a;
a = (x_49 + 1);
let x_52 : f32 = x_6.x_GLF_uniform_float_values[0];
arr[x_49] = x_52;
}
let x_55 : i32 = x_9.x_GLF_uniform_int_values[1];
let x_57 : f32 = arr[x_55];
let x_59 : f32 = x_6.x_GLF_uniform_float_values[0];
let x_60 : bool = (x_57 == x_59);
x_70_phi = x_60;
if (x_60) {
let x_64 : i32 = x_9.x_GLF_uniform_int_values[2];
let x_66 : f32 = arr[x_64];
let x_68 : f32 = x_6.x_GLF_uniform_float_values[0];
x_69 = (x_66 == x_68);
x_70_phi = x_69;
}
let x_70 : bool = x_70_phi;
x_80_phi = x_70;
if (x_70) {
let x_74 : i32 = x_9.x_GLF_uniform_int_values[0];
let x_76 : f32 = arr[x_74];
let x_78 : f32 = x_6.x_GLF_uniform_float_values[2];
x_79 = (x_76 == x_78);
x_80_phi = x_79;
}
let x_80 : bool = x_80_phi;
if (x_80) {
let x_85 : i32 = x_9.x_GLF_uniform_int_values[1];
let x_87 : f32 = arr[x_85];
let x_89 : f32 = x_6.x_GLF_uniform_float_values[1];
let x_91 : f32 = x_6.x_GLF_uniform_float_values[1];
let x_93 : f32 = x_6.x_GLF_uniform_float_values[0];
x_GLF_color = vec4<f32>(x_87, x_89, x_91, x_93);
} else {
let x_96 : f32 = x_6.x_GLF_uniform_float_values[1];
x_GLF_color = vec4<f32>(x_96, x_96, x_96, x_96);
}
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);
}

View File

@@ -0,0 +1,87 @@
cbuffer cbuffer_x_6 : register(b1, space0) {
uint4 x_6[3];
};
cbuffer cbuffer_x_9 : register(b0, space0) {
uint4 x_9[3];
};
static float4 x_GLF_color = float4(0.0f, 0.0f, 0.0f, 0.0f);
void main_1() {
float arr[3] = (float[3])0;
int a = 0;
bool x_69 = false;
bool x_79 = false;
bool x_70_phi = false;
bool x_80_phi = false;
const float x_34 = asfloat(x_6[1].x);
const uint scalar_offset = ((16u * uint(0))) / 4;
const float x_36 = asfloat(x_6[scalar_offset / 4][scalar_offset % 4]);
const float x_38 = asfloat(x_6[2].x);
const float tint_symbol_4[3] = {x_34, x_36, x_38};
arr = tint_symbol_4;
a = 0;
while (true) {
const int x_44 = a;
const int x_46 = asint(x_9[1].x);
if ((x_44 <= x_46)) {
} else {
break;
}
const int x_49 = a;
a = (x_49 + 1);
const uint scalar_offset_1 = ((16u * uint(0))) / 4;
const float x_52 = asfloat(x_6[scalar_offset_1 / 4][scalar_offset_1 % 4]);
arr[x_49] = x_52;
}
const int x_55 = asint(x_9[1].x);
const float x_57 = arr[x_55];
const uint scalar_offset_2 = ((16u * uint(0))) / 4;
const float x_59 = asfloat(x_6[scalar_offset_2 / 4][scalar_offset_2 % 4]);
const bool x_60 = (x_57 == x_59);
x_70_phi = x_60;
if (x_60) {
const int x_64 = asint(x_9[2].x);
const float x_66 = arr[x_64];
const uint scalar_offset_3 = ((16u * uint(0))) / 4;
const float x_68 = asfloat(x_6[scalar_offset_3 / 4][scalar_offset_3 % 4]);
x_69 = (x_66 == x_68);
x_70_phi = x_69;
}
const bool x_70 = x_70_phi;
x_80_phi = x_70;
if (x_70) {
const uint scalar_offset_4 = ((16u * uint(0))) / 4;
const int x_74 = asint(x_9[scalar_offset_4 / 4][scalar_offset_4 % 4]);
const float x_76 = arr[x_74];
const float x_78 = asfloat(x_6[2].x);
x_79 = (x_76 == x_78);
x_80_phi = x_79;
}
if (x_80_phi) {
const int x_85 = asint(x_9[1].x);
const float x_87 = arr[x_85];
const float x_89 = asfloat(x_6[1].x);
const float x_91 = asfloat(x_6[1].x);
const uint scalar_offset_5 = ((16u * uint(0))) / 4;
const float x_93 = asfloat(x_6[scalar_offset_5 / 4][scalar_offset_5 % 4]);
x_GLF_color = float4(x_87, x_89, x_91, x_93);
} else {
const float x_96 = asfloat(x_6[1].x);
x_GLF_color = float4(x_96, x_96, x_96, x_96);
}
return;
}
struct main_out {
float4 x_GLF_color_1;
};
struct tint_symbol {
float4 x_GLF_color_1 : SV_Target0;
};
tint_symbol main() {
main_1();
const main_out tint_symbol_1 = {x_GLF_color};
const tint_symbol tint_symbol_5 = {tint_symbol_1.x_GLF_color_1};
return tint_symbol_5;
}

View File

@@ -0,0 +1,102 @@
#include <metal_stdlib>
using namespace metal;
struct tint_padded_array_element {
/* 0x0000 */ float el;
/* 0x0004 */ int8_t tint_pad[12];
};
struct tint_array_wrapper {
/* 0x0000 */ tint_padded_array_element arr[3];
};
struct buf1 {
/* 0x0000 */ tint_array_wrapper x_GLF_uniform_float_values;
};
struct tint_padded_array_element_1 {
/* 0x0000 */ int el;
/* 0x0004 */ int8_t tint_pad_1[12];
};
struct tint_array_wrapper_1 {
/* 0x0000 */ tint_padded_array_element_1 arr[3];
};
struct buf0 {
/* 0x0000 */ tint_array_wrapper_1 x_GLF_uniform_int_values;
};
struct tint_array_wrapper_2 {
float arr[3];
};
struct main_out {
float4 x_GLF_color_1;
};
struct tint_symbol_1 {
float4 x_GLF_color_1 [[color(0)]];
};
void main_1(constant buf1& x_6, constant buf0& x_9, thread float4* const tint_symbol_5) {
tint_array_wrapper_2 arr = {};
int a = 0;
bool x_69 = false;
bool x_79 = false;
bool x_70_phi = false;
bool x_80_phi = false;
float const x_34 = x_6.x_GLF_uniform_float_values.arr[1].el;
float const x_36 = x_6.x_GLF_uniform_float_values.arr[0].el;
float const x_38 = x_6.x_GLF_uniform_float_values.arr[2].el;
tint_array_wrapper_2 const tint_symbol_3 = {.arr={x_34, x_36, x_38}};
arr = tint_symbol_3;
a = 0;
while (true) {
int const x_44 = a;
int const x_46 = x_9.x_GLF_uniform_int_values.arr[1].el;
if ((x_44 <= x_46)) {
} else {
break;
}
int const x_49 = a;
a = (x_49 + 1);
float const x_52 = x_6.x_GLF_uniform_float_values.arr[0].el;
arr.arr[x_49] = x_52;
}
int const x_55 = x_9.x_GLF_uniform_int_values.arr[1].el;
float const x_57 = arr.arr[x_55];
float const x_59 = x_6.x_GLF_uniform_float_values.arr[0].el;
bool const x_60 = (x_57 == x_59);
x_70_phi = x_60;
if (x_60) {
int const x_64 = x_9.x_GLF_uniform_int_values.arr[2].el;
float const x_66 = arr.arr[x_64];
float const x_68 = x_6.x_GLF_uniform_float_values.arr[0].el;
x_69 = (x_66 == x_68);
x_70_phi = x_69;
}
bool const x_70 = x_70_phi;
x_80_phi = x_70;
if (x_70) {
int const x_74 = x_9.x_GLF_uniform_int_values.arr[0].el;
float const x_76 = arr.arr[x_74];
float const x_78 = x_6.x_GLF_uniform_float_values.arr[2].el;
x_79 = (x_76 == x_78);
x_80_phi = x_79;
}
bool const x_80 = x_80_phi;
if (x_80) {
int const x_85 = x_9.x_GLF_uniform_int_values.arr[1].el;
float const x_87 = arr.arr[x_85];
float const x_89 = x_6.x_GLF_uniform_float_values.arr[1].el;
float const x_91 = x_6.x_GLF_uniform_float_values.arr[1].el;
float const x_93 = x_6.x_GLF_uniform_float_values.arr[0].el;
*(tint_symbol_5) = float4(x_87, x_89, x_91, x_93);
} else {
float const x_96 = x_6.x_GLF_uniform_float_values.arr[1].el;
*(tint_symbol_5) = float4(x_96, x_96, x_96, x_96);
}
return;
}
fragment tint_symbol_1 tint_symbol(constant buf1& x_6 [[buffer(1)]], constant buf0& x_9 [[buffer(0)]]) {
thread float4 tint_symbol_6 = 0.0f;
main_1(x_6, x_9, &(tint_symbol_6));
main_out const tint_symbol_2 = {.x_GLF_color_1=tint_symbol_6};
tint_symbol_1 const tint_symbol_4 = {.x_GLF_color_1=tint_symbol_2.x_GLF_color_1};
return tint_symbol_4;
}

View File

@@ -0,0 +1,206 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 125
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main" %tint_symbol_1
OpExecutionMode %main OriginUpperLeft
OpName %buf1 "buf1"
OpMemberName %buf1 0 "x_GLF_uniform_float_values"
OpName %x_6 "x_6"
OpName %buf0 "buf0"
OpMemberName %buf0 0 "x_GLF_uniform_int_values"
OpName %x_9 "x_9"
OpName %x_GLF_color "x_GLF_color"
OpName %tint_symbol_1 "tint_symbol_1"
OpName %main_1 "main_1"
OpName %arr "arr"
OpName %a "a"
OpName %x_69 "x_69"
OpName %x_79 "x_79"
OpName %x_70_phi "x_70_phi"
OpName %x_80_phi "x_80_phi"
OpName %main_out "main_out"
OpMemberName %main_out 0 "x_GLF_color_1"
OpName %tint_symbol_2 "tint_symbol_2"
OpName %tint_symbol "tint_symbol"
OpName %main "main"
OpDecorate %buf1 Block
OpMemberDecorate %buf1 0 Offset 0
OpDecorate %_arr_float_uint_3 ArrayStride 16
OpDecorate %x_6 NonWritable
OpDecorate %x_6 DescriptorSet 0
OpDecorate %x_6 Binding 1
OpDecorate %buf0 Block
OpMemberDecorate %buf0 0 Offset 0
OpDecorate %_arr_int_uint_3 ArrayStride 16
OpDecorate %x_9 NonWritable
OpDecorate %x_9 DescriptorSet 0
OpDecorate %x_9 Binding 0
OpDecorate %tint_symbol_1 Location 0
OpDecorate %_arr_float_uint_3_0 ArrayStride 4
OpMemberDecorate %main_out 0 Offset 0
%float = OpTypeFloat 32
%uint = OpTypeInt 32 0
%uint_3 = OpConstant %uint 3
%_arr_float_uint_3 = OpTypeArray %float %uint_3
%buf1 = OpTypeStruct %_arr_float_uint_3
%_ptr_Uniform_buf1 = OpTypePointer Uniform %buf1
%x_6 = OpVariable %_ptr_Uniform_buf1 Uniform
%int = OpTypeInt 32 1
%_arr_int_uint_3 = OpTypeArray %int %uint_3
%buf0 = OpTypeStruct %_arr_int_uint_3
%_ptr_Uniform_buf0 = OpTypePointer Uniform %buf0
%x_9 = OpVariable %_ptr_Uniform_buf0 Uniform
%v4float = OpTypeVector %float 4
%_ptr_Private_v4float = OpTypePointer Private %v4float
%16 = OpConstantNull %v4float
%x_GLF_color = OpVariable %_ptr_Private_v4float Private %16
%_ptr_Output_v4float = OpTypePointer Output %v4float
%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %16
%void = OpTypeVoid
%19 = OpTypeFunction %void
%_arr_float_uint_3_0 = OpTypeArray %float %uint_3
%_ptr_Function__arr_float_uint_3_0 = OpTypePointer Function %_arr_float_uint_3_0
%26 = OpConstantNull %_arr_float_uint_3_0
%_ptr_Function_int = OpTypePointer Function %int
%29 = OpConstantNull %int
%bool = OpTypeBool
%_ptr_Function_bool = OpTypePointer Function %bool
%33 = OpConstantNull %bool
%uint_0 = OpConstant %uint 0
%int_1 = OpConstant %int 1
%_ptr_Uniform_float = OpTypePointer Uniform %float
%int_0 = OpConstant %int 0
%int_2 = OpConstant %int 2
%_ptr_Uniform_int = OpTypePointer Uniform %int
%_ptr_Function_float = OpTypePointer Function %float
%main_out = OpTypeStruct %v4float
%113 = OpTypeFunction %void %main_out
%main_1 = OpFunction %void None %19
%22 = OpLabel
%arr = OpVariable %_ptr_Function__arr_float_uint_3_0 Function %26
%a = OpVariable %_ptr_Function_int Function %29
%x_69 = OpVariable %_ptr_Function_bool Function %33
%x_79 = OpVariable %_ptr_Function_bool Function %33
%x_70_phi = OpVariable %_ptr_Function_bool Function %33
%x_80_phi = OpVariable %_ptr_Function_bool Function %33
%40 = OpAccessChain %_ptr_Uniform_float %x_6 %uint_0 %int_1
%41 = OpLoad %float %40
%43 = OpAccessChain %_ptr_Uniform_float %x_6 %uint_0 %int_0
%44 = OpLoad %float %43
%46 = OpAccessChain %_ptr_Uniform_float %x_6 %uint_0 %int_2
%47 = OpLoad %float %46
%48 = OpCompositeConstruct %_arr_float_uint_3_0 %41 %44 %47
OpStore %arr %48
OpStore %a %int_0
OpBranch %49
%49 = OpLabel
OpLoopMerge %50 %51 None
OpBranch %52
%52 = OpLabel
%53 = OpLoad %int %a
%55 = OpAccessChain %_ptr_Uniform_int %x_9 %uint_0 %int_1
%56 = OpLoad %int %55
%57 = OpSLessThanEqual %bool %53 %56
OpSelectionMerge %58 None
OpBranchConditional %57 %59 %60
%59 = OpLabel
OpBranch %58
%60 = OpLabel
OpBranch %50
%58 = OpLabel
%61 = OpLoad %int %a
%62 = OpIAdd %int %61 %int_1
OpStore %a %62
%63 = OpAccessChain %_ptr_Uniform_float %x_6 %uint_0 %int_0
%64 = OpLoad %float %63
%66 = OpAccessChain %_ptr_Function_float %arr %61
OpStore %66 %64
OpBranch %51
%51 = OpLabel
OpBranch %49
%50 = OpLabel
%67 = OpAccessChain %_ptr_Uniform_int %x_9 %uint_0 %int_1
%68 = OpLoad %int %67
%69 = OpAccessChain %_ptr_Function_float %arr %68
%70 = OpLoad %float %69
%71 = OpAccessChain %_ptr_Uniform_float %x_6 %uint_0 %int_0
%72 = OpLoad %float %71
%73 = OpFOrdEqual %bool %70 %72
OpStore %x_70_phi %73
OpSelectionMerge %74 None
OpBranchConditional %73 %75 %74
%75 = OpLabel
%76 = OpAccessChain %_ptr_Uniform_int %x_9 %uint_0 %int_2
%77 = OpLoad %int %76
%78 = OpAccessChain %_ptr_Function_float %arr %77
%79 = OpLoad %float %78
%80 = OpAccessChain %_ptr_Uniform_float %x_6 %uint_0 %int_0
%81 = OpLoad %float %80
%82 = OpFOrdEqual %bool %79 %81
OpStore %x_69 %82
%83 = OpLoad %bool %x_69
OpStore %x_70_phi %83
OpBranch %74
%74 = OpLabel
%84 = OpLoad %bool %x_70_phi
OpStore %x_80_phi %84
OpSelectionMerge %85 None
OpBranchConditional %84 %86 %85
%86 = OpLabel
%87 = OpAccessChain %_ptr_Uniform_int %x_9 %uint_0 %int_0
%88 = OpLoad %int %87
%89 = OpAccessChain %_ptr_Function_float %arr %88
%90 = OpLoad %float %89
%91 = OpAccessChain %_ptr_Uniform_float %x_6 %uint_0 %int_2
%92 = OpLoad %float %91
%93 = OpFOrdEqual %bool %90 %92
OpStore %x_79 %93
%94 = OpLoad %bool %x_79
OpStore %x_80_phi %94
OpBranch %85
%85 = OpLabel
%95 = OpLoad %bool %x_80_phi
OpSelectionMerge %96 None
OpBranchConditional %95 %97 %98
%97 = OpLabel
%99 = OpAccessChain %_ptr_Uniform_int %x_9 %uint_0 %int_1
%100 = OpLoad %int %99
%101 = OpAccessChain %_ptr_Function_float %arr %100
%102 = OpLoad %float %101
%103 = OpAccessChain %_ptr_Uniform_float %x_6 %uint_0 %int_1
%104 = OpLoad %float %103
%105 = OpAccessChain %_ptr_Uniform_float %x_6 %uint_0 %int_1
%106 = OpLoad %float %105
%107 = OpAccessChain %_ptr_Uniform_float %x_6 %uint_0 %int_0
%108 = OpLoad %float %107
%109 = OpCompositeConstruct %v4float %102 %104 %106 %108
OpStore %x_GLF_color %109
OpBranch %96
%98 = OpLabel
%110 = OpAccessChain %_ptr_Uniform_float %x_6 %uint_0 %int_1
%111 = OpLoad %float %110
%112 = OpCompositeConstruct %v4float %111 %111 %111 %111
OpStore %x_GLF_color %112
OpBranch %96
%96 = OpLabel
OpReturn
OpFunctionEnd
%tint_symbol_2 = OpFunction %void None %113
%tint_symbol = OpFunctionParameter %main_out
%117 = OpLabel
%118 = OpCompositeExtract %v4float %tint_symbol 0
OpStore %tint_symbol_1 %118
OpReturn
OpFunctionEnd
%main = OpFunction %void None %19
%120 = OpLabel
%121 = OpFunctionCall %void %main_1
%123 = OpLoad %v4float %x_GLF_color
%124 = OpCompositeConstruct %main_out %123
%122 = OpFunctionCall %void %tint_symbol_2 %124
OpReturn
OpFunctionEnd

View File

@@ -0,0 +1,90 @@
type Arr = [[stride(16)]] array<f32, 3>;
[[block]]
struct buf1 {
x_GLF_uniform_float_values : Arr;
};
type Arr_1 = [[stride(16)]] array<i32, 3>;
[[block]]
struct buf0 {
x_GLF_uniform_int_values : Arr_1;
};
[[group(0), binding(1)]] var<uniform> x_6 : buf1;
[[group(0), binding(0)]] var<uniform> x_9 : buf0;
var<private> x_GLF_color : vec4<f32>;
fn main_1() {
var arr : array<f32, 3>;
var a : i32;
var x_69 : bool;
var x_79 : bool;
var x_70_phi : bool;
var x_80_phi : bool;
let x_34 : f32 = x_6.x_GLF_uniform_float_values[1];
let x_36 : f32 = x_6.x_GLF_uniform_float_values[0];
let x_38 : f32 = x_6.x_GLF_uniform_float_values[2];
arr = array<f32, 3>(x_34, x_36, x_38);
a = 0;
loop {
let x_44 : i32 = a;
let x_46 : i32 = x_9.x_GLF_uniform_int_values[1];
if ((x_44 <= x_46)) {
} else {
break;
}
let x_49 : i32 = a;
a = (x_49 + 1);
let x_52 : f32 = x_6.x_GLF_uniform_float_values[0];
arr[x_49] = x_52;
}
let x_55 : i32 = x_9.x_GLF_uniform_int_values[1];
let x_57 : f32 = arr[x_55];
let x_59 : f32 = x_6.x_GLF_uniform_float_values[0];
let x_60 : bool = (x_57 == x_59);
x_70_phi = x_60;
if (x_60) {
let x_64 : i32 = x_9.x_GLF_uniform_int_values[2];
let x_66 : f32 = arr[x_64];
let x_68 : f32 = x_6.x_GLF_uniform_float_values[0];
x_69 = (x_66 == x_68);
x_70_phi = x_69;
}
let x_70 : bool = x_70_phi;
x_80_phi = x_70;
if (x_70) {
let x_74 : i32 = x_9.x_GLF_uniform_int_values[0];
let x_76 : f32 = arr[x_74];
let x_78 : f32 = x_6.x_GLF_uniform_float_values[2];
x_79 = (x_76 == x_78);
x_80_phi = x_79;
}
let x_80 : bool = x_80_phi;
if (x_80) {
let x_85 : i32 = x_9.x_GLF_uniform_int_values[1];
let x_87 : f32 = arr[x_85];
let x_89 : f32 = x_6.x_GLF_uniform_float_values[1];
let x_91 : f32 = x_6.x_GLF_uniform_float_values[1];
let x_93 : f32 = x_6.x_GLF_uniform_float_values[0];
x_GLF_color = vec4<f32>(x_87, x_89, x_91, x_93);
} else {
let x_96 : f32 = x_6.x_GLF_uniform_float_values[1];
x_GLF_color = vec4<f32>(x_96, x_96, x_96, x_96);
}
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);
}