dan sinclair | 1b77b6c | 2024-08-06 15:47:05 +0000 | [diff] [blame] | 1 | ; SPIR-V |
| 2 | ; Version: 1.3 |
| 3 | ; Generator: Google Tint Compiler; 1 |
| 4 | ; Bound: 113 |
| 5 | ; Schema: 0 |
| 6 | OpCapability Shader |
| 7 | OpMemoryModel Logical GLSL450 |
| 8 | OpEntryPoint GLCompute %main "main" %main_local_invocation_index_Input |
| 9 | OpExecutionMode %main LocalSize 1 1 1 |
| 10 | OpName %src_private "src_private" |
| 11 | OpName %src_workgroup "src_workgroup" |
| 12 | OpMemberName %S 0 "arr" |
| 13 | OpName %S "S" |
James Price | 71c1d54 | 2024-10-10 23:01:19 +0000 | [diff] [blame] | 14 | OpMemberName %src_uniform_block 0 "inner" |
| 15 | OpName %src_uniform_block "src_uniform_block" |
| 16 | OpMemberName %src_storage_block 0 "inner" |
| 17 | OpName %src_storage_block "src_storage_block" |
dan sinclair | 1b77b6c | 2024-08-06 15:47:05 +0000 | [diff] [blame] | 18 | OpName %dst "dst" |
| 19 | OpName %dst_nested "dst_nested" |
| 20 | OpName %main_local_invocation_index_Input "main_local_invocation_index_Input" |
| 21 | OpName %ret_arr "ret_arr" |
| 22 | OpName %ret_struct_arr "ret_struct_arr" |
| 23 | OpName %foo "foo" |
| 24 | OpName %src_param "src_param" |
| 25 | OpName %src_function "src_function" |
| 26 | OpName %src_let "src_let" |
| 27 | OpName %src_nested "src_nested" |
| 28 | OpName %main_inner "main_inner" |
| 29 | OpName %tint_local_index "tint_local_index" |
| 30 | OpName %src_let "val" |
| 31 | OpName %main "main" |
| 32 | OpDecorate %_arr_v4int_uint_4 ArrayStride 16 |
| 33 | OpMemberDecorate %S 0 Offset 0 |
James Price | 71c1d54 | 2024-10-10 23:01:19 +0000 | [diff] [blame] | 34 | OpMemberDecorate %src_uniform_block 0 Offset 0 |
| 35 | OpDecorate %src_uniform_block Block |
dan sinclair | 1b77b6c | 2024-08-06 15:47:05 +0000 | [diff] [blame] | 36 | OpDecorate %11 DescriptorSet 0 |
| 37 | OpDecorate %11 Binding 0 |
| 38 | OpDecorate %11 NonWritable |
James Price | 71c1d54 | 2024-10-10 23:01:19 +0000 | [diff] [blame] | 39 | OpMemberDecorate %src_storage_block 0 Offset 0 |
| 40 | OpDecorate %src_storage_block Block |
dan sinclair | 1b77b6c | 2024-08-06 15:47:05 +0000 | [diff] [blame] | 41 | OpDecorate %15 DescriptorSet 0 |
| 42 | OpDecorate %15 Binding 1 |
dan sinclair | d117d65 | 2024-08-21 01:20:00 +0000 | [diff] [blame] | 43 | OpDecorate %15 Coherent |
dan sinclair | 1b77b6c | 2024-08-06 15:47:05 +0000 | [diff] [blame] | 44 | OpDecorate %_arr_int_uint_2 ArrayStride 4 |
| 45 | OpDecorate %_arr__arr_int_uint_2_uint_3 ArrayStride 8 |
| 46 | OpDecorate %_arr__arr__arr_int_uint_2_uint_3_uint_4 ArrayStride 24 |
| 47 | OpDecorate %main_local_invocation_index_Input BuiltIn LocalInvocationIndex |
| 48 | %int = OpTypeInt 32 1 |
| 49 | %v4int = OpTypeVector %int 4 |
| 50 | %uint = OpTypeInt 32 0 |
| 51 | %uint_4 = OpConstant %uint 4 |
| 52 | %_arr_v4int_uint_4 = OpTypeArray %v4int %uint_4 |
| 53 | %_ptr_Private__arr_v4int_uint_4 = OpTypePointer Private %_arr_v4int_uint_4 |
| 54 | %src_let = OpConstantNull %_arr_v4int_uint_4 |
| 55 | %src_private = OpVariable %_ptr_Private__arr_v4int_uint_4 Private %src_let |
| 56 | %_ptr_Workgroup__arr_v4int_uint_4 = OpTypePointer Workgroup %_arr_v4int_uint_4 |
| 57 | %src_workgroup = OpVariable %_ptr_Workgroup__arr_v4int_uint_4 Workgroup |
| 58 | %S = OpTypeStruct %_arr_v4int_uint_4 |
James Price | 71c1d54 | 2024-10-10 23:01:19 +0000 | [diff] [blame] | 59 | %src_uniform_block = OpTypeStruct %S |
| 60 | %_ptr_Uniform_src_uniform_block = OpTypePointer Uniform %src_uniform_block |
| 61 | %11 = OpVariable %_ptr_Uniform_src_uniform_block Uniform |
| 62 | %src_storage_block = OpTypeStruct %S |
| 63 | %_ptr_StorageBuffer_src_storage_block = OpTypePointer StorageBuffer %src_storage_block |
| 64 | %15 = OpVariable %_ptr_StorageBuffer_src_storage_block StorageBuffer |
dan sinclair | 1b77b6c | 2024-08-06 15:47:05 +0000 | [diff] [blame] | 65 | %dst = OpVariable %_ptr_Workgroup__arr_v4int_uint_4 Workgroup |
| 66 | %uint_2 = OpConstant %uint 2 |
| 67 | %_arr_int_uint_2 = OpTypeArray %int %uint_2 |
| 68 | %uint_3 = OpConstant %uint 3 |
| 69 | %_arr__arr_int_uint_2_uint_3 = OpTypeArray %_arr_int_uint_2 %uint_3 |
| 70 | %_arr__arr__arr_int_uint_2_uint_3_uint_4 = OpTypeArray %_arr__arr_int_uint_2_uint_3 %uint_4 |
| 71 | %_ptr_Workgroup__arr__arr__arr_int_uint_2_uint_3_uint_4 = OpTypePointer Workgroup %_arr__arr__arr_int_uint_2_uint_3_uint_4 |
| 72 | %dst_nested = OpVariable %_ptr_Workgroup__arr__arr__arr_int_uint_2_uint_3_uint_4 Workgroup |
| 73 | %_ptr_Input_uint = OpTypePointer Input %uint |
| 74 | %main_local_invocation_index_Input = OpVariable %_ptr_Input_uint Input |
| 75 | %29 = OpTypeFunction %_arr_v4int_uint_4 |
| 76 | %32 = OpTypeFunction %S |
| 77 | %34 = OpConstantNull %S |
| 78 | %void = OpTypeVoid |
| 79 | %38 = OpTypeFunction %void %_arr_v4int_uint_4 |
| 80 | %_ptr_Function__arr_v4int_uint_4 = OpTypePointer Function %_arr_v4int_uint_4 |
| 81 | %int_1 = OpConstant %int 1 |
| 82 | %43 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1 |
| 83 | %int_2 = OpConstant %int 2 |
| 84 | %45 = OpConstantComposite %v4int %int_2 %int_2 %int_2 %int_2 |
| 85 | %int_3 = OpConstant %int 3 |
| 86 | %47 = OpConstantComposite %v4int %int_3 %int_3 %int_3 %int_3 |
| 87 | %42 = OpConstantComposite %_arr_v4int_uint_4 %43 %45 %47 %47 |
| 88 | %_ptr_Uniform__arr_v4int_uint_4 = OpTypePointer Uniform %_arr_v4int_uint_4 |
| 89 | %uint_0 = OpConstant %uint 0 |
| 90 | %_ptr_StorageBuffer__arr_v4int_uint_4 = OpTypePointer StorageBuffer %_arr_v4int_uint_4 |
| 91 | %_ptr_Function__arr__arr__arr_int_uint_2_uint_3_uint_4 = OpTypePointer Function %_arr__arr__arr_int_uint_2_uint_3_uint_4 |
| 92 | %64 = OpConstantNull %_arr__arr__arr_int_uint_2_uint_3_uint_4 |
| 93 | %68 = OpTypeFunction %void %uint |
| 94 | %bool = OpTypeBool |
| 95 | %_ptr_Workgroup_v4int = OpTypePointer Workgroup %v4int |
| 96 | %83 = OpConstantNull %v4int |
| 97 | %uint_1 = OpConstant %uint 1 |
| 98 | %uint_24 = OpConstant %uint 24 |
| 99 | %uint_6 = OpConstant %uint 6 |
| 100 | %_ptr_Workgroup_int = OpTypePointer Workgroup %int |
| 101 | %int_0 = OpConstant %int 0 |
| 102 | %uint_264 = OpConstant %uint 264 |
| 103 | %109 = OpTypeFunction %void |
| 104 | %ret_arr = OpFunction %_arr_v4int_uint_4 None %29 |
| 105 | %30 = OpLabel |
| 106 | OpReturnValue %src_let |
| 107 | OpFunctionEnd |
| 108 | %ret_struct_arr = OpFunction %S None %32 |
| 109 | %33 = OpLabel |
| 110 | OpReturnValue %34 |
| 111 | OpFunctionEnd |
| 112 | %foo = OpFunction %void None %38 |
| 113 | %src_param = OpFunctionParameter %_arr_v4int_uint_4 |
| 114 | %39 = OpLabel |
| 115 | %src_function = OpVariable %_ptr_Function__arr_v4int_uint_4 Function %src_let |
| 116 | %src_nested = OpVariable %_ptr_Function__arr__arr__arr_int_uint_2_uint_3_uint_4 Function %64 |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 117 | OpStore %dst %42 None |
| 118 | OpStore %dst %src_param None |
dan sinclair | 1b77b6c | 2024-08-06 15:47:05 +0000 | [diff] [blame] | 119 | %49 = OpFunctionCall %_arr_v4int_uint_4 %ret_arr |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 120 | OpStore %dst %49 None |
| 121 | OpStore %dst %src_let None |
| 122 | %50 = OpLoad %_arr_v4int_uint_4 %src_function None |
| 123 | OpStore %dst %50 None |
| 124 | %51 = OpLoad %_arr_v4int_uint_4 %src_private None |
| 125 | OpStore %dst %51 None |
| 126 | %52 = OpLoad %_arr_v4int_uint_4 %src_workgroup None |
| 127 | OpStore %dst %52 None |
dan sinclair | 1b77b6c | 2024-08-06 15:47:05 +0000 | [diff] [blame] | 128 | %53 = OpFunctionCall %S %ret_struct_arr |
| 129 | %54 = OpCompositeExtract %_arr_v4int_uint_4 %53 0 |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 130 | OpStore %dst %54 None |
dan sinclair | 1b77b6c | 2024-08-06 15:47:05 +0000 | [diff] [blame] | 131 | %55 = OpAccessChain %_ptr_Uniform__arr_v4int_uint_4 %11 %uint_0 %uint_0 |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 132 | %58 = OpLoad %_arr_v4int_uint_4 %55 None |
| 133 | OpStore %dst %58 None |
dan sinclair | 1b77b6c | 2024-08-06 15:47:05 +0000 | [diff] [blame] | 134 | %59 = OpAccessChain %_ptr_StorageBuffer__arr_v4int_uint_4 %15 %uint_0 %uint_0 |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 135 | %61 = OpLoad %_arr_v4int_uint_4 %59 None |
| 136 | OpStore %dst %61 None |
| 137 | %65 = OpLoad %_arr__arr__arr_int_uint_2_uint_3_uint_4 %src_nested None |
| 138 | OpStore %dst_nested %65 None |
dan sinclair | 1b77b6c | 2024-08-06 15:47:05 +0000 | [diff] [blame] | 139 | OpReturn |
| 140 | OpFunctionEnd |
| 141 | %main_inner = OpFunction %void None %68 |
| 142 | %tint_local_index = OpFunctionParameter %uint |
| 143 | %69 = OpLabel |
| 144 | OpBranch %70 |
| 145 | %70 = OpLabel |
| 146 | OpBranch %73 |
| 147 | %73 = OpLabel |
| 148 | %75 = OpPhi %uint %tint_local_index %70 %76 %72 |
| 149 | OpLoopMerge %74 %72 None |
| 150 | OpBranch %71 |
| 151 | %71 = OpLabel |
| 152 | %77 = OpUGreaterThanEqual %bool %75 %uint_4 |
| 153 | OpSelectionMerge %79 None |
| 154 | OpBranchConditional %77 %80 %79 |
| 155 | %80 = OpLabel |
| 156 | OpBranch %74 |
| 157 | %79 = OpLabel |
| 158 | %81 = OpAccessChain %_ptr_Workgroup_v4int %src_workgroup %75 |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 159 | OpStore %81 %83 None |
dan sinclair | 1b77b6c | 2024-08-06 15:47:05 +0000 | [diff] [blame] | 160 | %84 = OpAccessChain %_ptr_Workgroup_v4int %dst %75 |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 161 | OpStore %84 %83 None |
dan sinclair | 1b77b6c | 2024-08-06 15:47:05 +0000 | [diff] [blame] | 162 | OpBranch %72 |
| 163 | %72 = OpLabel |
| 164 | %76 = OpIAdd %uint %75 %uint_1 |
| 165 | OpBranch %73 |
| 166 | %74 = OpLabel |
| 167 | OpBranch %86 |
| 168 | %86 = OpLabel |
| 169 | OpBranch %89 |
| 170 | %89 = OpLabel |
| 171 | %91 = OpPhi %uint %tint_local_index %86 %92 %88 |
| 172 | OpLoopMerge %90 %88 None |
| 173 | OpBranch %87 |
| 174 | %87 = OpLabel |
| 175 | %93 = OpUGreaterThanEqual %bool %91 %uint_24 |
| 176 | OpSelectionMerge %95 None |
| 177 | OpBranchConditional %93 %96 %95 |
| 178 | %96 = OpLabel |
| 179 | OpBranch %90 |
| 180 | %95 = OpLabel |
| 181 | %97 = OpUMod %uint %91 %uint_2 |
| 182 | %98 = OpUDiv %uint %91 %uint_2 |
| 183 | %99 = OpUMod %uint %98 %uint_3 |
| 184 | %100 = OpUDiv %uint %91 %uint_6 |
| 185 | %102 = OpAccessChain %_ptr_Workgroup_int %dst_nested %100 %99 %97 |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 186 | OpStore %102 %int_0 None |
dan sinclair | 1b77b6c | 2024-08-06 15:47:05 +0000 | [diff] [blame] | 187 | OpBranch %88 |
| 188 | %88 = OpLabel |
| 189 | %92 = OpIAdd %uint %91 %uint_1 |
| 190 | OpBranch %89 |
| 191 | %90 = OpLabel |
| 192 | OpControlBarrier %uint_2 %uint_2 %uint_264 |
| 193 | %107 = OpFunctionCall %void %foo %src_let |
| 194 | OpReturn |
| 195 | OpFunctionEnd |
| 196 | %main = OpFunction %void None %109 |
| 197 | %110 = OpLabel |
dan sinclair | 5026041 | 2024-08-28 19:43:27 +0000 | [diff] [blame] | 198 | %111 = OpLoad %uint %main_local_invocation_index_Input None |
dan sinclair | 1b77b6c | 2024-08-06 15:47:05 +0000 | [diff] [blame] | 199 | %112 = OpFunctionCall %void %main_inner %111 |
| 200 | OpReturn |
| 201 | OpFunctionEnd |