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,87 +0,0 @@
void set_float4(inout float4 vec, int idx, float val) {
vec = (idx.xxxx == int4(0, 1, 2, 3)) ? val.xxxx : vec;
}
cbuffer cbuffer_x_6 : register(b1, space0) {
uint4 x_6[5];
};
cbuffer cbuffer_x_9 : register(b0, space0) {
uint4 x_9[2];
};
static float4 x_GLF_color = float4(0.0f, 0.0f, 0.0f, 0.0f);
void main_1() {
float4 v = float4(0.0f, 0.0f, 0.0f, 0.0f);
int i = 0;
const int x_40 = asint(x_6[1].x);
const int x_43 = asint(x_6[2].x);
const int x_46 = asint(x_6[3].x);
const uint scalar_offset = ((16u * uint(0))) / 4;
const int x_49 = asint(x_6[scalar_offset / 4][scalar_offset % 4]);
v = float4(float(x_40), float(x_43), float(x_46), float(x_49));
const int x_53 = asint(x_6[4].x);
i = x_53;
while (true) {
const int x_58 = i;
const uint scalar_offset_1 = ((16u * uint(0))) / 4;
const int x_60 = asint(x_6[scalar_offset_1 / 4][scalar_offset_1 % 4]);
if ((x_58 < x_60)) {
} else {
break;
}
const float4 x_63 = v;
const float4 x_64 = v;
const float4 x_65 = v;
const float4 x_66 = v;
const int x_88 = i;
const uint scalar_offset_2 = ((16u * uint(0))) / 4;
const float x_92 = asfloat(x_9[scalar_offset_2 / 4][scalar_offset_2 % 4]);
if ((float4x4(float4(x_63.x, x_63.y, x_63.z, x_63.w), float4(x_64.x, x_64.y, x_64.z, x_64.w), float4(x_65.x, x_65.y, x_65.z, x_65.w), float4(x_66.x, x_66.y, x_66.z, x_66.w))[0u][x_88] > x_92)) {
const int x_96 = i;
const float4 x_97 = v;
const float x_99 = asfloat(x_9[1].x);
const uint scalar_offset_3 = ((16u * uint(0))) / 4;
const float x_102 = asfloat(x_9[scalar_offset_3 / 4][scalar_offset_3 % 4]);
const int x_106 = asint(x_6[1].x);
set_float4(v, x_96, clamp(x_97, float4(x_99, x_99, x_99, x_99), float4(x_102, x_102, x_102, x_102))[x_106]);
}
{
i = (i + 1);
}
}
const float4 x_111 = v;
const int x_113 = asint(x_6[1].x);
const float x_114 = float(x_113);
if (all((x_111 == float4(x_114, x_114, x_114, x_114)))) {
const int x_122 = asint(x_6[1].x);
const int x_125 = asint(x_6[4].x);
const int x_128 = asint(x_6[4].x);
const int x_131 = asint(x_6[1].x);
x_GLF_color = float4(float(x_122), float(x_125), float(x_128), float(x_131));
} else {
const int x_135 = asint(x_6[4].x);
const float x_136 = float(x_135);
x_GLF_color = float4(x_136, x_136, x_136, x_136);
}
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_3 = {x_GLF_color};
return tint_symbol_3;
}
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;
}

View File

@@ -1,97 +0,0 @@
#include <metal_stdlib>
using namespace metal;
struct tint_padded_array_element {
/* 0x0000 */ int el;
/* 0x0004 */ int8_t tint_pad[12];
};
struct tint_array_wrapper {
/* 0x0000 */ tint_padded_array_element arr[5];
};
struct buf1 {
/* 0x0000 */ tint_array_wrapper x_GLF_uniform_int_values;
};
struct tint_padded_array_element_1 {
/* 0x0000 */ float el;
/* 0x0004 */ int8_t tint_pad_1[12];
};
struct tint_array_wrapper_1 {
/* 0x0000 */ tint_padded_array_element_1 arr[2];
};
struct buf0 {
/* 0x0000 */ tint_array_wrapper_1 x_GLF_uniform_float_values;
};
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_3) {
float4 v = 0.0f;
int i = 0;
int const x_40 = x_6.x_GLF_uniform_int_values.arr[1].el;
int const x_43 = x_6.x_GLF_uniform_int_values.arr[2].el;
int const x_46 = x_6.x_GLF_uniform_int_values.arr[3].el;
int const x_49 = x_6.x_GLF_uniform_int_values.arr[0].el;
v = float4(float(x_40), float(x_43), float(x_46), float(x_49));
int const x_53 = x_6.x_GLF_uniform_int_values.arr[4].el;
i = x_53;
while (true) {
int const x_58 = i;
int const x_60 = x_6.x_GLF_uniform_int_values.arr[0].el;
if ((x_58 < x_60)) {
} else {
break;
}
float4 const x_63 = v;
float4 const x_64 = v;
float4 const x_65 = v;
float4 const x_66 = v;
int const x_88 = i;
float const x_92 = x_9.x_GLF_uniform_float_values.arr[0].el;
if ((float4x4(float4(x_63.x, x_63.y, x_63.z, x_63.w), float4(x_64.x, x_64.y, x_64.z, x_64.w), float4(x_65.x, x_65.y, x_65.z, x_65.w), float4(x_66.x, x_66.y, x_66.z, x_66.w))[0u][x_88] > x_92)) {
int const x_96 = i;
float4 const x_97 = v;
float const x_99 = x_9.x_GLF_uniform_float_values.arr[1].el;
float const x_102 = x_9.x_GLF_uniform_float_values.arr[0].el;
int const x_106 = x_6.x_GLF_uniform_int_values.arr[1].el;
v[x_96] = clamp(x_97, float4(x_99, x_99, x_99, x_99), float4(x_102, x_102, x_102, x_102))[x_106];
}
{
int const x_109 = i;
i = as_type<int>((as_type<uint>(x_109) + as_type<uint>(1)));
}
}
float4 const x_111 = v;
int const x_113 = x_6.x_GLF_uniform_int_values.arr[1].el;
float const x_114 = float(x_113);
if (all((x_111 == float4(x_114, x_114, x_114, x_114)))) {
int const x_122 = x_6.x_GLF_uniform_int_values.arr[1].el;
int const x_125 = x_6.x_GLF_uniform_int_values.arr[4].el;
int const x_128 = x_6.x_GLF_uniform_int_values.arr[4].el;
int const x_131 = x_6.x_GLF_uniform_int_values.arr[1].el;
*(tint_symbol_3) = float4(float(x_122), float(x_125), float(x_128), float(x_131));
} else {
int const x_135 = x_6.x_GLF_uniform_int_values.arr[4].el;
float const x_136 = float(x_135);
*(tint_symbol_3) = float4(x_136, x_136, x_136, x_136);
}
return;
}
main_out tint_symbol_inner(constant buf1& x_6, constant buf0& x_9, thread float4* const tint_symbol_4) {
main_1(x_6, x_9, 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 buf1& x_6 [[buffer(0)]], constant buf0& x_9 [[buffer(1)]]) {
thread float4 tint_symbol_5 = 0.0f;
main_out const inner_result = tint_symbol_inner(x_6, x_9, &(tint_symbol_5));
tint_symbol_1 wrapper_result = {};
wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1;
return wrapper_result;
}

View File

@@ -1,220 +0,0 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 154
; Schema: 0
OpCapability Shader
%109 = OpExtInstImport "GLSL.std.450"
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 %buf1 "buf1"
OpMemberName %buf1 0 "x_GLF_uniform_int_values"
OpName %x_6 "x_6"
OpName %buf0 "buf0"
OpMemberName %buf0 0 "x_GLF_uniform_float_values"
OpName %x_9 "x_9"
OpName %x_GLF_color "x_GLF_color"
OpName %main_1 "main_1"
OpName %v "v"
OpName %i "i"
OpName %main_out "main_out"
OpMemberName %main_out 0 "x_GLF_color_1"
OpName %main_inner "main_inner"
OpName %main "main"
OpDecorate %x_GLF_color_1_1 Location 0
OpDecorate %buf1 Block
OpMemberDecorate %buf1 0 Offset 0
OpDecorate %_arr_int_uint_5 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_float_uint_2 ArrayStride 16
OpDecorate %x_9 NonWritable
OpDecorate %x_9 DescriptorSet 0
OpDecorate %x_9 Binding 0
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
%int = OpTypeInt 32 1
%uint = OpTypeInt 32 0
%uint_5 = OpConstant %uint 5
%_arr_int_uint_5 = OpTypeArray %int %uint_5
%buf1 = OpTypeStruct %_arr_int_uint_5
%_ptr_Uniform_buf1 = OpTypePointer Uniform %buf1
%x_6 = OpVariable %_ptr_Uniform_buf1 Uniform
%uint_2 = OpConstant %uint 2
%_arr_float_uint_2 = OpTypeArray %float %uint_2
%buf0 = OpTypeStruct %_arr_float_uint_2
%_ptr_Uniform_buf0 = OpTypePointer Uniform %buf0
%x_9 = OpVariable %_ptr_Uniform_buf0 Uniform
%_ptr_Private_v4float = OpTypePointer Private %v4float
%x_GLF_color = OpVariable %_ptr_Private_v4float Private %5
%void = OpTypeVoid
%20 = OpTypeFunction %void
%_ptr_Function_v4float = OpTypePointer Function %v4float
%_ptr_Function_int = OpTypePointer Function %int
%28 = OpConstantNull %int
%uint_0 = OpConstant %uint 0
%int_1 = OpConstant %int 1
%_ptr_Uniform_int = OpTypePointer Uniform %int
%int_2 = OpConstant %int 2
%int_3 = OpConstant %int 3
%int_0 = OpConstant %int 0
%int_4 = OpConstant %int 4
%bool = OpTypeBool
%_ptr_Uniform_float = OpTypePointer Uniform %float
%mat4v4float = OpTypeMatrix %v4float 4
%_ptr_Function_float = OpTypePointer Function %float
%v4bool = OpTypeVector %bool 4
%main_out = OpTypeStruct %v4float
%143 = OpTypeFunction %main_out
%main_1 = OpFunction %void None %20
%23 = OpLabel
%v = OpVariable %_ptr_Function_v4float Function %5
%i = OpVariable %_ptr_Function_int Function %28
%32 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_1
%33 = OpLoad %int %32
%35 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_2
%36 = OpLoad %int %35
%38 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_3
%39 = OpLoad %int %38
%41 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_0
%42 = OpLoad %int %41
%43 = OpConvertSToF %float %33
%44 = OpConvertSToF %float %36
%45 = OpConvertSToF %float %39
%46 = OpConvertSToF %float %42
%47 = OpCompositeConstruct %v4float %43 %44 %45 %46
OpStore %v %47
%49 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_4
%50 = OpLoad %int %49
OpStore %i %50
OpBranch %51
%51 = OpLabel
OpLoopMerge %52 %53 None
OpBranch %54
%54 = OpLabel
%55 = OpLoad %int %i
%56 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_0
%57 = OpLoad %int %56
%58 = OpSLessThan %bool %55 %57
OpSelectionMerge %60 None
OpBranchConditional %58 %61 %62
%61 = OpLabel
OpBranch %60
%62 = OpLabel
OpBranch %52
%60 = OpLabel
%63 = OpLoad %v4float %v
%64 = OpLoad %v4float %v
%65 = OpLoad %v4float %v
%66 = OpLoad %v4float %v
%67 = OpLoad %int %i
%69 = OpAccessChain %_ptr_Uniform_float %x_9 %uint_0 %int_0
%70 = OpLoad %float %69
%72 = OpCompositeExtract %float %63 0
%73 = OpCompositeExtract %float %63 1
%74 = OpCompositeExtract %float %63 2
%75 = OpCompositeExtract %float %63 3
%76 = OpCompositeConstruct %v4float %72 %73 %74 %75
%77 = OpCompositeExtract %float %64 0
%78 = OpCompositeExtract %float %64 1
%79 = OpCompositeExtract %float %64 2
%80 = OpCompositeExtract %float %64 3
%81 = OpCompositeConstruct %v4float %77 %78 %79 %80
%82 = OpCompositeExtract %float %65 0
%83 = OpCompositeExtract %float %65 1
%84 = OpCompositeExtract %float %65 2
%85 = OpCompositeExtract %float %65 3
%86 = OpCompositeConstruct %v4float %82 %83 %84 %85
%87 = OpCompositeExtract %float %66 0
%88 = OpCompositeExtract %float %66 1
%89 = OpCompositeExtract %float %66 2
%90 = OpCompositeExtract %float %66 3
%91 = OpCompositeConstruct %v4float %87 %88 %89 %90
%92 = OpCompositeConstruct %mat4v4float %76 %81 %86 %91
%93 = OpCompositeExtract %v4float %92 0
%94 = OpVectorExtractDynamic %float %93 %67
%95 = OpFOrdGreaterThan %bool %94 %70
OpSelectionMerge %96 None
OpBranchConditional %95 %97 %96
%97 = OpLabel
%98 = OpLoad %int %i
%99 = OpLoad %v4float %v
%100 = OpAccessChain %_ptr_Uniform_float %x_9 %uint_0 %int_1
%101 = OpLoad %float %100
%102 = OpAccessChain %_ptr_Uniform_float %x_9 %uint_0 %int_0
%103 = OpLoad %float %102
%104 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_1
%105 = OpLoad %int %104
%107 = OpAccessChain %_ptr_Function_float %v %98
%110 = OpCompositeConstruct %v4float %101 %101 %101 %101
%111 = OpCompositeConstruct %v4float %103 %103 %103 %103
%108 = OpExtInst %v4float %109 NClamp %99 %110 %111
%112 = OpVectorExtractDynamic %float %108 %105
OpStore %107 %112
OpBranch %96
%96 = OpLabel
OpBranch %53
%53 = OpLabel
%113 = OpLoad %int %i
%114 = OpIAdd %int %113 %int_1
OpStore %i %114
OpBranch %51
%52 = OpLabel
%115 = OpLoad %v4float %v
%116 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_1
%117 = OpLoad %int %116
%118 = OpConvertSToF %float %117
%120 = OpCompositeConstruct %v4float %118 %118 %118 %118
%121 = OpFOrdEqual %v4bool %115 %120
%119 = OpAll %bool %121
OpSelectionMerge %123 None
OpBranchConditional %119 %124 %125
%124 = OpLabel
%126 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_1
%127 = OpLoad %int %126
%128 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_4
%129 = OpLoad %int %128
%130 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_4
%131 = OpLoad %int %130
%132 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_1
%133 = OpLoad %int %132
%134 = OpConvertSToF %float %127
%135 = OpConvertSToF %float %129
%136 = OpConvertSToF %float %131
%137 = OpConvertSToF %float %133
%138 = OpCompositeConstruct %v4float %134 %135 %136 %137
OpStore %x_GLF_color %138
OpBranch %123
%125 = OpLabel
%139 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_4
%140 = OpLoad %int %139
%141 = OpConvertSToF %float %140
%142 = OpCompositeConstruct %v4float %141 %141 %141 %141
OpStore %x_GLF_color %142
OpBranch %123
%123 = OpLabel
OpReturn
OpFunctionEnd
%main_inner = OpFunction %main_out None %143
%146 = OpLabel
%147 = OpFunctionCall %void %main_1
%148 = OpLoad %v4float %x_GLF_color
%149 = OpCompositeConstruct %main_out %148
OpReturnValue %149
OpFunctionEnd
%main = OpFunction %void None %20
%151 = OpLabel
%152 = OpFunctionCall %main_out %main_inner
%153 = OpCompositeExtract %v4float %152 0
OpStore %x_GLF_color_1_1 %153
OpReturn
OpFunctionEnd

View File

@@ -1,84 +0,0 @@
type Arr = [[stride(16)]] array<i32, 5>;
[[block]]
struct buf1 {
x_GLF_uniform_int_values : Arr;
};
type Arr_1 = [[stride(16)]] array<f32, 2>;
[[block]]
struct buf0 {
x_GLF_uniform_float_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 v : vec4<f32>;
var i : i32;
let x_40 : i32 = x_6.x_GLF_uniform_int_values[1];
let x_43 : i32 = x_6.x_GLF_uniform_int_values[2];
let x_46 : i32 = x_6.x_GLF_uniform_int_values[3];
let x_49 : i32 = x_6.x_GLF_uniform_int_values[0];
v = vec4<f32>(f32(x_40), f32(x_43), f32(x_46), f32(x_49));
let x_53 : i32 = x_6.x_GLF_uniform_int_values[4];
i = x_53;
loop {
let x_58 : i32 = i;
let x_60 : i32 = x_6.x_GLF_uniform_int_values[0];
if ((x_58 < x_60)) {
} else {
break;
}
let x_63 : vec4<f32> = v;
let x_64 : vec4<f32> = v;
let x_65 : vec4<f32> = v;
let x_66 : vec4<f32> = v;
let x_88 : i32 = i;
let x_92 : f32 = x_9.x_GLF_uniform_float_values[0];
if ((mat4x4<f32>(vec4<f32>(x_63.x, x_63.y, x_63.z, x_63.w), vec4<f32>(x_64.x, x_64.y, x_64.z, x_64.w), vec4<f32>(x_65.x, x_65.y, x_65.z, x_65.w), vec4<f32>(x_66.x, x_66.y, x_66.z, x_66.w))[0u][x_88] > x_92)) {
let x_96 : i32 = i;
let x_97 : vec4<f32> = v;
let x_99 : f32 = x_9.x_GLF_uniform_float_values[1];
let x_102 : f32 = x_9.x_GLF_uniform_float_values[0];
let x_106 : i32 = x_6.x_GLF_uniform_int_values[1];
v[x_96] = clamp(x_97, vec4<f32>(x_99, x_99, x_99, x_99), vec4<f32>(x_102, x_102, x_102, x_102))[x_106];
}
continuing {
let x_109 : i32 = i;
i = (x_109 + 1);
}
}
let x_111 : vec4<f32> = v;
let x_113 : i32 = x_6.x_GLF_uniform_int_values[1];
let x_114 : f32 = f32(x_113);
if (all((x_111 == vec4<f32>(x_114, x_114, x_114, x_114)))) {
let x_122 : i32 = x_6.x_GLF_uniform_int_values[1];
let x_125 : i32 = x_6.x_GLF_uniform_int_values[4];
let x_128 : i32 = x_6.x_GLF_uniform_int_values[4];
let x_131 : i32 = x_6.x_GLF_uniform_int_values[1];
x_GLF_color = vec4<f32>(f32(x_122), f32(x_125), f32(x_128), f32(x_131));
} else {
let x_135 : i32 = x_6.x_GLF_uniform_int_values[4];
let x_136 : f32 = f32(x_135);
x_GLF_color = vec4<f32>(x_136, x_136, x_136, x_136);
}
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

@@ -1,87 +0,0 @@
void set_float4(inout float4 vec, int idx, float val) {
vec = (idx.xxxx == int4(0, 1, 2, 3)) ? val.xxxx : vec;
}
cbuffer cbuffer_x_6 : register(b1, space0) {
uint4 x_6[5];
};
cbuffer cbuffer_x_9 : register(b0, space0) {
uint4 x_9[2];
};
static float4 x_GLF_color = float4(0.0f, 0.0f, 0.0f, 0.0f);
void main_1() {
float4 v = float4(0.0f, 0.0f, 0.0f, 0.0f);
int i = 0;
const int x_40 = asint(x_6[1].x);
const int x_43 = asint(x_6[2].x);
const int x_46 = asint(x_6[3].x);
const uint scalar_offset = ((16u * uint(0))) / 4;
const int x_49 = asint(x_6[scalar_offset / 4][scalar_offset % 4]);
v = float4(float(x_40), float(x_43), float(x_46), float(x_49));
const int x_53 = asint(x_6[4].x);
i = x_53;
while (true) {
const int x_58 = i;
const uint scalar_offset_1 = ((16u * uint(0))) / 4;
const int x_60 = asint(x_6[scalar_offset_1 / 4][scalar_offset_1 % 4]);
if ((x_58 < x_60)) {
} else {
break;
}
const float4 x_63 = v;
const float4 x_64 = v;
const float4 x_65 = v;
const float4 x_66 = v;
const int x_88 = i;
const uint scalar_offset_2 = ((16u * uint(0))) / 4;
const float x_92 = asfloat(x_9[scalar_offset_2 / 4][scalar_offset_2 % 4]);
if ((float4x4(float4(x_63.x, x_63.y, x_63.z, x_63.w), float4(x_64.x, x_64.y, x_64.z, x_64.w), float4(x_65.x, x_65.y, x_65.z, x_65.w), float4(x_66.x, x_66.y, x_66.z, x_66.w))[0u][x_88] > x_92)) {
const int x_96 = i;
const float4 x_97 = v;
const float x_99 = asfloat(x_9[1].x);
const uint scalar_offset_3 = ((16u * uint(0))) / 4;
const float x_102 = asfloat(x_9[scalar_offset_3 / 4][scalar_offset_3 % 4]);
const int x_106 = asint(x_6[1].x);
set_float4(v, x_96, clamp(x_97, float4(x_99, x_99, x_99, x_99), float4(x_102, x_102, x_102, x_102))[x_106]);
}
{
i = (i + 1);
}
}
const float4 x_111 = v;
const int x_113 = asint(x_6[1].x);
const float x_114 = float(x_113);
if (all((x_111 == float4(x_114, x_114, x_114, x_114)))) {
const int x_122 = asint(x_6[1].x);
const int x_125 = asint(x_6[4].x);
const int x_128 = asint(x_6[4].x);
const int x_131 = asint(x_6[1].x);
x_GLF_color = float4(float(x_122), float(x_125), float(x_128), float(x_131));
} else {
const int x_135 = asint(x_6[4].x);
const float x_136 = float(x_135);
x_GLF_color = float4(x_136, x_136, x_136, x_136);
}
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_3 = {x_GLF_color};
return tint_symbol_3;
}
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;
}

View File

@@ -1,97 +0,0 @@
#include <metal_stdlib>
using namespace metal;
struct tint_padded_array_element {
/* 0x0000 */ int el;
/* 0x0004 */ int8_t tint_pad[12];
};
struct tint_array_wrapper {
/* 0x0000 */ tint_padded_array_element arr[5];
};
struct buf1 {
/* 0x0000 */ tint_array_wrapper x_GLF_uniform_int_values;
};
struct tint_padded_array_element_1 {
/* 0x0000 */ float el;
/* 0x0004 */ int8_t tint_pad_1[12];
};
struct tint_array_wrapper_1 {
/* 0x0000 */ tint_padded_array_element_1 arr[2];
};
struct buf0 {
/* 0x0000 */ tint_array_wrapper_1 x_GLF_uniform_float_values;
};
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_3) {
float4 v = 0.0f;
int i = 0;
int const x_40 = x_6.x_GLF_uniform_int_values.arr[1].el;
int const x_43 = x_6.x_GLF_uniform_int_values.arr[2].el;
int const x_46 = x_6.x_GLF_uniform_int_values.arr[3].el;
int const x_49 = x_6.x_GLF_uniform_int_values.arr[0].el;
v = float4(float(x_40), float(x_43), float(x_46), float(x_49));
int const x_53 = x_6.x_GLF_uniform_int_values.arr[4].el;
i = x_53;
while (true) {
int const x_58 = i;
int const x_60 = x_6.x_GLF_uniform_int_values.arr[0].el;
if ((x_58 < x_60)) {
} else {
break;
}
float4 const x_63 = v;
float4 const x_64 = v;
float4 const x_65 = v;
float4 const x_66 = v;
int const x_88 = i;
float const x_92 = x_9.x_GLF_uniform_float_values.arr[0].el;
if ((float4x4(float4(x_63.x, x_63.y, x_63.z, x_63.w), float4(x_64.x, x_64.y, x_64.z, x_64.w), float4(x_65.x, x_65.y, x_65.z, x_65.w), float4(x_66.x, x_66.y, x_66.z, x_66.w))[0u][x_88] > x_92)) {
int const x_96 = i;
float4 const x_97 = v;
float const x_99 = x_9.x_GLF_uniform_float_values.arr[1].el;
float const x_102 = x_9.x_GLF_uniform_float_values.arr[0].el;
int const x_106 = x_6.x_GLF_uniform_int_values.arr[1].el;
v[x_96] = clamp(x_97, float4(x_99, x_99, x_99, x_99), float4(x_102, x_102, x_102, x_102))[x_106];
}
{
int const x_109 = i;
i = as_type<int>((as_type<uint>(x_109) + as_type<uint>(1)));
}
}
float4 const x_111 = v;
int const x_113 = x_6.x_GLF_uniform_int_values.arr[1].el;
float const x_114 = float(x_113);
if (all((x_111 == float4(x_114, x_114, x_114, x_114)))) {
int const x_122 = x_6.x_GLF_uniform_int_values.arr[1].el;
int const x_125 = x_6.x_GLF_uniform_int_values.arr[4].el;
int const x_128 = x_6.x_GLF_uniform_int_values.arr[4].el;
int const x_131 = x_6.x_GLF_uniform_int_values.arr[1].el;
*(tint_symbol_3) = float4(float(x_122), float(x_125), float(x_128), float(x_131));
} else {
int const x_135 = x_6.x_GLF_uniform_int_values.arr[4].el;
float const x_136 = float(x_135);
*(tint_symbol_3) = float4(x_136, x_136, x_136, x_136);
}
return;
}
main_out tint_symbol_inner(constant buf1& x_6, constant buf0& x_9, thread float4* const tint_symbol_4) {
main_1(x_6, x_9, 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 buf1& x_6 [[buffer(0)]], constant buf0& x_9 [[buffer(1)]]) {
thread float4 tint_symbol_5 = 0.0f;
main_out const inner_result = tint_symbol_inner(x_6, x_9, &(tint_symbol_5));
tint_symbol_1 wrapper_result = {};
wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1;
return wrapper_result;
}

View File

@@ -1,220 +0,0 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 154
; Schema: 0
OpCapability Shader
%109 = OpExtInstImport "GLSL.std.450"
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 %buf1 "buf1"
OpMemberName %buf1 0 "x_GLF_uniform_int_values"
OpName %x_6 "x_6"
OpName %buf0 "buf0"
OpMemberName %buf0 0 "x_GLF_uniform_float_values"
OpName %x_9 "x_9"
OpName %x_GLF_color "x_GLF_color"
OpName %main_1 "main_1"
OpName %v "v"
OpName %i "i"
OpName %main_out "main_out"
OpMemberName %main_out 0 "x_GLF_color_1"
OpName %main_inner "main_inner"
OpName %main "main"
OpDecorate %x_GLF_color_1_1 Location 0
OpDecorate %buf1 Block
OpMemberDecorate %buf1 0 Offset 0
OpDecorate %_arr_int_uint_5 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_float_uint_2 ArrayStride 16
OpDecorate %x_9 NonWritable
OpDecorate %x_9 DescriptorSet 0
OpDecorate %x_9 Binding 0
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
%int = OpTypeInt 32 1
%uint = OpTypeInt 32 0
%uint_5 = OpConstant %uint 5
%_arr_int_uint_5 = OpTypeArray %int %uint_5
%buf1 = OpTypeStruct %_arr_int_uint_5
%_ptr_Uniform_buf1 = OpTypePointer Uniform %buf1
%x_6 = OpVariable %_ptr_Uniform_buf1 Uniform
%uint_2 = OpConstant %uint 2
%_arr_float_uint_2 = OpTypeArray %float %uint_2
%buf0 = OpTypeStruct %_arr_float_uint_2
%_ptr_Uniform_buf0 = OpTypePointer Uniform %buf0
%x_9 = OpVariable %_ptr_Uniform_buf0 Uniform
%_ptr_Private_v4float = OpTypePointer Private %v4float
%x_GLF_color = OpVariable %_ptr_Private_v4float Private %5
%void = OpTypeVoid
%20 = OpTypeFunction %void
%_ptr_Function_v4float = OpTypePointer Function %v4float
%_ptr_Function_int = OpTypePointer Function %int
%28 = OpConstantNull %int
%uint_0 = OpConstant %uint 0
%int_1 = OpConstant %int 1
%_ptr_Uniform_int = OpTypePointer Uniform %int
%int_2 = OpConstant %int 2
%int_3 = OpConstant %int 3
%int_0 = OpConstant %int 0
%int_4 = OpConstant %int 4
%bool = OpTypeBool
%_ptr_Uniform_float = OpTypePointer Uniform %float
%mat4v4float = OpTypeMatrix %v4float 4
%_ptr_Function_float = OpTypePointer Function %float
%v4bool = OpTypeVector %bool 4
%main_out = OpTypeStruct %v4float
%143 = OpTypeFunction %main_out
%main_1 = OpFunction %void None %20
%23 = OpLabel
%v = OpVariable %_ptr_Function_v4float Function %5
%i = OpVariable %_ptr_Function_int Function %28
%32 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_1
%33 = OpLoad %int %32
%35 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_2
%36 = OpLoad %int %35
%38 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_3
%39 = OpLoad %int %38
%41 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_0
%42 = OpLoad %int %41
%43 = OpConvertSToF %float %33
%44 = OpConvertSToF %float %36
%45 = OpConvertSToF %float %39
%46 = OpConvertSToF %float %42
%47 = OpCompositeConstruct %v4float %43 %44 %45 %46
OpStore %v %47
%49 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_4
%50 = OpLoad %int %49
OpStore %i %50
OpBranch %51
%51 = OpLabel
OpLoopMerge %52 %53 None
OpBranch %54
%54 = OpLabel
%55 = OpLoad %int %i
%56 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_0
%57 = OpLoad %int %56
%58 = OpSLessThan %bool %55 %57
OpSelectionMerge %60 None
OpBranchConditional %58 %61 %62
%61 = OpLabel
OpBranch %60
%62 = OpLabel
OpBranch %52
%60 = OpLabel
%63 = OpLoad %v4float %v
%64 = OpLoad %v4float %v
%65 = OpLoad %v4float %v
%66 = OpLoad %v4float %v
%67 = OpLoad %int %i
%69 = OpAccessChain %_ptr_Uniform_float %x_9 %uint_0 %int_0
%70 = OpLoad %float %69
%72 = OpCompositeExtract %float %63 0
%73 = OpCompositeExtract %float %63 1
%74 = OpCompositeExtract %float %63 2
%75 = OpCompositeExtract %float %63 3
%76 = OpCompositeConstruct %v4float %72 %73 %74 %75
%77 = OpCompositeExtract %float %64 0
%78 = OpCompositeExtract %float %64 1
%79 = OpCompositeExtract %float %64 2
%80 = OpCompositeExtract %float %64 3
%81 = OpCompositeConstruct %v4float %77 %78 %79 %80
%82 = OpCompositeExtract %float %65 0
%83 = OpCompositeExtract %float %65 1
%84 = OpCompositeExtract %float %65 2
%85 = OpCompositeExtract %float %65 3
%86 = OpCompositeConstruct %v4float %82 %83 %84 %85
%87 = OpCompositeExtract %float %66 0
%88 = OpCompositeExtract %float %66 1
%89 = OpCompositeExtract %float %66 2
%90 = OpCompositeExtract %float %66 3
%91 = OpCompositeConstruct %v4float %87 %88 %89 %90
%92 = OpCompositeConstruct %mat4v4float %76 %81 %86 %91
%93 = OpCompositeExtract %v4float %92 0
%94 = OpVectorExtractDynamic %float %93 %67
%95 = OpFOrdGreaterThan %bool %94 %70
OpSelectionMerge %96 None
OpBranchConditional %95 %97 %96
%97 = OpLabel
%98 = OpLoad %int %i
%99 = OpLoad %v4float %v
%100 = OpAccessChain %_ptr_Uniform_float %x_9 %uint_0 %int_1
%101 = OpLoad %float %100
%102 = OpAccessChain %_ptr_Uniform_float %x_9 %uint_0 %int_0
%103 = OpLoad %float %102
%104 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_1
%105 = OpLoad %int %104
%107 = OpAccessChain %_ptr_Function_float %v %98
%110 = OpCompositeConstruct %v4float %101 %101 %101 %101
%111 = OpCompositeConstruct %v4float %103 %103 %103 %103
%108 = OpExtInst %v4float %109 NClamp %99 %110 %111
%112 = OpVectorExtractDynamic %float %108 %105
OpStore %107 %112
OpBranch %96
%96 = OpLabel
OpBranch %53
%53 = OpLabel
%113 = OpLoad %int %i
%114 = OpIAdd %int %113 %int_1
OpStore %i %114
OpBranch %51
%52 = OpLabel
%115 = OpLoad %v4float %v
%116 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_1
%117 = OpLoad %int %116
%118 = OpConvertSToF %float %117
%120 = OpCompositeConstruct %v4float %118 %118 %118 %118
%121 = OpFOrdEqual %v4bool %115 %120
%119 = OpAll %bool %121
OpSelectionMerge %123 None
OpBranchConditional %119 %124 %125
%124 = OpLabel
%126 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_1
%127 = OpLoad %int %126
%128 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_4
%129 = OpLoad %int %128
%130 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_4
%131 = OpLoad %int %130
%132 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_1
%133 = OpLoad %int %132
%134 = OpConvertSToF %float %127
%135 = OpConvertSToF %float %129
%136 = OpConvertSToF %float %131
%137 = OpConvertSToF %float %133
%138 = OpCompositeConstruct %v4float %134 %135 %136 %137
OpStore %x_GLF_color %138
OpBranch %123
%125 = OpLabel
%139 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_4
%140 = OpLoad %int %139
%141 = OpConvertSToF %float %140
%142 = OpCompositeConstruct %v4float %141 %141 %141 %141
OpStore %x_GLF_color %142
OpBranch %123
%123 = OpLabel
OpReturn
OpFunctionEnd
%main_inner = OpFunction %main_out None %143
%146 = OpLabel
%147 = OpFunctionCall %void %main_1
%148 = OpLoad %v4float %x_GLF_color
%149 = OpCompositeConstruct %main_out %148
OpReturnValue %149
OpFunctionEnd
%main = OpFunction %void None %20
%151 = OpLabel
%152 = OpFunctionCall %main_out %main_inner
%153 = OpCompositeExtract %v4float %152 0
OpStore %x_GLF_color_1_1 %153
OpReturn
OpFunctionEnd

View File

@@ -1,84 +0,0 @@
type Arr = [[stride(16)]] array<i32, 5>;
[[block]]
struct buf1 {
x_GLF_uniform_int_values : Arr;
};
type Arr_1 = [[stride(16)]] array<f32, 2>;
[[block]]
struct buf0 {
x_GLF_uniform_float_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 v : vec4<f32>;
var i : i32;
let x_40 : i32 = x_6.x_GLF_uniform_int_values[1];
let x_43 : i32 = x_6.x_GLF_uniform_int_values[2];
let x_46 : i32 = x_6.x_GLF_uniform_int_values[3];
let x_49 : i32 = x_6.x_GLF_uniform_int_values[0];
v = vec4<f32>(f32(x_40), f32(x_43), f32(x_46), f32(x_49));
let x_53 : i32 = x_6.x_GLF_uniform_int_values[4];
i = x_53;
loop {
let x_58 : i32 = i;
let x_60 : i32 = x_6.x_GLF_uniform_int_values[0];
if ((x_58 < x_60)) {
} else {
break;
}
let x_63 : vec4<f32> = v;
let x_64 : vec4<f32> = v;
let x_65 : vec4<f32> = v;
let x_66 : vec4<f32> = v;
let x_88 : i32 = i;
let x_92 : f32 = x_9.x_GLF_uniform_float_values[0];
if ((mat4x4<f32>(vec4<f32>(x_63.x, x_63.y, x_63.z, x_63.w), vec4<f32>(x_64.x, x_64.y, x_64.z, x_64.w), vec4<f32>(x_65.x, x_65.y, x_65.z, x_65.w), vec4<f32>(x_66.x, x_66.y, x_66.z, x_66.w))[0u][x_88] > x_92)) {
let x_96 : i32 = i;
let x_97 : vec4<f32> = v;
let x_99 : f32 = x_9.x_GLF_uniform_float_values[1];
let x_102 : f32 = x_9.x_GLF_uniform_float_values[0];
let x_106 : i32 = x_6.x_GLF_uniform_int_values[1];
v[x_96] = clamp(x_97, vec4<f32>(x_99, x_99, x_99, x_99), vec4<f32>(x_102, x_102, x_102, x_102))[x_106];
}
continuing {
let x_109 : i32 = i;
i = (x_109 + 1);
}
}
let x_111 : vec4<f32> = v;
let x_113 : i32 = x_6.x_GLF_uniform_int_values[1];
let x_114 : f32 = f32(x_113);
if (all((x_111 == vec4<f32>(x_114, x_114, x_114, x_114)))) {
let x_122 : i32 = x_6.x_GLF_uniform_int_values[1];
let x_125 : i32 = x_6.x_GLF_uniform_int_values[4];
let x_128 : i32 = x_6.x_GLF_uniform_int_values[4];
let x_131 : i32 = x_6.x_GLF_uniform_int_values[1];
x_GLF_color = vec4<f32>(f32(x_122), f32(x_125), f32(x_128), f32(x_131));
} else {
let x_135 : i32 = x_6.x_GLF_uniform_int_values[4];
let x_136 : f32 = f32(x_135);
x_GLF_color = vec4<f32>(x_136, x_136, x_136, x_136);
}
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);
}