mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-15 16:16:08 +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,71 +0,0 @@
|
||||
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() {
|
||||
int numbers[3] = (int[3])0;
|
||||
float2 a = float2(0.0f, 0.0f);
|
||||
float b = 0.0f;
|
||||
const uint scalar_offset = ((16u * uint(0))) / 4;
|
||||
const int x_38 = asint(x_6[scalar_offset / 4][scalar_offset % 4]);
|
||||
const uint scalar_offset_1 = ((16u * uint(0))) / 4;
|
||||
const int x_40 = asint(x_6[scalar_offset_1 / 4][scalar_offset_1 % 4]);
|
||||
numbers[x_38] = x_40;
|
||||
const int x_43 = asint(x_6[1].x);
|
||||
const int x_45 = asint(x_6[1].x);
|
||||
numbers[x_43] = x_45;
|
||||
const int x_48 = asint(x_6[2].x);
|
||||
const int x_50 = asint(x_6[2].x);
|
||||
numbers[x_48] = x_50;
|
||||
const uint scalar_offset_2 = ((16u * uint(0))) / 4;
|
||||
const int x_53 = asint(x_6[scalar_offset_2 / 4][scalar_offset_2 % 4]);
|
||||
const float x_56 = asfloat(x_9[2].x);
|
||||
const int x_60 = numbers[((0.0f < x_56) ? 1 : 2)];
|
||||
a = float2(float(x_53), float(x_60));
|
||||
const float2 x_63 = a;
|
||||
const float x_65 = asfloat(x_9[1].x);
|
||||
const float x_67 = asfloat(x_9[1].x);
|
||||
b = dot(x_63, float2(x_65, x_67));
|
||||
const float x_70 = b;
|
||||
const uint scalar_offset_3 = ((16u * uint(0))) / 4;
|
||||
const float x_72 = asfloat(x_9[scalar_offset_3 / 4][scalar_offset_3 % 4]);
|
||||
if ((x_70 == x_72)) {
|
||||
const int x_78 = asint(x_6[1].x);
|
||||
const uint scalar_offset_4 = ((16u * uint(0))) / 4;
|
||||
const int x_81 = asint(x_6[scalar_offset_4 / 4][scalar_offset_4 % 4]);
|
||||
const uint scalar_offset_5 = ((16u * uint(0))) / 4;
|
||||
const int x_84 = asint(x_6[scalar_offset_5 / 4][scalar_offset_5 % 4]);
|
||||
const int x_87 = asint(x_6[1].x);
|
||||
x_GLF_color = float4(float(x_78), float(x_81), float(x_84), float(x_87));
|
||||
} else {
|
||||
const uint scalar_offset_6 = ((16u * uint(0))) / 4;
|
||||
const int x_91 = asint(x_6[scalar_offset_6 / 4][scalar_offset_6 % 4]);
|
||||
const float x_92 = float(x_91);
|
||||
x_GLF_color = float4(x_92, x_92, x_92, x_92);
|
||||
}
|
||||
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;
|
||||
}
|
||||
@@ -1,84 +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[3];
|
||||
};
|
||||
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[3];
|
||||
};
|
||||
struct buf0 {
|
||||
/* 0x0000 */ tint_array_wrapper_1 x_GLF_uniform_float_values;
|
||||
};
|
||||
struct tint_array_wrapper_2 {
|
||||
int 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_3) {
|
||||
tint_array_wrapper_2 numbers = {};
|
||||
float2 a = 0.0f;
|
||||
float b = 0.0f;
|
||||
int const x_38 = x_6.x_GLF_uniform_int_values.arr[0].el;
|
||||
int const x_40 = x_6.x_GLF_uniform_int_values.arr[0].el;
|
||||
numbers.arr[x_38] = x_40;
|
||||
int const x_43 = x_6.x_GLF_uniform_int_values.arr[1].el;
|
||||
int const x_45 = x_6.x_GLF_uniform_int_values.arr[1].el;
|
||||
numbers.arr[x_43] = x_45;
|
||||
int const x_48 = x_6.x_GLF_uniform_int_values.arr[2].el;
|
||||
int const x_50 = x_6.x_GLF_uniform_int_values.arr[2].el;
|
||||
numbers.arr[x_48] = x_50;
|
||||
int const x_53 = x_6.x_GLF_uniform_int_values.arr[0].el;
|
||||
float const x_56 = x_9.x_GLF_uniform_float_values.arr[2].el;
|
||||
int const x_60 = numbers.arr[select(2, 1, (0.0f < x_56))];
|
||||
a = float2(float(x_53), float(x_60));
|
||||
float2 const x_63 = a;
|
||||
float const x_65 = x_9.x_GLF_uniform_float_values.arr[1].el;
|
||||
float const x_67 = x_9.x_GLF_uniform_float_values.arr[1].el;
|
||||
b = dot(x_63, float2(x_65, x_67));
|
||||
float const x_70 = b;
|
||||
float const x_72 = x_9.x_GLF_uniform_float_values.arr[0].el;
|
||||
if ((x_70 == x_72)) {
|
||||
int const x_78 = x_6.x_GLF_uniform_int_values.arr[1].el;
|
||||
int const x_81 = x_6.x_GLF_uniform_int_values.arr[0].el;
|
||||
int const x_84 = x_6.x_GLF_uniform_int_values.arr[0].el;
|
||||
int const x_87 = x_6.x_GLF_uniform_int_values.arr[1].el;
|
||||
*(tint_symbol_3) = float4(float(x_78), float(x_81), float(x_84), float(x_87));
|
||||
} else {
|
||||
int const x_91 = x_6.x_GLF_uniform_int_values.arr[0].el;
|
||||
float const x_92 = float(x_91);
|
||||
*(tint_symbol_3) = float4(x_92, x_92, x_92, x_92);
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -1,168 +0,0 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 111
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Fragment %main "main" %x_GLF_color_1_1
|
||||
OpExecutionMode %main OriginUpperLeft
|
||||
OpName %x_GLF_color_1_1 "x_GLF_color_1_1"
|
||||
OpName %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 %numbers "numbers"
|
||||
OpName %a "a"
|
||||
OpName %b "b"
|
||||
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_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_float_uint_3 ArrayStride 16
|
||||
OpDecorate %x_9 NonWritable
|
||||
OpDecorate %x_9 DescriptorSet 0
|
||||
OpDecorate %x_9 Binding 0
|
||||
OpDecorate %_arr_int_uint_3_0 ArrayStride 4
|
||||
OpMemberDecorate %main_out 0 Offset 0
|
||||
%float = OpTypeFloat 32
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%5 = OpConstantNull %v4float
|
||||
%x_GLF_color_1_1 = OpVariable %_ptr_Output_v4float Output %5
|
||||
%int = OpTypeInt 32 1
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_3 = OpConstant %uint 3
|
||||
%_arr_int_uint_3 = OpTypeArray %int %uint_3
|
||||
%buf1 = OpTypeStruct %_arr_int_uint_3
|
||||
%_ptr_Uniform_buf1 = OpTypePointer Uniform %buf1
|
||||
%x_6 = OpVariable %_ptr_Uniform_buf1 Uniform
|
||||
%_arr_float_uint_3 = OpTypeArray %float %uint_3
|
||||
%buf0 = OpTypeStruct %_arr_float_uint_3
|
||||
%_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
|
||||
%19 = OpTypeFunction %void
|
||||
%_arr_int_uint_3_0 = OpTypeArray %int %uint_3
|
||||
%_ptr_Function__arr_int_uint_3_0 = OpTypePointer Function %_arr_int_uint_3_0
|
||||
%26 = OpConstantNull %_arr_int_uint_3_0
|
||||
%v2float = OpTypeVector %float 2
|
||||
%_ptr_Function_v2float = OpTypePointer Function %v2float
|
||||
%30 = OpConstantNull %v2float
|
||||
%_ptr_Function_float = OpTypePointer Function %float
|
||||
%33 = OpConstantNull %float
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%int_0 = OpConstant %int 0
|
||||
%_ptr_Uniform_int = OpTypePointer Uniform %int
|
||||
%_ptr_Function_int = OpTypePointer Function %int
|
||||
%int_1 = OpConstant %int 1
|
||||
%int_2 = OpConstant %int 2
|
||||
%_ptr_Uniform_float = OpTypePointer Uniform %float
|
||||
%float_0 = OpConstant %float 0
|
||||
%bool = OpTypeBool
|
||||
%main_out = OpTypeStruct %v4float
|
||||
%100 = OpTypeFunction %main_out
|
||||
%main_1 = OpFunction %void None %19
|
||||
%22 = OpLabel
|
||||
%numbers = OpVariable %_ptr_Function__arr_int_uint_3_0 Function %26
|
||||
%a = OpVariable %_ptr_Function_v2float Function %30
|
||||
%b = OpVariable %_ptr_Function_float Function %33
|
||||
%37 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_0
|
||||
%38 = OpLoad %int %37
|
||||
%39 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_0
|
||||
%40 = OpLoad %int %39
|
||||
%42 = OpAccessChain %_ptr_Function_int %numbers %38
|
||||
OpStore %42 %40
|
||||
%44 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_1
|
||||
%45 = OpLoad %int %44
|
||||
%46 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_1
|
||||
%47 = OpLoad %int %46
|
||||
%48 = OpAccessChain %_ptr_Function_int %numbers %45
|
||||
OpStore %48 %47
|
||||
%50 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_2
|
||||
%51 = OpLoad %int %50
|
||||
%52 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_2
|
||||
%53 = OpLoad %int %52
|
||||
%54 = OpAccessChain %_ptr_Function_int %numbers %51
|
||||
OpStore %54 %53
|
||||
%55 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_0
|
||||
%56 = OpLoad %int %55
|
||||
%58 = OpAccessChain %_ptr_Uniform_float %x_9 %uint_0 %int_2
|
||||
%59 = OpLoad %float %58
|
||||
%62 = OpFOrdLessThan %bool %float_0 %59
|
||||
%60 = OpSelect %int %62 %int_1 %int_2
|
||||
%64 = OpAccessChain %_ptr_Function_int %numbers %60
|
||||
%65 = OpLoad %int %64
|
||||
%66 = OpConvertSToF %float %56
|
||||
%67 = OpConvertSToF %float %65
|
||||
%68 = OpCompositeConstruct %v2float %66 %67
|
||||
OpStore %a %68
|
||||
%69 = OpLoad %v2float %a
|
||||
%70 = OpAccessChain %_ptr_Uniform_float %x_9 %uint_0 %int_1
|
||||
%71 = OpLoad %float %70
|
||||
%72 = OpAccessChain %_ptr_Uniform_float %x_9 %uint_0 %int_1
|
||||
%73 = OpLoad %float %72
|
||||
%75 = OpCompositeConstruct %v2float %71 %73
|
||||
%74 = OpDot %float %69 %75
|
||||
OpStore %b %74
|
||||
%76 = OpLoad %float %b
|
||||
%77 = OpAccessChain %_ptr_Uniform_float %x_9 %uint_0 %int_0
|
||||
%78 = OpLoad %float %77
|
||||
%79 = OpFOrdEqual %bool %76 %78
|
||||
OpSelectionMerge %80 None
|
||||
OpBranchConditional %79 %81 %82
|
||||
%81 = OpLabel
|
||||
%83 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_1
|
||||
%84 = OpLoad %int %83
|
||||
%85 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_0
|
||||
%86 = OpLoad %int %85
|
||||
%87 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_0
|
||||
%88 = OpLoad %int %87
|
||||
%89 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_1
|
||||
%90 = OpLoad %int %89
|
||||
%91 = OpConvertSToF %float %84
|
||||
%92 = OpConvertSToF %float %86
|
||||
%93 = OpConvertSToF %float %88
|
||||
%94 = OpConvertSToF %float %90
|
||||
%95 = OpCompositeConstruct %v4float %91 %92 %93 %94
|
||||
OpStore %x_GLF_color %95
|
||||
OpBranch %80
|
||||
%82 = OpLabel
|
||||
%96 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_0
|
||||
%97 = OpLoad %int %96
|
||||
%98 = OpConvertSToF %float %97
|
||||
%99 = OpCompositeConstruct %v4float %98 %98 %98 %98
|
||||
OpStore %x_GLF_color %99
|
||||
OpBranch %80
|
||||
%80 = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%main_inner = OpFunction %main_out None %100
|
||||
%103 = OpLabel
|
||||
%104 = OpFunctionCall %void %main_1
|
||||
%105 = OpLoad %v4float %x_GLF_color
|
||||
%106 = OpCompositeConstruct %main_out %105
|
||||
OpReturnValue %106
|
||||
OpFunctionEnd
|
||||
%main = OpFunction %void None %19
|
||||
%108 = OpLabel
|
||||
%109 = OpFunctionCall %main_out %main_inner
|
||||
%110 = OpCompositeExtract %v4float %109 0
|
||||
OpStore %x_GLF_color_1_1 %110
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -1,67 +0,0 @@
|
||||
type Arr = [[stride(16)]] array<i32, 3>;
|
||||
|
||||
[[block]]
|
||||
struct buf1 {
|
||||
x_GLF_uniform_int_values : Arr;
|
||||
};
|
||||
|
||||
type Arr_1 = [[stride(16)]] array<f32, 3>;
|
||||
|
||||
[[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 numbers : array<i32, 3>;
|
||||
var a : vec2<f32>;
|
||||
var b : f32;
|
||||
let x_38 : i32 = x_6.x_GLF_uniform_int_values[0];
|
||||
let x_40 : i32 = x_6.x_GLF_uniform_int_values[0];
|
||||
numbers[x_38] = x_40;
|
||||
let x_43 : i32 = x_6.x_GLF_uniform_int_values[1];
|
||||
let x_45 : i32 = x_6.x_GLF_uniform_int_values[1];
|
||||
numbers[x_43] = x_45;
|
||||
let x_48 : i32 = x_6.x_GLF_uniform_int_values[2];
|
||||
let x_50 : i32 = x_6.x_GLF_uniform_int_values[2];
|
||||
numbers[x_48] = x_50;
|
||||
let x_53 : i32 = x_6.x_GLF_uniform_int_values[0];
|
||||
let x_56 : f32 = x_9.x_GLF_uniform_float_values[2];
|
||||
let x_60 : i32 = numbers[select(2, 1, (0.0 < x_56))];
|
||||
a = vec2<f32>(f32(x_53), f32(x_60));
|
||||
let x_63 : vec2<f32> = a;
|
||||
let x_65 : f32 = x_9.x_GLF_uniform_float_values[1];
|
||||
let x_67 : f32 = x_9.x_GLF_uniform_float_values[1];
|
||||
b = dot(x_63, vec2<f32>(x_65, x_67));
|
||||
let x_70 : f32 = b;
|
||||
let x_72 : f32 = x_9.x_GLF_uniform_float_values[0];
|
||||
if ((x_70 == x_72)) {
|
||||
let x_78 : i32 = x_6.x_GLF_uniform_int_values[1];
|
||||
let x_81 : i32 = x_6.x_GLF_uniform_int_values[0];
|
||||
let x_84 : i32 = x_6.x_GLF_uniform_int_values[0];
|
||||
let x_87 : i32 = x_6.x_GLF_uniform_int_values[1];
|
||||
x_GLF_color = vec4<f32>(f32(x_78), f32(x_81), f32(x_84), f32(x_87));
|
||||
} else {
|
||||
let x_91 : i32 = x_6.x_GLF_uniform_int_values[0];
|
||||
let x_92 : f32 = f32(x_91);
|
||||
x_GLF_color = vec4<f32>(x_92, x_92, x_92, x_92);
|
||||
}
|
||||
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);
|
||||
}
|
||||
@@ -1,71 +0,0 @@
|
||||
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() {
|
||||
int numbers[3] = (int[3])0;
|
||||
float2 a = float2(0.0f, 0.0f);
|
||||
float b = 0.0f;
|
||||
const uint scalar_offset = ((16u * uint(0))) / 4;
|
||||
const int x_38 = asint(x_6[scalar_offset / 4][scalar_offset % 4]);
|
||||
const uint scalar_offset_1 = ((16u * uint(0))) / 4;
|
||||
const int x_40 = asint(x_6[scalar_offset_1 / 4][scalar_offset_1 % 4]);
|
||||
numbers[x_38] = x_40;
|
||||
const int x_43 = asint(x_6[1].x);
|
||||
const int x_45 = asint(x_6[1].x);
|
||||
numbers[x_43] = x_45;
|
||||
const int x_48 = asint(x_6[2].x);
|
||||
const int x_50 = asint(x_6[2].x);
|
||||
numbers[x_48] = x_50;
|
||||
const uint scalar_offset_2 = ((16u * uint(0))) / 4;
|
||||
const int x_53 = asint(x_6[scalar_offset_2 / 4][scalar_offset_2 % 4]);
|
||||
const float x_56 = asfloat(x_9[2].x);
|
||||
const int x_60 = numbers[((0.0f < x_56) ? 1 : 2)];
|
||||
a = float2(float(x_53), float(x_60));
|
||||
const float2 x_63 = a;
|
||||
const float x_65 = asfloat(x_9[1].x);
|
||||
const float x_67 = asfloat(x_9[1].x);
|
||||
b = dot(x_63, float2(x_65, x_67));
|
||||
const float x_70 = b;
|
||||
const uint scalar_offset_3 = ((16u * uint(0))) / 4;
|
||||
const float x_72 = asfloat(x_9[scalar_offset_3 / 4][scalar_offset_3 % 4]);
|
||||
if ((x_70 == x_72)) {
|
||||
const int x_78 = asint(x_6[1].x);
|
||||
const uint scalar_offset_4 = ((16u * uint(0))) / 4;
|
||||
const int x_81 = asint(x_6[scalar_offset_4 / 4][scalar_offset_4 % 4]);
|
||||
const uint scalar_offset_5 = ((16u * uint(0))) / 4;
|
||||
const int x_84 = asint(x_6[scalar_offset_5 / 4][scalar_offset_5 % 4]);
|
||||
const int x_87 = asint(x_6[1].x);
|
||||
x_GLF_color = float4(float(x_78), float(x_81), float(x_84), float(x_87));
|
||||
} else {
|
||||
const uint scalar_offset_6 = ((16u * uint(0))) / 4;
|
||||
const int x_91 = asint(x_6[scalar_offset_6 / 4][scalar_offset_6 % 4]);
|
||||
const float x_92 = float(x_91);
|
||||
x_GLF_color = float4(x_92, x_92, x_92, x_92);
|
||||
}
|
||||
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;
|
||||
}
|
||||
@@ -1,84 +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[3];
|
||||
};
|
||||
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[3];
|
||||
};
|
||||
struct buf0 {
|
||||
/* 0x0000 */ tint_array_wrapper_1 x_GLF_uniform_float_values;
|
||||
};
|
||||
struct tint_array_wrapper_2 {
|
||||
int 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_3) {
|
||||
tint_array_wrapper_2 numbers = {};
|
||||
float2 a = 0.0f;
|
||||
float b = 0.0f;
|
||||
int const x_38 = x_6.x_GLF_uniform_int_values.arr[0].el;
|
||||
int const x_40 = x_6.x_GLF_uniform_int_values.arr[0].el;
|
||||
numbers.arr[x_38] = x_40;
|
||||
int const x_43 = x_6.x_GLF_uniform_int_values.arr[1].el;
|
||||
int const x_45 = x_6.x_GLF_uniform_int_values.arr[1].el;
|
||||
numbers.arr[x_43] = x_45;
|
||||
int const x_48 = x_6.x_GLF_uniform_int_values.arr[2].el;
|
||||
int const x_50 = x_6.x_GLF_uniform_int_values.arr[2].el;
|
||||
numbers.arr[x_48] = x_50;
|
||||
int const x_53 = x_6.x_GLF_uniform_int_values.arr[0].el;
|
||||
float const x_56 = x_9.x_GLF_uniform_float_values.arr[2].el;
|
||||
int const x_60 = numbers.arr[select(2, 1, (0.0f < x_56))];
|
||||
a = float2(float(x_53), float(x_60));
|
||||
float2 const x_63 = a;
|
||||
float const x_65 = x_9.x_GLF_uniform_float_values.arr[1].el;
|
||||
float const x_67 = x_9.x_GLF_uniform_float_values.arr[1].el;
|
||||
b = dot(x_63, float2(x_65, x_67));
|
||||
float const x_70 = b;
|
||||
float const x_72 = x_9.x_GLF_uniform_float_values.arr[0].el;
|
||||
if ((x_70 == x_72)) {
|
||||
int const x_78 = x_6.x_GLF_uniform_int_values.arr[1].el;
|
||||
int const x_81 = x_6.x_GLF_uniform_int_values.arr[0].el;
|
||||
int const x_84 = x_6.x_GLF_uniform_int_values.arr[0].el;
|
||||
int const x_87 = x_6.x_GLF_uniform_int_values.arr[1].el;
|
||||
*(tint_symbol_3) = float4(float(x_78), float(x_81), float(x_84), float(x_87));
|
||||
} else {
|
||||
int const x_91 = x_6.x_GLF_uniform_int_values.arr[0].el;
|
||||
float const x_92 = float(x_91);
|
||||
*(tint_symbol_3) = float4(x_92, x_92, x_92, x_92);
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -1,168 +0,0 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 111
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Fragment %main "main" %x_GLF_color_1_1
|
||||
OpExecutionMode %main OriginUpperLeft
|
||||
OpName %x_GLF_color_1_1 "x_GLF_color_1_1"
|
||||
OpName %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 %numbers "numbers"
|
||||
OpName %a "a"
|
||||
OpName %b "b"
|
||||
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_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_float_uint_3 ArrayStride 16
|
||||
OpDecorate %x_9 NonWritable
|
||||
OpDecorate %x_9 DescriptorSet 0
|
||||
OpDecorate %x_9 Binding 0
|
||||
OpDecorate %_arr_int_uint_3_0 ArrayStride 4
|
||||
OpMemberDecorate %main_out 0 Offset 0
|
||||
%float = OpTypeFloat 32
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%5 = OpConstantNull %v4float
|
||||
%x_GLF_color_1_1 = OpVariable %_ptr_Output_v4float Output %5
|
||||
%int = OpTypeInt 32 1
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_3 = OpConstant %uint 3
|
||||
%_arr_int_uint_3 = OpTypeArray %int %uint_3
|
||||
%buf1 = OpTypeStruct %_arr_int_uint_3
|
||||
%_ptr_Uniform_buf1 = OpTypePointer Uniform %buf1
|
||||
%x_6 = OpVariable %_ptr_Uniform_buf1 Uniform
|
||||
%_arr_float_uint_3 = OpTypeArray %float %uint_3
|
||||
%buf0 = OpTypeStruct %_arr_float_uint_3
|
||||
%_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
|
||||
%19 = OpTypeFunction %void
|
||||
%_arr_int_uint_3_0 = OpTypeArray %int %uint_3
|
||||
%_ptr_Function__arr_int_uint_3_0 = OpTypePointer Function %_arr_int_uint_3_0
|
||||
%26 = OpConstantNull %_arr_int_uint_3_0
|
||||
%v2float = OpTypeVector %float 2
|
||||
%_ptr_Function_v2float = OpTypePointer Function %v2float
|
||||
%30 = OpConstantNull %v2float
|
||||
%_ptr_Function_float = OpTypePointer Function %float
|
||||
%33 = OpConstantNull %float
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%int_0 = OpConstant %int 0
|
||||
%_ptr_Uniform_int = OpTypePointer Uniform %int
|
||||
%_ptr_Function_int = OpTypePointer Function %int
|
||||
%int_1 = OpConstant %int 1
|
||||
%int_2 = OpConstant %int 2
|
||||
%_ptr_Uniform_float = OpTypePointer Uniform %float
|
||||
%float_0 = OpConstant %float 0
|
||||
%bool = OpTypeBool
|
||||
%main_out = OpTypeStruct %v4float
|
||||
%100 = OpTypeFunction %main_out
|
||||
%main_1 = OpFunction %void None %19
|
||||
%22 = OpLabel
|
||||
%numbers = OpVariable %_ptr_Function__arr_int_uint_3_0 Function %26
|
||||
%a = OpVariable %_ptr_Function_v2float Function %30
|
||||
%b = OpVariable %_ptr_Function_float Function %33
|
||||
%37 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_0
|
||||
%38 = OpLoad %int %37
|
||||
%39 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_0
|
||||
%40 = OpLoad %int %39
|
||||
%42 = OpAccessChain %_ptr_Function_int %numbers %38
|
||||
OpStore %42 %40
|
||||
%44 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_1
|
||||
%45 = OpLoad %int %44
|
||||
%46 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_1
|
||||
%47 = OpLoad %int %46
|
||||
%48 = OpAccessChain %_ptr_Function_int %numbers %45
|
||||
OpStore %48 %47
|
||||
%50 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_2
|
||||
%51 = OpLoad %int %50
|
||||
%52 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_2
|
||||
%53 = OpLoad %int %52
|
||||
%54 = OpAccessChain %_ptr_Function_int %numbers %51
|
||||
OpStore %54 %53
|
||||
%55 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_0
|
||||
%56 = OpLoad %int %55
|
||||
%58 = OpAccessChain %_ptr_Uniform_float %x_9 %uint_0 %int_2
|
||||
%59 = OpLoad %float %58
|
||||
%62 = OpFOrdLessThan %bool %float_0 %59
|
||||
%60 = OpSelect %int %62 %int_1 %int_2
|
||||
%64 = OpAccessChain %_ptr_Function_int %numbers %60
|
||||
%65 = OpLoad %int %64
|
||||
%66 = OpConvertSToF %float %56
|
||||
%67 = OpConvertSToF %float %65
|
||||
%68 = OpCompositeConstruct %v2float %66 %67
|
||||
OpStore %a %68
|
||||
%69 = OpLoad %v2float %a
|
||||
%70 = OpAccessChain %_ptr_Uniform_float %x_9 %uint_0 %int_1
|
||||
%71 = OpLoad %float %70
|
||||
%72 = OpAccessChain %_ptr_Uniform_float %x_9 %uint_0 %int_1
|
||||
%73 = OpLoad %float %72
|
||||
%75 = OpCompositeConstruct %v2float %71 %73
|
||||
%74 = OpDot %float %69 %75
|
||||
OpStore %b %74
|
||||
%76 = OpLoad %float %b
|
||||
%77 = OpAccessChain %_ptr_Uniform_float %x_9 %uint_0 %int_0
|
||||
%78 = OpLoad %float %77
|
||||
%79 = OpFOrdEqual %bool %76 %78
|
||||
OpSelectionMerge %80 None
|
||||
OpBranchConditional %79 %81 %82
|
||||
%81 = OpLabel
|
||||
%83 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_1
|
||||
%84 = OpLoad %int %83
|
||||
%85 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_0
|
||||
%86 = OpLoad %int %85
|
||||
%87 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_0
|
||||
%88 = OpLoad %int %87
|
||||
%89 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_1
|
||||
%90 = OpLoad %int %89
|
||||
%91 = OpConvertSToF %float %84
|
||||
%92 = OpConvertSToF %float %86
|
||||
%93 = OpConvertSToF %float %88
|
||||
%94 = OpConvertSToF %float %90
|
||||
%95 = OpCompositeConstruct %v4float %91 %92 %93 %94
|
||||
OpStore %x_GLF_color %95
|
||||
OpBranch %80
|
||||
%82 = OpLabel
|
||||
%96 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_0
|
||||
%97 = OpLoad %int %96
|
||||
%98 = OpConvertSToF %float %97
|
||||
%99 = OpCompositeConstruct %v4float %98 %98 %98 %98
|
||||
OpStore %x_GLF_color %99
|
||||
OpBranch %80
|
||||
%80 = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%main_inner = OpFunction %main_out None %100
|
||||
%103 = OpLabel
|
||||
%104 = OpFunctionCall %void %main_1
|
||||
%105 = OpLoad %v4float %x_GLF_color
|
||||
%106 = OpCompositeConstruct %main_out %105
|
||||
OpReturnValue %106
|
||||
OpFunctionEnd
|
||||
%main = OpFunction %void None %19
|
||||
%108 = OpLabel
|
||||
%109 = OpFunctionCall %main_out %main_inner
|
||||
%110 = OpCompositeExtract %v4float %109 0
|
||||
OpStore %x_GLF_color_1_1 %110
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -1,67 +0,0 @@
|
||||
type Arr = [[stride(16)]] array<i32, 3>;
|
||||
|
||||
[[block]]
|
||||
struct buf1 {
|
||||
x_GLF_uniform_int_values : Arr;
|
||||
};
|
||||
|
||||
type Arr_1 = [[stride(16)]] array<f32, 3>;
|
||||
|
||||
[[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 numbers : array<i32, 3>;
|
||||
var a : vec2<f32>;
|
||||
var b : f32;
|
||||
let x_38 : i32 = x_6.x_GLF_uniform_int_values[0];
|
||||
let x_40 : i32 = x_6.x_GLF_uniform_int_values[0];
|
||||
numbers[x_38] = x_40;
|
||||
let x_43 : i32 = x_6.x_GLF_uniform_int_values[1];
|
||||
let x_45 : i32 = x_6.x_GLF_uniform_int_values[1];
|
||||
numbers[x_43] = x_45;
|
||||
let x_48 : i32 = x_6.x_GLF_uniform_int_values[2];
|
||||
let x_50 : i32 = x_6.x_GLF_uniform_int_values[2];
|
||||
numbers[x_48] = x_50;
|
||||
let x_53 : i32 = x_6.x_GLF_uniform_int_values[0];
|
||||
let x_56 : f32 = x_9.x_GLF_uniform_float_values[2];
|
||||
let x_60 : i32 = numbers[select(2, 1, (0.0 < x_56))];
|
||||
a = vec2<f32>(f32(x_53), f32(x_60));
|
||||
let x_63 : vec2<f32> = a;
|
||||
let x_65 : f32 = x_9.x_GLF_uniform_float_values[1];
|
||||
let x_67 : f32 = x_9.x_GLF_uniform_float_values[1];
|
||||
b = dot(x_63, vec2<f32>(x_65, x_67));
|
||||
let x_70 : f32 = b;
|
||||
let x_72 : f32 = x_9.x_GLF_uniform_float_values[0];
|
||||
if ((x_70 == x_72)) {
|
||||
let x_78 : i32 = x_6.x_GLF_uniform_int_values[1];
|
||||
let x_81 : i32 = x_6.x_GLF_uniform_int_values[0];
|
||||
let x_84 : i32 = x_6.x_GLF_uniform_int_values[0];
|
||||
let x_87 : i32 = x_6.x_GLF_uniform_int_values[1];
|
||||
x_GLF_color = vec4<f32>(f32(x_78), f32(x_81), f32(x_84), f32(x_87));
|
||||
} else {
|
||||
let x_91 : i32 = x_6.x_GLF_uniform_int_values[0];
|
||||
let x_92 : f32 = f32(x_91);
|
||||
x_GLF_color = vec4<f32>(x_92, x_92, x_92, x_92);
|
||||
}
|
||||
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);
|
||||
}
|
||||
Reference in New Issue
Block a user