mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-21 10:49:14 +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,152 @@
|
||||
OpCapability Shader
|
||||
%1 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Fragment %main "main" %_GLF_color
|
||||
OpExecutionMode %main OriginUpperLeft
|
||||
OpSource ESSL 320
|
||||
OpName %main "main"
|
||||
OpName %a "a"
|
||||
OpName %buf0 "buf0"
|
||||
OpMemberName %buf0 0 "_GLF_uniform_int_values"
|
||||
OpName %_ ""
|
||||
OpName %v "v"
|
||||
OpName %buf1 "buf1"
|
||||
OpMemberName %buf1 0 "_GLF_uniform_float_values"
|
||||
OpName %__0 ""
|
||||
OpName %m "m"
|
||||
OpName %indexable "indexable"
|
||||
OpName %_GLF_color "_GLF_color"
|
||||
OpDecorate %_arr_int_uint_2 ArrayStride 16
|
||||
OpMemberDecorate %buf0 0 Offset 0
|
||||
OpDecorate %buf0 Block
|
||||
OpDecorate %_ DescriptorSet 0
|
||||
OpDecorate %_ Binding 0
|
||||
OpDecorate %_arr_float_uint_4 ArrayStride 16
|
||||
OpMemberDecorate %buf1 0 Offset 0
|
||||
OpDecorate %buf1 Block
|
||||
OpDecorate %__0 DescriptorSet 0
|
||||
OpDecorate %__0 Binding 1
|
||||
OpDecorate %_GLF_color Location 0
|
||||
%void = OpTypeVoid
|
||||
%15 = OpTypeFunction %void
|
||||
%int = OpTypeInt 32 1
|
||||
%_ptr_Function_int = OpTypePointer Function %int
|
||||
%uint = OpTypeInt 32 0
|
||||
%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
|
||||
%_ = OpVariable %_ptr_Uniform_buf0 Uniform
|
||||
%int_0 = OpConstant %int 0
|
||||
%_ptr_Uniform_int = OpTypePointer Uniform %int
|
||||
%float = OpTypeFloat 32
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Function_v4float = OpTypePointer Function %v4float
|
||||
%uint_4 = OpConstant %uint 4
|
||||
%_arr_float_uint_4 = OpTypeArray %float %uint_4
|
||||
%buf1 = OpTypeStruct %_arr_float_uint_4
|
||||
%_ptr_Uniform_buf1 = OpTypePointer Uniform %buf1
|
||||
%__0 = OpVariable %_ptr_Uniform_buf1 Uniform
|
||||
%int_2 = OpConstant %int 2
|
||||
%_ptr_Uniform_float = OpTypePointer Uniform %float
|
||||
%mat3v4float = OpTypeMatrix %v4float 3
|
||||
%_ptr_Function_mat3v4float = OpTypePointer Function %mat3v4float
|
||||
%int_3 = OpConstant %int 3
|
||||
%float_1 = OpConstant %float 1
|
||||
%float_0 = OpConstant %float 0
|
||||
%_ptr_Function_float = OpTypePointer Function %float
|
||||
%mat4v4float = OpTypeMatrix %v4float 4
|
||||
%_ptr_Function_mat4v4float = OpTypePointer Function %mat4v4float
|
||||
%uint_1 = OpConstant %uint 1
|
||||
%int_1 = OpConstant %int 1
|
||||
%bool = OpTypeBool
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%_GLF_color = OpVariable %_ptr_Output_v4float Output
|
||||
%main = OpFunction %void None %15
|
||||
%42 = OpLabel
|
||||
%a = OpVariable %_ptr_Function_int Function
|
||||
%v = OpVariable %_ptr_Function_v4float Function
|
||||
%m = OpVariable %_ptr_Function_mat3v4float Function
|
||||
%indexable = OpVariable %_ptr_Function_mat4v4float Function
|
||||
%43 = OpAccessChain %_ptr_Uniform_int %_ %int_0 %int_0
|
||||
%44 = OpLoad %int %43
|
||||
OpStore %a %44
|
||||
%45 = OpAccessChain %_ptr_Uniform_float %__0 %int_0 %int_2
|
||||
%46 = OpLoad %float %45
|
||||
%47 = OpCompositeConstruct %v4float %46 %46 %46 %46
|
||||
OpStore %v %47
|
||||
%48 = OpAccessChain %_ptr_Uniform_float %__0 %int_0 %int_3
|
||||
%49 = OpLoad %float %48
|
||||
%50 = OpCompositeConstruct %v4float %49 %float_0 %float_0 %float_0
|
||||
%51 = OpCompositeConstruct %v4float %float_0 %49 %float_0 %float_0
|
||||
%52 = OpCompositeConstruct %v4float %float_0 %float_0 %49 %float_0
|
||||
%53 = OpCompositeConstruct %mat3v4float %50 %51 %52
|
||||
OpStore %m %53
|
||||
%54 = OpLoad %int %a
|
||||
%55 = OpLoad %int %a
|
||||
%56 = OpAccessChain %_ptr_Uniform_float %__0 %int_0 %int_0
|
||||
%57 = OpLoad %float %56
|
||||
%58 = OpAccessChain %_ptr_Function_float %m %54 %55
|
||||
OpStore %58 %57
|
||||
%59 = OpLoad %int %a
|
||||
%60 = OpLoad %mat3v4float %m
|
||||
%61 = OpCompositeExtract %float %60 0 0
|
||||
%62 = OpCompositeExtract %float %60 0 1
|
||||
%63 = OpCompositeExtract %float %60 0 2
|
||||
%64 = OpCompositeExtract %float %60 0 3
|
||||
%65 = OpCompositeExtract %float %60 1 0
|
||||
%66 = OpCompositeExtract %float %60 1 1
|
||||
%67 = OpCompositeExtract %float %60 1 2
|
||||
%68 = OpCompositeExtract %float %60 1 3
|
||||
%69 = OpCompositeExtract %float %60 2 0
|
||||
%70 = OpCompositeExtract %float %60 2 1
|
||||
%71 = OpCompositeExtract %float %60 2 2
|
||||
%72 = OpCompositeExtract %float %60 2 3
|
||||
%73 = OpCompositeConstruct %v4float %61 %62 %63 %64
|
||||
%74 = OpCompositeConstruct %v4float %65 %66 %67 %68
|
||||
%75 = OpCompositeConstruct %v4float %69 %70 %71 %72
|
||||
%76 = OpCompositeConstruct %v4float %float_0 %float_0 %float_0 %float_1
|
||||
%77 = OpCompositeConstruct %mat4v4float %73 %74 %75 %76
|
||||
%78 = OpLoad %int %a
|
||||
%79 = OpLoad %int %a
|
||||
OpStore %indexable %77
|
||||
%80 = OpAccessChain %_ptr_Function_float %indexable %78 %79
|
||||
%81 = OpLoad %float %80
|
||||
%82 = OpAccessChain %_ptr_Function_float %v %59
|
||||
%83 = OpLoad %float %82
|
||||
%84 = OpFAdd %float %83 %81
|
||||
%85 = OpAccessChain %_ptr_Function_float %v %59
|
||||
OpStore %85 %84
|
||||
%86 = OpAccessChain %_ptr_Function_float %v %uint_1
|
||||
%87 = OpLoad %float %86
|
||||
%88 = OpAccessChain %_ptr_Uniform_float %__0 %int_0 %int_1
|
||||
%89 = OpLoad %float %88
|
||||
%90 = OpFOrdEqual %bool %87 %89
|
||||
OpSelectionMerge %91 None
|
||||
OpBranchConditional %90 %92 %93
|
||||
%92 = OpLabel
|
||||
%94 = OpAccessChain %_ptr_Uniform_int %_ %int_0 %int_0
|
||||
%95 = OpLoad %int %94
|
||||
%96 = OpConvertSToF %float %95
|
||||
%97 = OpAccessChain %_ptr_Uniform_int %_ %int_0 %int_1
|
||||
%98 = OpLoad %int %97
|
||||
%99 = OpConvertSToF %float %98
|
||||
%100 = OpAccessChain %_ptr_Uniform_int %_ %int_0 %int_1
|
||||
%101 = OpLoad %int %100
|
||||
%102 = OpConvertSToF %float %101
|
||||
%103 = OpAccessChain %_ptr_Uniform_int %_ %int_0 %int_0
|
||||
%104 = OpLoad %int %103
|
||||
%105 = OpConvertSToF %float %104
|
||||
%106 = OpCompositeConstruct %v4float %96 %99 %102 %105
|
||||
OpStore %_GLF_color %106
|
||||
OpBranch %91
|
||||
%93 = OpLabel
|
||||
%107 = OpAccessChain %_ptr_Uniform_int %_ %int_0 %int_1
|
||||
%108 = OpLoad %int %107
|
||||
%109 = OpConvertSToF %float %108
|
||||
%110 = OpCompositeConstruct %v4float %109 %109 %109 %109
|
||||
OpStore %_GLF_color %110
|
||||
OpBranch %91
|
||||
%91 = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,68 @@
|
||||
void set_float4(inout float4 vec, int idx, float val) {
|
||||
vec = (idx.xxxx == int4(0, 1, 2, 3)) ? val.xxxx : vec;
|
||||
}
|
||||
|
||||
cbuffer cbuffer_x_6 : register(b0, space0) {
|
||||
uint4 x_6[2];
|
||||
};
|
||||
cbuffer cbuffer_x_9 : register(b1, space0) {
|
||||
uint4 x_9[4];
|
||||
};
|
||||
static float4 x_GLF_color = float4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
|
||||
void main_1() {
|
||||
int a = 0;
|
||||
float4 v = float4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
float3x4 m = float3x4(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
|
||||
float4x4 indexable = float4x4(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
|
||||
const uint scalar_offset = ((16u * uint(0))) / 4;
|
||||
const int x_44 = asint(x_6[scalar_offset / 4][scalar_offset % 4]);
|
||||
a = x_44;
|
||||
const float x_46 = asfloat(x_9[2].x);
|
||||
v = float4(x_46, x_46, x_46, x_46);
|
||||
const float x_49 = asfloat(x_9[3].x);
|
||||
m = float3x4(float4(x_49, 0.0f, 0.0f, 0.0f), float4(0.0f, x_49, 0.0f, 0.0f), float4(0.0f, 0.0f, x_49, 0.0f));
|
||||
const int x_54 = a;
|
||||
const int x_55 = a;
|
||||
const uint scalar_offset_1 = ((16u * uint(0))) / 4;
|
||||
const float x_57 = asfloat(x_9[scalar_offset_1 / 4][scalar_offset_1 % 4]);
|
||||
set_float4(m[x_54], x_55, x_57);
|
||||
const int x_59 = a;
|
||||
const float3x4 x_60 = m;
|
||||
const int x_78 = a;
|
||||
const int x_79 = a;
|
||||
indexable = float4x4(float4(x_60[0u].x, x_60[0u].y, x_60[0u].z, x_60[0u].w), float4(x_60[1u].x, x_60[1u].y, x_60[1u].z, x_60[1u].w), float4(x_60[2u].x, x_60[2u].y, x_60[2u].z, x_60[2u].w), float4(0.0f, 0.0f, 0.0f, 1.0f));
|
||||
const float x_81 = indexable[x_78][x_79];
|
||||
const float x_83 = v[x_59];
|
||||
set_float4(v, x_59, (x_83 + x_81));
|
||||
const float x_87 = v.y;
|
||||
const float x_89 = asfloat(x_9[1].x);
|
||||
if ((x_87 == x_89)) {
|
||||
const uint scalar_offset_2 = ((16u * uint(0))) / 4;
|
||||
const int x_95 = asint(x_6[scalar_offset_2 / 4][scalar_offset_2 % 4]);
|
||||
const int x_98 = asint(x_6[1].x);
|
||||
const int x_101 = asint(x_6[1].x);
|
||||
const uint scalar_offset_3 = ((16u * uint(0))) / 4;
|
||||
const int x_104 = asint(x_6[scalar_offset_3 / 4][scalar_offset_3 % 4]);
|
||||
x_GLF_color = float4(float(x_95), float(x_98), float(x_101), float(x_104));
|
||||
} else {
|
||||
const int x_108 = asint(x_6[1].x);
|
||||
const float x_109 = float(x_108);
|
||||
x_GLF_color = float4(x_109, x_109, x_109, x_109);
|
||||
}
|
||||
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_4 = {tint_symbol_1.x_GLF_color_1};
|
||||
return tint_symbol_4;
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
#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[2];
|
||||
};
|
||||
struct buf0 {
|
||||
/* 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[4];
|
||||
};
|
||||
struct buf1 {
|
||||
/* 0x0000 */ tint_array_wrapper_1 x_GLF_uniform_float_values;
|
||||
};
|
||||
struct main_out {
|
||||
float4 x_GLF_color_1;
|
||||
};
|
||||
struct tint_symbol_1 {
|
||||
float4 x_GLF_color_1 [[color(0)]];
|
||||
};
|
||||
|
||||
void main_1(constant buf0& x_6, constant buf1& x_9, thread float4* const tint_symbol_4) {
|
||||
int a = 0;
|
||||
float4 v = 0.0f;
|
||||
float3x4 m = float3x4(0.0f);
|
||||
float4x4 indexable = float4x4(0.0f);
|
||||
int const x_44 = x_6.x_GLF_uniform_int_values.arr[0].el;
|
||||
a = x_44;
|
||||
float const x_46 = x_9.x_GLF_uniform_float_values.arr[2].el;
|
||||
v = float4(x_46, x_46, x_46, x_46);
|
||||
float const x_49 = x_9.x_GLF_uniform_float_values.arr[3].el;
|
||||
m = float3x4(float4(x_49, 0.0f, 0.0f, 0.0f), float4(0.0f, x_49, 0.0f, 0.0f), float4(0.0f, 0.0f, x_49, 0.0f));
|
||||
int const x_54 = a;
|
||||
int const x_55 = a;
|
||||
float const x_57 = x_9.x_GLF_uniform_float_values.arr[0].el;
|
||||
m[x_54][x_55] = x_57;
|
||||
int const x_59 = a;
|
||||
float3x4 const x_60 = m;
|
||||
int const x_78 = a;
|
||||
int const x_79 = a;
|
||||
indexable = float4x4(float4(x_60[0u].x, x_60[0u].y, x_60[0u].z, x_60[0u].w), float4(x_60[1u].x, x_60[1u].y, x_60[1u].z, x_60[1u].w), float4(x_60[2u].x, x_60[2u].y, x_60[2u].z, x_60[2u].w), float4(0.0f, 0.0f, 0.0f, 1.0f));
|
||||
float const x_81 = indexable[x_78][x_79];
|
||||
float const x_83 = v[x_59];
|
||||
v[x_59] = (x_83 + x_81);
|
||||
float const x_87 = v.y;
|
||||
float const x_89 = x_9.x_GLF_uniform_float_values.arr[1].el;
|
||||
if ((x_87 == x_89)) {
|
||||
int const x_95 = x_6.x_GLF_uniform_int_values.arr[0].el;
|
||||
int const x_98 = x_6.x_GLF_uniform_int_values.arr[1].el;
|
||||
int const x_101 = x_6.x_GLF_uniform_int_values.arr[1].el;
|
||||
int const x_104 = x_6.x_GLF_uniform_int_values.arr[0].el;
|
||||
*(tint_symbol_4) = float4(float(x_95), float(x_98), float(x_101), float(x_104));
|
||||
} else {
|
||||
int const x_108 = x_6.x_GLF_uniform_int_values.arr[1].el;
|
||||
float const x_109 = float(x_108);
|
||||
*(tint_symbol_4) = float4(x_109, x_109, x_109, x_109);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
fragment tint_symbol_1 tint_symbol(constant buf0& x_6 [[buffer(0)]], constant buf1& x_9 [[buffer(1)]]) {
|
||||
thread float4 tint_symbol_5 = 0.0f;
|
||||
main_1(x_6, x_9, &(tint_symbol_5));
|
||||
main_out const tint_symbol_2 = {.x_GLF_color_1=tint_symbol_5};
|
||||
tint_symbol_1 const tint_symbol_3 = {.x_GLF_color_1=tint_symbol_2.x_GLF_color_1};
|
||||
return tint_symbol_3;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,200 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 141
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Fragment %main "main" %tint_symbol_1
|
||||
OpExecutionMode %main OriginUpperLeft
|
||||
OpName %buf0 "buf0"
|
||||
OpMemberName %buf0 0 "x_GLF_uniform_int_values"
|
||||
OpName %x_6 "x_6"
|
||||
OpName %buf1 "buf1"
|
||||
OpMemberName %buf1 0 "x_GLF_uniform_float_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 %a "a"
|
||||
OpName %v "v"
|
||||
OpName %m "m"
|
||||
OpName %indexable "indexable"
|
||||
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 %buf0 Block
|
||||
OpMemberDecorate %buf0 0 Offset 0
|
||||
OpDecorate %_arr_int_uint_2 ArrayStride 16
|
||||
OpDecorate %x_6 NonWritable
|
||||
OpDecorate %x_6 DescriptorSet 0
|
||||
OpDecorate %x_6 Binding 0
|
||||
OpDecorate %buf1 Block
|
||||
OpMemberDecorate %buf1 0 Offset 0
|
||||
OpDecorate %_arr_float_uint_4 ArrayStride 16
|
||||
OpDecorate %x_9 NonWritable
|
||||
OpDecorate %x_9 DescriptorSet 0
|
||||
OpDecorate %x_9 Binding 1
|
||||
OpDecorate %tint_symbol_1 Location 0
|
||||
OpMemberDecorate %main_out 0 Offset 0
|
||||
%int = OpTypeInt 32 1
|
||||
%uint = OpTypeInt 32 0
|
||||
%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_6 = OpVariable %_ptr_Uniform_buf0 Uniform
|
||||
%float = OpTypeFloat 32
|
||||
%uint_4 = OpConstant %uint 4
|
||||
%_arr_float_uint_4 = OpTypeArray %float %uint_4
|
||||
%buf1 = OpTypeStruct %_arr_float_uint_4
|
||||
%_ptr_Uniform_buf1 = OpTypePointer Uniform %buf1
|
||||
%x_9 = OpVariable %_ptr_Uniform_buf1 Uniform
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Private_v4float = OpTypePointer Private %v4float
|
||||
%17 = OpConstantNull %v4float
|
||||
%x_GLF_color = OpVariable %_ptr_Private_v4float Private %17
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %17
|
||||
%void = OpTypeVoid
|
||||
%20 = OpTypeFunction %void
|
||||
%_ptr_Function_int = OpTypePointer Function %int
|
||||
%26 = OpConstantNull %int
|
||||
%_ptr_Function_v4float = OpTypePointer Function %v4float
|
||||
%mat3v4float = OpTypeMatrix %v4float 3
|
||||
%_ptr_Function_mat3v4float = OpTypePointer Function %mat3v4float
|
||||
%32 = OpConstantNull %mat3v4float
|
||||
%mat4v4float = OpTypeMatrix %v4float 4
|
||||
%_ptr_Function_mat4v4float = OpTypePointer Function %mat4v4float
|
||||
%36 = OpConstantNull %mat4v4float
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%int_0 = OpConstant %int 0
|
||||
%_ptr_Uniform_int = OpTypePointer Uniform %int
|
||||
%int_2 = OpConstant %int 2
|
||||
%_ptr_Uniform_float = OpTypePointer Uniform %float
|
||||
%int_3 = OpConstant %int 3
|
||||
%float_0 = OpConstant %float 0
|
||||
%_ptr_Function_float = OpTypePointer Function %float
|
||||
%uint_1 = OpConstant %uint 1
|
||||
%float_1 = OpConstant %float 1
|
||||
%94 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_1
|
||||
%int_1 = OpConstant %int 1
|
||||
%bool = OpTypeBool
|
||||
%main_out = OpTypeStruct %v4float
|
||||
%129 = OpTypeFunction %void %main_out
|
||||
%main_1 = OpFunction %void None %20
|
||||
%23 = OpLabel
|
||||
%a = OpVariable %_ptr_Function_int Function %26
|
||||
%v = OpVariable %_ptr_Function_v4float Function %17
|
||||
%m = OpVariable %_ptr_Function_mat3v4float Function %32
|
||||
%indexable = OpVariable %_ptr_Function_mat4v4float Function %36
|
||||
%40 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_0
|
||||
%41 = OpLoad %int %40
|
||||
OpStore %a %41
|
||||
%44 = OpAccessChain %_ptr_Uniform_float %x_9 %uint_0 %int_2
|
||||
%45 = OpLoad %float %44
|
||||
%46 = OpCompositeConstruct %v4float %45 %45 %45 %45
|
||||
OpStore %v %46
|
||||
%48 = OpAccessChain %_ptr_Uniform_float %x_9 %uint_0 %int_3
|
||||
%49 = OpLoad %float %48
|
||||
%51 = OpCompositeConstruct %v4float %49 %float_0 %float_0 %float_0
|
||||
%52 = OpCompositeConstruct %v4float %float_0 %49 %float_0 %float_0
|
||||
%53 = OpCompositeConstruct %v4float %float_0 %float_0 %49 %float_0
|
||||
%54 = OpCompositeConstruct %mat3v4float %51 %52 %53
|
||||
OpStore %m %54
|
||||
%55 = OpLoad %int %a
|
||||
%56 = OpLoad %int %a
|
||||
%57 = OpAccessChain %_ptr_Uniform_float %x_9 %uint_0 %int_0
|
||||
%58 = OpLoad %float %57
|
||||
%60 = OpAccessChain %_ptr_Function_float %m %55 %56
|
||||
OpStore %60 %58
|
||||
%61 = OpLoad %int %a
|
||||
%62 = OpLoad %mat3v4float %m
|
||||
%63 = OpLoad %int %a
|
||||
%64 = OpLoad %int %a
|
||||
%65 = OpCompositeExtract %v4float %62 0
|
||||
%66 = OpCompositeExtract %float %65 0
|
||||
%67 = OpCompositeExtract %v4float %62 0
|
||||
%68 = OpCompositeExtract %float %67 1
|
||||
%69 = OpCompositeExtract %v4float %62 0
|
||||
%70 = OpCompositeExtract %float %69 2
|
||||
%71 = OpCompositeExtract %v4float %62 0
|
||||
%72 = OpCompositeExtract %float %71 3
|
||||
%73 = OpCompositeConstruct %v4float %66 %68 %70 %72
|
||||
%75 = OpCompositeExtract %v4float %62 1
|
||||
%76 = OpCompositeExtract %float %75 0
|
||||
%77 = OpCompositeExtract %v4float %62 1
|
||||
%78 = OpCompositeExtract %float %77 1
|
||||
%79 = OpCompositeExtract %v4float %62 1
|
||||
%80 = OpCompositeExtract %float %79 2
|
||||
%81 = OpCompositeExtract %v4float %62 1
|
||||
%82 = OpCompositeExtract %float %81 3
|
||||
%83 = OpCompositeConstruct %v4float %76 %78 %80 %82
|
||||
%84 = OpCompositeExtract %v4float %62 2
|
||||
%85 = OpCompositeExtract %float %84 0
|
||||
%86 = OpCompositeExtract %v4float %62 2
|
||||
%87 = OpCompositeExtract %float %86 1
|
||||
%88 = OpCompositeExtract %v4float %62 2
|
||||
%89 = OpCompositeExtract %float %88 2
|
||||
%90 = OpCompositeExtract %v4float %62 2
|
||||
%91 = OpCompositeExtract %float %90 3
|
||||
%92 = OpCompositeConstruct %v4float %85 %87 %89 %91
|
||||
%95 = OpCompositeConstruct %mat4v4float %73 %83 %92 %94
|
||||
OpStore %indexable %95
|
||||
%96 = OpAccessChain %_ptr_Function_float %indexable %63 %64
|
||||
%97 = OpLoad %float %96
|
||||
%98 = OpAccessChain %_ptr_Function_float %v %61
|
||||
%99 = OpLoad %float %98
|
||||
%100 = OpAccessChain %_ptr_Function_float %v %61
|
||||
%101 = OpFAdd %float %99 %97
|
||||
OpStore %100 %101
|
||||
%102 = OpAccessChain %_ptr_Function_float %v %uint_1
|
||||
%103 = OpLoad %float %102
|
||||
%105 = OpAccessChain %_ptr_Uniform_float %x_9 %uint_0 %int_1
|
||||
%106 = OpLoad %float %105
|
||||
%107 = OpFOrdEqual %bool %103 %106
|
||||
OpSelectionMerge %109 None
|
||||
OpBranchConditional %107 %110 %111
|
||||
%110 = OpLabel
|
||||
%112 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_0
|
||||
%113 = OpLoad %int %112
|
||||
%114 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_1
|
||||
%115 = OpLoad %int %114
|
||||
%116 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_1
|
||||
%117 = OpLoad %int %116
|
||||
%118 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_0
|
||||
%119 = OpLoad %int %118
|
||||
%120 = OpConvertSToF %float %113
|
||||
%121 = OpConvertSToF %float %115
|
||||
%122 = OpConvertSToF %float %117
|
||||
%123 = OpConvertSToF %float %119
|
||||
%124 = OpCompositeConstruct %v4float %120 %121 %122 %123
|
||||
OpStore %x_GLF_color %124
|
||||
OpBranch %109
|
||||
%111 = OpLabel
|
||||
%125 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_1
|
||||
%126 = OpLoad %int %125
|
||||
%127 = OpConvertSToF %float %126
|
||||
%128 = OpCompositeConstruct %v4float %127 %127 %127 %127
|
||||
OpStore %x_GLF_color %128
|
||||
OpBranch %109
|
||||
%109 = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%tint_symbol_2 = OpFunction %void None %129
|
||||
%tint_symbol = OpFunctionParameter %main_out
|
||||
%133 = OpLabel
|
||||
%134 = OpCompositeExtract %v4float %tint_symbol 0
|
||||
OpStore %tint_symbol_1 %134
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%main = OpFunction %void None %20
|
||||
%136 = OpLabel
|
||||
%137 = OpFunctionCall %void %main_1
|
||||
%139 = OpLoad %v4float %x_GLF_color
|
||||
%140 = OpCompositeConstruct %main_out %139
|
||||
%138 = OpFunctionCall %void %tint_symbol_2 %140
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,69 @@
|
||||
type Arr = [[stride(16)]] array<i32, 2>;
|
||||
|
||||
[[block]]
|
||||
struct buf0 {
|
||||
x_GLF_uniform_int_values : Arr;
|
||||
};
|
||||
|
||||
type Arr_1 = [[stride(16)]] array<f32, 4>;
|
||||
|
||||
[[block]]
|
||||
struct buf1 {
|
||||
x_GLF_uniform_float_values : Arr_1;
|
||||
};
|
||||
|
||||
[[group(0), binding(0)]] var<uniform> x_6 : buf0;
|
||||
|
||||
[[group(0), binding(1)]] var<uniform> x_9 : buf1;
|
||||
|
||||
var<private> x_GLF_color : vec4<f32>;
|
||||
|
||||
fn main_1() {
|
||||
var a : i32;
|
||||
var v : vec4<f32>;
|
||||
var m : mat3x4<f32>;
|
||||
var indexable : mat4x4<f32>;
|
||||
let x_44 : i32 = x_6.x_GLF_uniform_int_values[0];
|
||||
a = x_44;
|
||||
let x_46 : f32 = x_9.x_GLF_uniform_float_values[2];
|
||||
v = vec4<f32>(x_46, x_46, x_46, x_46);
|
||||
let x_49 : f32 = x_9.x_GLF_uniform_float_values[3];
|
||||
m = mat3x4<f32>(vec4<f32>(x_49, 0.0, 0.0, 0.0), vec4<f32>(0.0, x_49, 0.0, 0.0), vec4<f32>(0.0, 0.0, x_49, 0.0));
|
||||
let x_54 : i32 = a;
|
||||
let x_55 : i32 = a;
|
||||
let x_57 : f32 = x_9.x_GLF_uniform_float_values[0];
|
||||
m[x_54][x_55] = x_57;
|
||||
let x_59 : i32 = a;
|
||||
let x_60 : mat3x4<f32> = m;
|
||||
let x_78 : i32 = a;
|
||||
let x_79 : i32 = a;
|
||||
indexable = mat4x4<f32>(vec4<f32>(x_60[0u].x, x_60[0u].y, x_60[0u].z, x_60[0u].w), vec4<f32>(x_60[1u].x, x_60[1u].y, x_60[1u].z, x_60[1u].w), vec4<f32>(x_60[2u].x, x_60[2u].y, x_60[2u].z, x_60[2u].w), vec4<f32>(0.0, 0.0, 0.0, 1.0));
|
||||
let x_81 : f32 = indexable[x_78][x_79];
|
||||
let x_83 : f32 = v[x_59];
|
||||
v[x_59] = (x_83 + x_81);
|
||||
let x_87 : f32 = v.y;
|
||||
let x_89 : f32 = x_9.x_GLF_uniform_float_values[1];
|
||||
if ((x_87 == x_89)) {
|
||||
let x_95 : i32 = x_6.x_GLF_uniform_int_values[0];
|
||||
let x_98 : i32 = x_6.x_GLF_uniform_int_values[1];
|
||||
let x_101 : i32 = x_6.x_GLF_uniform_int_values[1];
|
||||
let x_104 : i32 = x_6.x_GLF_uniform_int_values[0];
|
||||
x_GLF_color = vec4<f32>(f32(x_95), f32(x_98), f32(x_101), f32(x_104));
|
||||
} else {
|
||||
let x_108 : i32 = x_6.x_GLF_uniform_int_values[1];
|
||||
let x_109 : f32 = f32(x_108);
|
||||
x_GLF_color = vec4<f32>(x_109, x_109, x_109, x_109);
|
||||
}
|
||||
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,69 @@
|
||||
type Arr = [[stride(16)]] array<i32, 2>;
|
||||
|
||||
[[block]]
|
||||
struct buf0 {
|
||||
x_GLF_uniform_int_values : Arr;
|
||||
};
|
||||
|
||||
type Arr_1 = [[stride(16)]] array<f32, 4>;
|
||||
|
||||
[[block]]
|
||||
struct buf1 {
|
||||
x_GLF_uniform_float_values : Arr_1;
|
||||
};
|
||||
|
||||
[[group(0), binding(0)]] var<uniform> x_6 : buf0;
|
||||
|
||||
[[group(0), binding(1)]] var<uniform> x_9 : buf1;
|
||||
|
||||
var<private> x_GLF_color : vec4<f32>;
|
||||
|
||||
fn main_1() {
|
||||
var a : i32;
|
||||
var v : vec4<f32>;
|
||||
var m : mat3x4<f32>;
|
||||
var indexable : mat4x4<f32>;
|
||||
let x_44 : i32 = x_6.x_GLF_uniform_int_values[0];
|
||||
a = x_44;
|
||||
let x_46 : f32 = x_9.x_GLF_uniform_float_values[2];
|
||||
v = vec4<f32>(x_46, x_46, x_46, x_46);
|
||||
let x_49 : f32 = x_9.x_GLF_uniform_float_values[3];
|
||||
m = mat3x4<f32>(vec4<f32>(x_49, 0.0, 0.0, 0.0), vec4<f32>(0.0, x_49, 0.0, 0.0), vec4<f32>(0.0, 0.0, x_49, 0.0));
|
||||
let x_54 : i32 = a;
|
||||
let x_55 : i32 = a;
|
||||
let x_57 : f32 = x_9.x_GLF_uniform_float_values[0];
|
||||
m[x_54][x_55] = x_57;
|
||||
let x_59 : i32 = a;
|
||||
let x_60 : mat3x4<f32> = m;
|
||||
let x_78 : i32 = a;
|
||||
let x_79 : i32 = a;
|
||||
indexable = mat4x4<f32>(vec4<f32>(x_60[0u].x, x_60[0u].y, x_60[0u].z, x_60[0u].w), vec4<f32>(x_60[1u].x, x_60[1u].y, x_60[1u].z, x_60[1u].w), vec4<f32>(x_60[2u].x, x_60[2u].y, x_60[2u].z, x_60[2u].w), vec4<f32>(0.0, 0.0, 0.0, 1.0));
|
||||
let x_81 : f32 = indexable[x_78][x_79];
|
||||
let x_83 : f32 = v[x_59];
|
||||
v[x_59] = (x_83 + x_81);
|
||||
let x_87 : f32 = v.y;
|
||||
let x_89 : f32 = x_9.x_GLF_uniform_float_values[1];
|
||||
if ((x_87 == x_89)) {
|
||||
let x_95 : i32 = x_6.x_GLF_uniform_int_values[0];
|
||||
let x_98 : i32 = x_6.x_GLF_uniform_int_values[1];
|
||||
let x_101 : i32 = x_6.x_GLF_uniform_int_values[1];
|
||||
let x_104 : i32 = x_6.x_GLF_uniform_int_values[0];
|
||||
x_GLF_color = vec4<f32>(f32(x_95), f32(x_98), f32(x_101), f32(x_104));
|
||||
} else {
|
||||
let x_108 : i32 = x_6.x_GLF_uniform_int_values[1];
|
||||
let x_109 : f32 = f32(x_108);
|
||||
x_GLF_color = vec4<f32>(x_109, x_109, x_109, x_109);
|
||||
}
|
||||
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,68 @@
|
||||
void set_float4(inout float4 vec, int idx, float val) {
|
||||
vec = (idx.xxxx == int4(0, 1, 2, 3)) ? val.xxxx : vec;
|
||||
}
|
||||
|
||||
cbuffer cbuffer_x_6 : register(b0, space0) {
|
||||
uint4 x_6[2];
|
||||
};
|
||||
cbuffer cbuffer_x_9 : register(b1, space0) {
|
||||
uint4 x_9[4];
|
||||
};
|
||||
static float4 x_GLF_color = float4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
|
||||
void main_1() {
|
||||
int a = 0;
|
||||
float4 v = float4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
float3x4 m = float3x4(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
|
||||
float4x4 indexable = float4x4(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
|
||||
const uint scalar_offset = ((16u * uint(0))) / 4;
|
||||
const int x_44 = asint(x_6[scalar_offset / 4][scalar_offset % 4]);
|
||||
a = x_44;
|
||||
const float x_46 = asfloat(x_9[2].x);
|
||||
v = float4(x_46, x_46, x_46, x_46);
|
||||
const float x_49 = asfloat(x_9[3].x);
|
||||
m = float3x4(float4(x_49, 0.0f, 0.0f, 0.0f), float4(0.0f, x_49, 0.0f, 0.0f), float4(0.0f, 0.0f, x_49, 0.0f));
|
||||
const int x_54 = a;
|
||||
const int x_55 = a;
|
||||
const uint scalar_offset_1 = ((16u * uint(0))) / 4;
|
||||
const float x_57 = asfloat(x_9[scalar_offset_1 / 4][scalar_offset_1 % 4]);
|
||||
set_float4(m[x_54], x_55, x_57);
|
||||
const int x_59 = a;
|
||||
const float3x4 x_60 = m;
|
||||
const int x_78 = a;
|
||||
const int x_79 = a;
|
||||
indexable = float4x4(float4(x_60[0u].x, x_60[0u].y, x_60[0u].z, x_60[0u].w), float4(x_60[1u].x, x_60[1u].y, x_60[1u].z, x_60[1u].w), float4(x_60[2u].x, x_60[2u].y, x_60[2u].z, x_60[2u].w), float4(0.0f, 0.0f, 0.0f, 1.0f));
|
||||
const float x_81 = indexable[x_78][x_79];
|
||||
const float x_83 = v[x_59];
|
||||
set_float4(v, x_59, (x_83 + x_81));
|
||||
const float x_87 = v.y;
|
||||
const float x_89 = asfloat(x_9[1].x);
|
||||
if ((x_87 == x_89)) {
|
||||
const uint scalar_offset_2 = ((16u * uint(0))) / 4;
|
||||
const int x_95 = asint(x_6[scalar_offset_2 / 4][scalar_offset_2 % 4]);
|
||||
const int x_98 = asint(x_6[1].x);
|
||||
const int x_101 = asint(x_6[1].x);
|
||||
const uint scalar_offset_3 = ((16u * uint(0))) / 4;
|
||||
const int x_104 = asint(x_6[scalar_offset_3 / 4][scalar_offset_3 % 4]);
|
||||
x_GLF_color = float4(float(x_95), float(x_98), float(x_101), float(x_104));
|
||||
} else {
|
||||
const int x_108 = asint(x_6[1].x);
|
||||
const float x_109 = float(x_108);
|
||||
x_GLF_color = float4(x_109, x_109, x_109, x_109);
|
||||
}
|
||||
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_4 = {tint_symbol_1.x_GLF_color_1};
|
||||
return tint_symbol_4;
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
#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[2];
|
||||
};
|
||||
struct buf0 {
|
||||
/* 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[4];
|
||||
};
|
||||
struct buf1 {
|
||||
/* 0x0000 */ tint_array_wrapper_1 x_GLF_uniform_float_values;
|
||||
};
|
||||
struct main_out {
|
||||
float4 x_GLF_color_1;
|
||||
};
|
||||
struct tint_symbol_1 {
|
||||
float4 x_GLF_color_1 [[color(0)]];
|
||||
};
|
||||
|
||||
void main_1(constant buf0& x_6, constant buf1& x_9, thread float4* const tint_symbol_4) {
|
||||
int a = 0;
|
||||
float4 v = 0.0f;
|
||||
float3x4 m = float3x4(0.0f);
|
||||
float4x4 indexable = float4x4(0.0f);
|
||||
int const x_44 = x_6.x_GLF_uniform_int_values.arr[0].el;
|
||||
a = x_44;
|
||||
float const x_46 = x_9.x_GLF_uniform_float_values.arr[2].el;
|
||||
v = float4(x_46, x_46, x_46, x_46);
|
||||
float const x_49 = x_9.x_GLF_uniform_float_values.arr[3].el;
|
||||
m = float3x4(float4(x_49, 0.0f, 0.0f, 0.0f), float4(0.0f, x_49, 0.0f, 0.0f), float4(0.0f, 0.0f, x_49, 0.0f));
|
||||
int const x_54 = a;
|
||||
int const x_55 = a;
|
||||
float const x_57 = x_9.x_GLF_uniform_float_values.arr[0].el;
|
||||
m[x_54][x_55] = x_57;
|
||||
int const x_59 = a;
|
||||
float3x4 const x_60 = m;
|
||||
int const x_78 = a;
|
||||
int const x_79 = a;
|
||||
indexable = float4x4(float4(x_60[0u].x, x_60[0u].y, x_60[0u].z, x_60[0u].w), float4(x_60[1u].x, x_60[1u].y, x_60[1u].z, x_60[1u].w), float4(x_60[2u].x, x_60[2u].y, x_60[2u].z, x_60[2u].w), float4(0.0f, 0.0f, 0.0f, 1.0f));
|
||||
float const x_81 = indexable[x_78][x_79];
|
||||
float const x_83 = v[x_59];
|
||||
v[x_59] = (x_83 + x_81);
|
||||
float const x_87 = v.y;
|
||||
float const x_89 = x_9.x_GLF_uniform_float_values.arr[1].el;
|
||||
if ((x_87 == x_89)) {
|
||||
int const x_95 = x_6.x_GLF_uniform_int_values.arr[0].el;
|
||||
int const x_98 = x_6.x_GLF_uniform_int_values.arr[1].el;
|
||||
int const x_101 = x_6.x_GLF_uniform_int_values.arr[1].el;
|
||||
int const x_104 = x_6.x_GLF_uniform_int_values.arr[0].el;
|
||||
*(tint_symbol_4) = float4(float(x_95), float(x_98), float(x_101), float(x_104));
|
||||
} else {
|
||||
int const x_108 = x_6.x_GLF_uniform_int_values.arr[1].el;
|
||||
float const x_109 = float(x_108);
|
||||
*(tint_symbol_4) = float4(x_109, x_109, x_109, x_109);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
fragment tint_symbol_1 tint_symbol(constant buf0& x_6 [[buffer(0)]], constant buf1& x_9 [[buffer(1)]]) {
|
||||
thread float4 tint_symbol_5 = 0.0f;
|
||||
main_1(x_6, x_9, &(tint_symbol_5));
|
||||
main_out const tint_symbol_2 = {.x_GLF_color_1=tint_symbol_5};
|
||||
tint_symbol_1 const tint_symbol_3 = {.x_GLF_color_1=tint_symbol_2.x_GLF_color_1};
|
||||
return tint_symbol_3;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,200 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 141
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Fragment %main "main" %tint_symbol_1
|
||||
OpExecutionMode %main OriginUpperLeft
|
||||
OpName %buf0 "buf0"
|
||||
OpMemberName %buf0 0 "x_GLF_uniform_int_values"
|
||||
OpName %x_6 "x_6"
|
||||
OpName %buf1 "buf1"
|
||||
OpMemberName %buf1 0 "x_GLF_uniform_float_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 %a "a"
|
||||
OpName %v "v"
|
||||
OpName %m "m"
|
||||
OpName %indexable "indexable"
|
||||
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 %buf0 Block
|
||||
OpMemberDecorate %buf0 0 Offset 0
|
||||
OpDecorate %_arr_int_uint_2 ArrayStride 16
|
||||
OpDecorate %x_6 NonWritable
|
||||
OpDecorate %x_6 DescriptorSet 0
|
||||
OpDecorate %x_6 Binding 0
|
||||
OpDecorate %buf1 Block
|
||||
OpMemberDecorate %buf1 0 Offset 0
|
||||
OpDecorate %_arr_float_uint_4 ArrayStride 16
|
||||
OpDecorate %x_9 NonWritable
|
||||
OpDecorate %x_9 DescriptorSet 0
|
||||
OpDecorate %x_9 Binding 1
|
||||
OpDecorate %tint_symbol_1 Location 0
|
||||
OpMemberDecorate %main_out 0 Offset 0
|
||||
%int = OpTypeInt 32 1
|
||||
%uint = OpTypeInt 32 0
|
||||
%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_6 = OpVariable %_ptr_Uniform_buf0 Uniform
|
||||
%float = OpTypeFloat 32
|
||||
%uint_4 = OpConstant %uint 4
|
||||
%_arr_float_uint_4 = OpTypeArray %float %uint_4
|
||||
%buf1 = OpTypeStruct %_arr_float_uint_4
|
||||
%_ptr_Uniform_buf1 = OpTypePointer Uniform %buf1
|
||||
%x_9 = OpVariable %_ptr_Uniform_buf1 Uniform
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Private_v4float = OpTypePointer Private %v4float
|
||||
%17 = OpConstantNull %v4float
|
||||
%x_GLF_color = OpVariable %_ptr_Private_v4float Private %17
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %17
|
||||
%void = OpTypeVoid
|
||||
%20 = OpTypeFunction %void
|
||||
%_ptr_Function_int = OpTypePointer Function %int
|
||||
%26 = OpConstantNull %int
|
||||
%_ptr_Function_v4float = OpTypePointer Function %v4float
|
||||
%mat3v4float = OpTypeMatrix %v4float 3
|
||||
%_ptr_Function_mat3v4float = OpTypePointer Function %mat3v4float
|
||||
%32 = OpConstantNull %mat3v4float
|
||||
%mat4v4float = OpTypeMatrix %v4float 4
|
||||
%_ptr_Function_mat4v4float = OpTypePointer Function %mat4v4float
|
||||
%36 = OpConstantNull %mat4v4float
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%int_0 = OpConstant %int 0
|
||||
%_ptr_Uniform_int = OpTypePointer Uniform %int
|
||||
%int_2 = OpConstant %int 2
|
||||
%_ptr_Uniform_float = OpTypePointer Uniform %float
|
||||
%int_3 = OpConstant %int 3
|
||||
%float_0 = OpConstant %float 0
|
||||
%_ptr_Function_float = OpTypePointer Function %float
|
||||
%uint_1 = OpConstant %uint 1
|
||||
%float_1 = OpConstant %float 1
|
||||
%94 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_1
|
||||
%int_1 = OpConstant %int 1
|
||||
%bool = OpTypeBool
|
||||
%main_out = OpTypeStruct %v4float
|
||||
%129 = OpTypeFunction %void %main_out
|
||||
%main_1 = OpFunction %void None %20
|
||||
%23 = OpLabel
|
||||
%a = OpVariable %_ptr_Function_int Function %26
|
||||
%v = OpVariable %_ptr_Function_v4float Function %17
|
||||
%m = OpVariable %_ptr_Function_mat3v4float Function %32
|
||||
%indexable = OpVariable %_ptr_Function_mat4v4float Function %36
|
||||
%40 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_0
|
||||
%41 = OpLoad %int %40
|
||||
OpStore %a %41
|
||||
%44 = OpAccessChain %_ptr_Uniform_float %x_9 %uint_0 %int_2
|
||||
%45 = OpLoad %float %44
|
||||
%46 = OpCompositeConstruct %v4float %45 %45 %45 %45
|
||||
OpStore %v %46
|
||||
%48 = OpAccessChain %_ptr_Uniform_float %x_9 %uint_0 %int_3
|
||||
%49 = OpLoad %float %48
|
||||
%51 = OpCompositeConstruct %v4float %49 %float_0 %float_0 %float_0
|
||||
%52 = OpCompositeConstruct %v4float %float_0 %49 %float_0 %float_0
|
||||
%53 = OpCompositeConstruct %v4float %float_0 %float_0 %49 %float_0
|
||||
%54 = OpCompositeConstruct %mat3v4float %51 %52 %53
|
||||
OpStore %m %54
|
||||
%55 = OpLoad %int %a
|
||||
%56 = OpLoad %int %a
|
||||
%57 = OpAccessChain %_ptr_Uniform_float %x_9 %uint_0 %int_0
|
||||
%58 = OpLoad %float %57
|
||||
%60 = OpAccessChain %_ptr_Function_float %m %55 %56
|
||||
OpStore %60 %58
|
||||
%61 = OpLoad %int %a
|
||||
%62 = OpLoad %mat3v4float %m
|
||||
%63 = OpLoad %int %a
|
||||
%64 = OpLoad %int %a
|
||||
%65 = OpCompositeExtract %v4float %62 0
|
||||
%66 = OpCompositeExtract %float %65 0
|
||||
%67 = OpCompositeExtract %v4float %62 0
|
||||
%68 = OpCompositeExtract %float %67 1
|
||||
%69 = OpCompositeExtract %v4float %62 0
|
||||
%70 = OpCompositeExtract %float %69 2
|
||||
%71 = OpCompositeExtract %v4float %62 0
|
||||
%72 = OpCompositeExtract %float %71 3
|
||||
%73 = OpCompositeConstruct %v4float %66 %68 %70 %72
|
||||
%75 = OpCompositeExtract %v4float %62 1
|
||||
%76 = OpCompositeExtract %float %75 0
|
||||
%77 = OpCompositeExtract %v4float %62 1
|
||||
%78 = OpCompositeExtract %float %77 1
|
||||
%79 = OpCompositeExtract %v4float %62 1
|
||||
%80 = OpCompositeExtract %float %79 2
|
||||
%81 = OpCompositeExtract %v4float %62 1
|
||||
%82 = OpCompositeExtract %float %81 3
|
||||
%83 = OpCompositeConstruct %v4float %76 %78 %80 %82
|
||||
%84 = OpCompositeExtract %v4float %62 2
|
||||
%85 = OpCompositeExtract %float %84 0
|
||||
%86 = OpCompositeExtract %v4float %62 2
|
||||
%87 = OpCompositeExtract %float %86 1
|
||||
%88 = OpCompositeExtract %v4float %62 2
|
||||
%89 = OpCompositeExtract %float %88 2
|
||||
%90 = OpCompositeExtract %v4float %62 2
|
||||
%91 = OpCompositeExtract %float %90 3
|
||||
%92 = OpCompositeConstruct %v4float %85 %87 %89 %91
|
||||
%95 = OpCompositeConstruct %mat4v4float %73 %83 %92 %94
|
||||
OpStore %indexable %95
|
||||
%96 = OpAccessChain %_ptr_Function_float %indexable %63 %64
|
||||
%97 = OpLoad %float %96
|
||||
%98 = OpAccessChain %_ptr_Function_float %v %61
|
||||
%99 = OpLoad %float %98
|
||||
%100 = OpAccessChain %_ptr_Function_float %v %61
|
||||
%101 = OpFAdd %float %99 %97
|
||||
OpStore %100 %101
|
||||
%102 = OpAccessChain %_ptr_Function_float %v %uint_1
|
||||
%103 = OpLoad %float %102
|
||||
%105 = OpAccessChain %_ptr_Uniform_float %x_9 %uint_0 %int_1
|
||||
%106 = OpLoad %float %105
|
||||
%107 = OpFOrdEqual %bool %103 %106
|
||||
OpSelectionMerge %109 None
|
||||
OpBranchConditional %107 %110 %111
|
||||
%110 = OpLabel
|
||||
%112 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_0
|
||||
%113 = OpLoad %int %112
|
||||
%114 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_1
|
||||
%115 = OpLoad %int %114
|
||||
%116 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_1
|
||||
%117 = OpLoad %int %116
|
||||
%118 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_0
|
||||
%119 = OpLoad %int %118
|
||||
%120 = OpConvertSToF %float %113
|
||||
%121 = OpConvertSToF %float %115
|
||||
%122 = OpConvertSToF %float %117
|
||||
%123 = OpConvertSToF %float %119
|
||||
%124 = OpCompositeConstruct %v4float %120 %121 %122 %123
|
||||
OpStore %x_GLF_color %124
|
||||
OpBranch %109
|
||||
%111 = OpLabel
|
||||
%125 = OpAccessChain %_ptr_Uniform_int %x_6 %uint_0 %int_1
|
||||
%126 = OpLoad %int %125
|
||||
%127 = OpConvertSToF %float %126
|
||||
%128 = OpCompositeConstruct %v4float %127 %127 %127 %127
|
||||
OpStore %x_GLF_color %128
|
||||
OpBranch %109
|
||||
%109 = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%tint_symbol_2 = OpFunction %void None %129
|
||||
%tint_symbol = OpFunctionParameter %main_out
|
||||
%133 = OpLabel
|
||||
%134 = OpCompositeExtract %v4float %tint_symbol 0
|
||||
OpStore %tint_symbol_1 %134
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%main = OpFunction %void None %20
|
||||
%136 = OpLabel
|
||||
%137 = OpFunctionCall %void %main_1
|
||||
%139 = OpLoad %v4float %x_GLF_color
|
||||
%140 = OpCompositeConstruct %main_out %139
|
||||
%138 = OpFunctionCall %void %tint_symbol_2 %140
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,69 @@
|
||||
type Arr = [[stride(16)]] array<i32, 2>;
|
||||
|
||||
[[block]]
|
||||
struct buf0 {
|
||||
x_GLF_uniform_int_values : Arr;
|
||||
};
|
||||
|
||||
type Arr_1 = [[stride(16)]] array<f32, 4>;
|
||||
|
||||
[[block]]
|
||||
struct buf1 {
|
||||
x_GLF_uniform_float_values : Arr_1;
|
||||
};
|
||||
|
||||
[[group(0), binding(0)]] var<uniform> x_6 : buf0;
|
||||
|
||||
[[group(0), binding(1)]] var<uniform> x_9 : buf1;
|
||||
|
||||
var<private> x_GLF_color : vec4<f32>;
|
||||
|
||||
fn main_1() {
|
||||
var a : i32;
|
||||
var v : vec4<f32>;
|
||||
var m : mat3x4<f32>;
|
||||
var indexable : mat4x4<f32>;
|
||||
let x_44 : i32 = x_6.x_GLF_uniform_int_values[0];
|
||||
a = x_44;
|
||||
let x_46 : f32 = x_9.x_GLF_uniform_float_values[2];
|
||||
v = vec4<f32>(x_46, x_46, x_46, x_46);
|
||||
let x_49 : f32 = x_9.x_GLF_uniform_float_values[3];
|
||||
m = mat3x4<f32>(vec4<f32>(x_49, 0.0, 0.0, 0.0), vec4<f32>(0.0, x_49, 0.0, 0.0), vec4<f32>(0.0, 0.0, x_49, 0.0));
|
||||
let x_54 : i32 = a;
|
||||
let x_55 : i32 = a;
|
||||
let x_57 : f32 = x_9.x_GLF_uniform_float_values[0];
|
||||
m[x_54][x_55] = x_57;
|
||||
let x_59 : i32 = a;
|
||||
let x_60 : mat3x4<f32> = m;
|
||||
let x_78 : i32 = a;
|
||||
let x_79 : i32 = a;
|
||||
indexable = mat4x4<f32>(vec4<f32>(x_60[0u].x, x_60[0u].y, x_60[0u].z, x_60[0u].w), vec4<f32>(x_60[1u].x, x_60[1u].y, x_60[1u].z, x_60[1u].w), vec4<f32>(x_60[2u].x, x_60[2u].y, x_60[2u].z, x_60[2u].w), vec4<f32>(0.0, 0.0, 0.0, 1.0));
|
||||
let x_81 : f32 = indexable[x_78][x_79];
|
||||
let x_83 : f32 = v[x_59];
|
||||
v[x_59] = (x_83 + x_81);
|
||||
let x_87 : f32 = v.y;
|
||||
let x_89 : f32 = x_9.x_GLF_uniform_float_values[1];
|
||||
if ((x_87 == x_89)) {
|
||||
let x_95 : i32 = x_6.x_GLF_uniform_int_values[0];
|
||||
let x_98 : i32 = x_6.x_GLF_uniform_int_values[1];
|
||||
let x_101 : i32 = x_6.x_GLF_uniform_int_values[1];
|
||||
let x_104 : i32 = x_6.x_GLF_uniform_int_values[0];
|
||||
x_GLF_color = vec4<f32>(f32(x_95), f32(x_98), f32(x_101), f32(x_104));
|
||||
} else {
|
||||
let x_108 : i32 = x_6.x_GLF_uniform_int_values[1];
|
||||
let x_109 : f32 = f32(x_108);
|
||||
x_GLF_color = vec4<f32>(x_109, x_109, x_109, x_109);
|
||||
}
|
||||
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