mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-13 15:16:16 +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,88 +0,0 @@
|
||||
SKIP: FAILED
|
||||
|
||||
struct S {
|
||||
float numbers[3];
|
||||
};
|
||||
|
||||
cbuffer cbuffer_x_7 : register(b1, space0) {
|
||||
uint4 x_7[5];
|
||||
};
|
||||
cbuffer cbuffer_x_9 : register(b2, space0) {
|
||||
uint4 x_9[1];
|
||||
};
|
||||
cbuffer cbuffer_x_12 : register(b3, space0) {
|
||||
uint4 x_12[1];
|
||||
};
|
||||
cbuffer cbuffer_x_15 : register(b0, space0) {
|
||||
uint4 x_15[2];
|
||||
};
|
||||
static float4 x_GLF_color = float4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
|
||||
void main_1() {
|
||||
S obj = (S)0;
|
||||
float a = 0.0f;
|
||||
float2 x_49 = float2(0.0f, 0.0f);
|
||||
float b = 0.0f;
|
||||
const float x_51 = asfloat(x_7[3].x);
|
||||
const float x_53 = asfloat(x_7[2].x);
|
||||
const float x_55 = asfloat(x_7[4].x);
|
||||
const float tint_symbol_7[3] = {x_51, x_53, x_55};
|
||||
const S tint_symbol_8 = {tint_symbol_7};
|
||||
obj = tint_symbol_8;
|
||||
const float x_59 = asfloat(x_9[0].x);
|
||||
const uint scalar_offset = ((16u * uint(0))) / 4;
|
||||
const float x_62 = asfloat(x_7[scalar_offset / 4][scalar_offset % 4]);
|
||||
obj.numbers[int(x_59)] = x_62;
|
||||
const float x_65 = asfloat(x_9[0].x);
|
||||
const uint scalar_offset_1 = ((16u * uint(0))) / 4;
|
||||
const float x_67 = asfloat(x_7[scalar_offset_1 / 4][scalar_offset_1 % 4]);
|
||||
if ((x_65 > x_67)) {
|
||||
const float2 x_73 = asfloat(x_9[0].xy);
|
||||
x_49 = x_73;
|
||||
} else {
|
||||
const float2 x_75 = asfloat(x_12[0].xy);
|
||||
x_49 = x_75;
|
||||
}
|
||||
const float x_77 = x_49.y;
|
||||
a = x_77;
|
||||
const uint scalar_offset_2 = ((16u * uint(0))) / 4;
|
||||
const float x_79 = asfloat(x_7[scalar_offset_2 / 4][scalar_offset_2 % 4]);
|
||||
const float x_80 = a;
|
||||
const uint scalar_offset_3 = ((16u * uint(0))) / 4;
|
||||
const int x_82 = asint(x_15[scalar_offset_3 / 4][scalar_offset_3 % 4]);
|
||||
const float x_84 = obj.numbers[x_82];
|
||||
b = lerp(x_79, x_80, x_84);
|
||||
const float x_86 = b;
|
||||
const float x_88 = asfloat(x_7[2].x);
|
||||
const float x_91 = asfloat(x_7[1].x);
|
||||
if ((distance(x_86, x_88) < x_91)) {
|
||||
const uint scalar_offset_4 = ((16u * uint(0))) / 4;
|
||||
const int x_97 = asint(x_15[scalar_offset_4 / 4][scalar_offset_4 % 4]);
|
||||
const int x_100 = asint(x_15[1].x);
|
||||
const int x_103 = asint(x_15[1].x);
|
||||
const uint scalar_offset_5 = ((16u * uint(0))) / 4;
|
||||
const int x_106 = asint(x_15[scalar_offset_5 / 4][scalar_offset_5 % 4]);
|
||||
x_GLF_color = float4(float(x_97), float(x_100), float(x_103), float(x_106));
|
||||
} else {
|
||||
const int x_110 = asint(x_15[1].x);
|
||||
const float x_111 = float(x_110);
|
||||
x_GLF_color = float4(x_111, x_111, x_111, x_111);
|
||||
}
|
||||
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_9 = {tint_symbol_1.x_GLF_color_1};
|
||||
return tint_symbol_9;
|
||||
}
|
||||
C:\src\tint\test\Shader@0x0000022951B91F60(33,3-24): error X3500: array reference cannot be used as an l-value; not natively addressable
|
||||
|
||||
@@ -1,103 +0,0 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct tint_array_wrapper {
|
||||
float arr[3];
|
||||
};
|
||||
struct S {
|
||||
tint_array_wrapper numbers;
|
||||
};
|
||||
struct tint_padded_array_element {
|
||||
/* 0x0000 */ float el;
|
||||
/* 0x0004 */ int8_t tint_pad[12];
|
||||
};
|
||||
struct tint_array_wrapper_1 {
|
||||
/* 0x0000 */ tint_padded_array_element arr[5];
|
||||
};
|
||||
struct buf1 {
|
||||
/* 0x0000 */ tint_array_wrapper_1 x_GLF_uniform_float_values;
|
||||
};
|
||||
struct buf2 {
|
||||
/* 0x0000 */ float2 zeroVec;
|
||||
};
|
||||
struct buf3 {
|
||||
/* 0x0000 */ float2 oneVec;
|
||||
};
|
||||
struct tint_padded_array_element_1 {
|
||||
/* 0x0000 */ int el;
|
||||
/* 0x0004 */ int8_t tint_pad_1[12];
|
||||
};
|
||||
struct tint_array_wrapper_2 {
|
||||
/* 0x0000 */ tint_padded_array_element_1 arr[2];
|
||||
};
|
||||
struct buf0 {
|
||||
/* 0x0000 */ tint_array_wrapper_2 x_GLF_uniform_int_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_7, constant buf2& x_9, constant buf3& x_12, constant buf0& x_15, thread float4* const tint_symbol_5) {
|
||||
S obj = {};
|
||||
float a = 0.0f;
|
||||
float2 x_49 = 0.0f;
|
||||
float b = 0.0f;
|
||||
float const x_51 = x_7.x_GLF_uniform_float_values.arr[3].el;
|
||||
float const x_53 = x_7.x_GLF_uniform_float_values.arr[2].el;
|
||||
float const x_55 = x_7.x_GLF_uniform_float_values.arr[4].el;
|
||||
tint_array_wrapper const tint_symbol_2 = {.arr={x_51, x_53, x_55}};
|
||||
S const tint_symbol_3 = {.numbers=tint_symbol_2};
|
||||
obj = tint_symbol_3;
|
||||
float const x_59 = x_9.zeroVec.x;
|
||||
float const x_62 = x_7.x_GLF_uniform_float_values.arr[0].el;
|
||||
obj.numbers.arr[int(x_59)] = x_62;
|
||||
float const x_65 = x_9.zeroVec.x;
|
||||
float const x_67 = x_7.x_GLF_uniform_float_values.arr[0].el;
|
||||
if ((x_65 > x_67)) {
|
||||
float2 const x_73 = x_9.zeroVec;
|
||||
x_49 = x_73;
|
||||
} else {
|
||||
float2 const x_75 = x_12.oneVec;
|
||||
x_49 = x_75;
|
||||
}
|
||||
float const x_77 = x_49.y;
|
||||
a = x_77;
|
||||
float const x_79 = x_7.x_GLF_uniform_float_values.arr[0].el;
|
||||
float const x_80 = a;
|
||||
int const x_82 = x_15.x_GLF_uniform_int_values.arr[0].el;
|
||||
float const x_84 = obj.numbers.arr[x_82];
|
||||
b = mix(x_79, x_80, x_84);
|
||||
float const x_86 = b;
|
||||
float const x_88 = x_7.x_GLF_uniform_float_values.arr[2].el;
|
||||
float const x_91 = x_7.x_GLF_uniform_float_values.arr[1].el;
|
||||
if ((fabs(x_86 - x_88) < x_91)) {
|
||||
int const x_97 = x_15.x_GLF_uniform_int_values.arr[0].el;
|
||||
int const x_100 = x_15.x_GLF_uniform_int_values.arr[1].el;
|
||||
int const x_103 = x_15.x_GLF_uniform_int_values.arr[1].el;
|
||||
int const x_106 = x_15.x_GLF_uniform_int_values.arr[0].el;
|
||||
*(tint_symbol_5) = float4(float(x_97), float(x_100), float(x_103), float(x_106));
|
||||
} else {
|
||||
int const x_110 = x_15.x_GLF_uniform_int_values.arr[1].el;
|
||||
float const x_111 = float(x_110);
|
||||
*(tint_symbol_5) = float4(x_111, x_111, x_111, x_111);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
main_out tint_symbol_inner(constant buf1& x_7, constant buf2& x_9, constant buf3& x_12, constant buf0& x_15, thread float4* const tint_symbol_6) {
|
||||
main_1(x_7, x_9, x_12, x_15, tint_symbol_6);
|
||||
main_out const tint_symbol_4 = {.x_GLF_color_1=*(tint_symbol_6)};
|
||||
return tint_symbol_4;
|
||||
}
|
||||
|
||||
fragment tint_symbol_1 tint_symbol(constant buf1& x_7 [[buffer(0)]], constant buf2& x_9 [[buffer(1)]], constant buf3& x_12 [[buffer(2)]], constant buf0& x_15 [[buffer(3)]]) {
|
||||
thread float4 tint_symbol_7 = 0.0f;
|
||||
main_out const inner_result = tint_symbol_inner(x_7, x_9, x_12, x_15, &(tint_symbol_7));
|
||||
tint_symbol_1 wrapper_result = {};
|
||||
wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1;
|
||||
return wrapper_result;
|
||||
}
|
||||
|
||||
@@ -1,212 +0,0 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 130
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
%90 = 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_float_values"
|
||||
OpName %x_7 "x_7"
|
||||
OpName %buf2 "buf2"
|
||||
OpMemberName %buf2 0 "zeroVec"
|
||||
OpName %x_9 "x_9"
|
||||
OpName %buf3 "buf3"
|
||||
OpMemberName %buf3 0 "oneVec"
|
||||
OpName %x_12 "x_12"
|
||||
OpName %buf0 "buf0"
|
||||
OpMemberName %buf0 0 "x_GLF_uniform_int_values"
|
||||
OpName %x_15 "x_15"
|
||||
OpName %x_GLF_color "x_GLF_color"
|
||||
OpName %main_1 "main_1"
|
||||
OpName %S "S"
|
||||
OpMemberName %S 0 "numbers"
|
||||
OpName %obj "obj"
|
||||
OpName %a "a"
|
||||
OpName %x_49 "x_49"
|
||||
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_float_uint_5 ArrayStride 16
|
||||
OpDecorate %x_7 NonWritable
|
||||
OpDecorate %x_7 DescriptorSet 0
|
||||
OpDecorate %x_7 Binding 1
|
||||
OpDecorate %buf2 Block
|
||||
OpMemberDecorate %buf2 0 Offset 0
|
||||
OpDecorate %x_9 NonWritable
|
||||
OpDecorate %x_9 DescriptorSet 0
|
||||
OpDecorate %x_9 Binding 2
|
||||
OpDecorate %buf3 Block
|
||||
OpMemberDecorate %buf3 0 Offset 0
|
||||
OpDecorate %x_12 NonWritable
|
||||
OpDecorate %x_12 DescriptorSet 0
|
||||
OpDecorate %x_12 Binding 3
|
||||
OpDecorate %buf0 Block
|
||||
OpMemberDecorate %buf0 0 Offset 0
|
||||
OpDecorate %_arr_int_uint_2 ArrayStride 16
|
||||
OpDecorate %x_15 NonWritable
|
||||
OpDecorate %x_15 DescriptorSet 0
|
||||
OpDecorate %x_15 Binding 0
|
||||
OpMemberDecorate %S 0 Offset 0
|
||||
OpDecorate %_arr_float_uint_3 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
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_5 = OpConstant %uint 5
|
||||
%_arr_float_uint_5 = OpTypeArray %float %uint_5
|
||||
%buf1 = OpTypeStruct %_arr_float_uint_5
|
||||
%_ptr_Uniform_buf1 = OpTypePointer Uniform %buf1
|
||||
%x_7 = OpVariable %_ptr_Uniform_buf1 Uniform
|
||||
%v2float = OpTypeVector %float 2
|
||||
%buf2 = OpTypeStruct %v2float
|
||||
%_ptr_Uniform_buf2 = OpTypePointer Uniform %buf2
|
||||
%x_9 = OpVariable %_ptr_Uniform_buf2 Uniform
|
||||
%buf3 = OpTypeStruct %v2float
|
||||
%_ptr_Uniform_buf3 = OpTypePointer Uniform %buf3
|
||||
%x_12 = OpVariable %_ptr_Uniform_buf3 Uniform
|
||||
%int = OpTypeInt 32 1
|
||||
%uint_2 = OpConstant %uint 2
|
||||
%_arr_int_uint_2 = OpTypeArray %int %uint_2
|
||||
%buf0 = OpTypeStruct %_arr_int_uint_2
|
||||
%_ptr_Uniform_buf0 = OpTypePointer Uniform %buf0
|
||||
%x_15 = OpVariable %_ptr_Uniform_buf0 Uniform
|
||||
%_ptr_Private_v4float = OpTypePointer Private %v4float
|
||||
%x_GLF_color = OpVariable %_ptr_Private_v4float Private %5
|
||||
%void = OpTypeVoid
|
||||
%27 = OpTypeFunction %void
|
||||
%uint_3 = OpConstant %uint 3
|
||||
%_arr_float_uint_3 = OpTypeArray %float %uint_3
|
||||
%S = OpTypeStruct %_arr_float_uint_3
|
||||
%_ptr_Function_S = OpTypePointer Function %S
|
||||
%36 = OpConstantNull %S
|
||||
%_ptr_Function_float = OpTypePointer Function %float
|
||||
%39 = OpConstantNull %float
|
||||
%_ptr_Function_v2float = OpTypePointer Function %v2float
|
||||
%42 = OpConstantNull %v2float
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%int_3 = OpConstant %int 3
|
||||
%_ptr_Uniform_float = OpTypePointer Uniform %float
|
||||
%int_2 = OpConstant %int 2
|
||||
%int_4 = OpConstant %int 4
|
||||
%int_0 = OpConstant %int 0
|
||||
%bool = OpTypeBool
|
||||
%_ptr_Uniform_v2float = OpTypePointer Uniform %v2float
|
||||
%uint_1 = OpConstant %uint 1
|
||||
%_ptr_Uniform_int = OpTypePointer Uniform %int
|
||||
%int_1 = OpConstant %int 1
|
||||
%main_out = OpTypeStruct %v4float
|
||||
%119 = OpTypeFunction %main_out
|
||||
%main_1 = OpFunction %void None %27
|
||||
%30 = OpLabel
|
||||
%obj = OpVariable %_ptr_Function_S Function %36
|
||||
%a = OpVariable %_ptr_Function_float Function %39
|
||||
%x_49 = OpVariable %_ptr_Function_v2float Function %42
|
||||
%b = OpVariable %_ptr_Function_float Function %39
|
||||
%47 = OpAccessChain %_ptr_Uniform_float %x_7 %uint_0 %int_3
|
||||
%48 = OpLoad %float %47
|
||||
%50 = OpAccessChain %_ptr_Uniform_float %x_7 %uint_0 %int_2
|
||||
%51 = OpLoad %float %50
|
||||
%53 = OpAccessChain %_ptr_Uniform_float %x_7 %uint_0 %int_4
|
||||
%54 = OpLoad %float %53
|
||||
%55 = OpCompositeConstruct %_arr_float_uint_3 %48 %51 %54
|
||||
%56 = OpCompositeConstruct %S %55
|
||||
OpStore %obj %56
|
||||
%57 = OpAccessChain %_ptr_Uniform_float %x_9 %uint_0 %uint_0
|
||||
%58 = OpLoad %float %57
|
||||
%60 = OpAccessChain %_ptr_Uniform_float %x_7 %uint_0 %int_0
|
||||
%61 = OpLoad %float %60
|
||||
%62 = OpConvertFToS %int %58
|
||||
%63 = OpAccessChain %_ptr_Function_float %obj %uint_0 %62
|
||||
OpStore %63 %61
|
||||
%64 = OpAccessChain %_ptr_Uniform_float %x_9 %uint_0 %uint_0
|
||||
%65 = OpLoad %float %64
|
||||
%66 = OpAccessChain %_ptr_Uniform_float %x_7 %uint_0 %int_0
|
||||
%67 = OpLoad %float %66
|
||||
%68 = OpFOrdGreaterThan %bool %65 %67
|
||||
OpSelectionMerge %70 None
|
||||
OpBranchConditional %68 %71 %72
|
||||
%71 = OpLabel
|
||||
%74 = OpAccessChain %_ptr_Uniform_v2float %x_9 %uint_0
|
||||
%75 = OpLoad %v2float %74
|
||||
OpStore %x_49 %75
|
||||
OpBranch %70
|
||||
%72 = OpLabel
|
||||
%76 = OpAccessChain %_ptr_Uniform_v2float %x_12 %uint_0
|
||||
%77 = OpLoad %v2float %76
|
||||
OpStore %x_49 %77
|
||||
OpBranch %70
|
||||
%70 = OpLabel
|
||||
%79 = OpAccessChain %_ptr_Function_float %x_49 %uint_1
|
||||
%80 = OpLoad %float %79
|
||||
OpStore %a %80
|
||||
%81 = OpAccessChain %_ptr_Uniform_float %x_7 %uint_0 %int_0
|
||||
%82 = OpLoad %float %81
|
||||
%83 = OpLoad %float %a
|
||||
%85 = OpAccessChain %_ptr_Uniform_int %x_15 %uint_0 %int_0
|
||||
%86 = OpLoad %int %85
|
||||
%87 = OpAccessChain %_ptr_Function_float %obj %uint_0 %86
|
||||
%88 = OpLoad %float %87
|
||||
%89 = OpExtInst %float %90 FMix %82 %83 %88
|
||||
OpStore %b %89
|
||||
%91 = OpLoad %float %b
|
||||
%92 = OpAccessChain %_ptr_Uniform_float %x_7 %uint_0 %int_2
|
||||
%93 = OpLoad %float %92
|
||||
%95 = OpAccessChain %_ptr_Uniform_float %x_7 %uint_0 %int_1
|
||||
%96 = OpLoad %float %95
|
||||
%97 = OpExtInst %float %90 Distance %91 %93
|
||||
%98 = OpFOrdLessThan %bool %97 %96
|
||||
OpSelectionMerge %99 None
|
||||
OpBranchConditional %98 %100 %101
|
||||
%100 = OpLabel
|
||||
%102 = OpAccessChain %_ptr_Uniform_int %x_15 %uint_0 %int_0
|
||||
%103 = OpLoad %int %102
|
||||
%104 = OpAccessChain %_ptr_Uniform_int %x_15 %uint_0 %int_1
|
||||
%105 = OpLoad %int %104
|
||||
%106 = OpAccessChain %_ptr_Uniform_int %x_15 %uint_0 %int_1
|
||||
%107 = OpLoad %int %106
|
||||
%108 = OpAccessChain %_ptr_Uniform_int %x_15 %uint_0 %int_0
|
||||
%109 = OpLoad %int %108
|
||||
%110 = OpConvertSToF %float %103
|
||||
%111 = OpConvertSToF %float %105
|
||||
%112 = OpConvertSToF %float %107
|
||||
%113 = OpConvertSToF %float %109
|
||||
%114 = OpCompositeConstruct %v4float %110 %111 %112 %113
|
||||
OpStore %x_GLF_color %114
|
||||
OpBranch %99
|
||||
%101 = OpLabel
|
||||
%115 = OpAccessChain %_ptr_Uniform_int %x_15 %uint_0 %int_1
|
||||
%116 = OpLoad %int %115
|
||||
%117 = OpConvertSToF %float %116
|
||||
%118 = OpCompositeConstruct %v4float %117 %117 %117 %117
|
||||
OpStore %x_GLF_color %118
|
||||
OpBranch %99
|
||||
%99 = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%main_inner = OpFunction %main_out None %119
|
||||
%122 = OpLabel
|
||||
%123 = OpFunctionCall %void %main_1
|
||||
%124 = OpLoad %v4float %x_GLF_color
|
||||
%125 = OpCompositeConstruct %main_out %124
|
||||
OpReturnValue %125
|
||||
OpFunctionEnd
|
||||
%main = OpFunction %void None %27
|
||||
%127 = OpLabel
|
||||
%128 = OpFunctionCall %main_out %main_inner
|
||||
%129 = OpCompositeExtract %v4float %128 0
|
||||
OpStore %x_GLF_color_1_1 %129
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -1,93 +0,0 @@
|
||||
struct S {
|
||||
numbers : array<f32, 3>;
|
||||
};
|
||||
|
||||
type Arr = [[stride(16)]] array<f32, 5>;
|
||||
|
||||
[[block]]
|
||||
struct buf1 {
|
||||
x_GLF_uniform_float_values : Arr;
|
||||
};
|
||||
|
||||
[[block]]
|
||||
struct buf2 {
|
||||
zeroVec : vec2<f32>;
|
||||
};
|
||||
|
||||
[[block]]
|
||||
struct buf3 {
|
||||
oneVec : vec2<f32>;
|
||||
};
|
||||
|
||||
type Arr_1 = [[stride(16)]] array<i32, 2>;
|
||||
|
||||
[[block]]
|
||||
struct buf0 {
|
||||
x_GLF_uniform_int_values : Arr_1;
|
||||
};
|
||||
|
||||
[[group(0), binding(1)]] var<uniform> x_7 : buf1;
|
||||
|
||||
[[group(0), binding(2)]] var<uniform> x_9 : buf2;
|
||||
|
||||
[[group(0), binding(3)]] var<uniform> x_12 : buf3;
|
||||
|
||||
[[group(0), binding(0)]] var<uniform> x_15 : buf0;
|
||||
|
||||
var<private> x_GLF_color : vec4<f32>;
|
||||
|
||||
fn main_1() {
|
||||
var obj : S;
|
||||
var a : f32;
|
||||
var x_49 : vec2<f32>;
|
||||
var b : f32;
|
||||
let x_51 : f32 = x_7.x_GLF_uniform_float_values[3];
|
||||
let x_53 : f32 = x_7.x_GLF_uniform_float_values[2];
|
||||
let x_55 : f32 = x_7.x_GLF_uniform_float_values[4];
|
||||
obj = S(array<f32, 3>(x_51, x_53, x_55));
|
||||
let x_59 : f32 = x_9.zeroVec.x;
|
||||
let x_62 : f32 = x_7.x_GLF_uniform_float_values[0];
|
||||
obj.numbers[i32(x_59)] = x_62;
|
||||
let x_65 : f32 = x_9.zeroVec.x;
|
||||
let x_67 : f32 = x_7.x_GLF_uniform_float_values[0];
|
||||
if ((x_65 > x_67)) {
|
||||
let x_73 : vec2<f32> = x_9.zeroVec;
|
||||
x_49 = x_73;
|
||||
} else {
|
||||
let x_75 : vec2<f32> = x_12.oneVec;
|
||||
x_49 = x_75;
|
||||
}
|
||||
let x_77 : f32 = x_49.y;
|
||||
a = x_77;
|
||||
let x_79 : f32 = x_7.x_GLF_uniform_float_values[0];
|
||||
let x_80 : f32 = a;
|
||||
let x_82 : i32 = x_15.x_GLF_uniform_int_values[0];
|
||||
let x_84 : f32 = obj.numbers[x_82];
|
||||
b = mix(x_79, x_80, x_84);
|
||||
let x_86 : f32 = b;
|
||||
let x_88 : f32 = x_7.x_GLF_uniform_float_values[2];
|
||||
let x_91 : f32 = x_7.x_GLF_uniform_float_values[1];
|
||||
if ((distance(x_86, x_88) < x_91)) {
|
||||
let x_97 : i32 = x_15.x_GLF_uniform_int_values[0];
|
||||
let x_100 : i32 = x_15.x_GLF_uniform_int_values[1];
|
||||
let x_103 : i32 = x_15.x_GLF_uniform_int_values[1];
|
||||
let x_106 : i32 = x_15.x_GLF_uniform_int_values[0];
|
||||
x_GLF_color = vec4<f32>(f32(x_97), f32(x_100), f32(x_103), f32(x_106));
|
||||
} else {
|
||||
let x_110 : i32 = x_15.x_GLF_uniform_int_values[1];
|
||||
let x_111 : f32 = f32(x_110);
|
||||
x_GLF_color = vec4<f32>(x_111, x_111, x_111, x_111);
|
||||
}
|
||||
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,88 +0,0 @@
|
||||
SKIP: FAILED
|
||||
|
||||
struct S {
|
||||
float numbers[3];
|
||||
};
|
||||
|
||||
cbuffer cbuffer_x_7 : register(b1, space0) {
|
||||
uint4 x_7[5];
|
||||
};
|
||||
cbuffer cbuffer_x_9 : register(b2, space0) {
|
||||
uint4 x_9[1];
|
||||
};
|
||||
cbuffer cbuffer_x_12 : register(b3, space0) {
|
||||
uint4 x_12[1];
|
||||
};
|
||||
cbuffer cbuffer_x_15 : register(b0, space0) {
|
||||
uint4 x_15[2];
|
||||
};
|
||||
static float4 x_GLF_color = float4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
|
||||
void main_1() {
|
||||
S obj = (S)0;
|
||||
float a = 0.0f;
|
||||
float2 x_49 = float2(0.0f, 0.0f);
|
||||
float b = 0.0f;
|
||||
const float x_51 = asfloat(x_7[3].x);
|
||||
const float x_53 = asfloat(x_7[2].x);
|
||||
const float x_55 = asfloat(x_7[4].x);
|
||||
const float tint_symbol_7[3] = {x_51, x_53, x_55};
|
||||
const S tint_symbol_8 = {tint_symbol_7};
|
||||
obj = tint_symbol_8;
|
||||
const float x_59 = asfloat(x_9[0].x);
|
||||
const uint scalar_offset = ((16u * uint(0))) / 4;
|
||||
const float x_62 = asfloat(x_7[scalar_offset / 4][scalar_offset % 4]);
|
||||
obj.numbers[int(x_59)] = x_62;
|
||||
const float x_65 = asfloat(x_9[0].x);
|
||||
const uint scalar_offset_1 = ((16u * uint(0))) / 4;
|
||||
const float x_67 = asfloat(x_7[scalar_offset_1 / 4][scalar_offset_1 % 4]);
|
||||
if ((x_65 > x_67)) {
|
||||
const float2 x_73 = asfloat(x_9[0].xy);
|
||||
x_49 = x_73;
|
||||
} else {
|
||||
const float2 x_75 = asfloat(x_12[0].xy);
|
||||
x_49 = x_75;
|
||||
}
|
||||
const float x_77 = x_49.y;
|
||||
a = x_77;
|
||||
const uint scalar_offset_2 = ((16u * uint(0))) / 4;
|
||||
const float x_79 = asfloat(x_7[scalar_offset_2 / 4][scalar_offset_2 % 4]);
|
||||
const float x_80 = a;
|
||||
const uint scalar_offset_3 = ((16u * uint(0))) / 4;
|
||||
const int x_82 = asint(x_15[scalar_offset_3 / 4][scalar_offset_3 % 4]);
|
||||
const float x_84 = obj.numbers[x_82];
|
||||
b = lerp(x_79, x_80, x_84);
|
||||
const float x_86 = b;
|
||||
const float x_88 = asfloat(x_7[2].x);
|
||||
const float x_91 = asfloat(x_7[1].x);
|
||||
if ((distance(x_86, x_88) < x_91)) {
|
||||
const uint scalar_offset_4 = ((16u * uint(0))) / 4;
|
||||
const int x_97 = asint(x_15[scalar_offset_4 / 4][scalar_offset_4 % 4]);
|
||||
const int x_100 = asint(x_15[1].x);
|
||||
const int x_103 = asint(x_15[1].x);
|
||||
const uint scalar_offset_5 = ((16u * uint(0))) / 4;
|
||||
const int x_106 = asint(x_15[scalar_offset_5 / 4][scalar_offset_5 % 4]);
|
||||
x_GLF_color = float4(float(x_97), float(x_100), float(x_103), float(x_106));
|
||||
} else {
|
||||
const int x_110 = asint(x_15[1].x);
|
||||
const float x_111 = float(x_110);
|
||||
x_GLF_color = float4(x_111, x_111, x_111, x_111);
|
||||
}
|
||||
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_9 = {tint_symbol_1.x_GLF_color_1};
|
||||
return tint_symbol_9;
|
||||
}
|
||||
C:\src\tint\test\Shader@0x000002E12CF56890(33,3-24): error X3500: array reference cannot be used as an l-value; not natively addressable
|
||||
|
||||
@@ -1,103 +0,0 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct tint_array_wrapper {
|
||||
float arr[3];
|
||||
};
|
||||
struct S {
|
||||
tint_array_wrapper numbers;
|
||||
};
|
||||
struct tint_padded_array_element {
|
||||
/* 0x0000 */ float el;
|
||||
/* 0x0004 */ int8_t tint_pad[12];
|
||||
};
|
||||
struct tint_array_wrapper_1 {
|
||||
/* 0x0000 */ tint_padded_array_element arr[5];
|
||||
};
|
||||
struct buf1 {
|
||||
/* 0x0000 */ tint_array_wrapper_1 x_GLF_uniform_float_values;
|
||||
};
|
||||
struct buf2 {
|
||||
/* 0x0000 */ float2 zeroVec;
|
||||
};
|
||||
struct buf3 {
|
||||
/* 0x0000 */ float2 oneVec;
|
||||
};
|
||||
struct tint_padded_array_element_1 {
|
||||
/* 0x0000 */ int el;
|
||||
/* 0x0004 */ int8_t tint_pad_1[12];
|
||||
};
|
||||
struct tint_array_wrapper_2 {
|
||||
/* 0x0000 */ tint_padded_array_element_1 arr[2];
|
||||
};
|
||||
struct buf0 {
|
||||
/* 0x0000 */ tint_array_wrapper_2 x_GLF_uniform_int_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_7, constant buf2& x_9, constant buf3& x_12, constant buf0& x_15, thread float4* const tint_symbol_5) {
|
||||
S obj = {};
|
||||
float a = 0.0f;
|
||||
float2 x_49 = 0.0f;
|
||||
float b = 0.0f;
|
||||
float const x_51 = x_7.x_GLF_uniform_float_values.arr[3].el;
|
||||
float const x_53 = x_7.x_GLF_uniform_float_values.arr[2].el;
|
||||
float const x_55 = x_7.x_GLF_uniform_float_values.arr[4].el;
|
||||
tint_array_wrapper const tint_symbol_2 = {.arr={x_51, x_53, x_55}};
|
||||
S const tint_symbol_3 = {.numbers=tint_symbol_2};
|
||||
obj = tint_symbol_3;
|
||||
float const x_59 = x_9.zeroVec.x;
|
||||
float const x_62 = x_7.x_GLF_uniform_float_values.arr[0].el;
|
||||
obj.numbers.arr[int(x_59)] = x_62;
|
||||
float const x_65 = x_9.zeroVec.x;
|
||||
float const x_67 = x_7.x_GLF_uniform_float_values.arr[0].el;
|
||||
if ((x_65 > x_67)) {
|
||||
float2 const x_73 = x_9.zeroVec;
|
||||
x_49 = x_73;
|
||||
} else {
|
||||
float2 const x_75 = x_12.oneVec;
|
||||
x_49 = x_75;
|
||||
}
|
||||
float const x_77 = x_49.y;
|
||||
a = x_77;
|
||||
float const x_79 = x_7.x_GLF_uniform_float_values.arr[0].el;
|
||||
float const x_80 = a;
|
||||
int const x_82 = x_15.x_GLF_uniform_int_values.arr[0].el;
|
||||
float const x_84 = obj.numbers.arr[x_82];
|
||||
b = mix(x_79, x_80, x_84);
|
||||
float const x_86 = b;
|
||||
float const x_88 = x_7.x_GLF_uniform_float_values.arr[2].el;
|
||||
float const x_91 = x_7.x_GLF_uniform_float_values.arr[1].el;
|
||||
if ((fabs(x_86 - x_88) < x_91)) {
|
||||
int const x_97 = x_15.x_GLF_uniform_int_values.arr[0].el;
|
||||
int const x_100 = x_15.x_GLF_uniform_int_values.arr[1].el;
|
||||
int const x_103 = x_15.x_GLF_uniform_int_values.arr[1].el;
|
||||
int const x_106 = x_15.x_GLF_uniform_int_values.arr[0].el;
|
||||
*(tint_symbol_5) = float4(float(x_97), float(x_100), float(x_103), float(x_106));
|
||||
} else {
|
||||
int const x_110 = x_15.x_GLF_uniform_int_values.arr[1].el;
|
||||
float const x_111 = float(x_110);
|
||||
*(tint_symbol_5) = float4(x_111, x_111, x_111, x_111);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
main_out tint_symbol_inner(constant buf1& x_7, constant buf2& x_9, constant buf3& x_12, constant buf0& x_15, thread float4* const tint_symbol_6) {
|
||||
main_1(x_7, x_9, x_12, x_15, tint_symbol_6);
|
||||
main_out const tint_symbol_4 = {.x_GLF_color_1=*(tint_symbol_6)};
|
||||
return tint_symbol_4;
|
||||
}
|
||||
|
||||
fragment tint_symbol_1 tint_symbol(constant buf1& x_7 [[buffer(0)]], constant buf2& x_9 [[buffer(1)]], constant buf3& x_12 [[buffer(2)]], constant buf0& x_15 [[buffer(3)]]) {
|
||||
thread float4 tint_symbol_7 = 0.0f;
|
||||
main_out const inner_result = tint_symbol_inner(x_7, x_9, x_12, x_15, &(tint_symbol_7));
|
||||
tint_symbol_1 wrapper_result = {};
|
||||
wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1;
|
||||
return wrapper_result;
|
||||
}
|
||||
|
||||
@@ -1,212 +0,0 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 130
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
%90 = 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_float_values"
|
||||
OpName %x_7 "x_7"
|
||||
OpName %buf2 "buf2"
|
||||
OpMemberName %buf2 0 "zeroVec"
|
||||
OpName %x_9 "x_9"
|
||||
OpName %buf3 "buf3"
|
||||
OpMemberName %buf3 0 "oneVec"
|
||||
OpName %x_12 "x_12"
|
||||
OpName %buf0 "buf0"
|
||||
OpMemberName %buf0 0 "x_GLF_uniform_int_values"
|
||||
OpName %x_15 "x_15"
|
||||
OpName %x_GLF_color "x_GLF_color"
|
||||
OpName %main_1 "main_1"
|
||||
OpName %S "S"
|
||||
OpMemberName %S 0 "numbers"
|
||||
OpName %obj "obj"
|
||||
OpName %a "a"
|
||||
OpName %x_49 "x_49"
|
||||
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_float_uint_5 ArrayStride 16
|
||||
OpDecorate %x_7 NonWritable
|
||||
OpDecorate %x_7 DescriptorSet 0
|
||||
OpDecorate %x_7 Binding 1
|
||||
OpDecorate %buf2 Block
|
||||
OpMemberDecorate %buf2 0 Offset 0
|
||||
OpDecorate %x_9 NonWritable
|
||||
OpDecorate %x_9 DescriptorSet 0
|
||||
OpDecorate %x_9 Binding 2
|
||||
OpDecorate %buf3 Block
|
||||
OpMemberDecorate %buf3 0 Offset 0
|
||||
OpDecorate %x_12 NonWritable
|
||||
OpDecorate %x_12 DescriptorSet 0
|
||||
OpDecorate %x_12 Binding 3
|
||||
OpDecorate %buf0 Block
|
||||
OpMemberDecorate %buf0 0 Offset 0
|
||||
OpDecorate %_arr_int_uint_2 ArrayStride 16
|
||||
OpDecorate %x_15 NonWritable
|
||||
OpDecorate %x_15 DescriptorSet 0
|
||||
OpDecorate %x_15 Binding 0
|
||||
OpMemberDecorate %S 0 Offset 0
|
||||
OpDecorate %_arr_float_uint_3 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
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_5 = OpConstant %uint 5
|
||||
%_arr_float_uint_5 = OpTypeArray %float %uint_5
|
||||
%buf1 = OpTypeStruct %_arr_float_uint_5
|
||||
%_ptr_Uniform_buf1 = OpTypePointer Uniform %buf1
|
||||
%x_7 = OpVariable %_ptr_Uniform_buf1 Uniform
|
||||
%v2float = OpTypeVector %float 2
|
||||
%buf2 = OpTypeStruct %v2float
|
||||
%_ptr_Uniform_buf2 = OpTypePointer Uniform %buf2
|
||||
%x_9 = OpVariable %_ptr_Uniform_buf2 Uniform
|
||||
%buf3 = OpTypeStruct %v2float
|
||||
%_ptr_Uniform_buf3 = OpTypePointer Uniform %buf3
|
||||
%x_12 = OpVariable %_ptr_Uniform_buf3 Uniform
|
||||
%int = OpTypeInt 32 1
|
||||
%uint_2 = OpConstant %uint 2
|
||||
%_arr_int_uint_2 = OpTypeArray %int %uint_2
|
||||
%buf0 = OpTypeStruct %_arr_int_uint_2
|
||||
%_ptr_Uniform_buf0 = OpTypePointer Uniform %buf0
|
||||
%x_15 = OpVariable %_ptr_Uniform_buf0 Uniform
|
||||
%_ptr_Private_v4float = OpTypePointer Private %v4float
|
||||
%x_GLF_color = OpVariable %_ptr_Private_v4float Private %5
|
||||
%void = OpTypeVoid
|
||||
%27 = OpTypeFunction %void
|
||||
%uint_3 = OpConstant %uint 3
|
||||
%_arr_float_uint_3 = OpTypeArray %float %uint_3
|
||||
%S = OpTypeStruct %_arr_float_uint_3
|
||||
%_ptr_Function_S = OpTypePointer Function %S
|
||||
%36 = OpConstantNull %S
|
||||
%_ptr_Function_float = OpTypePointer Function %float
|
||||
%39 = OpConstantNull %float
|
||||
%_ptr_Function_v2float = OpTypePointer Function %v2float
|
||||
%42 = OpConstantNull %v2float
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%int_3 = OpConstant %int 3
|
||||
%_ptr_Uniform_float = OpTypePointer Uniform %float
|
||||
%int_2 = OpConstant %int 2
|
||||
%int_4 = OpConstant %int 4
|
||||
%int_0 = OpConstant %int 0
|
||||
%bool = OpTypeBool
|
||||
%_ptr_Uniform_v2float = OpTypePointer Uniform %v2float
|
||||
%uint_1 = OpConstant %uint 1
|
||||
%_ptr_Uniform_int = OpTypePointer Uniform %int
|
||||
%int_1 = OpConstant %int 1
|
||||
%main_out = OpTypeStruct %v4float
|
||||
%119 = OpTypeFunction %main_out
|
||||
%main_1 = OpFunction %void None %27
|
||||
%30 = OpLabel
|
||||
%obj = OpVariable %_ptr_Function_S Function %36
|
||||
%a = OpVariable %_ptr_Function_float Function %39
|
||||
%x_49 = OpVariable %_ptr_Function_v2float Function %42
|
||||
%b = OpVariable %_ptr_Function_float Function %39
|
||||
%47 = OpAccessChain %_ptr_Uniform_float %x_7 %uint_0 %int_3
|
||||
%48 = OpLoad %float %47
|
||||
%50 = OpAccessChain %_ptr_Uniform_float %x_7 %uint_0 %int_2
|
||||
%51 = OpLoad %float %50
|
||||
%53 = OpAccessChain %_ptr_Uniform_float %x_7 %uint_0 %int_4
|
||||
%54 = OpLoad %float %53
|
||||
%55 = OpCompositeConstruct %_arr_float_uint_3 %48 %51 %54
|
||||
%56 = OpCompositeConstruct %S %55
|
||||
OpStore %obj %56
|
||||
%57 = OpAccessChain %_ptr_Uniform_float %x_9 %uint_0 %uint_0
|
||||
%58 = OpLoad %float %57
|
||||
%60 = OpAccessChain %_ptr_Uniform_float %x_7 %uint_0 %int_0
|
||||
%61 = OpLoad %float %60
|
||||
%62 = OpConvertFToS %int %58
|
||||
%63 = OpAccessChain %_ptr_Function_float %obj %uint_0 %62
|
||||
OpStore %63 %61
|
||||
%64 = OpAccessChain %_ptr_Uniform_float %x_9 %uint_0 %uint_0
|
||||
%65 = OpLoad %float %64
|
||||
%66 = OpAccessChain %_ptr_Uniform_float %x_7 %uint_0 %int_0
|
||||
%67 = OpLoad %float %66
|
||||
%68 = OpFOrdGreaterThan %bool %65 %67
|
||||
OpSelectionMerge %70 None
|
||||
OpBranchConditional %68 %71 %72
|
||||
%71 = OpLabel
|
||||
%74 = OpAccessChain %_ptr_Uniform_v2float %x_9 %uint_0
|
||||
%75 = OpLoad %v2float %74
|
||||
OpStore %x_49 %75
|
||||
OpBranch %70
|
||||
%72 = OpLabel
|
||||
%76 = OpAccessChain %_ptr_Uniform_v2float %x_12 %uint_0
|
||||
%77 = OpLoad %v2float %76
|
||||
OpStore %x_49 %77
|
||||
OpBranch %70
|
||||
%70 = OpLabel
|
||||
%79 = OpAccessChain %_ptr_Function_float %x_49 %uint_1
|
||||
%80 = OpLoad %float %79
|
||||
OpStore %a %80
|
||||
%81 = OpAccessChain %_ptr_Uniform_float %x_7 %uint_0 %int_0
|
||||
%82 = OpLoad %float %81
|
||||
%83 = OpLoad %float %a
|
||||
%85 = OpAccessChain %_ptr_Uniform_int %x_15 %uint_0 %int_0
|
||||
%86 = OpLoad %int %85
|
||||
%87 = OpAccessChain %_ptr_Function_float %obj %uint_0 %86
|
||||
%88 = OpLoad %float %87
|
||||
%89 = OpExtInst %float %90 FMix %82 %83 %88
|
||||
OpStore %b %89
|
||||
%91 = OpLoad %float %b
|
||||
%92 = OpAccessChain %_ptr_Uniform_float %x_7 %uint_0 %int_2
|
||||
%93 = OpLoad %float %92
|
||||
%95 = OpAccessChain %_ptr_Uniform_float %x_7 %uint_0 %int_1
|
||||
%96 = OpLoad %float %95
|
||||
%97 = OpExtInst %float %90 Distance %91 %93
|
||||
%98 = OpFOrdLessThan %bool %97 %96
|
||||
OpSelectionMerge %99 None
|
||||
OpBranchConditional %98 %100 %101
|
||||
%100 = OpLabel
|
||||
%102 = OpAccessChain %_ptr_Uniform_int %x_15 %uint_0 %int_0
|
||||
%103 = OpLoad %int %102
|
||||
%104 = OpAccessChain %_ptr_Uniform_int %x_15 %uint_0 %int_1
|
||||
%105 = OpLoad %int %104
|
||||
%106 = OpAccessChain %_ptr_Uniform_int %x_15 %uint_0 %int_1
|
||||
%107 = OpLoad %int %106
|
||||
%108 = OpAccessChain %_ptr_Uniform_int %x_15 %uint_0 %int_0
|
||||
%109 = OpLoad %int %108
|
||||
%110 = OpConvertSToF %float %103
|
||||
%111 = OpConvertSToF %float %105
|
||||
%112 = OpConvertSToF %float %107
|
||||
%113 = OpConvertSToF %float %109
|
||||
%114 = OpCompositeConstruct %v4float %110 %111 %112 %113
|
||||
OpStore %x_GLF_color %114
|
||||
OpBranch %99
|
||||
%101 = OpLabel
|
||||
%115 = OpAccessChain %_ptr_Uniform_int %x_15 %uint_0 %int_1
|
||||
%116 = OpLoad %int %115
|
||||
%117 = OpConvertSToF %float %116
|
||||
%118 = OpCompositeConstruct %v4float %117 %117 %117 %117
|
||||
OpStore %x_GLF_color %118
|
||||
OpBranch %99
|
||||
%99 = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%main_inner = OpFunction %main_out None %119
|
||||
%122 = OpLabel
|
||||
%123 = OpFunctionCall %void %main_1
|
||||
%124 = OpLoad %v4float %x_GLF_color
|
||||
%125 = OpCompositeConstruct %main_out %124
|
||||
OpReturnValue %125
|
||||
OpFunctionEnd
|
||||
%main = OpFunction %void None %27
|
||||
%127 = OpLabel
|
||||
%128 = OpFunctionCall %main_out %main_inner
|
||||
%129 = OpCompositeExtract %v4float %128 0
|
||||
OpStore %x_GLF_color_1_1 %129
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -1,93 +0,0 @@
|
||||
struct S {
|
||||
numbers : array<f32, 3>;
|
||||
};
|
||||
|
||||
type Arr = [[stride(16)]] array<f32, 5>;
|
||||
|
||||
[[block]]
|
||||
struct buf1 {
|
||||
x_GLF_uniform_float_values : Arr;
|
||||
};
|
||||
|
||||
[[block]]
|
||||
struct buf2 {
|
||||
zeroVec : vec2<f32>;
|
||||
};
|
||||
|
||||
[[block]]
|
||||
struct buf3 {
|
||||
oneVec : vec2<f32>;
|
||||
};
|
||||
|
||||
type Arr_1 = [[stride(16)]] array<i32, 2>;
|
||||
|
||||
[[block]]
|
||||
struct buf0 {
|
||||
x_GLF_uniform_int_values : Arr_1;
|
||||
};
|
||||
|
||||
[[group(0), binding(1)]] var<uniform> x_7 : buf1;
|
||||
|
||||
[[group(0), binding(2)]] var<uniform> x_9 : buf2;
|
||||
|
||||
[[group(0), binding(3)]] var<uniform> x_12 : buf3;
|
||||
|
||||
[[group(0), binding(0)]] var<uniform> x_15 : buf0;
|
||||
|
||||
var<private> x_GLF_color : vec4<f32>;
|
||||
|
||||
fn main_1() {
|
||||
var obj : S;
|
||||
var a : f32;
|
||||
var x_49 : vec2<f32>;
|
||||
var b : f32;
|
||||
let x_51 : f32 = x_7.x_GLF_uniform_float_values[3];
|
||||
let x_53 : f32 = x_7.x_GLF_uniform_float_values[2];
|
||||
let x_55 : f32 = x_7.x_GLF_uniform_float_values[4];
|
||||
obj = S(array<f32, 3>(x_51, x_53, x_55));
|
||||
let x_59 : f32 = x_9.zeroVec.x;
|
||||
let x_62 : f32 = x_7.x_GLF_uniform_float_values[0];
|
||||
obj.numbers[i32(x_59)] = x_62;
|
||||
let x_65 : f32 = x_9.zeroVec.x;
|
||||
let x_67 : f32 = x_7.x_GLF_uniform_float_values[0];
|
||||
if ((x_65 > x_67)) {
|
||||
let x_73 : vec2<f32> = x_9.zeroVec;
|
||||
x_49 = x_73;
|
||||
} else {
|
||||
let x_75 : vec2<f32> = x_12.oneVec;
|
||||
x_49 = x_75;
|
||||
}
|
||||
let x_77 : f32 = x_49.y;
|
||||
a = x_77;
|
||||
let x_79 : f32 = x_7.x_GLF_uniform_float_values[0];
|
||||
let x_80 : f32 = a;
|
||||
let x_82 : i32 = x_15.x_GLF_uniform_int_values[0];
|
||||
let x_84 : f32 = obj.numbers[x_82];
|
||||
b = mix(x_79, x_80, x_84);
|
||||
let x_86 : f32 = b;
|
||||
let x_88 : f32 = x_7.x_GLF_uniform_float_values[2];
|
||||
let x_91 : f32 = x_7.x_GLF_uniform_float_values[1];
|
||||
if ((distance(x_86, x_88) < x_91)) {
|
||||
let x_97 : i32 = x_15.x_GLF_uniform_int_values[0];
|
||||
let x_100 : i32 = x_15.x_GLF_uniform_int_values[1];
|
||||
let x_103 : i32 = x_15.x_GLF_uniform_int_values[1];
|
||||
let x_106 : i32 = x_15.x_GLF_uniform_int_values[0];
|
||||
x_GLF_color = vec4<f32>(f32(x_97), f32(x_100), f32(x_103), f32(x_106));
|
||||
} else {
|
||||
let x_110 : i32 = x_15.x_GLF_uniform_int_values[1];
|
||||
let x_111 : f32 = f32(x_110);
|
||||
x_GLF_color = vec4<f32>(x_111, x_111, x_111, x_111);
|
||||
}
|
||||
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