mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-10 14:08:04 +00:00
tint: Preserve padding in matrices with three rows
The PreservePadding transform now decomposes writes to matrices with three rows into separate column vector writes, to avoid modifying padding between columns. Bug: tint:1571 Change-Id: If575f79bb87f52810783fd3338e2f3ce3228ab2e Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121600 Auto-Submit: James Price <jrprice@google.com> Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Ben Clayton <bclayton@google.com> Commit-Queue: James Price <jrprice@google.com>
This commit is contained in:
committed by
Dawn LUCI CQ
parent
fe19fee3ea
commit
6176c85be8
@@ -14,6 +14,20 @@ layout(binding = 1, std430) buffer u_block_ssbo {
|
||||
f16mat2x3 inner[4];
|
||||
} s;
|
||||
|
||||
void assign_and_preserve_padding_1_s_X(uint dest[1], f16mat2x3 value) {
|
||||
s.inner[dest[0]][0] = value[0u];
|
||||
s.inner[dest[0]][1] = value[1u];
|
||||
}
|
||||
|
||||
void assign_and_preserve_padding_s(f16mat2x3 value[4]) {
|
||||
{
|
||||
for(uint i = 0u; (i < 4u); i = (i + 1u)) {
|
||||
uint tint_symbol[1] = uint[1](i);
|
||||
assign_and_preserve_padding_1_s_X(tint_symbol, value[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
f16mat2x3 conv_mat2x3_f16(mat2x3_f16 val) {
|
||||
return f16mat2x3(val.col0, val.col1);
|
||||
}
|
||||
@@ -29,8 +43,9 @@ f16mat2x3[4] conv_arr4_mat2x3_f16(mat2x3_f16 val[4]) {
|
||||
}
|
||||
|
||||
void f() {
|
||||
s.inner = conv_arr4_mat2x3_f16(u.inner);
|
||||
s.inner[1] = conv_mat2x3_f16(u.inner[2u]);
|
||||
assign_and_preserve_padding_s(conv_arr4_mat2x3_f16(u.inner));
|
||||
uint tint_symbol_1[1] = uint[1](1u);
|
||||
assign_and_preserve_padding_1_s_X(tint_symbol_1, conv_mat2x3_f16(u.inner[2u]));
|
||||
s.inner[1][0] = u.inner[0u].col1.zxy;
|
||||
s.inner[1][0].x = u.inner[0u].col1[0u];
|
||||
}
|
||||
|
||||
@@ -14,9 +14,20 @@ struct tint_array {
|
||||
T elements[N];
|
||||
};
|
||||
|
||||
void assign_and_preserve_padding_1(device half2x3* const dest, half2x3 value) {
|
||||
(*(dest))[0u] = value[0u];
|
||||
(*(dest))[1u] = value[1u];
|
||||
}
|
||||
|
||||
void assign_and_preserve_padding(device tint_array<half2x3, 4>* const dest, tint_array<half2x3, 4> value) {
|
||||
for(uint i = 0u; (i < 4u); i = (i + 1u)) {
|
||||
assign_and_preserve_padding_1(&((*(dest))[i]), value[i]);
|
||||
}
|
||||
}
|
||||
|
||||
kernel void f(device tint_array<half2x3, 4>* tint_symbol [[buffer(1)]], const constant tint_array<half2x3, 4>* tint_symbol_1 [[buffer(0)]]) {
|
||||
*(tint_symbol) = *(tint_symbol_1);
|
||||
(*(tint_symbol))[1] = (*(tint_symbol_1))[2];
|
||||
assign_and_preserve_padding(tint_symbol, *(tint_symbol_1));
|
||||
assign_and_preserve_padding_1(&((*(tint_symbol))[1]), (*(tint_symbol_1))[2]);
|
||||
(*(tint_symbol))[1][0] = half3((*(tint_symbol_1))[0][1]).zxy;
|
||||
(*(tint_symbol))[1][0][0] = (*(tint_symbol_1))[0][1][0];
|
||||
return;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 89
|
||||
; Bound: 123
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpCapability Float16
|
||||
@@ -20,13 +20,20 @@
|
||||
OpName %u_block "u_block"
|
||||
OpMemberName %u_block 0 "inner"
|
||||
OpName %s "s"
|
||||
OpName %assign_and_preserve_padding_1_s_X "assign_and_preserve_padding_1_s_X"
|
||||
OpName %dest "dest"
|
||||
OpName %value "value"
|
||||
OpName %assign_and_preserve_padding_s "assign_and_preserve_padding_s"
|
||||
OpName %value_0 "value"
|
||||
OpName %i "i"
|
||||
OpName %var_for_index "var_for_index"
|
||||
OpName %conv_mat2x3_f16 "conv_mat2x3_f16"
|
||||
OpName %val "val"
|
||||
OpName %conv_arr4_mat2x3_f16 "conv_arr4_mat2x3_f16"
|
||||
OpName %val_0 "val"
|
||||
OpName %arr "arr"
|
||||
OpName %i "i"
|
||||
OpName %var_for_index "var_for_index"
|
||||
OpName %i_0 "i"
|
||||
OpName %var_for_index_1 "var_for_index_1"
|
||||
OpName %f "f"
|
||||
OpDecorate %u_block_std140 Block
|
||||
OpMemberDecorate %u_block_std140 0 Offset 0
|
||||
@@ -43,6 +50,7 @@
|
||||
OpDecorate %_arr_mat2v3half_uint_4 ArrayStride 16
|
||||
OpDecorate %s DescriptorSet 0
|
||||
OpDecorate %s Binding 1
|
||||
OpDecorate %_arr_uint_uint_1 ArrayStride 4
|
||||
%half = OpTypeFloat 16
|
||||
%v3half = OpTypeVector %half 3
|
||||
%mat2x3_f16 = OpTypeStruct %v3half %v3half
|
||||
@@ -57,98 +65,147 @@
|
||||
%u_block = OpTypeStruct %_arr_mat2v3half_uint_4
|
||||
%_ptr_StorageBuffer_u_block = OpTypePointer StorageBuffer %u_block
|
||||
%s = OpVariable %_ptr_StorageBuffer_u_block StorageBuffer
|
||||
%15 = OpTypeFunction %mat2v3half %mat2x3_f16
|
||||
%22 = OpTypeFunction %_arr_mat2v3half_uint_4 %_arr_mat2x3_f16_uint_4
|
||||
%_ptr_Function__arr_mat2v3half_uint_4 = OpTypePointer Function %_arr_mat2v3half_uint_4
|
||||
%28 = OpConstantNull %_arr_mat2v3half_uint_4
|
||||
%_ptr_Function_uint = OpTypePointer Function %uint
|
||||
%31 = OpConstantNull %uint
|
||||
%bool = OpTypeBool
|
||||
%_ptr_Function__arr_mat2x3_f16_uint_4 = OpTypePointer Function %_arr_mat2x3_f16_uint_4
|
||||
%44 = OpConstantNull %_arr_mat2x3_f16_uint_4
|
||||
%_ptr_Function_mat2v3half = OpTypePointer Function %mat2v3half
|
||||
%_ptr_Function_mat2x3_f16 = OpTypePointer Function %mat2x3_f16
|
||||
%uint_1 = OpConstant %uint 1
|
||||
%void = OpTypeVoid
|
||||
%57 = OpTypeFunction %void
|
||||
%uint_1 = OpConstant %uint 1
|
||||
%_arr_uint_uint_1 = OpTypeArray %uint %uint_1
|
||||
%15 = OpTypeFunction %void %_arr_uint_uint_1 %mat2v3half
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%_ptr_StorageBuffer__arr_mat2v3half_uint_4 = OpTypePointer StorageBuffer %_arr_mat2v3half_uint_4
|
||||
%_ptr_Uniform__arr_mat2x3_f16_uint_4 = OpTypePointer Uniform %_arr_mat2x3_f16_uint_4
|
||||
%int = OpTypeInt 32 1
|
||||
%25 = OpConstantNull %int
|
||||
%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
|
||||
%29 = OpConstantNull %uint
|
||||
%int_1 = OpConstant %int 1
|
||||
%_ptr_StorageBuffer_mat2v3half = OpTypePointer StorageBuffer %mat2v3half
|
||||
%35 = OpTypeFunction %void %_arr_mat2v3half_uint_4
|
||||
%_ptr_Function_uint = OpTypePointer Function %uint
|
||||
%bool = OpTypeBool
|
||||
%_ptr_Function__arr_mat2v3half_uint_4 = OpTypePointer Function %_arr_mat2v3half_uint_4
|
||||
%53 = OpConstantNull %_arr_mat2v3half_uint_4
|
||||
%_ptr_Function_mat2v3half = OpTypePointer Function %mat2v3half
|
||||
%63 = OpTypeFunction %mat2v3half %mat2x3_f16
|
||||
%70 = OpTypeFunction %_arr_mat2v3half_uint_4 %_arr_mat2x3_f16_uint_4
|
||||
%_ptr_Function__arr_mat2x3_f16_uint_4 = OpTypePointer Function %_arr_mat2x3_f16_uint_4
|
||||
%87 = OpConstantNull %_arr_mat2x3_f16_uint_4
|
||||
%_ptr_Function_mat2x3_f16 = OpTypePointer Function %mat2x3_f16
|
||||
%98 = OpTypeFunction %void
|
||||
%_ptr_Uniform__arr_mat2x3_f16_uint_4 = OpTypePointer Uniform %_arr_mat2x3_f16_uint_4
|
||||
%107 = OpConstantComposite %_arr_uint_uint_1 %uint_1
|
||||
%uint_2 = OpConstant %uint 2
|
||||
%_ptr_Uniform_mat2x3_f16 = OpTypePointer Uniform %mat2x3_f16
|
||||
%77 = OpConstantNull %int
|
||||
%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
|
||||
%_ptr_Uniform_v3half = OpTypePointer Uniform %v3half
|
||||
%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
|
||||
%_ptr_Uniform_half = OpTypePointer Uniform %half
|
||||
%conv_mat2x3_f16 = OpFunction %mat2v3half None %15
|
||||
%val = OpFunctionParameter %mat2x3_f16
|
||||
%18 = OpLabel
|
||||
%19 = OpCompositeExtract %v3half %val 0
|
||||
%20 = OpCompositeExtract %v3half %val 1
|
||||
%21 = OpCompositeConstruct %mat2v3half %19 %20
|
||||
OpReturnValue %21
|
||||
OpFunctionEnd
|
||||
%conv_arr4_mat2x3_f16 = OpFunction %_arr_mat2v3half_uint_4 None %22
|
||||
%val_0 = OpFunctionParameter %_arr_mat2x3_f16_uint_4
|
||||
%25 = OpLabel
|
||||
%arr = OpVariable %_ptr_Function__arr_mat2v3half_uint_4 Function %28
|
||||
%i = OpVariable %_ptr_Function_uint Function %31
|
||||
%var_for_index = OpVariable %_ptr_Function__arr_mat2x3_f16_uint_4 Function %44
|
||||
OpBranch %32
|
||||
%32 = OpLabel
|
||||
OpLoopMerge %33 %34 None
|
||||
OpBranch %35
|
||||
%35 = OpLabel
|
||||
%37 = OpLoad %uint %i
|
||||
%38 = OpULessThan %bool %37 %uint_4
|
||||
%36 = OpLogicalNot %bool %38
|
||||
OpSelectionMerge %40 None
|
||||
OpBranchConditional %36 %41 %40
|
||||
%41 = OpLabel
|
||||
OpBranch %33
|
||||
%40 = OpLabel
|
||||
OpStore %var_for_index %val_0
|
||||
%45 = OpLoad %uint %i
|
||||
%47 = OpAccessChain %_ptr_Function_mat2v3half %arr %45
|
||||
%49 = OpLoad %uint %i
|
||||
%51 = OpAccessChain %_ptr_Function_mat2x3_f16 %var_for_index %49
|
||||
%52 = OpLoad %mat2x3_f16 %51
|
||||
%48 = OpFunctionCall %mat2v3half %conv_mat2x3_f16 %52
|
||||
OpStore %47 %48
|
||||
OpBranch %34
|
||||
%34 = OpLabel
|
||||
%53 = OpLoad %uint %i
|
||||
%55 = OpIAdd %uint %53 %uint_1
|
||||
OpStore %i %55
|
||||
OpBranch %32
|
||||
%33 = OpLabel
|
||||
%56 = OpLoad %_arr_mat2v3half_uint_4 %arr
|
||||
OpReturnValue %56
|
||||
OpFunctionEnd
|
||||
%f = OpFunction %void None %57
|
||||
%60 = OpLabel
|
||||
%63 = OpAccessChain %_ptr_StorageBuffer__arr_mat2v3half_uint_4 %s %uint_0
|
||||
%66 = OpAccessChain %_ptr_Uniform__arr_mat2x3_f16_uint_4 %u %uint_0
|
||||
%67 = OpLoad %_arr_mat2x3_f16_uint_4 %66
|
||||
%64 = OpFunctionCall %_arr_mat2v3half_uint_4 %conv_arr4_mat2x3_f16 %67
|
||||
OpStore %63 %64
|
||||
%71 = OpAccessChain %_ptr_StorageBuffer_mat2v3half %s %uint_0 %int_1
|
||||
%75 = OpAccessChain %_ptr_Uniform_mat2x3_f16 %u %uint_0 %uint_2
|
||||
%76 = OpLoad %mat2x3_f16 %75
|
||||
%72 = OpFunctionCall %mat2v3half %conv_mat2x3_f16 %76
|
||||
OpStore %71 %72
|
||||
%79 = OpAccessChain %_ptr_StorageBuffer_v3half %s %uint_0 %int_1 %77
|
||||
%81 = OpAccessChain %_ptr_Uniform_v3half %u %uint_0 %31 %uint_1
|
||||
%82 = OpLoad %v3half %81
|
||||
%83 = OpVectorShuffle %v3half %82 %82 2 0 1
|
||||
OpStore %79 %83
|
||||
%85 = OpAccessChain %_ptr_StorageBuffer_half %s %uint_0 %int_1 %77 %uint_0
|
||||
%87 = OpAccessChain %_ptr_Uniform_half %u %uint_0 %31 %uint_1 %31
|
||||
%88 = OpLoad %half %87
|
||||
OpStore %85 %88
|
||||
%assign_and_preserve_padding_1_s_X = OpFunction %void None %15
|
||||
%dest = OpFunctionParameter %_arr_uint_uint_1
|
||||
%value = OpFunctionParameter %mat2v3half
|
||||
%22 = OpLabel
|
||||
%26 = OpCompositeExtract %uint %dest 0
|
||||
%28 = OpAccessChain %_ptr_StorageBuffer_v3half %s %uint_0 %26 %25
|
||||
%30 = OpCompositeExtract %v3half %value 0
|
||||
OpStore %28 %30
|
||||
%31 = OpCompositeExtract %uint %dest 0
|
||||
%33 = OpAccessChain %_ptr_StorageBuffer_v3half %s %uint_0 %31 %int_1
|
||||
%34 = OpCompositeExtract %v3half %value 1
|
||||
OpStore %33 %34
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%assign_and_preserve_padding_s = OpFunction %void None %35
|
||||
%value_0 = OpFunctionParameter %_arr_mat2v3half_uint_4
|
||||
%38 = OpLabel
|
||||
%i = OpVariable %_ptr_Function_uint Function %29
|
||||
%var_for_index = OpVariable %_ptr_Function__arr_mat2v3half_uint_4 Function %53
|
||||
OpStore %i %29
|
||||
OpBranch %41
|
||||
%41 = OpLabel
|
||||
OpLoopMerge %42 %43 None
|
||||
OpBranch %44
|
||||
%44 = OpLabel
|
||||
%46 = OpLoad %uint %i
|
||||
%47 = OpULessThan %bool %46 %uint_4
|
||||
%45 = OpLogicalNot %bool %47
|
||||
OpSelectionMerge %49 None
|
||||
OpBranchConditional %45 %50 %49
|
||||
%50 = OpLabel
|
||||
OpBranch %42
|
||||
%49 = OpLabel
|
||||
OpStore %var_for_index %value_0
|
||||
%55 = OpLoad %uint %i
|
||||
%56 = OpCompositeConstruct %_arr_uint_uint_1 %55
|
||||
%57 = OpLoad %uint %i
|
||||
%59 = OpAccessChain %_ptr_Function_mat2v3half %var_for_index %57
|
||||
%60 = OpLoad %mat2v3half %59
|
||||
%54 = OpFunctionCall %void %assign_and_preserve_padding_1_s_X %56 %60
|
||||
OpBranch %43
|
||||
%43 = OpLabel
|
||||
%61 = OpLoad %uint %i
|
||||
%62 = OpIAdd %uint %61 %uint_1
|
||||
OpStore %i %62
|
||||
OpBranch %41
|
||||
%42 = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%conv_mat2x3_f16 = OpFunction %mat2v3half None %63
|
||||
%val = OpFunctionParameter %mat2x3_f16
|
||||
%66 = OpLabel
|
||||
%67 = OpCompositeExtract %v3half %val 0
|
||||
%68 = OpCompositeExtract %v3half %val 1
|
||||
%69 = OpCompositeConstruct %mat2v3half %67 %68
|
||||
OpReturnValue %69
|
||||
OpFunctionEnd
|
||||
%conv_arr4_mat2x3_f16 = OpFunction %_arr_mat2v3half_uint_4 None %70
|
||||
%val_0 = OpFunctionParameter %_arr_mat2x3_f16_uint_4
|
||||
%73 = OpLabel
|
||||
%arr = OpVariable %_ptr_Function__arr_mat2v3half_uint_4 Function %53
|
||||
%i_0 = OpVariable %_ptr_Function_uint Function %29
|
||||
%var_for_index_1 = OpVariable %_ptr_Function__arr_mat2x3_f16_uint_4 Function %87
|
||||
OpBranch %76
|
||||
%76 = OpLabel
|
||||
OpLoopMerge %77 %78 None
|
||||
OpBranch %79
|
||||
%79 = OpLabel
|
||||
%81 = OpLoad %uint %i_0
|
||||
%82 = OpULessThan %bool %81 %uint_4
|
||||
%80 = OpLogicalNot %bool %82
|
||||
OpSelectionMerge %83 None
|
||||
OpBranchConditional %80 %84 %83
|
||||
%84 = OpLabel
|
||||
OpBranch %77
|
||||
%83 = OpLabel
|
||||
OpStore %var_for_index_1 %val_0
|
||||
%88 = OpLoad %uint %i_0
|
||||
%89 = OpAccessChain %_ptr_Function_mat2v3half %arr %88
|
||||
%91 = OpLoad %uint %i_0
|
||||
%93 = OpAccessChain %_ptr_Function_mat2x3_f16 %var_for_index_1 %91
|
||||
%94 = OpLoad %mat2x3_f16 %93
|
||||
%90 = OpFunctionCall %mat2v3half %conv_mat2x3_f16 %94
|
||||
OpStore %89 %90
|
||||
OpBranch %78
|
||||
%78 = OpLabel
|
||||
%95 = OpLoad %uint %i_0
|
||||
%96 = OpIAdd %uint %95 %uint_1
|
||||
OpStore %i_0 %96
|
||||
OpBranch %76
|
||||
%77 = OpLabel
|
||||
%97 = OpLoad %_arr_mat2v3half_uint_4 %arr
|
||||
OpReturnValue %97
|
||||
OpFunctionEnd
|
||||
%f = OpFunction %void None %98
|
||||
%100 = OpLabel
|
||||
%104 = OpAccessChain %_ptr_Uniform__arr_mat2x3_f16_uint_4 %u %uint_0
|
||||
%105 = OpLoad %_arr_mat2x3_f16_uint_4 %104
|
||||
%102 = OpFunctionCall %_arr_mat2v3half_uint_4 %conv_arr4_mat2x3_f16 %105
|
||||
%101 = OpFunctionCall %void %assign_and_preserve_padding_s %102
|
||||
%111 = OpAccessChain %_ptr_Uniform_mat2x3_f16 %u %uint_0 %uint_2
|
||||
%112 = OpLoad %mat2x3_f16 %111
|
||||
%108 = OpFunctionCall %mat2v3half %conv_mat2x3_f16 %112
|
||||
%106 = OpFunctionCall %void %assign_and_preserve_padding_1_s_X %107 %108
|
||||
%113 = OpAccessChain %_ptr_StorageBuffer_v3half %s %uint_0 %int_1 %25
|
||||
%115 = OpAccessChain %_ptr_Uniform_v3half %u %uint_0 %29 %uint_1
|
||||
%116 = OpLoad %v3half %115
|
||||
%117 = OpVectorShuffle %v3half %116 %116 2 0 1
|
||||
OpStore %113 %117
|
||||
%119 = OpAccessChain %_ptr_StorageBuffer_half %s %uint_0 %int_1 %25 %uint_0
|
||||
%121 = OpAccessChain %_ptr_Uniform_half %u %uint_0 %29 %uint_1 %29
|
||||
%122 = OpLoad %half %121
|
||||
OpStore %119 %122
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
||||
@@ -8,9 +8,24 @@ layout(binding = 1, std430) buffer u_block_ssbo {
|
||||
mat2x3 inner[4];
|
||||
} s;
|
||||
|
||||
void assign_and_preserve_padding_1_s_X(uint dest[1], mat2x3 value) {
|
||||
s.inner[dest[0]][0] = value[0u];
|
||||
s.inner[dest[0]][1] = value[1u];
|
||||
}
|
||||
|
||||
void assign_and_preserve_padding_s(mat2x3 value[4]) {
|
||||
{
|
||||
for(uint i = 0u; (i < 4u); i = (i + 1u)) {
|
||||
uint tint_symbol[1] = uint[1](i);
|
||||
assign_and_preserve_padding_1_s_X(tint_symbol, value[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void f() {
|
||||
s.inner = u.inner;
|
||||
s.inner[1] = u.inner[2];
|
||||
assign_and_preserve_padding_s(u.inner);
|
||||
uint tint_symbol_1[1] = uint[1](1u);
|
||||
assign_and_preserve_padding_1_s_X(tint_symbol_1, u.inner[2]);
|
||||
s.inner[1][0] = u.inner[0][1].zxy;
|
||||
s.inner[1][0].x = u.inner[0][1].x;
|
||||
}
|
||||
|
||||
@@ -14,9 +14,20 @@ struct tint_array {
|
||||
T elements[N];
|
||||
};
|
||||
|
||||
void assign_and_preserve_padding_1(device float2x3* const dest, float2x3 value) {
|
||||
(*(dest))[0u] = value[0u];
|
||||
(*(dest))[1u] = value[1u];
|
||||
}
|
||||
|
||||
void assign_and_preserve_padding(device tint_array<float2x3, 4>* const dest, tint_array<float2x3, 4> value) {
|
||||
for(uint i = 0u; (i < 4u); i = (i + 1u)) {
|
||||
assign_and_preserve_padding_1(&((*(dest))[i]), value[i]);
|
||||
}
|
||||
}
|
||||
|
||||
kernel void f(device tint_array<float2x3, 4>* tint_symbol [[buffer(1)]], const constant tint_array<float2x3, 4>* tint_symbol_1 [[buffer(0)]]) {
|
||||
*(tint_symbol) = *(tint_symbol_1);
|
||||
(*(tint_symbol))[1] = (*(tint_symbol_1))[2];
|
||||
assign_and_preserve_padding(tint_symbol, *(tint_symbol_1));
|
||||
assign_and_preserve_padding_1(&((*(tint_symbol))[1]), (*(tint_symbol_1))[2]);
|
||||
(*(tint_symbol))[1][0] = float3((*(tint_symbol_1))[0][1]).zxy;
|
||||
(*(tint_symbol))[1][0][0] = (*(tint_symbol_1))[0][1][0];
|
||||
return;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 42
|
||||
; Bound: 83
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
@@ -11,6 +11,13 @@
|
||||
OpMemberName %u_block 0 "inner"
|
||||
OpName %u "u"
|
||||
OpName %s "s"
|
||||
OpName %assign_and_preserve_padding_1_s_X "assign_and_preserve_padding_1_s_X"
|
||||
OpName %dest "dest"
|
||||
OpName %value "value"
|
||||
OpName %assign_and_preserve_padding_s "assign_and_preserve_padding_s"
|
||||
OpName %value_0 "value"
|
||||
OpName %i "i"
|
||||
OpName %var_for_index "var_for_index"
|
||||
OpName %f "f"
|
||||
OpDecorate %u_block Block
|
||||
OpMemberDecorate %u_block 0 Offset 0
|
||||
@@ -22,6 +29,7 @@
|
||||
OpDecorate %u Binding 0
|
||||
OpDecorate %s DescriptorSet 0
|
||||
OpDecorate %s Binding 1
|
||||
OpDecorate %_arr_uint_uint_1 ArrayStride 4
|
||||
%float = OpTypeFloat 32
|
||||
%v3float = OpTypeVector %float 3
|
||||
%mat2v3float = OpTypeMatrix %v3float 2
|
||||
@@ -34,38 +42,94 @@
|
||||
%_ptr_StorageBuffer_u_block = OpTypePointer StorageBuffer %u_block
|
||||
%s = OpVariable %_ptr_StorageBuffer_u_block StorageBuffer
|
||||
%void = OpTypeVoid
|
||||
%12 = OpTypeFunction %void
|
||||
%uint_1 = OpConstant %uint 1
|
||||
%_arr_uint_uint_1 = OpTypeArray %uint %uint_1
|
||||
%12 = OpTypeFunction %void %_arr_uint_uint_1 %mat2v3float
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%_ptr_StorageBuffer__arr_mat2v3float_uint_4 = OpTypePointer StorageBuffer %_arr_mat2v3float_uint_4
|
||||
%_ptr_Uniform__arr_mat2v3float_uint_4 = OpTypePointer Uniform %_arr_mat2v3float_uint_4
|
||||
%int = OpTypeInt 32 1
|
||||
%22 = OpConstantNull %int
|
||||
%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
|
||||
%26 = OpConstantNull %uint
|
||||
%int_1 = OpConstant %int 1
|
||||
%_ptr_StorageBuffer_mat2v3float = OpTypePointer StorageBuffer %mat2v3float
|
||||
%32 = OpTypeFunction %void %_arr_mat2v3float_uint_4
|
||||
%_ptr_Function_uint = OpTypePointer Function %uint
|
||||
%bool = OpTypeBool
|
||||
%_ptr_Function__arr_mat2v3float_uint_4 = OpTypePointer Function %_arr_mat2v3float_uint_4
|
||||
%50 = OpConstantNull %_arr_mat2v3float_uint_4
|
||||
%_ptr_Function_mat2v3float = OpTypePointer Function %mat2v3float
|
||||
%60 = OpTypeFunction %void
|
||||
%_ptr_Uniform__arr_mat2v3float_uint_4 = OpTypePointer Uniform %_arr_mat2v3float_uint_4
|
||||
%68 = OpConstantComposite %_arr_uint_uint_1 %uint_1
|
||||
%int_2 = OpConstant %int 2
|
||||
%_ptr_Uniform_mat2v3float = OpTypePointer Uniform %mat2v3float
|
||||
%30 = OpConstantNull %int
|
||||
%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
|
||||
%_ptr_Uniform_v3float = OpTypePointer Uniform %v3float
|
||||
%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
|
||||
%_ptr_Uniform_float = OpTypePointer Uniform %float
|
||||
%f = OpFunction %void None %12
|
||||
%15 = OpLabel
|
||||
%18 = OpAccessChain %_ptr_StorageBuffer__arr_mat2v3float_uint_4 %s %uint_0
|
||||
%20 = OpAccessChain %_ptr_Uniform__arr_mat2v3float_uint_4 %u %uint_0
|
||||
%21 = OpLoad %_arr_mat2v3float_uint_4 %20
|
||||
OpStore %18 %21
|
||||
%25 = OpAccessChain %_ptr_StorageBuffer_mat2v3float %s %uint_0 %int_1
|
||||
%28 = OpAccessChain %_ptr_Uniform_mat2v3float %u %uint_0 %int_2
|
||||
%29 = OpLoad %mat2v3float %28
|
||||
OpStore %25 %29
|
||||
%32 = OpAccessChain %_ptr_StorageBuffer_v3float %s %uint_0 %int_1 %30
|
||||
%34 = OpAccessChain %_ptr_Uniform_v3float %u %uint_0 %30 %int_1
|
||||
%35 = OpLoad %v3float %34
|
||||
%36 = OpVectorShuffle %v3float %35 %35 2 0 1
|
||||
OpStore %32 %36
|
||||
%38 = OpAccessChain %_ptr_StorageBuffer_float %s %uint_0 %int_1 %30 %uint_0
|
||||
%40 = OpAccessChain %_ptr_Uniform_float %u %uint_0 %30 %int_1 %uint_0
|
||||
%41 = OpLoad %float %40
|
||||
OpStore %38 %41
|
||||
%assign_and_preserve_padding_1_s_X = OpFunction %void None %12
|
||||
%dest = OpFunctionParameter %_arr_uint_uint_1
|
||||
%value = OpFunctionParameter %mat2v3float
|
||||
%19 = OpLabel
|
||||
%23 = OpCompositeExtract %uint %dest 0
|
||||
%25 = OpAccessChain %_ptr_StorageBuffer_v3float %s %uint_0 %23 %22
|
||||
%27 = OpCompositeExtract %v3float %value 0
|
||||
OpStore %25 %27
|
||||
%28 = OpCompositeExtract %uint %dest 0
|
||||
%30 = OpAccessChain %_ptr_StorageBuffer_v3float %s %uint_0 %28 %int_1
|
||||
%31 = OpCompositeExtract %v3float %value 1
|
||||
OpStore %30 %31
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%assign_and_preserve_padding_s = OpFunction %void None %32
|
||||
%value_0 = OpFunctionParameter %_arr_mat2v3float_uint_4
|
||||
%35 = OpLabel
|
||||
%i = OpVariable %_ptr_Function_uint Function %26
|
||||
%var_for_index = OpVariable %_ptr_Function__arr_mat2v3float_uint_4 Function %50
|
||||
OpStore %i %26
|
||||
OpBranch %38
|
||||
%38 = OpLabel
|
||||
OpLoopMerge %39 %40 None
|
||||
OpBranch %41
|
||||
%41 = OpLabel
|
||||
%43 = OpLoad %uint %i
|
||||
%44 = OpULessThan %bool %43 %uint_4
|
||||
%42 = OpLogicalNot %bool %44
|
||||
OpSelectionMerge %46 None
|
||||
OpBranchConditional %42 %47 %46
|
||||
%47 = OpLabel
|
||||
OpBranch %39
|
||||
%46 = OpLabel
|
||||
OpStore %var_for_index %value_0
|
||||
%52 = OpLoad %uint %i
|
||||
%53 = OpCompositeConstruct %_arr_uint_uint_1 %52
|
||||
%54 = OpLoad %uint %i
|
||||
%56 = OpAccessChain %_ptr_Function_mat2v3float %var_for_index %54
|
||||
%57 = OpLoad %mat2v3float %56
|
||||
%51 = OpFunctionCall %void %assign_and_preserve_padding_1_s_X %53 %57
|
||||
OpBranch %40
|
||||
%40 = OpLabel
|
||||
%58 = OpLoad %uint %i
|
||||
%59 = OpIAdd %uint %58 %uint_1
|
||||
OpStore %i %59
|
||||
OpBranch %38
|
||||
%39 = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%f = OpFunction %void None %60
|
||||
%62 = OpLabel
|
||||
%65 = OpAccessChain %_ptr_Uniform__arr_mat2v3float_uint_4 %u %uint_0
|
||||
%66 = OpLoad %_arr_mat2v3float_uint_4 %65
|
||||
%63 = OpFunctionCall %void %assign_and_preserve_padding_s %66
|
||||
%71 = OpAccessChain %_ptr_Uniform_mat2v3float %u %uint_0 %int_2
|
||||
%72 = OpLoad %mat2v3float %71
|
||||
%67 = OpFunctionCall %void %assign_and_preserve_padding_1_s_X %68 %72
|
||||
%73 = OpAccessChain %_ptr_StorageBuffer_v3float %s %uint_0 %int_1 %22
|
||||
%75 = OpAccessChain %_ptr_Uniform_v3float %u %uint_0 %22 %int_1
|
||||
%76 = OpLoad %v3float %75
|
||||
%77 = OpVectorShuffle %v3float %76 %76 2 0 1
|
||||
OpStore %73 %77
|
||||
%79 = OpAccessChain %_ptr_StorageBuffer_float %s %uint_0 %int_1 %22 %uint_0
|
||||
%81 = OpAccessChain %_ptr_Uniform_float %u %uint_0 %22 %int_1 %uint_0
|
||||
%82 = OpLoad %float %81
|
||||
OpStore %79 %82
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
||||
@@ -8,9 +8,25 @@ layout(binding = 1, std430) buffer u_block_ssbo {
|
||||
mat3 inner[4];
|
||||
} s;
|
||||
|
||||
void assign_and_preserve_padding_1_s_X(uint dest[1], mat3 value) {
|
||||
s.inner[dest[0]][0] = value[0u];
|
||||
s.inner[dest[0]][1] = value[1u];
|
||||
s.inner[dest[0]][2] = value[2u];
|
||||
}
|
||||
|
||||
void assign_and_preserve_padding_s(mat3 value[4]) {
|
||||
{
|
||||
for(uint i = 0u; (i < 4u); i = (i + 1u)) {
|
||||
uint tint_symbol[1] = uint[1](i);
|
||||
assign_and_preserve_padding_1_s_X(tint_symbol, value[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void f() {
|
||||
s.inner = u.inner;
|
||||
s.inner[1] = u.inner[2];
|
||||
assign_and_preserve_padding_s(u.inner);
|
||||
uint tint_symbol_1[1] = uint[1](1u);
|
||||
assign_and_preserve_padding_1_s_X(tint_symbol_1, u.inner[2]);
|
||||
s.inner[1][0] = u.inner[0][1].zxy;
|
||||
s.inner[1][0].x = u.inner[0][1].x;
|
||||
}
|
||||
|
||||
@@ -14,9 +14,21 @@ struct tint_array {
|
||||
T elements[N];
|
||||
};
|
||||
|
||||
void assign_and_preserve_padding_1(device float3x3* const dest, float3x3 value) {
|
||||
(*(dest))[0u] = value[0u];
|
||||
(*(dest))[1u] = value[1u];
|
||||
(*(dest))[2u] = value[2u];
|
||||
}
|
||||
|
||||
void assign_and_preserve_padding(device tint_array<float3x3, 4>* const dest, tint_array<float3x3, 4> value) {
|
||||
for(uint i = 0u; (i < 4u); i = (i + 1u)) {
|
||||
assign_and_preserve_padding_1(&((*(dest))[i]), value[i]);
|
||||
}
|
||||
}
|
||||
|
||||
kernel void f(device tint_array<float3x3, 4>* tint_symbol [[buffer(1)]], const constant tint_array<float3x3, 4>* tint_symbol_1 [[buffer(0)]]) {
|
||||
*(tint_symbol) = *(tint_symbol_1);
|
||||
(*(tint_symbol))[1] = (*(tint_symbol_1))[2];
|
||||
assign_and_preserve_padding(tint_symbol, *(tint_symbol_1));
|
||||
assign_and_preserve_padding_1(&((*(tint_symbol))[1]), (*(tint_symbol_1))[2]);
|
||||
(*(tint_symbol))[1][0] = float3((*(tint_symbol_1))[0][1]).zxy;
|
||||
(*(tint_symbol))[1][0][0] = (*(tint_symbol_1))[0][1][0];
|
||||
return;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 42
|
||||
; Bound: 87
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
@@ -11,6 +11,13 @@
|
||||
OpMemberName %u_block 0 "inner"
|
||||
OpName %u "u"
|
||||
OpName %s "s"
|
||||
OpName %assign_and_preserve_padding_1_s_X "assign_and_preserve_padding_1_s_X"
|
||||
OpName %dest "dest"
|
||||
OpName %value "value"
|
||||
OpName %assign_and_preserve_padding_s "assign_and_preserve_padding_s"
|
||||
OpName %value_0 "value"
|
||||
OpName %i "i"
|
||||
OpName %var_for_index "var_for_index"
|
||||
OpName %f "f"
|
||||
OpDecorate %u_block Block
|
||||
OpMemberDecorate %u_block 0 Offset 0
|
||||
@@ -22,6 +29,7 @@
|
||||
OpDecorate %u Binding 0
|
||||
OpDecorate %s DescriptorSet 0
|
||||
OpDecorate %s Binding 1
|
||||
OpDecorate %_arr_uint_uint_1 ArrayStride 4
|
||||
%float = OpTypeFloat 32
|
||||
%v3float = OpTypeVector %float 3
|
||||
%mat3v3float = OpTypeMatrix %v3float 3
|
||||
@@ -34,38 +42,99 @@
|
||||
%_ptr_StorageBuffer_u_block = OpTypePointer StorageBuffer %u_block
|
||||
%s = OpVariable %_ptr_StorageBuffer_u_block StorageBuffer
|
||||
%void = OpTypeVoid
|
||||
%12 = OpTypeFunction %void
|
||||
%uint_1 = OpConstant %uint 1
|
||||
%_arr_uint_uint_1 = OpTypeArray %uint %uint_1
|
||||
%12 = OpTypeFunction %void %_arr_uint_uint_1 %mat3v3float
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%_ptr_StorageBuffer__arr_mat3v3float_uint_4 = OpTypePointer StorageBuffer %_arr_mat3v3float_uint_4
|
||||
%_ptr_Uniform__arr_mat3v3float_uint_4 = OpTypePointer Uniform %_arr_mat3v3float_uint_4
|
||||
%int = OpTypeInt 32 1
|
||||
%int_1 = OpConstant %int 1
|
||||
%_ptr_StorageBuffer_mat3v3float = OpTypePointer StorageBuffer %mat3v3float
|
||||
%int_2 = OpConstant %int 2
|
||||
%_ptr_Uniform_mat3v3float = OpTypePointer Uniform %mat3v3float
|
||||
%30 = OpConstantNull %int
|
||||
%22 = OpConstantNull %int
|
||||
%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
|
||||
%26 = OpConstantNull %uint
|
||||
%int_1 = OpConstant %int 1
|
||||
%int_2 = OpConstant %int 2
|
||||
%uint_2 = OpConstant %uint 2
|
||||
%37 = OpTypeFunction %void %_arr_mat3v3float_uint_4
|
||||
%_ptr_Function_uint = OpTypePointer Function %uint
|
||||
%bool = OpTypeBool
|
||||
%_ptr_Function__arr_mat3v3float_uint_4 = OpTypePointer Function %_arr_mat3v3float_uint_4
|
||||
%55 = OpConstantNull %_arr_mat3v3float_uint_4
|
||||
%_ptr_Function_mat3v3float = OpTypePointer Function %mat3v3float
|
||||
%65 = OpTypeFunction %void
|
||||
%_ptr_Uniform__arr_mat3v3float_uint_4 = OpTypePointer Uniform %_arr_mat3v3float_uint_4
|
||||
%73 = OpConstantComposite %_arr_uint_uint_1 %uint_1
|
||||
%_ptr_Uniform_mat3v3float = OpTypePointer Uniform %mat3v3float
|
||||
%_ptr_Uniform_v3float = OpTypePointer Uniform %v3float
|
||||
%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
|
||||
%_ptr_Uniform_float = OpTypePointer Uniform %float
|
||||
%f = OpFunction %void None %12
|
||||
%15 = OpLabel
|
||||
%18 = OpAccessChain %_ptr_StorageBuffer__arr_mat3v3float_uint_4 %s %uint_0
|
||||
%20 = OpAccessChain %_ptr_Uniform__arr_mat3v3float_uint_4 %u %uint_0
|
||||
%21 = OpLoad %_arr_mat3v3float_uint_4 %20
|
||||
OpStore %18 %21
|
||||
%25 = OpAccessChain %_ptr_StorageBuffer_mat3v3float %s %uint_0 %int_1
|
||||
%28 = OpAccessChain %_ptr_Uniform_mat3v3float %u %uint_0 %int_2
|
||||
%29 = OpLoad %mat3v3float %28
|
||||
OpStore %25 %29
|
||||
%32 = OpAccessChain %_ptr_StorageBuffer_v3float %s %uint_0 %int_1 %30
|
||||
%34 = OpAccessChain %_ptr_Uniform_v3float %u %uint_0 %30 %int_1
|
||||
%35 = OpLoad %v3float %34
|
||||
%36 = OpVectorShuffle %v3float %35 %35 2 0 1
|
||||
OpStore %32 %36
|
||||
%38 = OpAccessChain %_ptr_StorageBuffer_float %s %uint_0 %int_1 %30 %uint_0
|
||||
%40 = OpAccessChain %_ptr_Uniform_float %u %uint_0 %30 %int_1 %uint_0
|
||||
%41 = OpLoad %float %40
|
||||
OpStore %38 %41
|
||||
%assign_and_preserve_padding_1_s_X = OpFunction %void None %12
|
||||
%dest = OpFunctionParameter %_arr_uint_uint_1
|
||||
%value = OpFunctionParameter %mat3v3float
|
||||
%19 = OpLabel
|
||||
%23 = OpCompositeExtract %uint %dest 0
|
||||
%25 = OpAccessChain %_ptr_StorageBuffer_v3float %s %uint_0 %23 %22
|
||||
%27 = OpCompositeExtract %v3float %value 0
|
||||
OpStore %25 %27
|
||||
%28 = OpCompositeExtract %uint %dest 0
|
||||
%30 = OpAccessChain %_ptr_StorageBuffer_v3float %s %uint_0 %28 %int_1
|
||||
%31 = OpCompositeExtract %v3float %value 1
|
||||
OpStore %30 %31
|
||||
%32 = OpCompositeExtract %uint %dest 0
|
||||
%34 = OpAccessChain %_ptr_StorageBuffer_v3float %s %uint_0 %32 %int_2
|
||||
%36 = OpCompositeExtract %v3float %value 2
|
||||
OpStore %34 %36
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%assign_and_preserve_padding_s = OpFunction %void None %37
|
||||
%value_0 = OpFunctionParameter %_arr_mat3v3float_uint_4
|
||||
%40 = OpLabel
|
||||
%i = OpVariable %_ptr_Function_uint Function %26
|
||||
%var_for_index = OpVariable %_ptr_Function__arr_mat3v3float_uint_4 Function %55
|
||||
OpStore %i %26
|
||||
OpBranch %43
|
||||
%43 = OpLabel
|
||||
OpLoopMerge %44 %45 None
|
||||
OpBranch %46
|
||||
%46 = OpLabel
|
||||
%48 = OpLoad %uint %i
|
||||
%49 = OpULessThan %bool %48 %uint_4
|
||||
%47 = OpLogicalNot %bool %49
|
||||
OpSelectionMerge %51 None
|
||||
OpBranchConditional %47 %52 %51
|
||||
%52 = OpLabel
|
||||
OpBranch %44
|
||||
%51 = OpLabel
|
||||
OpStore %var_for_index %value_0
|
||||
%57 = OpLoad %uint %i
|
||||
%58 = OpCompositeConstruct %_arr_uint_uint_1 %57
|
||||
%59 = OpLoad %uint %i
|
||||
%61 = OpAccessChain %_ptr_Function_mat3v3float %var_for_index %59
|
||||
%62 = OpLoad %mat3v3float %61
|
||||
%56 = OpFunctionCall %void %assign_and_preserve_padding_1_s_X %58 %62
|
||||
OpBranch %45
|
||||
%45 = OpLabel
|
||||
%63 = OpLoad %uint %i
|
||||
%64 = OpIAdd %uint %63 %uint_1
|
||||
OpStore %i %64
|
||||
OpBranch %43
|
||||
%44 = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%f = OpFunction %void None %65
|
||||
%67 = OpLabel
|
||||
%70 = OpAccessChain %_ptr_Uniform__arr_mat3v3float_uint_4 %u %uint_0
|
||||
%71 = OpLoad %_arr_mat3v3float_uint_4 %70
|
||||
%68 = OpFunctionCall %void %assign_and_preserve_padding_s %71
|
||||
%75 = OpAccessChain %_ptr_Uniform_mat3v3float %u %uint_0 %int_2
|
||||
%76 = OpLoad %mat3v3float %75
|
||||
%72 = OpFunctionCall %void %assign_and_preserve_padding_1_s_X %73 %76
|
||||
%77 = OpAccessChain %_ptr_StorageBuffer_v3float %s %uint_0 %int_1 %22
|
||||
%79 = OpAccessChain %_ptr_Uniform_v3float %u %uint_0 %22 %int_1
|
||||
%80 = OpLoad %v3float %79
|
||||
%81 = OpVectorShuffle %v3float %80 %80 2 0 1
|
||||
OpStore %77 %81
|
||||
%83 = OpAccessChain %_ptr_StorageBuffer_float %s %uint_0 %int_1 %22 %uint_0
|
||||
%85 = OpAccessChain %_ptr_Uniform_float %u %uint_0 %22 %int_1 %uint_0
|
||||
%86 = OpLoad %float %85
|
||||
OpStore %83 %86
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
||||
@@ -16,6 +16,22 @@ layout(binding = 1, std430) buffer u_block_ssbo {
|
||||
f16mat4x3 inner[4];
|
||||
} s;
|
||||
|
||||
void assign_and_preserve_padding_1_s_X(uint dest[1], f16mat4x3 value) {
|
||||
s.inner[dest[0]][0] = value[0u];
|
||||
s.inner[dest[0]][1] = value[1u];
|
||||
s.inner[dest[0]][2] = value[2u];
|
||||
s.inner[dest[0]][3] = value[3u];
|
||||
}
|
||||
|
||||
void assign_and_preserve_padding_s(f16mat4x3 value[4]) {
|
||||
{
|
||||
for(uint i = 0u; (i < 4u); i = (i + 1u)) {
|
||||
uint tint_symbol[1] = uint[1](i);
|
||||
assign_and_preserve_padding_1_s_X(tint_symbol, value[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
f16mat4x3 conv_mat4x3_f16(mat4x3_f16 val) {
|
||||
return f16mat4x3(val.col0, val.col1, val.col2, val.col3);
|
||||
}
|
||||
@@ -31,8 +47,9 @@ f16mat4x3[4] conv_arr4_mat4x3_f16(mat4x3_f16 val[4]) {
|
||||
}
|
||||
|
||||
void f() {
|
||||
s.inner = conv_arr4_mat4x3_f16(u.inner);
|
||||
s.inner[1] = conv_mat4x3_f16(u.inner[2u]);
|
||||
assign_and_preserve_padding_s(conv_arr4_mat4x3_f16(u.inner));
|
||||
uint tint_symbol_1[1] = uint[1](1u);
|
||||
assign_and_preserve_padding_1_s_X(tint_symbol_1, conv_mat4x3_f16(u.inner[2u]));
|
||||
s.inner[1][0] = u.inner[0u].col1.zxy;
|
||||
s.inner[1][0].x = u.inner[0u].col1[0u];
|
||||
}
|
||||
|
||||
@@ -14,9 +14,22 @@ struct tint_array {
|
||||
T elements[N];
|
||||
};
|
||||
|
||||
void assign_and_preserve_padding_1(device half4x3* const dest, half4x3 value) {
|
||||
(*(dest))[0u] = value[0u];
|
||||
(*(dest))[1u] = value[1u];
|
||||
(*(dest))[2u] = value[2u];
|
||||
(*(dest))[3u] = value[3u];
|
||||
}
|
||||
|
||||
void assign_and_preserve_padding(device tint_array<half4x3, 4>* const dest, tint_array<half4x3, 4> value) {
|
||||
for(uint i = 0u; (i < 4u); i = (i + 1u)) {
|
||||
assign_and_preserve_padding_1(&((*(dest))[i]), value[i]);
|
||||
}
|
||||
}
|
||||
|
||||
kernel void f(device tint_array<half4x3, 4>* tint_symbol [[buffer(1)]], const constant tint_array<half4x3, 4>* tint_symbol_1 [[buffer(0)]]) {
|
||||
*(tint_symbol) = *(tint_symbol_1);
|
||||
(*(tint_symbol))[1] = (*(tint_symbol_1))[2];
|
||||
assign_and_preserve_padding(tint_symbol, *(tint_symbol_1));
|
||||
assign_and_preserve_padding_1(&((*(tint_symbol))[1]), (*(tint_symbol_1))[2]);
|
||||
(*(tint_symbol))[1][0] = half3((*(tint_symbol_1))[0][1]).zxy;
|
||||
(*(tint_symbol))[1][0][0] = (*(tint_symbol_1))[0][1][0];
|
||||
return;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 91
|
||||
; Bound: 134
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpCapability Float16
|
||||
@@ -22,13 +22,20 @@
|
||||
OpName %u_block "u_block"
|
||||
OpMemberName %u_block 0 "inner"
|
||||
OpName %s "s"
|
||||
OpName %assign_and_preserve_padding_1_s_X "assign_and_preserve_padding_1_s_X"
|
||||
OpName %dest "dest"
|
||||
OpName %value "value"
|
||||
OpName %assign_and_preserve_padding_s "assign_and_preserve_padding_s"
|
||||
OpName %value_0 "value"
|
||||
OpName %i "i"
|
||||
OpName %var_for_index "var_for_index"
|
||||
OpName %conv_mat4x3_f16 "conv_mat4x3_f16"
|
||||
OpName %val "val"
|
||||
OpName %conv_arr4_mat4x3_f16 "conv_arr4_mat4x3_f16"
|
||||
OpName %val_0 "val"
|
||||
OpName %arr "arr"
|
||||
OpName %i "i"
|
||||
OpName %var_for_index "var_for_index"
|
||||
OpName %i_0 "i"
|
||||
OpName %var_for_index_1 "var_for_index_1"
|
||||
OpName %f "f"
|
||||
OpDecorate %u_block_std140 Block
|
||||
OpMemberDecorate %u_block_std140 0 Offset 0
|
||||
@@ -47,6 +54,7 @@
|
||||
OpDecorate %_arr_mat4v3half_uint_4 ArrayStride 32
|
||||
OpDecorate %s DescriptorSet 0
|
||||
OpDecorate %s Binding 1
|
||||
OpDecorate %_arr_uint_uint_1 ArrayStride 4
|
||||
%half = OpTypeFloat 16
|
||||
%v3half = OpTypeVector %half 3
|
||||
%mat4x3_f16 = OpTypeStruct %v3half %v3half %v3half %v3half
|
||||
@@ -61,100 +69,160 @@
|
||||
%u_block = OpTypeStruct %_arr_mat4v3half_uint_4
|
||||
%_ptr_StorageBuffer_u_block = OpTypePointer StorageBuffer %u_block
|
||||
%s = OpVariable %_ptr_StorageBuffer_u_block StorageBuffer
|
||||
%15 = OpTypeFunction %mat4v3half %mat4x3_f16
|
||||
%24 = OpTypeFunction %_arr_mat4v3half_uint_4 %_arr_mat4x3_f16_uint_4
|
||||
%_ptr_Function__arr_mat4v3half_uint_4 = OpTypePointer Function %_arr_mat4v3half_uint_4
|
||||
%30 = OpConstantNull %_arr_mat4v3half_uint_4
|
||||
%_ptr_Function_uint = OpTypePointer Function %uint
|
||||
%33 = OpConstantNull %uint
|
||||
%bool = OpTypeBool
|
||||
%_ptr_Function__arr_mat4x3_f16_uint_4 = OpTypePointer Function %_arr_mat4x3_f16_uint_4
|
||||
%46 = OpConstantNull %_arr_mat4x3_f16_uint_4
|
||||
%_ptr_Function_mat4v3half = OpTypePointer Function %mat4v3half
|
||||
%_ptr_Function_mat4x3_f16 = OpTypePointer Function %mat4x3_f16
|
||||
%uint_1 = OpConstant %uint 1
|
||||
%void = OpTypeVoid
|
||||
%59 = OpTypeFunction %void
|
||||
%uint_1 = OpConstant %uint 1
|
||||
%_arr_uint_uint_1 = OpTypeArray %uint %uint_1
|
||||
%15 = OpTypeFunction %void %_arr_uint_uint_1 %mat4v3half
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%_ptr_StorageBuffer__arr_mat4v3half_uint_4 = OpTypePointer StorageBuffer %_arr_mat4v3half_uint_4
|
||||
%_ptr_Uniform__arr_mat4x3_f16_uint_4 = OpTypePointer Uniform %_arr_mat4x3_f16_uint_4
|
||||
%int = OpTypeInt 32 1
|
||||
%int_1 = OpConstant %int 1
|
||||
%_ptr_StorageBuffer_mat4v3half = OpTypePointer StorageBuffer %mat4v3half
|
||||
%uint_2 = OpConstant %uint 2
|
||||
%_ptr_Uniform_mat4x3_f16 = OpTypePointer Uniform %mat4x3_f16
|
||||
%79 = OpConstantNull %int
|
||||
%25 = OpConstantNull %int
|
||||
%_ptr_StorageBuffer_v3half = OpTypePointer StorageBuffer %v3half
|
||||
%29 = OpConstantNull %uint
|
||||
%int_1 = OpConstant %int 1
|
||||
%int_2 = OpConstant %int 2
|
||||
%uint_2 = OpConstant %uint 2
|
||||
%int_3 = OpConstant %int 3
|
||||
%uint_3 = OpConstant %uint 3
|
||||
%45 = OpTypeFunction %void %_arr_mat4v3half_uint_4
|
||||
%_ptr_Function_uint = OpTypePointer Function %uint
|
||||
%bool = OpTypeBool
|
||||
%_ptr_Function__arr_mat4v3half_uint_4 = OpTypePointer Function %_arr_mat4v3half_uint_4
|
||||
%63 = OpConstantNull %_arr_mat4v3half_uint_4
|
||||
%_ptr_Function_mat4v3half = OpTypePointer Function %mat4v3half
|
||||
%73 = OpTypeFunction %mat4v3half %mat4x3_f16
|
||||
%82 = OpTypeFunction %_arr_mat4v3half_uint_4 %_arr_mat4x3_f16_uint_4
|
||||
%_ptr_Function__arr_mat4x3_f16_uint_4 = OpTypePointer Function %_arr_mat4x3_f16_uint_4
|
||||
%99 = OpConstantNull %_arr_mat4x3_f16_uint_4
|
||||
%_ptr_Function_mat4x3_f16 = OpTypePointer Function %mat4x3_f16
|
||||
%110 = OpTypeFunction %void
|
||||
%_ptr_Uniform__arr_mat4x3_f16_uint_4 = OpTypePointer Uniform %_arr_mat4x3_f16_uint_4
|
||||
%119 = OpConstantComposite %_arr_uint_uint_1 %uint_1
|
||||
%_ptr_Uniform_mat4x3_f16 = OpTypePointer Uniform %mat4x3_f16
|
||||
%_ptr_Uniform_v3half = OpTypePointer Uniform %v3half
|
||||
%_ptr_StorageBuffer_half = OpTypePointer StorageBuffer %half
|
||||
%_ptr_Uniform_half = OpTypePointer Uniform %half
|
||||
%conv_mat4x3_f16 = OpFunction %mat4v3half None %15
|
||||
%val = OpFunctionParameter %mat4x3_f16
|
||||
%18 = OpLabel
|
||||
%19 = OpCompositeExtract %v3half %val 0
|
||||
%20 = OpCompositeExtract %v3half %val 1
|
||||
%21 = OpCompositeExtract %v3half %val 2
|
||||
%22 = OpCompositeExtract %v3half %val 3
|
||||
%23 = OpCompositeConstruct %mat4v3half %19 %20 %21 %22
|
||||
OpReturnValue %23
|
||||
OpFunctionEnd
|
||||
%conv_arr4_mat4x3_f16 = OpFunction %_arr_mat4v3half_uint_4 None %24
|
||||
%val_0 = OpFunctionParameter %_arr_mat4x3_f16_uint_4
|
||||
%27 = OpLabel
|
||||
%arr = OpVariable %_ptr_Function__arr_mat4v3half_uint_4 Function %30
|
||||
%i = OpVariable %_ptr_Function_uint Function %33
|
||||
%var_for_index = OpVariable %_ptr_Function__arr_mat4x3_f16_uint_4 Function %46
|
||||
OpBranch %34
|
||||
%34 = OpLabel
|
||||
OpLoopMerge %35 %36 None
|
||||
OpBranch %37
|
||||
%37 = OpLabel
|
||||
%39 = OpLoad %uint %i
|
||||
%40 = OpULessThan %bool %39 %uint_4
|
||||
%38 = OpLogicalNot %bool %40
|
||||
OpSelectionMerge %42 None
|
||||
OpBranchConditional %38 %43 %42
|
||||
%43 = OpLabel
|
||||
OpBranch %35
|
||||
%42 = OpLabel
|
||||
OpStore %var_for_index %val_0
|
||||
%47 = OpLoad %uint %i
|
||||
%49 = OpAccessChain %_ptr_Function_mat4v3half %arr %47
|
||||
%51 = OpLoad %uint %i
|
||||
%53 = OpAccessChain %_ptr_Function_mat4x3_f16 %var_for_index %51
|
||||
%54 = OpLoad %mat4x3_f16 %53
|
||||
%50 = OpFunctionCall %mat4v3half %conv_mat4x3_f16 %54
|
||||
OpStore %49 %50
|
||||
OpBranch %36
|
||||
%36 = OpLabel
|
||||
%55 = OpLoad %uint %i
|
||||
%57 = OpIAdd %uint %55 %uint_1
|
||||
OpStore %i %57
|
||||
OpBranch %34
|
||||
%35 = OpLabel
|
||||
%58 = OpLoad %_arr_mat4v3half_uint_4 %arr
|
||||
OpReturnValue %58
|
||||
OpFunctionEnd
|
||||
%f = OpFunction %void None %59
|
||||
%62 = OpLabel
|
||||
%65 = OpAccessChain %_ptr_StorageBuffer__arr_mat4v3half_uint_4 %s %uint_0
|
||||
%68 = OpAccessChain %_ptr_Uniform__arr_mat4x3_f16_uint_4 %u %uint_0
|
||||
%69 = OpLoad %_arr_mat4x3_f16_uint_4 %68
|
||||
%66 = OpFunctionCall %_arr_mat4v3half_uint_4 %conv_arr4_mat4x3_f16 %69
|
||||
OpStore %65 %66
|
||||
%73 = OpAccessChain %_ptr_StorageBuffer_mat4v3half %s %uint_0 %int_1
|
||||
%77 = OpAccessChain %_ptr_Uniform_mat4x3_f16 %u %uint_0 %uint_2
|
||||
%78 = OpLoad %mat4x3_f16 %77
|
||||
%74 = OpFunctionCall %mat4v3half %conv_mat4x3_f16 %78
|
||||
OpStore %73 %74
|
||||
%81 = OpAccessChain %_ptr_StorageBuffer_v3half %s %uint_0 %int_1 %79
|
||||
%83 = OpAccessChain %_ptr_Uniform_v3half %u %uint_0 %33 %uint_1
|
||||
%84 = OpLoad %v3half %83
|
||||
%85 = OpVectorShuffle %v3half %84 %84 2 0 1
|
||||
OpStore %81 %85
|
||||
%87 = OpAccessChain %_ptr_StorageBuffer_half %s %uint_0 %int_1 %79 %uint_0
|
||||
%89 = OpAccessChain %_ptr_Uniform_half %u %uint_0 %33 %uint_1 %33
|
||||
%90 = OpLoad %half %89
|
||||
OpStore %87 %90
|
||||
%assign_and_preserve_padding_1_s_X = OpFunction %void None %15
|
||||
%dest = OpFunctionParameter %_arr_uint_uint_1
|
||||
%value = OpFunctionParameter %mat4v3half
|
||||
%22 = OpLabel
|
||||
%26 = OpCompositeExtract %uint %dest 0
|
||||
%28 = OpAccessChain %_ptr_StorageBuffer_v3half %s %uint_0 %26 %25
|
||||
%30 = OpCompositeExtract %v3half %value 0
|
||||
OpStore %28 %30
|
||||
%31 = OpCompositeExtract %uint %dest 0
|
||||
%33 = OpAccessChain %_ptr_StorageBuffer_v3half %s %uint_0 %31 %int_1
|
||||
%34 = OpCompositeExtract %v3half %value 1
|
||||
OpStore %33 %34
|
||||
%35 = OpCompositeExtract %uint %dest 0
|
||||
%37 = OpAccessChain %_ptr_StorageBuffer_v3half %s %uint_0 %35 %int_2
|
||||
%39 = OpCompositeExtract %v3half %value 2
|
||||
OpStore %37 %39
|
||||
%40 = OpCompositeExtract %uint %dest 0
|
||||
%42 = OpAccessChain %_ptr_StorageBuffer_v3half %s %uint_0 %40 %int_3
|
||||
%44 = OpCompositeExtract %v3half %value 3
|
||||
OpStore %42 %44
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%assign_and_preserve_padding_s = OpFunction %void None %45
|
||||
%value_0 = OpFunctionParameter %_arr_mat4v3half_uint_4
|
||||
%48 = OpLabel
|
||||
%i = OpVariable %_ptr_Function_uint Function %29
|
||||
%var_for_index = OpVariable %_ptr_Function__arr_mat4v3half_uint_4 Function %63
|
||||
OpStore %i %29
|
||||
OpBranch %51
|
||||
%51 = OpLabel
|
||||
OpLoopMerge %52 %53 None
|
||||
OpBranch %54
|
||||
%54 = OpLabel
|
||||
%56 = OpLoad %uint %i
|
||||
%57 = OpULessThan %bool %56 %uint_4
|
||||
%55 = OpLogicalNot %bool %57
|
||||
OpSelectionMerge %59 None
|
||||
OpBranchConditional %55 %60 %59
|
||||
%60 = OpLabel
|
||||
OpBranch %52
|
||||
%59 = OpLabel
|
||||
OpStore %var_for_index %value_0
|
||||
%65 = OpLoad %uint %i
|
||||
%66 = OpCompositeConstruct %_arr_uint_uint_1 %65
|
||||
%67 = OpLoad %uint %i
|
||||
%69 = OpAccessChain %_ptr_Function_mat4v3half %var_for_index %67
|
||||
%70 = OpLoad %mat4v3half %69
|
||||
%64 = OpFunctionCall %void %assign_and_preserve_padding_1_s_X %66 %70
|
||||
OpBranch %53
|
||||
%53 = OpLabel
|
||||
%71 = OpLoad %uint %i
|
||||
%72 = OpIAdd %uint %71 %uint_1
|
||||
OpStore %i %72
|
||||
OpBranch %51
|
||||
%52 = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%conv_mat4x3_f16 = OpFunction %mat4v3half None %73
|
||||
%val = OpFunctionParameter %mat4x3_f16
|
||||
%76 = OpLabel
|
||||
%77 = OpCompositeExtract %v3half %val 0
|
||||
%78 = OpCompositeExtract %v3half %val 1
|
||||
%79 = OpCompositeExtract %v3half %val 2
|
||||
%80 = OpCompositeExtract %v3half %val 3
|
||||
%81 = OpCompositeConstruct %mat4v3half %77 %78 %79 %80
|
||||
OpReturnValue %81
|
||||
OpFunctionEnd
|
||||
%conv_arr4_mat4x3_f16 = OpFunction %_arr_mat4v3half_uint_4 None %82
|
||||
%val_0 = OpFunctionParameter %_arr_mat4x3_f16_uint_4
|
||||
%85 = OpLabel
|
||||
%arr = OpVariable %_ptr_Function__arr_mat4v3half_uint_4 Function %63
|
||||
%i_0 = OpVariable %_ptr_Function_uint Function %29
|
||||
%var_for_index_1 = OpVariable %_ptr_Function__arr_mat4x3_f16_uint_4 Function %99
|
||||
OpBranch %88
|
||||
%88 = OpLabel
|
||||
OpLoopMerge %89 %90 None
|
||||
OpBranch %91
|
||||
%91 = OpLabel
|
||||
%93 = OpLoad %uint %i_0
|
||||
%94 = OpULessThan %bool %93 %uint_4
|
||||
%92 = OpLogicalNot %bool %94
|
||||
OpSelectionMerge %95 None
|
||||
OpBranchConditional %92 %96 %95
|
||||
%96 = OpLabel
|
||||
OpBranch %89
|
||||
%95 = OpLabel
|
||||
OpStore %var_for_index_1 %val_0
|
||||
%100 = OpLoad %uint %i_0
|
||||
%101 = OpAccessChain %_ptr_Function_mat4v3half %arr %100
|
||||
%103 = OpLoad %uint %i_0
|
||||
%105 = OpAccessChain %_ptr_Function_mat4x3_f16 %var_for_index_1 %103
|
||||
%106 = OpLoad %mat4x3_f16 %105
|
||||
%102 = OpFunctionCall %mat4v3half %conv_mat4x3_f16 %106
|
||||
OpStore %101 %102
|
||||
OpBranch %90
|
||||
%90 = OpLabel
|
||||
%107 = OpLoad %uint %i_0
|
||||
%108 = OpIAdd %uint %107 %uint_1
|
||||
OpStore %i_0 %108
|
||||
OpBranch %88
|
||||
%89 = OpLabel
|
||||
%109 = OpLoad %_arr_mat4v3half_uint_4 %arr
|
||||
OpReturnValue %109
|
||||
OpFunctionEnd
|
||||
%f = OpFunction %void None %110
|
||||
%112 = OpLabel
|
||||
%116 = OpAccessChain %_ptr_Uniform__arr_mat4x3_f16_uint_4 %u %uint_0
|
||||
%117 = OpLoad %_arr_mat4x3_f16_uint_4 %116
|
||||
%114 = OpFunctionCall %_arr_mat4v3half_uint_4 %conv_arr4_mat4x3_f16 %117
|
||||
%113 = OpFunctionCall %void %assign_and_preserve_padding_s %114
|
||||
%122 = OpAccessChain %_ptr_Uniform_mat4x3_f16 %u %uint_0 %uint_2
|
||||
%123 = OpLoad %mat4x3_f16 %122
|
||||
%120 = OpFunctionCall %mat4v3half %conv_mat4x3_f16 %123
|
||||
%118 = OpFunctionCall %void %assign_and_preserve_padding_1_s_X %119 %120
|
||||
%124 = OpAccessChain %_ptr_StorageBuffer_v3half %s %uint_0 %int_1 %25
|
||||
%126 = OpAccessChain %_ptr_Uniform_v3half %u %uint_0 %29 %uint_1
|
||||
%127 = OpLoad %v3half %126
|
||||
%128 = OpVectorShuffle %v3half %127 %127 2 0 1
|
||||
OpStore %124 %128
|
||||
%130 = OpAccessChain %_ptr_StorageBuffer_half %s %uint_0 %int_1 %25 %uint_0
|
||||
%132 = OpAccessChain %_ptr_Uniform_half %u %uint_0 %29 %uint_1 %29
|
||||
%133 = OpLoad %half %132
|
||||
OpStore %130 %133
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
||||
@@ -8,9 +8,26 @@ layout(binding = 1, std430) buffer u_block_ssbo {
|
||||
mat4x3 inner[4];
|
||||
} s;
|
||||
|
||||
void assign_and_preserve_padding_1_s_X(uint dest[1], mat4x3 value) {
|
||||
s.inner[dest[0]][0] = value[0u];
|
||||
s.inner[dest[0]][1] = value[1u];
|
||||
s.inner[dest[0]][2] = value[2u];
|
||||
s.inner[dest[0]][3] = value[3u];
|
||||
}
|
||||
|
||||
void assign_and_preserve_padding_s(mat4x3 value[4]) {
|
||||
{
|
||||
for(uint i = 0u; (i < 4u); i = (i + 1u)) {
|
||||
uint tint_symbol[1] = uint[1](i);
|
||||
assign_and_preserve_padding_1_s_X(tint_symbol, value[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void f() {
|
||||
s.inner = u.inner;
|
||||
s.inner[1] = u.inner[2];
|
||||
assign_and_preserve_padding_s(u.inner);
|
||||
uint tint_symbol_1[1] = uint[1](1u);
|
||||
assign_and_preserve_padding_1_s_X(tint_symbol_1, u.inner[2]);
|
||||
s.inner[1][0] = u.inner[0][1].zxy;
|
||||
s.inner[1][0].x = u.inner[0][1].x;
|
||||
}
|
||||
|
||||
@@ -14,9 +14,22 @@ struct tint_array {
|
||||
T elements[N];
|
||||
};
|
||||
|
||||
void assign_and_preserve_padding_1(device float4x3* const dest, float4x3 value) {
|
||||
(*(dest))[0u] = value[0u];
|
||||
(*(dest))[1u] = value[1u];
|
||||
(*(dest))[2u] = value[2u];
|
||||
(*(dest))[3u] = value[3u];
|
||||
}
|
||||
|
||||
void assign_and_preserve_padding(device tint_array<float4x3, 4>* const dest, tint_array<float4x3, 4> value) {
|
||||
for(uint i = 0u; (i < 4u); i = (i + 1u)) {
|
||||
assign_and_preserve_padding_1(&((*(dest))[i]), value[i]);
|
||||
}
|
||||
}
|
||||
|
||||
kernel void f(device tint_array<float4x3, 4>* tint_symbol [[buffer(1)]], const constant tint_array<float4x3, 4>* tint_symbol_1 [[buffer(0)]]) {
|
||||
*(tint_symbol) = *(tint_symbol_1);
|
||||
(*(tint_symbol))[1] = (*(tint_symbol_1))[2];
|
||||
assign_and_preserve_padding(tint_symbol, *(tint_symbol_1));
|
||||
assign_and_preserve_padding_1(&((*(tint_symbol))[1]), (*(tint_symbol_1))[2]);
|
||||
(*(tint_symbol))[1][0] = float3((*(tint_symbol_1))[0][1]).zxy;
|
||||
(*(tint_symbol))[1][0][0] = (*(tint_symbol_1))[0][1][0];
|
||||
return;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 42
|
||||
; Bound: 92
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
@@ -11,6 +11,13 @@
|
||||
OpMemberName %u_block 0 "inner"
|
||||
OpName %u "u"
|
||||
OpName %s "s"
|
||||
OpName %assign_and_preserve_padding_1_s_X "assign_and_preserve_padding_1_s_X"
|
||||
OpName %dest "dest"
|
||||
OpName %value "value"
|
||||
OpName %assign_and_preserve_padding_s "assign_and_preserve_padding_s"
|
||||
OpName %value_0 "value"
|
||||
OpName %i "i"
|
||||
OpName %var_for_index "var_for_index"
|
||||
OpName %f "f"
|
||||
OpDecorate %u_block Block
|
||||
OpMemberDecorate %u_block 0 Offset 0
|
||||
@@ -22,6 +29,7 @@
|
||||
OpDecorate %u Binding 0
|
||||
OpDecorate %s DescriptorSet 0
|
||||
OpDecorate %s Binding 1
|
||||
OpDecorate %_arr_uint_uint_1 ArrayStride 4
|
||||
%float = OpTypeFloat 32
|
||||
%v3float = OpTypeVector %float 3
|
||||
%mat4v3float = OpTypeMatrix %v3float 4
|
||||
@@ -34,38 +42,105 @@
|
||||
%_ptr_StorageBuffer_u_block = OpTypePointer StorageBuffer %u_block
|
||||
%s = OpVariable %_ptr_StorageBuffer_u_block StorageBuffer
|
||||
%void = OpTypeVoid
|
||||
%12 = OpTypeFunction %void
|
||||
%uint_1 = OpConstant %uint 1
|
||||
%_arr_uint_uint_1 = OpTypeArray %uint %uint_1
|
||||
%12 = OpTypeFunction %void %_arr_uint_uint_1 %mat4v3float
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%_ptr_StorageBuffer__arr_mat4v3float_uint_4 = OpTypePointer StorageBuffer %_arr_mat4v3float_uint_4
|
||||
%_ptr_Uniform__arr_mat4v3float_uint_4 = OpTypePointer Uniform %_arr_mat4v3float_uint_4
|
||||
%int = OpTypeInt 32 1
|
||||
%int_1 = OpConstant %int 1
|
||||
%_ptr_StorageBuffer_mat4v3float = OpTypePointer StorageBuffer %mat4v3float
|
||||
%int_2 = OpConstant %int 2
|
||||
%_ptr_Uniform_mat4v3float = OpTypePointer Uniform %mat4v3float
|
||||
%30 = OpConstantNull %int
|
||||
%22 = OpConstantNull %int
|
||||
%_ptr_StorageBuffer_v3float = OpTypePointer StorageBuffer %v3float
|
||||
%26 = OpConstantNull %uint
|
||||
%int_1 = OpConstant %int 1
|
||||
%int_2 = OpConstant %int 2
|
||||
%uint_2 = OpConstant %uint 2
|
||||
%int_3 = OpConstant %int 3
|
||||
%uint_3 = OpConstant %uint 3
|
||||
%42 = OpTypeFunction %void %_arr_mat4v3float_uint_4
|
||||
%_ptr_Function_uint = OpTypePointer Function %uint
|
||||
%bool = OpTypeBool
|
||||
%_ptr_Function__arr_mat4v3float_uint_4 = OpTypePointer Function %_arr_mat4v3float_uint_4
|
||||
%60 = OpConstantNull %_arr_mat4v3float_uint_4
|
||||
%_ptr_Function_mat4v3float = OpTypePointer Function %mat4v3float
|
||||
%70 = OpTypeFunction %void
|
||||
%_ptr_Uniform__arr_mat4v3float_uint_4 = OpTypePointer Uniform %_arr_mat4v3float_uint_4
|
||||
%78 = OpConstantComposite %_arr_uint_uint_1 %uint_1
|
||||
%_ptr_Uniform_mat4v3float = OpTypePointer Uniform %mat4v3float
|
||||
%_ptr_Uniform_v3float = OpTypePointer Uniform %v3float
|
||||
%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
|
||||
%_ptr_Uniform_float = OpTypePointer Uniform %float
|
||||
%f = OpFunction %void None %12
|
||||
%15 = OpLabel
|
||||
%18 = OpAccessChain %_ptr_StorageBuffer__arr_mat4v3float_uint_4 %s %uint_0
|
||||
%20 = OpAccessChain %_ptr_Uniform__arr_mat4v3float_uint_4 %u %uint_0
|
||||
%21 = OpLoad %_arr_mat4v3float_uint_4 %20
|
||||
OpStore %18 %21
|
||||
%25 = OpAccessChain %_ptr_StorageBuffer_mat4v3float %s %uint_0 %int_1
|
||||
%28 = OpAccessChain %_ptr_Uniform_mat4v3float %u %uint_0 %int_2
|
||||
%29 = OpLoad %mat4v3float %28
|
||||
OpStore %25 %29
|
||||
%32 = OpAccessChain %_ptr_StorageBuffer_v3float %s %uint_0 %int_1 %30
|
||||
%34 = OpAccessChain %_ptr_Uniform_v3float %u %uint_0 %30 %int_1
|
||||
%35 = OpLoad %v3float %34
|
||||
%36 = OpVectorShuffle %v3float %35 %35 2 0 1
|
||||
OpStore %32 %36
|
||||
%38 = OpAccessChain %_ptr_StorageBuffer_float %s %uint_0 %int_1 %30 %uint_0
|
||||
%40 = OpAccessChain %_ptr_Uniform_float %u %uint_0 %30 %int_1 %uint_0
|
||||
%41 = OpLoad %float %40
|
||||
OpStore %38 %41
|
||||
%assign_and_preserve_padding_1_s_X = OpFunction %void None %12
|
||||
%dest = OpFunctionParameter %_arr_uint_uint_1
|
||||
%value = OpFunctionParameter %mat4v3float
|
||||
%19 = OpLabel
|
||||
%23 = OpCompositeExtract %uint %dest 0
|
||||
%25 = OpAccessChain %_ptr_StorageBuffer_v3float %s %uint_0 %23 %22
|
||||
%27 = OpCompositeExtract %v3float %value 0
|
||||
OpStore %25 %27
|
||||
%28 = OpCompositeExtract %uint %dest 0
|
||||
%30 = OpAccessChain %_ptr_StorageBuffer_v3float %s %uint_0 %28 %int_1
|
||||
%31 = OpCompositeExtract %v3float %value 1
|
||||
OpStore %30 %31
|
||||
%32 = OpCompositeExtract %uint %dest 0
|
||||
%34 = OpAccessChain %_ptr_StorageBuffer_v3float %s %uint_0 %32 %int_2
|
||||
%36 = OpCompositeExtract %v3float %value 2
|
||||
OpStore %34 %36
|
||||
%37 = OpCompositeExtract %uint %dest 0
|
||||
%39 = OpAccessChain %_ptr_StorageBuffer_v3float %s %uint_0 %37 %int_3
|
||||
%41 = OpCompositeExtract %v3float %value 3
|
||||
OpStore %39 %41
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%assign_and_preserve_padding_s = OpFunction %void None %42
|
||||
%value_0 = OpFunctionParameter %_arr_mat4v3float_uint_4
|
||||
%45 = OpLabel
|
||||
%i = OpVariable %_ptr_Function_uint Function %26
|
||||
%var_for_index = OpVariable %_ptr_Function__arr_mat4v3float_uint_4 Function %60
|
||||
OpStore %i %26
|
||||
OpBranch %48
|
||||
%48 = OpLabel
|
||||
OpLoopMerge %49 %50 None
|
||||
OpBranch %51
|
||||
%51 = OpLabel
|
||||
%53 = OpLoad %uint %i
|
||||
%54 = OpULessThan %bool %53 %uint_4
|
||||
%52 = OpLogicalNot %bool %54
|
||||
OpSelectionMerge %56 None
|
||||
OpBranchConditional %52 %57 %56
|
||||
%57 = OpLabel
|
||||
OpBranch %49
|
||||
%56 = OpLabel
|
||||
OpStore %var_for_index %value_0
|
||||
%62 = OpLoad %uint %i
|
||||
%63 = OpCompositeConstruct %_arr_uint_uint_1 %62
|
||||
%64 = OpLoad %uint %i
|
||||
%66 = OpAccessChain %_ptr_Function_mat4v3float %var_for_index %64
|
||||
%67 = OpLoad %mat4v3float %66
|
||||
%61 = OpFunctionCall %void %assign_and_preserve_padding_1_s_X %63 %67
|
||||
OpBranch %50
|
||||
%50 = OpLabel
|
||||
%68 = OpLoad %uint %i
|
||||
%69 = OpIAdd %uint %68 %uint_1
|
||||
OpStore %i %69
|
||||
OpBranch %48
|
||||
%49 = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%f = OpFunction %void None %70
|
||||
%72 = OpLabel
|
||||
%75 = OpAccessChain %_ptr_Uniform__arr_mat4v3float_uint_4 %u %uint_0
|
||||
%76 = OpLoad %_arr_mat4v3float_uint_4 %75
|
||||
%73 = OpFunctionCall %void %assign_and_preserve_padding_s %76
|
||||
%80 = OpAccessChain %_ptr_Uniform_mat4v3float %u %uint_0 %int_2
|
||||
%81 = OpLoad %mat4v3float %80
|
||||
%77 = OpFunctionCall %void %assign_and_preserve_padding_1_s_X %78 %81
|
||||
%82 = OpAccessChain %_ptr_StorageBuffer_v3float %s %uint_0 %int_1 %22
|
||||
%84 = OpAccessChain %_ptr_Uniform_v3float %u %uint_0 %22 %int_1
|
||||
%85 = OpLoad %v3float %84
|
||||
%86 = OpVectorShuffle %v3float %85 %85 2 0 1
|
||||
OpStore %82 %86
|
||||
%88 = OpAccessChain %_ptr_StorageBuffer_float %s %uint_0 %int_1 %22 %uint_0
|
||||
%90 = OpAccessChain %_ptr_Uniform_float %u %uint_0 %22 %int_1 %uint_0
|
||||
%91 = OpLoad %float %90
|
||||
OpStore %88 %91
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
||||
Reference in New Issue
Block a user