mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-16 00:17:03 +00:00
Add tests derived from VK-GL-CTS
This adds SPIR-V assembly and WGSL tests derived from VK-GL-CTS commit 571256871c2e2f03995373e1e4a02958d8cd8cf5. The following procedure was followed: - Those .amber files in VK-GL-CTS wholly owned by Google were identified - All GLSL and SPIR-V shaders were extracted from the Amber files and converted into SPIR-V binaries - The compact-ids pass of spirv-opt was applied to each binary - Duplicate binaries were removed - spirv-opt -O was used to obtain an optimized version of each remaining binary, with duplicates discarded - Binaries that failed validation using spirv-val with target environment SPIR-V 1.3 were discarded - Those binaries that tint could not successfully convert into WGSL were put aside for further investigation - SPIR-V assembly versions of the remaining binaries are included in this CL - test-runner with -generate-expected and -generate-skip was used to generate expected .spvasm, .msl, .hlsl and .wgsl outputs for these SPIR-V assembly tests - Each successfully-generated .expected.wgsl is included in this CL again, as a WGLSL test - test-runner with -generate-expected and -generate-skip was used again, to generate expected outputs for these WGSL tests Change-Id: Ibe9baf2729cf97e0b633db9a426f53362a5de540 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/58842 Kokoro: Kokoro <noreply+kokoro@google.com> Commit-Queue: Ben Clayton <bclayton@google.com> Reviewed-by: Ben Clayton <bclayton@google.com>
This commit is contained in:
committed by
Tint LUCI CQ
parent
bd3edb564f
commit
f7e73d4ee3
@@ -0,0 +1,146 @@
|
||||
OpCapability Shader
|
||||
%1 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Fragment %main "main" %_GLF_color
|
||||
OpExecutionMode %main OriginUpperLeft
|
||||
OpSource ESSL 310
|
||||
OpName %main "main"
|
||||
OpName %A1 "A1"
|
||||
OpName %buf1 "buf1"
|
||||
OpMemberName %buf1 0 "_GLF_uniform_float_values"
|
||||
OpName %_ ""
|
||||
OpName %a "a"
|
||||
OpName %buf0 "buf0"
|
||||
OpMemberName %buf0 0 "_GLF_uniform_int_values"
|
||||
OpName %__0 ""
|
||||
OpName %b "b"
|
||||
OpName %c "c"
|
||||
OpName %_GLF_color "_GLF_color"
|
||||
OpDecorate %_arr_float_uint_3_0 ArrayStride 16
|
||||
OpMemberDecorate %buf1 0 Offset 0
|
||||
OpDecorate %buf1 Block
|
||||
OpDecorate %_ DescriptorSet 0
|
||||
OpDecorate %_ Binding 1
|
||||
OpDecorate %_arr_int_uint_3 ArrayStride 16
|
||||
OpMemberDecorate %buf0 0 Offset 0
|
||||
OpDecorate %buf0 Block
|
||||
OpDecorate %__0 DescriptorSet 0
|
||||
OpDecorate %__0 Binding 0
|
||||
OpDecorate %_GLF_color Location 0
|
||||
%void = OpTypeVoid
|
||||
%15 = OpTypeFunction %void
|
||||
%float = OpTypeFloat 32
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_3 = OpConstant %uint 3
|
||||
%_arr_float_uint_3 = OpTypeArray %float %uint_3
|
||||
%_ptr_Function__arr_float_uint_3 = OpTypePointer Function %_arr_float_uint_3
|
||||
%_arr_float_uint_3_0 = OpTypeArray %float %uint_3
|
||||
%buf1 = OpTypeStruct %_arr_float_uint_3_0
|
||||
%_ptr_Uniform_buf1 = OpTypePointer Uniform %buf1
|
||||
%_ = OpVariable %_ptr_Uniform_buf1 Uniform
|
||||
%int = OpTypeInt 32 1
|
||||
%int_0 = OpConstant %int 0
|
||||
%int_2 = OpConstant %int 2
|
||||
%_ptr_Uniform_float = OpTypePointer Uniform %float
|
||||
%int_1 = OpConstant %int 1
|
||||
%_ptr_Function_int = OpTypePointer Function %int
|
||||
%_arr_int_uint_3 = OpTypeArray %int %uint_3
|
||||
%buf0 = OpTypeStruct %_arr_int_uint_3
|
||||
%_ptr_Uniform_buf0 = OpTypePointer Uniform %buf0
|
||||
%__0 = OpVariable %_ptr_Uniform_buf0 Uniform
|
||||
%_ptr_Uniform_int = OpTypePointer Uniform %int
|
||||
%_ptr_Function_float = OpTypePointer Function %float
|
||||
%bool = OpTypeBool
|
||||
%_ptr_Function_bool = OpTypePointer Function %bool
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%_GLF_color = OpVariable %_ptr_Output_v4float Output
|
||||
%main = OpFunction %void None %15
|
||||
%35 = OpLabel
|
||||
%A1 = OpVariable %_ptr_Function__arr_float_uint_3 Function
|
||||
%a = OpVariable %_ptr_Function_int Function
|
||||
%b = OpVariable %_ptr_Function_float Function
|
||||
%c = OpVariable %_ptr_Function_bool Function
|
||||
%36 = OpVariable %_ptr_Function_bool Function
|
||||
%37 = OpAccessChain %_ptr_Uniform_float %_ %int_0 %int_2
|
||||
%38 = OpLoad %float %37
|
||||
%39 = OpAccessChain %_ptr_Uniform_float %_ %int_0 %int_0
|
||||
%40 = OpLoad %float %39
|
||||
%41 = OpAccessChain %_ptr_Uniform_float %_ %int_0 %int_1
|
||||
%42 = OpLoad %float %41
|
||||
%43 = OpCompositeConstruct %_arr_float_uint_3 %38 %40 %42
|
||||
OpStore %A1 %43
|
||||
%44 = OpAccessChain %_ptr_Uniform_int %__0 %int_0 %int_0
|
||||
%45 = OpLoad %int %44
|
||||
%46 = OpAccessChain %_ptr_Uniform_int %__0 %int_0 %int_0
|
||||
%47 = OpLoad %int %46
|
||||
%48 = OpAccessChain %_ptr_Uniform_int %__0 %int_0 %int_1
|
||||
%49 = OpLoad %int %48
|
||||
%50 = OpExtInst %int %1 SClamp %45 %47 %49
|
||||
OpStore %a %50
|
||||
%51 = OpLoad %int %a
|
||||
%52 = OpAccessChain %_ptr_Uniform_int %__0 %int_0 %int_1
|
||||
%53 = OpLoad %int %52
|
||||
%54 = OpAccessChain %_ptr_Uniform_int %__0 %int_0 %int_0
|
||||
%55 = OpLoad %int %54
|
||||
%56 = OpExtInst %int %1 SClamp %51 %53 %55
|
||||
%57 = OpAccessChain %_ptr_Function_float %A1 %56
|
||||
%58 = OpLoad %float %57
|
||||
OpStore %b %58
|
||||
%59 = OpLoad %float %b
|
||||
%60 = OpAccessChain %_ptr_Uniform_int %__0 %int_0 %int_1
|
||||
%61 = OpLoad %int %60
|
||||
%62 = OpAccessChain %_ptr_Function_float %A1 %61
|
||||
%63 = OpLoad %float %62
|
||||
%64 = OpFOrdLessThan %bool %59 %63
|
||||
OpSelectionMerge %65 None
|
||||
OpBranchConditional %64 %66 %67
|
||||
%66 = OpLabel
|
||||
%68 = OpAccessChain %_ptr_Uniform_float %_ %int_0 %int_0
|
||||
%69 = OpLoad %float %68
|
||||
%70 = OpAccessChain %_ptr_Uniform_float %_ %int_0 %int_2
|
||||
%71 = OpLoad %float %70
|
||||
%72 = OpFOrdGreaterThan %bool %69 %71
|
||||
OpStore %36 %72
|
||||
OpBranch %65
|
||||
%67 = OpLabel
|
||||
%73 = OpAccessChain %_ptr_Uniform_float %_ %int_0 %int_0
|
||||
%74 = OpLoad %float %73
|
||||
%75 = OpAccessChain %_ptr_Uniform_int %__0 %int_0 %int_2
|
||||
%76 = OpLoad %int %75
|
||||
%77 = OpAccessChain %_ptr_Function_float %A1 %76
|
||||
%78 = OpLoad %float %77
|
||||
%79 = OpFOrdLessThan %bool %74 %78
|
||||
OpStore %36 %79
|
||||
OpBranch %65
|
||||
%65 = OpLabel
|
||||
%80 = OpLoad %bool %36
|
||||
OpStore %c %80
|
||||
%81 = OpLoad %bool %c
|
||||
OpSelectionMerge %82 None
|
||||
OpBranchConditional %81 %83 %84
|
||||
%83 = OpLabel
|
||||
%85 = OpAccessChain %_ptr_Uniform_int %__0 %int_0 %int_0
|
||||
%86 = OpLoad %int %85
|
||||
%87 = OpConvertSToF %float %86
|
||||
%88 = OpAccessChain %_ptr_Uniform_int %__0 %int_0 %int_1
|
||||
%89 = OpLoad %int %88
|
||||
%90 = OpConvertSToF %float %89
|
||||
%91 = OpAccessChain %_ptr_Uniform_int %__0 %int_0 %int_1
|
||||
%92 = OpLoad %int %91
|
||||
%93 = OpConvertSToF %float %92
|
||||
%94 = OpAccessChain %_ptr_Uniform_int %__0 %int_0 %int_0
|
||||
%95 = OpLoad %int %94
|
||||
%96 = OpConvertSToF %float %95
|
||||
%97 = OpCompositeConstruct %v4float %87 %90 %93 %96
|
||||
OpStore %_GLF_color %97
|
||||
OpBranch %82
|
||||
%84 = OpLabel
|
||||
%98 = OpAccessChain %_ptr_Uniform_float %_ %int_0 %int_0
|
||||
%99 = OpLoad %float %98
|
||||
%100 = OpCompositeConstruct %v4float %99 %99 %99 %99
|
||||
OpStore %_GLF_color %100
|
||||
OpBranch %82
|
||||
%82 = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,77 @@
|
||||
cbuffer cbuffer_x_6 : register(b1, space0) {
|
||||
uint4 x_6[3];
|
||||
};
|
||||
cbuffer cbuffer_x_9 : register(b0, space0) {
|
||||
uint4 x_9[3];
|
||||
};
|
||||
static float4 x_GLF_color = float4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
|
||||
void main_1() {
|
||||
float A1[3] = (float[3])0;
|
||||
int a = 0;
|
||||
float b = 0.0f;
|
||||
bool c = false;
|
||||
bool x_36 = false;
|
||||
const float x_38 = asfloat(x_6[2].x);
|
||||
const uint scalar_offset = ((16u * uint(0))) / 4;
|
||||
const float x_40 = asfloat(x_6[scalar_offset / 4][scalar_offset % 4]);
|
||||
const float x_42 = asfloat(x_6[1].x);
|
||||
const float tint_symbol_4[3] = {x_38, x_40, x_42};
|
||||
A1 = tint_symbol_4;
|
||||
const uint scalar_offset_1 = ((16u * uint(0))) / 4;
|
||||
const int x_45 = asint(x_9[scalar_offset_1 / 4][scalar_offset_1 % 4]);
|
||||
const uint scalar_offset_2 = ((16u * uint(0))) / 4;
|
||||
const int x_47 = asint(x_9[scalar_offset_2 / 4][scalar_offset_2 % 4]);
|
||||
const int x_49 = asint(x_9[1].x);
|
||||
a = clamp(x_45, x_47, x_49);
|
||||
const int x_51 = a;
|
||||
const int x_53 = asint(x_9[1].x);
|
||||
const uint scalar_offset_3 = ((16u * uint(0))) / 4;
|
||||
const int x_55 = asint(x_9[scalar_offset_3 / 4][scalar_offset_3 % 4]);
|
||||
const float x_58 = A1[clamp(x_51, x_53, x_55)];
|
||||
b = x_58;
|
||||
const float x_59 = b;
|
||||
const int x_61 = asint(x_9[1].x);
|
||||
const float x_63 = A1[x_61];
|
||||
if ((x_59 < x_63)) {
|
||||
const uint scalar_offset_4 = ((16u * uint(0))) / 4;
|
||||
const float x_69 = asfloat(x_6[scalar_offset_4 / 4][scalar_offset_4 % 4]);
|
||||
const float x_71 = asfloat(x_6[2].x);
|
||||
x_36 = (x_69 > x_71);
|
||||
} else {
|
||||
const uint scalar_offset_5 = ((16u * uint(0))) / 4;
|
||||
const float x_74 = asfloat(x_6[scalar_offset_5 / 4][scalar_offset_5 % 4]);
|
||||
const int x_76 = asint(x_9[2].x);
|
||||
const float x_78 = A1[x_76];
|
||||
x_36 = (x_74 < x_78);
|
||||
}
|
||||
c = x_36;
|
||||
if (c) {
|
||||
const uint scalar_offset_6 = ((16u * uint(0))) / 4;
|
||||
const int x_86 = asint(x_9[scalar_offset_6 / 4][scalar_offset_6 % 4]);
|
||||
const int x_89 = asint(x_9[1].x);
|
||||
const int x_92 = asint(x_9[1].x);
|
||||
const uint scalar_offset_7 = ((16u * uint(0))) / 4;
|
||||
const int x_95 = asint(x_9[scalar_offset_7 / 4][scalar_offset_7 % 4]);
|
||||
x_GLF_color = float4(float(x_86), float(x_89), float(x_92), float(x_95));
|
||||
} else {
|
||||
const uint scalar_offset_8 = ((16u * uint(0))) / 4;
|
||||
const float x_99 = asfloat(x_6[scalar_offset_8 / 4][scalar_offset_8 % 4]);
|
||||
x_GLF_color = float4(x_99, x_99, x_99, x_99);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
struct main_out {
|
||||
float4 x_GLF_color_1;
|
||||
};
|
||||
struct tint_symbol {
|
||||
float4 x_GLF_color_1 : SV_Target0;
|
||||
};
|
||||
|
||||
tint_symbol main() {
|
||||
main_1();
|
||||
const main_out tint_symbol_1 = {x_GLF_color};
|
||||
const tint_symbol tint_symbol_5 = {tint_symbol_1.x_GLF_color_1};
|
||||
return tint_symbol_5;
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct tint_padded_array_element {
|
||||
/* 0x0000 */ float el;
|
||||
/* 0x0004 */ int8_t tint_pad[12];
|
||||
};
|
||||
struct tint_array_wrapper {
|
||||
/* 0x0000 */ tint_padded_array_element arr[3];
|
||||
};
|
||||
struct buf1 {
|
||||
/* 0x0000 */ tint_array_wrapper x_GLF_uniform_float_values;
|
||||
};
|
||||
struct tint_padded_array_element_1 {
|
||||
/* 0x0000 */ int el;
|
||||
/* 0x0004 */ int8_t tint_pad_1[12];
|
||||
};
|
||||
struct tint_array_wrapper_1 {
|
||||
/* 0x0000 */ tint_padded_array_element_1 arr[3];
|
||||
};
|
||||
struct buf0 {
|
||||
/* 0x0000 */ tint_array_wrapper_1 x_GLF_uniform_int_values;
|
||||
};
|
||||
struct tint_array_wrapper_2 {
|
||||
float arr[3];
|
||||
};
|
||||
struct main_out {
|
||||
float4 x_GLF_color_1;
|
||||
};
|
||||
struct tint_symbol_1 {
|
||||
float4 x_GLF_color_1 [[color(0)]];
|
||||
};
|
||||
|
||||
void main_1(constant buf1& x_6, constant buf0& x_9, thread float4* const tint_symbol_5) {
|
||||
tint_array_wrapper_2 A1 = {};
|
||||
int a = 0;
|
||||
float b = 0.0f;
|
||||
bool c = false;
|
||||
bool x_36 = false;
|
||||
float const x_38 = x_6.x_GLF_uniform_float_values.arr[2].el;
|
||||
float const x_40 = x_6.x_GLF_uniform_float_values.arr[0].el;
|
||||
float const x_42 = x_6.x_GLF_uniform_float_values.arr[1].el;
|
||||
tint_array_wrapper_2 const tint_symbol_3 = {.arr={x_38, x_40, x_42}};
|
||||
A1 = tint_symbol_3;
|
||||
int const x_45 = x_9.x_GLF_uniform_int_values.arr[0].el;
|
||||
int const x_47 = x_9.x_GLF_uniform_int_values.arr[0].el;
|
||||
int const x_49 = x_9.x_GLF_uniform_int_values.arr[1].el;
|
||||
a = clamp(x_45, x_47, x_49);
|
||||
int const x_51 = a;
|
||||
int const x_53 = x_9.x_GLF_uniform_int_values.arr[1].el;
|
||||
int const x_55 = x_9.x_GLF_uniform_int_values.arr[0].el;
|
||||
float const x_58 = A1.arr[clamp(x_51, x_53, x_55)];
|
||||
b = x_58;
|
||||
float const x_59 = b;
|
||||
int const x_61 = x_9.x_GLF_uniform_int_values.arr[1].el;
|
||||
float const x_63 = A1.arr[x_61];
|
||||
if ((x_59 < x_63)) {
|
||||
float const x_69 = x_6.x_GLF_uniform_float_values.arr[0].el;
|
||||
float const x_71 = x_6.x_GLF_uniform_float_values.arr[2].el;
|
||||
x_36 = (x_69 > x_71);
|
||||
} else {
|
||||
float const x_74 = x_6.x_GLF_uniform_float_values.arr[0].el;
|
||||
int const x_76 = x_9.x_GLF_uniform_int_values.arr[2].el;
|
||||
float const x_78 = A1.arr[x_76];
|
||||
x_36 = (x_74 < x_78);
|
||||
}
|
||||
bool const x_80 = x_36;
|
||||
c = x_80;
|
||||
bool const x_81 = c;
|
||||
if (x_81) {
|
||||
int const x_86 = x_9.x_GLF_uniform_int_values.arr[0].el;
|
||||
int const x_89 = x_9.x_GLF_uniform_int_values.arr[1].el;
|
||||
int const x_92 = x_9.x_GLF_uniform_int_values.arr[1].el;
|
||||
int const x_95 = x_9.x_GLF_uniform_int_values.arr[0].el;
|
||||
*(tint_symbol_5) = float4(float(x_86), float(x_89), float(x_92), float(x_95));
|
||||
} else {
|
||||
float const x_99 = x_6.x_GLF_uniform_float_values.arr[0].el;
|
||||
*(tint_symbol_5) = float4(x_99, x_99, x_99, x_99);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
fragment tint_symbol_1 tint_symbol(constant buf1& x_6 [[buffer(1)]], constant buf0& x_9 [[buffer(0)]]) {
|
||||
thread float4 tint_symbol_6 = 0.0f;
|
||||
main_1(x_6, x_9, &(tint_symbol_6));
|
||||
main_out const tint_symbol_2 = {.x_GLF_color_1=tint_symbol_6};
|
||||
tint_symbol_1 const tint_symbol_4 = {.x_GLF_color_1=tint_symbol_2.x_GLF_color_1};
|
||||
return tint_symbol_4;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,186 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 121
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
%58 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Fragment %main "main" %tint_symbol_1
|
||||
OpExecutionMode %main OriginUpperLeft
|
||||
OpName %buf1 "buf1"
|
||||
OpMemberName %buf1 0 "x_GLF_uniform_float_values"
|
||||
OpName %x_6 "x_6"
|
||||
OpName %buf0 "buf0"
|
||||
OpMemberName %buf0 0 "x_GLF_uniform_int_values"
|
||||
OpName %x_9 "x_9"
|
||||
OpName %x_GLF_color "x_GLF_color"
|
||||
OpName %tint_symbol_1 "tint_symbol_1"
|
||||
OpName %main_1 "main_1"
|
||||
OpName %A1 "A1"
|
||||
OpName %a "a"
|
||||
OpName %b "b"
|
||||
OpName %c "c"
|
||||
OpName %x_36 "x_36"
|
||||
OpName %main_out "main_out"
|
||||
OpMemberName %main_out 0 "x_GLF_color_1"
|
||||
OpName %tint_symbol_2 "tint_symbol_2"
|
||||
OpName %tint_symbol "tint_symbol"
|
||||
OpName %main "main"
|
||||
OpDecorate %buf1 Block
|
||||
OpMemberDecorate %buf1 0 Offset 0
|
||||
OpDecorate %_arr_float_uint_3 ArrayStride 16
|
||||
OpDecorate %x_6 NonWritable
|
||||
OpDecorate %x_6 DescriptorSet 0
|
||||
OpDecorate %x_6 Binding 1
|
||||
OpDecorate %buf0 Block
|
||||
OpMemberDecorate %buf0 0 Offset 0
|
||||
OpDecorate %_arr_int_uint_3 ArrayStride 16
|
||||
OpDecorate %x_9 NonWritable
|
||||
OpDecorate %x_9 DescriptorSet 0
|
||||
OpDecorate %x_9 Binding 0
|
||||
OpDecorate %tint_symbol_1 Location 0
|
||||
OpDecorate %_arr_float_uint_3_0 ArrayStride 4
|
||||
OpMemberDecorate %main_out 0 Offset 0
|
||||
%float = OpTypeFloat 32
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_3 = OpConstant %uint 3
|
||||
%_arr_float_uint_3 = OpTypeArray %float %uint_3
|
||||
%buf1 = OpTypeStruct %_arr_float_uint_3
|
||||
%_ptr_Uniform_buf1 = OpTypePointer Uniform %buf1
|
||||
%x_6 = OpVariable %_ptr_Uniform_buf1 Uniform
|
||||
%int = OpTypeInt 32 1
|
||||
%_arr_int_uint_3 = OpTypeArray %int %uint_3
|
||||
%buf0 = OpTypeStruct %_arr_int_uint_3
|
||||
%_ptr_Uniform_buf0 = OpTypePointer Uniform %buf0
|
||||
%x_9 = OpVariable %_ptr_Uniform_buf0 Uniform
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Private_v4float = OpTypePointer Private %v4float
|
||||
%16 = OpConstantNull %v4float
|
||||
%x_GLF_color = OpVariable %_ptr_Private_v4float Private %16
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %16
|
||||
%void = OpTypeVoid
|
||||
%19 = OpTypeFunction %void
|
||||
%_arr_float_uint_3_0 = OpTypeArray %float %uint_3
|
||||
%_ptr_Function__arr_float_uint_3_0 = OpTypePointer Function %_arr_float_uint_3_0
|
||||
%26 = OpConstantNull %_arr_float_uint_3_0
|
||||
%_ptr_Function_int = OpTypePointer Function %int
|
||||
%29 = OpConstantNull %int
|
||||
%_ptr_Function_float = OpTypePointer Function %float
|
||||
%32 = OpConstantNull %float
|
||||
%bool = OpTypeBool
|
||||
%_ptr_Function_bool = OpTypePointer Function %bool
|
||||
%36 = OpConstantNull %bool
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%int_2 = OpConstant %int 2
|
||||
%_ptr_Uniform_float = OpTypePointer Uniform %float
|
||||
%int_0 = OpConstant %int 0
|
||||
%int_1 = OpConstant %int 1
|
||||
%_ptr_Uniform_int = OpTypePointer Uniform %int
|
||||
%main_out = OpTypeStruct %v4float
|
||||
%109 = OpTypeFunction %void %main_out
|
||||
%main_1 = OpFunction %void None %19
|
||||
%22 = OpLabel
|
||||
%A1 = OpVariable %_ptr_Function__arr_float_uint_3_0 Function %26
|
||||
%a = OpVariable %_ptr_Function_int Function %29
|
||||
%b = OpVariable %_ptr_Function_float Function %32
|
||||
%c = OpVariable %_ptr_Function_bool Function %36
|
||||
%x_36 = OpVariable %_ptr_Function_bool Function %36
|
||||
%41 = OpAccessChain %_ptr_Uniform_float %x_6 %uint_0 %int_2
|
||||
%42 = OpLoad %float %41
|
||||
%44 = OpAccessChain %_ptr_Uniform_float %x_6 %uint_0 %int_0
|
||||
%45 = OpLoad %float %44
|
||||
%47 = OpAccessChain %_ptr_Uniform_float %x_6 %uint_0 %int_1
|
||||
%48 = OpLoad %float %47
|
||||
%49 = OpCompositeConstruct %_arr_float_uint_3_0 %42 %45 %48
|
||||
OpStore %A1 %49
|
||||
%51 = OpAccessChain %_ptr_Uniform_int %x_9 %uint_0 %int_0
|
||||
%52 = OpLoad %int %51
|
||||
%53 = OpAccessChain %_ptr_Uniform_int %x_9 %uint_0 %int_0
|
||||
%54 = OpLoad %int %53
|
||||
%55 = OpAccessChain %_ptr_Uniform_int %x_9 %uint_0 %int_1
|
||||
%56 = OpLoad %int %55
|
||||
%57 = OpExtInst %int %58 SClamp %52 %54 %56
|
||||
OpStore %a %57
|
||||
%59 = OpLoad %int %a
|
||||
%60 = OpAccessChain %_ptr_Uniform_int %x_9 %uint_0 %int_1
|
||||
%61 = OpLoad %int %60
|
||||
%62 = OpAccessChain %_ptr_Uniform_int %x_9 %uint_0 %int_0
|
||||
%63 = OpLoad %int %62
|
||||
%64 = OpExtInst %int %58 SClamp %59 %61 %63
|
||||
%65 = OpAccessChain %_ptr_Function_float %A1 %64
|
||||
%66 = OpLoad %float %65
|
||||
OpStore %b %66
|
||||
%67 = OpLoad %float %b
|
||||
%68 = OpAccessChain %_ptr_Uniform_int %x_9 %uint_0 %int_1
|
||||
%69 = OpLoad %int %68
|
||||
%70 = OpAccessChain %_ptr_Function_float %A1 %69
|
||||
%71 = OpLoad %float %70
|
||||
%72 = OpFOrdLessThan %bool %67 %71
|
||||
OpSelectionMerge %73 None
|
||||
OpBranchConditional %72 %74 %75
|
||||
%74 = OpLabel
|
||||
%76 = OpAccessChain %_ptr_Uniform_float %x_6 %uint_0 %int_0
|
||||
%77 = OpLoad %float %76
|
||||
%78 = OpAccessChain %_ptr_Uniform_float %x_6 %uint_0 %int_2
|
||||
%79 = OpLoad %float %78
|
||||
%80 = OpFOrdGreaterThan %bool %77 %79
|
||||
OpStore %x_36 %80
|
||||
OpBranch %73
|
||||
%75 = OpLabel
|
||||
%81 = OpAccessChain %_ptr_Uniform_float %x_6 %uint_0 %int_0
|
||||
%82 = OpLoad %float %81
|
||||
%83 = OpAccessChain %_ptr_Uniform_int %x_9 %uint_0 %int_2
|
||||
%84 = OpLoad %int %83
|
||||
%85 = OpAccessChain %_ptr_Function_float %A1 %84
|
||||
%86 = OpLoad %float %85
|
||||
%87 = OpFOrdLessThan %bool %82 %86
|
||||
OpStore %x_36 %87
|
||||
OpBranch %73
|
||||
%73 = OpLabel
|
||||
%88 = OpLoad %bool %x_36
|
||||
OpStore %c %88
|
||||
%89 = OpLoad %bool %c
|
||||
OpSelectionMerge %90 None
|
||||
OpBranchConditional %89 %91 %92
|
||||
%91 = OpLabel
|
||||
%93 = OpAccessChain %_ptr_Uniform_int %x_9 %uint_0 %int_0
|
||||
%94 = OpLoad %int %93
|
||||
%95 = OpAccessChain %_ptr_Uniform_int %x_9 %uint_0 %int_1
|
||||
%96 = OpLoad %int %95
|
||||
%97 = OpAccessChain %_ptr_Uniform_int %x_9 %uint_0 %int_1
|
||||
%98 = OpLoad %int %97
|
||||
%99 = OpAccessChain %_ptr_Uniform_int %x_9 %uint_0 %int_0
|
||||
%100 = OpLoad %int %99
|
||||
%101 = OpConvertSToF %float %94
|
||||
%102 = OpConvertSToF %float %96
|
||||
%103 = OpConvertSToF %float %98
|
||||
%104 = OpConvertSToF %float %100
|
||||
%105 = OpCompositeConstruct %v4float %101 %102 %103 %104
|
||||
OpStore %x_GLF_color %105
|
||||
OpBranch %90
|
||||
%92 = OpLabel
|
||||
%106 = OpAccessChain %_ptr_Uniform_float %x_6 %uint_0 %int_0
|
||||
%107 = OpLoad %float %106
|
||||
%108 = OpCompositeConstruct %v4float %107 %107 %107 %107
|
||||
OpStore %x_GLF_color %108
|
||||
OpBranch %90
|
||||
%90 = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%tint_symbol_2 = OpFunction %void None %109
|
||||
%tint_symbol = OpFunctionParameter %main_out
|
||||
%113 = OpLabel
|
||||
%114 = OpCompositeExtract %v4float %tint_symbol 0
|
||||
OpStore %tint_symbol_1 %114
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%main = OpFunction %void None %19
|
||||
%116 = OpLabel
|
||||
%117 = OpFunctionCall %void %main_1
|
||||
%119 = OpLoad %v4float %x_GLF_color
|
||||
%120 = OpCompositeConstruct %main_out %119
|
||||
%118 = OpFunctionCall %void %tint_symbol_2 %120
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,78 @@
|
||||
type Arr = [[stride(16)]] array<f32, 3>;
|
||||
|
||||
[[block]]
|
||||
struct buf1 {
|
||||
x_GLF_uniform_float_values : Arr;
|
||||
};
|
||||
|
||||
type Arr_1 = [[stride(16)]] array<i32, 3>;
|
||||
|
||||
[[block]]
|
||||
struct buf0 {
|
||||
x_GLF_uniform_int_values : Arr_1;
|
||||
};
|
||||
|
||||
[[group(0), binding(1)]] var<uniform> x_6 : buf1;
|
||||
|
||||
[[group(0), binding(0)]] var<uniform> x_9 : buf0;
|
||||
|
||||
var<private> x_GLF_color : vec4<f32>;
|
||||
|
||||
fn main_1() {
|
||||
var A1 : array<f32, 3>;
|
||||
var a : i32;
|
||||
var b : f32;
|
||||
var c : bool;
|
||||
var x_36 : bool;
|
||||
let x_38 : f32 = x_6.x_GLF_uniform_float_values[2];
|
||||
let x_40 : f32 = x_6.x_GLF_uniform_float_values[0];
|
||||
let x_42 : f32 = x_6.x_GLF_uniform_float_values[1];
|
||||
A1 = array<f32, 3>(x_38, x_40, x_42);
|
||||
let x_45 : i32 = x_9.x_GLF_uniform_int_values[0];
|
||||
let x_47 : i32 = x_9.x_GLF_uniform_int_values[0];
|
||||
let x_49 : i32 = x_9.x_GLF_uniform_int_values[1];
|
||||
a = clamp(x_45, x_47, x_49);
|
||||
let x_51 : i32 = a;
|
||||
let x_53 : i32 = x_9.x_GLF_uniform_int_values[1];
|
||||
let x_55 : i32 = x_9.x_GLF_uniform_int_values[0];
|
||||
let x_58 : f32 = A1[clamp(x_51, x_53, x_55)];
|
||||
b = x_58;
|
||||
let x_59 : f32 = b;
|
||||
let x_61 : i32 = x_9.x_GLF_uniform_int_values[1];
|
||||
let x_63 : f32 = A1[x_61];
|
||||
if ((x_59 < x_63)) {
|
||||
let x_69 : f32 = x_6.x_GLF_uniform_float_values[0];
|
||||
let x_71 : f32 = x_6.x_GLF_uniform_float_values[2];
|
||||
x_36 = (x_69 > x_71);
|
||||
} else {
|
||||
let x_74 : f32 = x_6.x_GLF_uniform_float_values[0];
|
||||
let x_76 : i32 = x_9.x_GLF_uniform_int_values[2];
|
||||
let x_78 : f32 = A1[x_76];
|
||||
x_36 = (x_74 < x_78);
|
||||
}
|
||||
let x_80 : bool = x_36;
|
||||
c = x_80;
|
||||
let x_81 : bool = c;
|
||||
if (x_81) {
|
||||
let x_86 : i32 = x_9.x_GLF_uniform_int_values[0];
|
||||
let x_89 : i32 = x_9.x_GLF_uniform_int_values[1];
|
||||
let x_92 : i32 = x_9.x_GLF_uniform_int_values[1];
|
||||
let x_95 : i32 = x_9.x_GLF_uniform_int_values[0];
|
||||
x_GLF_color = vec4<f32>(f32(x_86), f32(x_89), f32(x_92), f32(x_95));
|
||||
} else {
|
||||
let x_99 : f32 = x_6.x_GLF_uniform_float_values[0];
|
||||
x_GLF_color = vec4<f32>(x_99, x_99, x_99, x_99);
|
||||
}
|
||||
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);
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
type Arr = [[stride(16)]] array<f32, 3>;
|
||||
|
||||
[[block]]
|
||||
struct buf1 {
|
||||
x_GLF_uniform_float_values : Arr;
|
||||
};
|
||||
|
||||
type Arr_1 = [[stride(16)]] array<i32, 3>;
|
||||
|
||||
[[block]]
|
||||
struct buf0 {
|
||||
x_GLF_uniform_int_values : Arr_1;
|
||||
};
|
||||
|
||||
[[group(0), binding(1)]] var<uniform> x_6 : buf1;
|
||||
|
||||
[[group(0), binding(0)]] var<uniform> x_9 : buf0;
|
||||
|
||||
var<private> x_GLF_color : vec4<f32>;
|
||||
|
||||
fn main_1() {
|
||||
var A1 : array<f32, 3>;
|
||||
var a : i32;
|
||||
var b : f32;
|
||||
var c : bool;
|
||||
var x_36 : bool;
|
||||
let x_38 : f32 = x_6.x_GLF_uniform_float_values[2];
|
||||
let x_40 : f32 = x_6.x_GLF_uniform_float_values[0];
|
||||
let x_42 : f32 = x_6.x_GLF_uniform_float_values[1];
|
||||
A1 = array<f32, 3>(x_38, x_40, x_42);
|
||||
let x_45 : i32 = x_9.x_GLF_uniform_int_values[0];
|
||||
let x_47 : i32 = x_9.x_GLF_uniform_int_values[0];
|
||||
let x_49 : i32 = x_9.x_GLF_uniform_int_values[1];
|
||||
a = clamp(x_45, x_47, x_49);
|
||||
let x_51 : i32 = a;
|
||||
let x_53 : i32 = x_9.x_GLF_uniform_int_values[1];
|
||||
let x_55 : i32 = x_9.x_GLF_uniform_int_values[0];
|
||||
let x_58 : f32 = A1[clamp(x_51, x_53, x_55)];
|
||||
b = x_58;
|
||||
let x_59 : f32 = b;
|
||||
let x_61 : i32 = x_9.x_GLF_uniform_int_values[1];
|
||||
let x_63 : f32 = A1[x_61];
|
||||
if ((x_59 < x_63)) {
|
||||
let x_69 : f32 = x_6.x_GLF_uniform_float_values[0];
|
||||
let x_71 : f32 = x_6.x_GLF_uniform_float_values[2];
|
||||
x_36 = (x_69 > x_71);
|
||||
} else {
|
||||
let x_74 : f32 = x_6.x_GLF_uniform_float_values[0];
|
||||
let x_76 : i32 = x_9.x_GLF_uniform_int_values[2];
|
||||
let x_78 : f32 = A1[x_76];
|
||||
x_36 = (x_74 < x_78);
|
||||
}
|
||||
let x_80 : bool = x_36;
|
||||
c = x_80;
|
||||
let x_81 : bool = c;
|
||||
if (x_81) {
|
||||
let x_86 : i32 = x_9.x_GLF_uniform_int_values[0];
|
||||
let x_89 : i32 = x_9.x_GLF_uniform_int_values[1];
|
||||
let x_92 : i32 = x_9.x_GLF_uniform_int_values[1];
|
||||
let x_95 : i32 = x_9.x_GLF_uniform_int_values[0];
|
||||
x_GLF_color = vec4<f32>(f32(x_86), f32(x_89), f32(x_92), f32(x_95));
|
||||
} else {
|
||||
let x_99 : f32 = x_6.x_GLF_uniform_float_values[0];
|
||||
x_GLF_color = vec4<f32>(x_99, x_99, x_99, x_99);
|
||||
}
|
||||
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);
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
cbuffer cbuffer_x_6 : register(b1, space0) {
|
||||
uint4 x_6[3];
|
||||
};
|
||||
cbuffer cbuffer_x_9 : register(b0, space0) {
|
||||
uint4 x_9[3];
|
||||
};
|
||||
static float4 x_GLF_color = float4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
|
||||
void main_1() {
|
||||
float A1[3] = (float[3])0;
|
||||
int a = 0;
|
||||
float b = 0.0f;
|
||||
bool c = false;
|
||||
bool x_36 = false;
|
||||
const float x_38 = asfloat(x_6[2].x);
|
||||
const uint scalar_offset = ((16u * uint(0))) / 4;
|
||||
const float x_40 = asfloat(x_6[scalar_offset / 4][scalar_offset % 4]);
|
||||
const float x_42 = asfloat(x_6[1].x);
|
||||
const float tint_symbol_4[3] = {x_38, x_40, x_42};
|
||||
A1 = tint_symbol_4;
|
||||
const uint scalar_offset_1 = ((16u * uint(0))) / 4;
|
||||
const int x_45 = asint(x_9[scalar_offset_1 / 4][scalar_offset_1 % 4]);
|
||||
const uint scalar_offset_2 = ((16u * uint(0))) / 4;
|
||||
const int x_47 = asint(x_9[scalar_offset_2 / 4][scalar_offset_2 % 4]);
|
||||
const int x_49 = asint(x_9[1].x);
|
||||
a = clamp(x_45, x_47, x_49);
|
||||
const int x_51 = a;
|
||||
const int x_53 = asint(x_9[1].x);
|
||||
const uint scalar_offset_3 = ((16u * uint(0))) / 4;
|
||||
const int x_55 = asint(x_9[scalar_offset_3 / 4][scalar_offset_3 % 4]);
|
||||
const float x_58 = A1[clamp(x_51, x_53, x_55)];
|
||||
b = x_58;
|
||||
const float x_59 = b;
|
||||
const int x_61 = asint(x_9[1].x);
|
||||
const float x_63 = A1[x_61];
|
||||
if ((x_59 < x_63)) {
|
||||
const uint scalar_offset_4 = ((16u * uint(0))) / 4;
|
||||
const float x_69 = asfloat(x_6[scalar_offset_4 / 4][scalar_offset_4 % 4]);
|
||||
const float x_71 = asfloat(x_6[2].x);
|
||||
x_36 = (x_69 > x_71);
|
||||
} else {
|
||||
const uint scalar_offset_5 = ((16u * uint(0))) / 4;
|
||||
const float x_74 = asfloat(x_6[scalar_offset_5 / 4][scalar_offset_5 % 4]);
|
||||
const int x_76 = asint(x_9[2].x);
|
||||
const float x_78 = A1[x_76];
|
||||
x_36 = (x_74 < x_78);
|
||||
}
|
||||
c = x_36;
|
||||
if (c) {
|
||||
const uint scalar_offset_6 = ((16u * uint(0))) / 4;
|
||||
const int x_86 = asint(x_9[scalar_offset_6 / 4][scalar_offset_6 % 4]);
|
||||
const int x_89 = asint(x_9[1].x);
|
||||
const int x_92 = asint(x_9[1].x);
|
||||
const uint scalar_offset_7 = ((16u * uint(0))) / 4;
|
||||
const int x_95 = asint(x_9[scalar_offset_7 / 4][scalar_offset_7 % 4]);
|
||||
x_GLF_color = float4(float(x_86), float(x_89), float(x_92), float(x_95));
|
||||
} else {
|
||||
const uint scalar_offset_8 = ((16u * uint(0))) / 4;
|
||||
const float x_99 = asfloat(x_6[scalar_offset_8 / 4][scalar_offset_8 % 4]);
|
||||
x_GLF_color = float4(x_99, x_99, x_99, x_99);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
struct main_out {
|
||||
float4 x_GLF_color_1;
|
||||
};
|
||||
struct tint_symbol {
|
||||
float4 x_GLF_color_1 : SV_Target0;
|
||||
};
|
||||
|
||||
tint_symbol main() {
|
||||
main_1();
|
||||
const main_out tint_symbol_1 = {x_GLF_color};
|
||||
const tint_symbol tint_symbol_5 = {tint_symbol_1.x_GLF_color_1};
|
||||
return tint_symbol_5;
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct tint_padded_array_element {
|
||||
/* 0x0000 */ float el;
|
||||
/* 0x0004 */ int8_t tint_pad[12];
|
||||
};
|
||||
struct tint_array_wrapper {
|
||||
/* 0x0000 */ tint_padded_array_element arr[3];
|
||||
};
|
||||
struct buf1 {
|
||||
/* 0x0000 */ tint_array_wrapper x_GLF_uniform_float_values;
|
||||
};
|
||||
struct tint_padded_array_element_1 {
|
||||
/* 0x0000 */ int el;
|
||||
/* 0x0004 */ int8_t tint_pad_1[12];
|
||||
};
|
||||
struct tint_array_wrapper_1 {
|
||||
/* 0x0000 */ tint_padded_array_element_1 arr[3];
|
||||
};
|
||||
struct buf0 {
|
||||
/* 0x0000 */ tint_array_wrapper_1 x_GLF_uniform_int_values;
|
||||
};
|
||||
struct tint_array_wrapper_2 {
|
||||
float arr[3];
|
||||
};
|
||||
struct main_out {
|
||||
float4 x_GLF_color_1;
|
||||
};
|
||||
struct tint_symbol_1 {
|
||||
float4 x_GLF_color_1 [[color(0)]];
|
||||
};
|
||||
|
||||
void main_1(constant buf1& x_6, constant buf0& x_9, thread float4* const tint_symbol_5) {
|
||||
tint_array_wrapper_2 A1 = {};
|
||||
int a = 0;
|
||||
float b = 0.0f;
|
||||
bool c = false;
|
||||
bool x_36 = false;
|
||||
float const x_38 = x_6.x_GLF_uniform_float_values.arr[2].el;
|
||||
float const x_40 = x_6.x_GLF_uniform_float_values.arr[0].el;
|
||||
float const x_42 = x_6.x_GLF_uniform_float_values.arr[1].el;
|
||||
tint_array_wrapper_2 const tint_symbol_3 = {.arr={x_38, x_40, x_42}};
|
||||
A1 = tint_symbol_3;
|
||||
int const x_45 = x_9.x_GLF_uniform_int_values.arr[0].el;
|
||||
int const x_47 = x_9.x_GLF_uniform_int_values.arr[0].el;
|
||||
int const x_49 = x_9.x_GLF_uniform_int_values.arr[1].el;
|
||||
a = clamp(x_45, x_47, x_49);
|
||||
int const x_51 = a;
|
||||
int const x_53 = x_9.x_GLF_uniform_int_values.arr[1].el;
|
||||
int const x_55 = x_9.x_GLF_uniform_int_values.arr[0].el;
|
||||
float const x_58 = A1.arr[clamp(x_51, x_53, x_55)];
|
||||
b = x_58;
|
||||
float const x_59 = b;
|
||||
int const x_61 = x_9.x_GLF_uniform_int_values.arr[1].el;
|
||||
float const x_63 = A1.arr[x_61];
|
||||
if ((x_59 < x_63)) {
|
||||
float const x_69 = x_6.x_GLF_uniform_float_values.arr[0].el;
|
||||
float const x_71 = x_6.x_GLF_uniform_float_values.arr[2].el;
|
||||
x_36 = (x_69 > x_71);
|
||||
} else {
|
||||
float const x_74 = x_6.x_GLF_uniform_float_values.arr[0].el;
|
||||
int const x_76 = x_9.x_GLF_uniform_int_values.arr[2].el;
|
||||
float const x_78 = A1.arr[x_76];
|
||||
x_36 = (x_74 < x_78);
|
||||
}
|
||||
bool const x_80 = x_36;
|
||||
c = x_80;
|
||||
bool const x_81 = c;
|
||||
if (x_81) {
|
||||
int const x_86 = x_9.x_GLF_uniform_int_values.arr[0].el;
|
||||
int const x_89 = x_9.x_GLF_uniform_int_values.arr[1].el;
|
||||
int const x_92 = x_9.x_GLF_uniform_int_values.arr[1].el;
|
||||
int const x_95 = x_9.x_GLF_uniform_int_values.arr[0].el;
|
||||
*(tint_symbol_5) = float4(float(x_86), float(x_89), float(x_92), float(x_95));
|
||||
} else {
|
||||
float const x_99 = x_6.x_GLF_uniform_float_values.arr[0].el;
|
||||
*(tint_symbol_5) = float4(x_99, x_99, x_99, x_99);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
fragment tint_symbol_1 tint_symbol(constant buf1& x_6 [[buffer(1)]], constant buf0& x_9 [[buffer(0)]]) {
|
||||
thread float4 tint_symbol_6 = 0.0f;
|
||||
main_1(x_6, x_9, &(tint_symbol_6));
|
||||
main_out const tint_symbol_2 = {.x_GLF_color_1=tint_symbol_6};
|
||||
tint_symbol_1 const tint_symbol_4 = {.x_GLF_color_1=tint_symbol_2.x_GLF_color_1};
|
||||
return tint_symbol_4;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,186 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 121
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
%58 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Fragment %main "main" %tint_symbol_1
|
||||
OpExecutionMode %main OriginUpperLeft
|
||||
OpName %buf1 "buf1"
|
||||
OpMemberName %buf1 0 "x_GLF_uniform_float_values"
|
||||
OpName %x_6 "x_6"
|
||||
OpName %buf0 "buf0"
|
||||
OpMemberName %buf0 0 "x_GLF_uniform_int_values"
|
||||
OpName %x_9 "x_9"
|
||||
OpName %x_GLF_color "x_GLF_color"
|
||||
OpName %tint_symbol_1 "tint_symbol_1"
|
||||
OpName %main_1 "main_1"
|
||||
OpName %A1 "A1"
|
||||
OpName %a "a"
|
||||
OpName %b "b"
|
||||
OpName %c "c"
|
||||
OpName %x_36 "x_36"
|
||||
OpName %main_out "main_out"
|
||||
OpMemberName %main_out 0 "x_GLF_color_1"
|
||||
OpName %tint_symbol_2 "tint_symbol_2"
|
||||
OpName %tint_symbol "tint_symbol"
|
||||
OpName %main "main"
|
||||
OpDecorate %buf1 Block
|
||||
OpMemberDecorate %buf1 0 Offset 0
|
||||
OpDecorate %_arr_float_uint_3 ArrayStride 16
|
||||
OpDecorate %x_6 NonWritable
|
||||
OpDecorate %x_6 DescriptorSet 0
|
||||
OpDecorate %x_6 Binding 1
|
||||
OpDecorate %buf0 Block
|
||||
OpMemberDecorate %buf0 0 Offset 0
|
||||
OpDecorate %_arr_int_uint_3 ArrayStride 16
|
||||
OpDecorate %x_9 NonWritable
|
||||
OpDecorate %x_9 DescriptorSet 0
|
||||
OpDecorate %x_9 Binding 0
|
||||
OpDecorate %tint_symbol_1 Location 0
|
||||
OpDecorate %_arr_float_uint_3_0 ArrayStride 4
|
||||
OpMemberDecorate %main_out 0 Offset 0
|
||||
%float = OpTypeFloat 32
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_3 = OpConstant %uint 3
|
||||
%_arr_float_uint_3 = OpTypeArray %float %uint_3
|
||||
%buf1 = OpTypeStruct %_arr_float_uint_3
|
||||
%_ptr_Uniform_buf1 = OpTypePointer Uniform %buf1
|
||||
%x_6 = OpVariable %_ptr_Uniform_buf1 Uniform
|
||||
%int = OpTypeInt 32 1
|
||||
%_arr_int_uint_3 = OpTypeArray %int %uint_3
|
||||
%buf0 = OpTypeStruct %_arr_int_uint_3
|
||||
%_ptr_Uniform_buf0 = OpTypePointer Uniform %buf0
|
||||
%x_9 = OpVariable %_ptr_Uniform_buf0 Uniform
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Private_v4float = OpTypePointer Private %v4float
|
||||
%16 = OpConstantNull %v4float
|
||||
%x_GLF_color = OpVariable %_ptr_Private_v4float Private %16
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %16
|
||||
%void = OpTypeVoid
|
||||
%19 = OpTypeFunction %void
|
||||
%_arr_float_uint_3_0 = OpTypeArray %float %uint_3
|
||||
%_ptr_Function__arr_float_uint_3_0 = OpTypePointer Function %_arr_float_uint_3_0
|
||||
%26 = OpConstantNull %_arr_float_uint_3_0
|
||||
%_ptr_Function_int = OpTypePointer Function %int
|
||||
%29 = OpConstantNull %int
|
||||
%_ptr_Function_float = OpTypePointer Function %float
|
||||
%32 = OpConstantNull %float
|
||||
%bool = OpTypeBool
|
||||
%_ptr_Function_bool = OpTypePointer Function %bool
|
||||
%36 = OpConstantNull %bool
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%int_2 = OpConstant %int 2
|
||||
%_ptr_Uniform_float = OpTypePointer Uniform %float
|
||||
%int_0 = OpConstant %int 0
|
||||
%int_1 = OpConstant %int 1
|
||||
%_ptr_Uniform_int = OpTypePointer Uniform %int
|
||||
%main_out = OpTypeStruct %v4float
|
||||
%109 = OpTypeFunction %void %main_out
|
||||
%main_1 = OpFunction %void None %19
|
||||
%22 = OpLabel
|
||||
%A1 = OpVariable %_ptr_Function__arr_float_uint_3_0 Function %26
|
||||
%a = OpVariable %_ptr_Function_int Function %29
|
||||
%b = OpVariable %_ptr_Function_float Function %32
|
||||
%c = OpVariable %_ptr_Function_bool Function %36
|
||||
%x_36 = OpVariable %_ptr_Function_bool Function %36
|
||||
%41 = OpAccessChain %_ptr_Uniform_float %x_6 %uint_0 %int_2
|
||||
%42 = OpLoad %float %41
|
||||
%44 = OpAccessChain %_ptr_Uniform_float %x_6 %uint_0 %int_0
|
||||
%45 = OpLoad %float %44
|
||||
%47 = OpAccessChain %_ptr_Uniform_float %x_6 %uint_0 %int_1
|
||||
%48 = OpLoad %float %47
|
||||
%49 = OpCompositeConstruct %_arr_float_uint_3_0 %42 %45 %48
|
||||
OpStore %A1 %49
|
||||
%51 = OpAccessChain %_ptr_Uniform_int %x_9 %uint_0 %int_0
|
||||
%52 = OpLoad %int %51
|
||||
%53 = OpAccessChain %_ptr_Uniform_int %x_9 %uint_0 %int_0
|
||||
%54 = OpLoad %int %53
|
||||
%55 = OpAccessChain %_ptr_Uniform_int %x_9 %uint_0 %int_1
|
||||
%56 = OpLoad %int %55
|
||||
%57 = OpExtInst %int %58 SClamp %52 %54 %56
|
||||
OpStore %a %57
|
||||
%59 = OpLoad %int %a
|
||||
%60 = OpAccessChain %_ptr_Uniform_int %x_9 %uint_0 %int_1
|
||||
%61 = OpLoad %int %60
|
||||
%62 = OpAccessChain %_ptr_Uniform_int %x_9 %uint_0 %int_0
|
||||
%63 = OpLoad %int %62
|
||||
%64 = OpExtInst %int %58 SClamp %59 %61 %63
|
||||
%65 = OpAccessChain %_ptr_Function_float %A1 %64
|
||||
%66 = OpLoad %float %65
|
||||
OpStore %b %66
|
||||
%67 = OpLoad %float %b
|
||||
%68 = OpAccessChain %_ptr_Uniform_int %x_9 %uint_0 %int_1
|
||||
%69 = OpLoad %int %68
|
||||
%70 = OpAccessChain %_ptr_Function_float %A1 %69
|
||||
%71 = OpLoad %float %70
|
||||
%72 = OpFOrdLessThan %bool %67 %71
|
||||
OpSelectionMerge %73 None
|
||||
OpBranchConditional %72 %74 %75
|
||||
%74 = OpLabel
|
||||
%76 = OpAccessChain %_ptr_Uniform_float %x_6 %uint_0 %int_0
|
||||
%77 = OpLoad %float %76
|
||||
%78 = OpAccessChain %_ptr_Uniform_float %x_6 %uint_0 %int_2
|
||||
%79 = OpLoad %float %78
|
||||
%80 = OpFOrdGreaterThan %bool %77 %79
|
||||
OpStore %x_36 %80
|
||||
OpBranch %73
|
||||
%75 = OpLabel
|
||||
%81 = OpAccessChain %_ptr_Uniform_float %x_6 %uint_0 %int_0
|
||||
%82 = OpLoad %float %81
|
||||
%83 = OpAccessChain %_ptr_Uniform_int %x_9 %uint_0 %int_2
|
||||
%84 = OpLoad %int %83
|
||||
%85 = OpAccessChain %_ptr_Function_float %A1 %84
|
||||
%86 = OpLoad %float %85
|
||||
%87 = OpFOrdLessThan %bool %82 %86
|
||||
OpStore %x_36 %87
|
||||
OpBranch %73
|
||||
%73 = OpLabel
|
||||
%88 = OpLoad %bool %x_36
|
||||
OpStore %c %88
|
||||
%89 = OpLoad %bool %c
|
||||
OpSelectionMerge %90 None
|
||||
OpBranchConditional %89 %91 %92
|
||||
%91 = OpLabel
|
||||
%93 = OpAccessChain %_ptr_Uniform_int %x_9 %uint_0 %int_0
|
||||
%94 = OpLoad %int %93
|
||||
%95 = OpAccessChain %_ptr_Uniform_int %x_9 %uint_0 %int_1
|
||||
%96 = OpLoad %int %95
|
||||
%97 = OpAccessChain %_ptr_Uniform_int %x_9 %uint_0 %int_1
|
||||
%98 = OpLoad %int %97
|
||||
%99 = OpAccessChain %_ptr_Uniform_int %x_9 %uint_0 %int_0
|
||||
%100 = OpLoad %int %99
|
||||
%101 = OpConvertSToF %float %94
|
||||
%102 = OpConvertSToF %float %96
|
||||
%103 = OpConvertSToF %float %98
|
||||
%104 = OpConvertSToF %float %100
|
||||
%105 = OpCompositeConstruct %v4float %101 %102 %103 %104
|
||||
OpStore %x_GLF_color %105
|
||||
OpBranch %90
|
||||
%92 = OpLabel
|
||||
%106 = OpAccessChain %_ptr_Uniform_float %x_6 %uint_0 %int_0
|
||||
%107 = OpLoad %float %106
|
||||
%108 = OpCompositeConstruct %v4float %107 %107 %107 %107
|
||||
OpStore %x_GLF_color %108
|
||||
OpBranch %90
|
||||
%90 = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%tint_symbol_2 = OpFunction %void None %109
|
||||
%tint_symbol = OpFunctionParameter %main_out
|
||||
%113 = OpLabel
|
||||
%114 = OpCompositeExtract %v4float %tint_symbol 0
|
||||
OpStore %tint_symbol_1 %114
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%main = OpFunction %void None %19
|
||||
%116 = OpLabel
|
||||
%117 = OpFunctionCall %void %main_1
|
||||
%119 = OpLoad %v4float %x_GLF_color
|
||||
%120 = OpCompositeConstruct %main_out %119
|
||||
%118 = OpFunctionCall %void %tint_symbol_2 %120
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,78 @@
|
||||
type Arr = [[stride(16)]] array<f32, 3>;
|
||||
|
||||
[[block]]
|
||||
struct buf1 {
|
||||
x_GLF_uniform_float_values : Arr;
|
||||
};
|
||||
|
||||
type Arr_1 = [[stride(16)]] array<i32, 3>;
|
||||
|
||||
[[block]]
|
||||
struct buf0 {
|
||||
x_GLF_uniform_int_values : Arr_1;
|
||||
};
|
||||
|
||||
[[group(0), binding(1)]] var<uniform> x_6 : buf1;
|
||||
|
||||
[[group(0), binding(0)]] var<uniform> x_9 : buf0;
|
||||
|
||||
var<private> x_GLF_color : vec4<f32>;
|
||||
|
||||
fn main_1() {
|
||||
var A1 : array<f32, 3>;
|
||||
var a : i32;
|
||||
var b : f32;
|
||||
var c : bool;
|
||||
var x_36 : bool;
|
||||
let x_38 : f32 = x_6.x_GLF_uniform_float_values[2];
|
||||
let x_40 : f32 = x_6.x_GLF_uniform_float_values[0];
|
||||
let x_42 : f32 = x_6.x_GLF_uniform_float_values[1];
|
||||
A1 = array<f32, 3>(x_38, x_40, x_42);
|
||||
let x_45 : i32 = x_9.x_GLF_uniform_int_values[0];
|
||||
let x_47 : i32 = x_9.x_GLF_uniform_int_values[0];
|
||||
let x_49 : i32 = x_9.x_GLF_uniform_int_values[1];
|
||||
a = clamp(x_45, x_47, x_49);
|
||||
let x_51 : i32 = a;
|
||||
let x_53 : i32 = x_9.x_GLF_uniform_int_values[1];
|
||||
let x_55 : i32 = x_9.x_GLF_uniform_int_values[0];
|
||||
let x_58 : f32 = A1[clamp(x_51, x_53, x_55)];
|
||||
b = x_58;
|
||||
let x_59 : f32 = b;
|
||||
let x_61 : i32 = x_9.x_GLF_uniform_int_values[1];
|
||||
let x_63 : f32 = A1[x_61];
|
||||
if ((x_59 < x_63)) {
|
||||
let x_69 : f32 = x_6.x_GLF_uniform_float_values[0];
|
||||
let x_71 : f32 = x_6.x_GLF_uniform_float_values[2];
|
||||
x_36 = (x_69 > x_71);
|
||||
} else {
|
||||
let x_74 : f32 = x_6.x_GLF_uniform_float_values[0];
|
||||
let x_76 : i32 = x_9.x_GLF_uniform_int_values[2];
|
||||
let x_78 : f32 = A1[x_76];
|
||||
x_36 = (x_74 < x_78);
|
||||
}
|
||||
let x_80 : bool = x_36;
|
||||
c = x_80;
|
||||
let x_81 : bool = c;
|
||||
if (x_81) {
|
||||
let x_86 : i32 = x_9.x_GLF_uniform_int_values[0];
|
||||
let x_89 : i32 = x_9.x_GLF_uniform_int_values[1];
|
||||
let x_92 : i32 = x_9.x_GLF_uniform_int_values[1];
|
||||
let x_95 : i32 = x_9.x_GLF_uniform_int_values[0];
|
||||
x_GLF_color = vec4<f32>(f32(x_86), f32(x_89), f32(x_92), f32(x_95));
|
||||
} else {
|
||||
let x_99 : f32 = x_6.x_GLF_uniform_float_values[0];
|
||||
x_GLF_color = vec4<f32>(x_99, x_99, x_99, x_99);
|
||||
}
|
||||
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