| ; SPIR-V |
| ; Version: 1.3 |
| ; Generator: Google Tint Compiler; 0 |
| ; Bound: 433 |
| ; Schema: 0 |
| OpCapability Shader |
| %83 = OpExtInstImport "GLSL.std.450" |
| OpMemoryModel Logical GLSL450 |
| OpEntryPoint GLCompute %main_count "main_count" %GlobalInvocationID_1 |
| OpEntryPoint GLCompute %main_create_lut "main_create_lut" %GlobalInvocationID_2 |
| OpEntryPoint GLCompute %main_sort_triangles "main_sort_triangles" %GlobalInvocationID_3 |
| OpExecutionMode %main_count LocalSize 128 1 1 |
| OpExecutionMode %main_create_lut LocalSize 128 1 1 |
| OpExecutionMode %main_sort_triangles LocalSize 128 1 1 |
| OpName %GlobalInvocationID_1 "GlobalInvocationID_1" |
| OpName %GlobalInvocationID_2 "GlobalInvocationID_2" |
| OpName %GlobalInvocationID_3 "GlobalInvocationID_3" |
| OpName %uniforms_block "uniforms_block" |
| OpMemberName %uniforms_block 0 "inner" |
| OpName %Uniforms "Uniforms" |
| OpMemberName %Uniforms 0 "numTriangles" |
| OpMemberName %Uniforms 1 "gridSize" |
| OpMemberName %Uniforms 2 "pad1" |
| OpMemberName %Uniforms 3 "pad2" |
| OpMemberName %Uniforms 4 "bbMin" |
| OpMemberName %Uniforms 5 "bbMax" |
| OpName %uniforms "uniforms" |
| OpName %U32s "U32s" |
| OpMemberName %U32s 0 "values" |
| OpName %indices "indices" |
| OpName %F32s "F32s" |
| OpMemberName %F32s 0 "values" |
| OpName %positions "positions" |
| OpName %AU32s "AU32s" |
| OpMemberName %AU32s 0 "values" |
| OpName %counters "counters" |
| OpName %AI32s "AI32s" |
| OpMemberName %AI32s 0 "values" |
| OpName %LUT "LUT" |
| OpName %dbg_block "dbg_block" |
| OpMemberName %dbg_block 0 "inner" |
| OpName %Dbg "Dbg" |
| OpMemberName %Dbg 0 "offsetCounter" |
| OpMemberName %Dbg 1 "pad0" |
| OpMemberName %Dbg 2 "pad1" |
| OpMemberName %Dbg 3 "pad2" |
| OpMemberName %Dbg 4 "value0" |
| OpMemberName %Dbg 5 "value1" |
| OpMemberName %Dbg 6 "value2" |
| OpMemberName %Dbg 7 "value3" |
| OpMemberName %Dbg 8 "value_f32_0" |
| OpMemberName %Dbg 9 "value_f32_1" |
| OpMemberName %Dbg 10 "value_f32_2" |
| OpMemberName %Dbg 11 "value_f32_3" |
| OpName %dbg "dbg" |
| OpName %tint_ftou "tint_ftou" |
| OpName %v "v" |
| OpName %toVoxelPos "toVoxelPos" |
| OpName %position "position" |
| OpName %bbMin "bbMin" |
| OpName %bbMax "bbMax" |
| OpName %bbSize "bbSize" |
| OpName %cubeSize "cubeSize" |
| OpName %gridSize "gridSize" |
| OpName %gx "gx" |
| OpName %gy "gy" |
| OpName %gz "gz" |
| OpName %toIndex1D "toIndex1D" |
| OpName %gridSize_0 "gridSize" |
| OpName %voxelPos "voxelPos" |
| OpName %icoord "icoord" |
| OpName %tint_div "tint_div" |
| OpName %lhs "lhs" |
| OpName %rhs "rhs" |
| OpName %tint_mod "tint_mod" |
| OpName %lhs_0 "lhs" |
| OpName %rhs_0 "rhs" |
| OpName %toIndex3D "toIndex3D" |
| OpName %gridSize_1 "gridSize" |
| OpName %index "index" |
| OpName %z "z" |
| OpName %y "y" |
| OpName %x "x" |
| OpName %loadPosition "loadPosition" |
| OpName %vertexIndex "vertexIndex" |
| OpName %position_0 "position" |
| OpName %doIgnore "doIgnore" |
| OpName %g42 "g42" |
| OpName %kj6 "kj6" |
| OpName %b53 "b53" |
| OpName %rwg "rwg" |
| OpName %rb5 "rb5" |
| OpName %g55 "g55" |
| OpName %main_count_inner "main_count_inner" |
| OpName %GlobalInvocationID "GlobalInvocationID" |
| OpName %triangleIndex "triangleIndex" |
| OpName %i0 "i0" |
| OpName %i1 "i1" |
| OpName %i2 "i2" |
| OpName %p0 "p0" |
| OpName %p1 "p1" |
| OpName %p2 "p2" |
| OpName %center "center" |
| OpName %voxelPos_0 "voxelPos" |
| OpName %voxelIndex "voxelIndex" |
| OpName %acefg "acefg" |
| OpName %main_count "main_count" |
| OpName %main_create_lut_inner "main_create_lut_inner" |
| OpName %GlobalInvocationID_0 "GlobalInvocationID" |
| OpName %voxelIndex_0 "voxelIndex" |
| OpName %maxVoxels "maxVoxels" |
| OpName %numTriangles "numTriangles" |
| OpName %offset "offset" |
| OpName %main_create_lut "main_create_lut" |
| OpName %main_sort_triangles_inner "main_sort_triangles_inner" |
| OpName %GlobalInvocationID_4 "GlobalInvocationID" |
| OpName %triangleIndex_0 "triangleIndex" |
| OpName %i0_0 "i0" |
| OpName %i1_0 "i1" |
| OpName %i2_0 "i2" |
| OpName %p0_0 "p0" |
| OpName %p1_0 "p1" |
| OpName %p2_0 "p2" |
| OpName %center_0 "center" |
| OpName %voxelPos_1 "voxelPos" |
| OpName %voxelIndex_1 "voxelIndex" |
| OpName %triangleOffset "triangleOffset" |
| OpName %main_sort_triangles "main_sort_triangles" |
| OpDecorate %GlobalInvocationID_1 BuiltIn GlobalInvocationId |
| OpDecorate %GlobalInvocationID_2 BuiltIn GlobalInvocationId |
| OpDecorate %GlobalInvocationID_3 BuiltIn GlobalInvocationId |
| OpDecorate %uniforms_block Block |
| OpMemberDecorate %uniforms_block 0 Offset 0 |
| OpMemberDecorate %Uniforms 0 Offset 0 |
| OpMemberDecorate %Uniforms 1 Offset 4 |
| OpMemberDecorate %Uniforms 2 Offset 8 |
| OpMemberDecorate %Uniforms 3 Offset 12 |
| OpMemberDecorate %Uniforms 4 Offset 16 |
| OpMemberDecorate %Uniforms 5 Offset 32 |
| OpDecorate %uniforms NonWritable |
| OpDecorate %uniforms Binding 0 |
| OpDecorate %uniforms DescriptorSet 0 |
| OpDecorate %U32s Block |
| OpMemberDecorate %U32s 0 Offset 0 |
| OpDecorate %_runtimearr_uint ArrayStride 4 |
| OpDecorate %indices Binding 10 |
| OpDecorate %indices DescriptorSet 0 |
| OpDecorate %F32s Block |
| OpMemberDecorate %F32s 0 Offset 0 |
| OpDecorate %_runtimearr_float ArrayStride 4 |
| OpDecorate %positions Binding 11 |
| OpDecorate %positions DescriptorSet 0 |
| OpDecorate %AU32s Block |
| OpMemberDecorate %AU32s 0 Offset 0 |
| OpDecorate %_runtimearr_uint_0 ArrayStride 4 |
| OpDecorate %counters Binding 20 |
| OpDecorate %counters DescriptorSet 0 |
| OpDecorate %AI32s Block |
| OpMemberDecorate %AI32s 0 Offset 0 |
| OpDecorate %_runtimearr_int ArrayStride 4 |
| OpDecorate %LUT Binding 21 |
| OpDecorate %LUT DescriptorSet 0 |
| OpDecorate %dbg_block Block |
| OpMemberDecorate %dbg_block 0 Offset 0 |
| OpMemberDecorate %Dbg 0 Offset 0 |
| OpMemberDecorate %Dbg 1 Offset 4 |
| OpMemberDecorate %Dbg 2 Offset 8 |
| OpMemberDecorate %Dbg 3 Offset 12 |
| OpMemberDecorate %Dbg 4 Offset 16 |
| OpMemberDecorate %Dbg 5 Offset 20 |
| OpMemberDecorate %Dbg 6 Offset 24 |
| OpMemberDecorate %Dbg 7 Offset 28 |
| OpMemberDecorate %Dbg 8 Offset 32 |
| OpMemberDecorate %Dbg 9 Offset 36 |
| OpMemberDecorate %Dbg 10 Offset 40 |
| OpMemberDecorate %Dbg 11 Offset 44 |
| OpDecorate %dbg Binding 50 |
| OpDecorate %dbg DescriptorSet 0 |
| %uint = OpTypeInt 32 0 |
| %v3uint = OpTypeVector %uint 3 |
| %_ptr_Input_v3uint = OpTypePointer Input %v3uint |
| %GlobalInvocationID_1 = OpVariable %_ptr_Input_v3uint Input |
| %GlobalInvocationID_2 = OpVariable %_ptr_Input_v3uint Input |
| %GlobalInvocationID_3 = OpVariable %_ptr_Input_v3uint Input |
| %float = OpTypeFloat 32 |
| %v3float = OpTypeVector %float 3 |
| %Uniforms = OpTypeStruct %uint %uint %uint %uint %v3float %v3float |
| %uniforms_block = OpTypeStruct %Uniforms |
| %_ptr_Uniform_uniforms_block = OpTypePointer Uniform %uniforms_block |
| %uniforms = OpVariable %_ptr_Uniform_uniforms_block Uniform |
| %_runtimearr_uint = OpTypeRuntimeArray %uint |
| %U32s = OpTypeStruct %_runtimearr_uint |
| %_ptr_StorageBuffer_U32s = OpTypePointer StorageBuffer %U32s |
| %indices = OpVariable %_ptr_StorageBuffer_U32s StorageBuffer |
| %_runtimearr_float = OpTypeRuntimeArray %float |
| %F32s = OpTypeStruct %_runtimearr_float |
| %_ptr_StorageBuffer_F32s = OpTypePointer StorageBuffer %F32s |
| %positions = OpVariable %_ptr_StorageBuffer_F32s StorageBuffer |
| %_runtimearr_uint_0 = OpTypeRuntimeArray %uint |
| %AU32s = OpTypeStruct %_runtimearr_uint_0 |
| %_ptr_StorageBuffer_AU32s = OpTypePointer StorageBuffer %AU32s |
| %counters = OpVariable %_ptr_StorageBuffer_AU32s StorageBuffer |
| %int = OpTypeInt 32 1 |
| %_runtimearr_int = OpTypeRuntimeArray %int |
| %AI32s = OpTypeStruct %_runtimearr_int |
| %_ptr_StorageBuffer_AI32s = OpTypePointer StorageBuffer %AI32s |
| %LUT = OpVariable %_ptr_StorageBuffer_AI32s StorageBuffer |
| %Dbg = OpTypeStruct %uint %uint %uint %uint %uint %uint %uint %uint %float %float %float %float |
| %dbg_block = OpTypeStruct %Dbg |
| %_ptr_StorageBuffer_dbg_block = OpTypePointer StorageBuffer %dbg_block |
| %dbg = OpVariable %_ptr_StorageBuffer_dbg_block StorageBuffer |
| %34 = OpTypeFunction %v3uint %v3float |
| %float_4_29496704e_09 = OpConstant %float 4.29496704e+09 |
| %40 = OpConstantComposite %v3float %float_4_29496704e_09 %float_4_29496704e_09 %float_4_29496704e_09 |
| %bool = OpTypeBool |
| %v3bool = OpTypeVector %bool 3 |
| %45 = OpConstantNull %v3float |
| %47 = OpConstantNull %v3uint |
| %uint_4294967295 = OpConstant %uint 4294967295 |
| %50 = OpConstantComposite %v3uint %uint_4294967295 %uint_4294967295 %uint_4294967295 |
| %51 = OpTypeFunction %v3float %v3float |
| %uint_0 = OpConstant %uint 0 |
| %uint_4 = OpConstant %uint 4 |
| %_ptr_Uniform_float = OpTypePointer Uniform %float |
| %uint_1 = OpConstant %uint 1 |
| %uint_2 = OpConstant %uint 2 |
| %_ptr_Function_v3float = OpTypePointer Function %v3float |
| %uint_5 = OpConstant %uint 5 |
| %_ptr_Function_float = OpTypePointer Function %float |
| %93 = OpConstantNull %float |
| %_ptr_Uniform_uint = OpTypePointer Uniform %uint |
| %130 = OpTypeFunction %uint %uint %v3float |
| %_ptr_Function_v3uint = OpTypePointer Function %v3uint |
| %_ptr_Function_uint = OpTypePointer Function %uint |
| %150 = OpTypeFunction %uint %uint %uint |
| %156 = OpConstantNull %uint |
| %166 = OpTypeFunction %v3uint %uint %uint |
| %186 = OpTypeFunction %v3float %uint |
| %uint_3 = OpConstant %uint 3 |
| %_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float |
| %void = OpTypeVoid |
| %207 = OpTypeFunction %void |
| %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint |
| %220 = OpConstantNull %int |
| %_ptr_StorageBuffer_uint_0 = OpTypePointer StorageBuffer %uint |
| %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int |
| %_ptr_Function_int = OpTypePointer Function %int |
| %236 = OpTypeFunction %void %v3uint |
| %float_3 = OpConstant %float 3 |
| %uint_8 = OpConstant %uint 8 |
| %uint_9 = OpConstant %uint 9 |
| %uint_10 = OpConstant %uint 10 |
| %int_n1 = OpConstant %int -1 |
| %int_1 = OpConstant %int 1 |
| %tint_ftou = OpFunction %v3uint None %34 |
| %v = OpFunctionParameter %v3float |
| %37 = OpLabel |
| %41 = OpFOrdLessThan %v3bool %v %40 |
| %46 = OpFOrdLessThan %v3bool %v %45 |
| %48 = OpConvertFToU %v3uint %v |
| %44 = OpSelect %v3uint %46 %47 %48 |
| %38 = OpSelect %v3uint %41 %44 %50 |
| OpReturnValue %38 |
| OpFunctionEnd |
| %toVoxelPos = OpFunction %v3float None %51 |
| %position = OpFunctionParameter %v3float |
| %54 = OpLabel |
| %bbMin = OpVariable %_ptr_Function_v3float Function %45 |
| %bbMax = OpVariable %_ptr_Function_v3float Function %45 |
| %bbSize = OpVariable %_ptr_Function_v3float Function %45 |
| %cubeSize = OpVariable %_ptr_Function_float Function %93 |
| %gridSize = OpVariable %_ptr_Function_float Function %93 |
| %gx = OpVariable %_ptr_Function_float Function %93 |
| %gy = OpVariable %_ptr_Function_float Function %93 |
| %gz = OpVariable %_ptr_Function_float Function %93 |
| %58 = OpAccessChain %_ptr_Uniform_float %uniforms %uint_0 %uint_4 %uint_0 |
| %59 = OpLoad %float %58 |
| %61 = OpAccessChain %_ptr_Uniform_float %uniforms %uint_0 %uint_4 %uint_1 |
| %62 = OpLoad %float %61 |
| %64 = OpAccessChain %_ptr_Uniform_float %uniforms %uint_0 %uint_4 %uint_2 |
| %65 = OpLoad %float %64 |
| %66 = OpCompositeConstruct %v3float %59 %62 %65 |
| OpStore %bbMin %66 |
| %70 = OpAccessChain %_ptr_Uniform_float %uniforms %uint_0 %uint_5 %uint_0 |
| %71 = OpLoad %float %70 |
| %72 = OpAccessChain %_ptr_Uniform_float %uniforms %uint_0 %uint_5 %uint_1 |
| %73 = OpLoad %float %72 |
| %74 = OpAccessChain %_ptr_Uniform_float %uniforms %uint_0 %uint_5 %uint_2 |
| %75 = OpLoad %float %74 |
| %76 = OpCompositeConstruct %v3float %71 %73 %75 |
| OpStore %bbMax %76 |
| %78 = OpLoad %v3float %bbMax |
| %79 = OpLoad %v3float %bbMin |
| %80 = OpFSub %v3float %78 %79 |
| OpStore %bbSize %80 |
| %86 = OpAccessChain %_ptr_Function_float %bbSize %uint_0 |
| %87 = OpLoad %float %86 |
| %88 = OpAccessChain %_ptr_Function_float %bbSize %uint_1 |
| %89 = OpLoad %float %88 |
| %84 = OpExtInst %float %83 NMax %87 %89 |
| %90 = OpAccessChain %_ptr_Function_float %bbSize %uint_2 |
| %91 = OpLoad %float %90 |
| %82 = OpExtInst %float %83 NMax %84 %91 |
| OpStore %cubeSize %82 |
| %96 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0 %uint_1 |
| %97 = OpLoad %uint %96 |
| %94 = OpConvertUToF %float %97 |
| OpStore %gridSize %94 |
| %99 = OpLoad %float %gridSize |
| %100 = OpCompositeExtract %float %position 0 |
| %101 = OpAccessChain %_ptr_Uniform_float %uniforms %uint_0 %uint_4 %uint_0 |
| %102 = OpLoad %float %101 |
| %103 = OpFSub %float %100 %102 |
| %104 = OpFMul %float %99 %103 |
| %105 = OpLoad %float %cubeSize |
| %106 = OpFDiv %float %104 %105 |
| OpStore %gx %106 |
| %108 = OpLoad %float %gridSize |
| %109 = OpCompositeExtract %float %position 1 |
| %110 = OpAccessChain %_ptr_Uniform_float %uniforms %uint_0 %uint_4 %uint_1 |
| %111 = OpLoad %float %110 |
| %112 = OpFSub %float %109 %111 |
| %113 = OpFMul %float %108 %112 |
| %114 = OpLoad %float %cubeSize |
| %115 = OpFDiv %float %113 %114 |
| OpStore %gy %115 |
| %117 = OpLoad %float %gridSize |
| %118 = OpCompositeExtract %float %position 2 |
| %119 = OpAccessChain %_ptr_Uniform_float %uniforms %uint_0 %uint_4 %uint_2 |
| %120 = OpLoad %float %119 |
| %121 = OpFSub %float %118 %120 |
| %122 = OpFMul %float %117 %121 |
| %123 = OpLoad %float %cubeSize |
| %124 = OpFDiv %float %122 %123 |
| OpStore %gz %124 |
| %126 = OpLoad %float %gx |
| %127 = OpLoad %float %gy |
| %128 = OpLoad %float %gz |
| %129 = OpCompositeConstruct %v3float %126 %127 %128 |
| OpReturnValue %129 |
| OpFunctionEnd |
| %toIndex1D = OpFunction %uint None %130 |
| %gridSize_0 = OpFunctionParameter %uint |
| %voxelPos = OpFunctionParameter %v3float |
| %134 = OpLabel |
| %icoord = OpVariable %_ptr_Function_v3uint Function %47 |
| %135 = OpFunctionCall %v3uint %tint_ftou %voxelPos |
| OpStore %icoord %135 |
| %139 = OpAccessChain %_ptr_Function_uint %icoord %uint_0 |
| %140 = OpLoad %uint %139 |
| %141 = OpAccessChain %_ptr_Function_uint %icoord %uint_1 |
| %142 = OpLoad %uint %141 |
| %143 = OpIMul %uint %gridSize_0 %142 |
| %144 = OpIAdd %uint %140 %143 |
| %145 = OpIMul %uint %gridSize_0 %gridSize_0 |
| %146 = OpAccessChain %_ptr_Function_uint %icoord %uint_2 |
| %147 = OpLoad %uint %146 |
| %148 = OpIMul %uint %145 %147 |
| %149 = OpIAdd %uint %144 %148 |
| OpReturnValue %149 |
| OpFunctionEnd |
| %tint_div = OpFunction %uint None %150 |
| %lhs = OpFunctionParameter %uint |
| %rhs = OpFunctionParameter %uint |
| %154 = OpLabel |
| %157 = OpIEqual %bool %rhs %156 |
| %155 = OpSelect %uint %157 %uint_1 %rhs |
| %158 = OpUDiv %uint %lhs %155 |
| OpReturnValue %158 |
| OpFunctionEnd |
| %tint_mod = OpFunction %uint None %150 |
| %lhs_0 = OpFunctionParameter %uint |
| %rhs_0 = OpFunctionParameter %uint |
| %162 = OpLabel |
| %164 = OpIEqual %bool %rhs_0 %156 |
| %163 = OpSelect %uint %164 %uint_1 %rhs_0 |
| %165 = OpUMod %uint %lhs_0 %163 |
| OpReturnValue %165 |
| OpFunctionEnd |
| %toIndex3D = OpFunction %v3uint None %166 |
| %gridSize_1 = OpFunctionParameter %uint |
| %index = OpFunctionParameter %uint |
| %170 = OpLabel |
| %z = OpVariable %_ptr_Function_uint Function %156 |
| %y = OpVariable %_ptr_Function_uint Function %156 |
| %x = OpVariable %_ptr_Function_uint Function %156 |
| %172 = OpIMul %uint %gridSize_1 %gridSize_1 |
| %171 = OpFunctionCall %uint %tint_div %index %172 |
| OpStore %z %171 |
| %175 = OpIMul %uint %gridSize_1 %gridSize_1 |
| %176 = OpLoad %uint %z |
| %177 = OpIMul %uint %175 %176 |
| %178 = OpISub %uint %index %177 |
| %174 = OpFunctionCall %uint %tint_div %178 %gridSize_1 |
| OpStore %y %174 |
| %180 = OpFunctionCall %uint %tint_mod %index %gridSize_1 |
| OpStore %x %180 |
| %182 = OpLoad %uint %x |
| %183 = OpLoad %uint %y |
| %184 = OpLoad %uint %z |
| %185 = OpCompositeConstruct %v3uint %182 %183 %184 |
| OpReturnValue %185 |
| OpFunctionEnd |
| %loadPosition = OpFunction %v3float None %186 |
| %vertexIndex = OpFunctionParameter %uint |
| %189 = OpLabel |
| %position_0 = OpVariable %_ptr_Function_v3float Function %45 |
| %191 = OpIMul %uint %uint_3 %vertexIndex |
| %192 = OpIAdd %uint %191 %156 |
| %194 = OpAccessChain %_ptr_StorageBuffer_float %positions %uint_0 %192 |
| %195 = OpLoad %float %194 |
| %196 = OpIMul %uint %uint_3 %vertexIndex |
| %197 = OpIAdd %uint %196 %uint_1 |
| %198 = OpAccessChain %_ptr_StorageBuffer_float %positions %uint_0 %197 |
| %199 = OpLoad %float %198 |
| %200 = OpIMul %uint %uint_3 %vertexIndex |
| %201 = OpIAdd %uint %200 %uint_2 |
| %202 = OpAccessChain %_ptr_StorageBuffer_float %positions %uint_0 %201 |
| %203 = OpLoad %float %202 |
| %204 = OpCompositeConstruct %v3float %195 %199 %203 |
| OpStore %position_0 %204 |
| %206 = OpLoad %v3float %position_0 |
| OpReturnValue %206 |
| OpFunctionEnd |
| %doIgnore = OpFunction %void None %207 |
| %210 = OpLabel |
| %g42 = OpVariable %_ptr_Function_uint Function %156 |
| %kj6 = OpVariable %_ptr_Function_uint Function %156 |
| %b53 = OpVariable %_ptr_Function_uint Function %156 |
| %rwg = OpVariable %_ptr_Function_uint Function %156 |
| %rb5 = OpVariable %_ptr_Function_float Function %93 |
| %g55 = OpVariable %_ptr_Function_int Function %220 |
| %211 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0 %uint_0 |
| %212 = OpLoad %uint %211 |
| OpStore %g42 %212 |
| %215 = OpAccessChain %_ptr_StorageBuffer_uint %dbg %uint_0 %uint_5 |
| %216 = OpLoad %uint %215 |
| OpStore %kj6 %216 |
| %222 = OpAccessChain %_ptr_StorageBuffer_uint_0 %counters %uint_0 %220 |
| %218 = OpAtomicLoad %uint %222 %uint_1 %uint_0 |
| OpStore %b53 %218 |
| %224 = OpAccessChain %_ptr_StorageBuffer_uint %indices %uint_0 %220 |
| %225 = OpLoad %uint %224 |
| OpStore %rwg %225 |
| %227 = OpAccessChain %_ptr_StorageBuffer_float %positions %uint_0 %220 |
| %228 = OpLoad %float %227 |
| OpStore %rb5 %228 |
| %233 = OpAccessChain %_ptr_StorageBuffer_int %LUT %uint_0 %220 |
| %230 = OpAtomicLoad %int %233 %uint_1 %uint_0 |
| OpStore %g55 %230 |
| OpReturn |
| OpFunctionEnd |
| %main_count_inner = OpFunction %void None %236 |
| %GlobalInvocationID = OpFunctionParameter %v3uint |
| %239 = OpLabel |
| %triangleIndex = OpVariable %_ptr_Function_uint Function %156 |
| %i0 = OpVariable %_ptr_Function_uint Function %156 |
| %i1 = OpVariable %_ptr_Function_uint Function %156 |
| %i2 = OpVariable %_ptr_Function_uint Function %156 |
| %p0 = OpVariable %_ptr_Function_v3float Function %45 |
| %p1 = OpVariable %_ptr_Function_v3float Function %45 |
| %p2 = OpVariable %_ptr_Function_v3float Function %45 |
| %283 = OpVariable %_ptr_Function_v3float Function %45 |
| %center = OpVariable %_ptr_Function_v3float Function %45 |
| %voxelPos_0 = OpVariable %_ptr_Function_v3float Function %45 |
| %voxelIndex = OpVariable %_ptr_Function_uint Function %156 |
| %acefg = OpVariable %_ptr_Function_uint Function %156 |
| %240 = OpCompositeExtract %uint %GlobalInvocationID 0 |
| OpStore %triangleIndex %240 |
| %242 = OpLoad %uint %triangleIndex |
| %243 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0 %uint_0 |
| %244 = OpLoad %uint %243 |
| %245 = OpUGreaterThanEqual %bool %242 %244 |
| OpSelectionMerge %246 None |
| OpBranchConditional %245 %247 %246 |
| %247 = OpLabel |
| OpReturn |
| %246 = OpLabel |
| %248 = OpFunctionCall %void %doIgnore |
| %249 = OpLoad %uint %triangleIndex |
| %250 = OpIMul %uint %uint_3 %249 |
| %251 = OpIAdd %uint %250 %156 |
| %252 = OpAccessChain %_ptr_StorageBuffer_uint %indices %uint_0 %251 |
| %253 = OpLoad %uint %252 |
| OpStore %i0 %253 |
| %255 = OpLoad %uint %triangleIndex |
| %256 = OpIMul %uint %uint_3 %255 |
| %257 = OpIAdd %uint %256 %uint_1 |
| %258 = OpAccessChain %_ptr_StorageBuffer_uint %indices %uint_0 %257 |
| %259 = OpLoad %uint %258 |
| OpStore %i1 %259 |
| %261 = OpLoad %uint %triangleIndex |
| %262 = OpIMul %uint %uint_3 %261 |
| %263 = OpIAdd %uint %262 %uint_2 |
| %264 = OpAccessChain %_ptr_StorageBuffer_uint %indices %uint_0 %263 |
| %265 = OpLoad %uint %264 |
| OpStore %i2 %265 |
| %268 = OpLoad %uint %i0 |
| %267 = OpFunctionCall %v3float %loadPosition %268 |
| OpStore %p0 %267 |
| %271 = OpLoad %uint %i1 |
| %270 = OpFunctionCall %v3float %loadPosition %271 |
| OpStore %p1 %270 |
| %274 = OpLoad %uint %i2 |
| %273 = OpFunctionCall %v3float %loadPosition %274 |
| OpStore %p2 %273 |
| %276 = OpLoad %v3float %p0 |
| %277 = OpLoad %v3float %p1 |
| %278 = OpFAdd %v3float %276 %277 |
| %279 = OpLoad %v3float %p2 |
| %280 = OpFAdd %v3float %278 %279 |
| %284 = OpCompositeConstruct %v3float %float_3 %float_3 %float_3 |
| %282 = OpFDiv %v3float %280 %284 |
| OpStore %center %282 |
| %287 = OpLoad %v3float %center |
| %286 = OpFunctionCall %v3float %toVoxelPos %287 |
| OpStore %voxelPos_0 %286 |
| %290 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0 %uint_1 |
| %291 = OpLoad %uint %290 |
| %292 = OpLoad %v3float %voxelPos_0 |
| %289 = OpFunctionCall %uint %toIndex1D %291 %292 |
| OpStore %voxelIndex %289 |
| %296 = OpLoad %uint %voxelIndex |
| %297 = OpAccessChain %_ptr_StorageBuffer_uint_0 %counters %uint_0 %296 |
| %294 = OpAtomicIAdd %uint %297 %uint_1 %uint_0 %uint_1 |
| OpStore %acefg %294 |
| %299 = OpLoad %uint %triangleIndex |
| %300 = OpIEqual %bool %299 %156 |
| OpSelectionMerge %301 None |
| OpBranchConditional %300 %302 %301 |
| %302 = OpLabel |
| %303 = OpAccessChain %_ptr_StorageBuffer_uint %dbg %uint_0 %uint_4 |
| %304 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0 %uint_1 |
| %305 = OpLoad %uint %304 |
| OpStore %303 %305 |
| %307 = OpAccessChain %_ptr_StorageBuffer_float %dbg %uint_0 %uint_8 |
| %308 = OpAccessChain %_ptr_Function_float %center %uint_0 |
| %309 = OpLoad %float %308 |
| OpStore %307 %309 |
| %311 = OpAccessChain %_ptr_StorageBuffer_float %dbg %uint_0 %uint_9 |
| %312 = OpAccessChain %_ptr_Function_float %center %uint_1 |
| %313 = OpLoad %float %312 |
| OpStore %311 %313 |
| %315 = OpAccessChain %_ptr_StorageBuffer_float %dbg %uint_0 %uint_10 |
| %316 = OpAccessChain %_ptr_Function_float %center %uint_2 |
| %317 = OpLoad %float %316 |
| OpStore %315 %317 |
| OpBranch %301 |
| %301 = OpLabel |
| OpReturn |
| OpFunctionEnd |
| %main_count = OpFunction %void None %207 |
| %319 = OpLabel |
| %321 = OpLoad %v3uint %GlobalInvocationID_1 |
| %320 = OpFunctionCall %void %main_count_inner %321 |
| OpReturn |
| OpFunctionEnd |
| %main_create_lut_inner = OpFunction %void None %236 |
| %GlobalInvocationID_0 = OpFunctionParameter %v3uint |
| %324 = OpLabel |
| %voxelIndex_0 = OpVariable %_ptr_Function_uint Function %156 |
| %maxVoxels = OpVariable %_ptr_Function_uint Function %156 |
| %numTriangles = OpVariable %_ptr_Function_uint Function %156 |
| %offset = OpVariable %_ptr_Function_int Function %220 |
| %325 = OpCompositeExtract %uint %GlobalInvocationID_0 0 |
| OpStore %voxelIndex_0 %325 |
| %327 = OpFunctionCall %void %doIgnore |
| %328 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0 %uint_1 |
| %329 = OpLoad %uint %328 |
| %330 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0 %uint_1 |
| %331 = OpLoad %uint %330 |
| %332 = OpIMul %uint %329 %331 |
| %333 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0 %uint_1 |
| %334 = OpLoad %uint %333 |
| %335 = OpIMul %uint %332 %334 |
| OpStore %maxVoxels %335 |
| %337 = OpLoad %uint %voxelIndex_0 |
| %338 = OpLoad %uint %maxVoxels |
| %339 = OpUGreaterThanEqual %bool %337 %338 |
| OpSelectionMerge %340 None |
| OpBranchConditional %339 %341 %340 |
| %341 = OpLabel |
| OpReturn |
| %340 = OpLabel |
| %344 = OpLoad %uint %voxelIndex_0 |
| %345 = OpAccessChain %_ptr_StorageBuffer_uint_0 %counters %uint_0 %344 |
| %342 = OpAtomicLoad %uint %345 %uint_1 %uint_0 |
| OpStore %numTriangles %342 |
| OpStore %offset %int_n1 |
| %349 = OpLoad %uint %numTriangles |
| %350 = OpUGreaterThan %bool %349 %156 |
| OpSelectionMerge %351 None |
| OpBranchConditional %350 %352 %351 |
| %352 = OpLabel |
| %355 = OpAccessChain %_ptr_StorageBuffer_uint_0 %dbg %uint_0 %uint_0 |
| %356 = OpLoad %uint %numTriangles |
| %353 = OpAtomicIAdd %uint %355 %uint_1 %uint_0 %356 |
| %357 = OpBitcast %int %353 |
| OpStore %offset %357 |
| OpBranch %351 |
| %351 = OpLabel |
| %360 = OpLoad %uint %voxelIndex_0 |
| %361 = OpAccessChain %_ptr_StorageBuffer_int %LUT %uint_0 %360 |
| %362 = OpLoad %int %offset |
| OpAtomicStore %361 %uint_1 %uint_0 %362 |
| OpReturn |
| OpFunctionEnd |
| %main_create_lut = OpFunction %void None %207 |
| %364 = OpLabel |
| %366 = OpLoad %v3uint %GlobalInvocationID_2 |
| %365 = OpFunctionCall %void %main_create_lut_inner %366 |
| OpReturn |
| OpFunctionEnd |
| %main_sort_triangles_inner = OpFunction %void None %236 |
| %GlobalInvocationID_4 = OpFunctionParameter %v3uint |
| %369 = OpLabel |
| %triangleIndex_0 = OpVariable %_ptr_Function_uint Function %156 |
| %i0_0 = OpVariable %_ptr_Function_uint Function %156 |
| %i1_0 = OpVariable %_ptr_Function_uint Function %156 |
| %i2_0 = OpVariable %_ptr_Function_uint Function %156 |
| %p0_0 = OpVariable %_ptr_Function_v3float Function %45 |
| %p1_0 = OpVariable %_ptr_Function_v3float Function %45 |
| %p2_0 = OpVariable %_ptr_Function_v3float Function %45 |
| %412 = OpVariable %_ptr_Function_v3float Function %45 |
| %center_0 = OpVariable %_ptr_Function_v3float Function %45 |
| %voxelPos_1 = OpVariable %_ptr_Function_v3float Function %45 |
| %voxelIndex_1 = OpVariable %_ptr_Function_uint Function %156 |
| %triangleOffset = OpVariable %_ptr_Function_int Function %220 |
| %370 = OpCompositeExtract %uint %GlobalInvocationID_4 0 |
| OpStore %triangleIndex_0 %370 |
| %372 = OpFunctionCall %void %doIgnore |
| %373 = OpLoad %uint %triangleIndex_0 |
| %374 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0 %uint_0 |
| %375 = OpLoad %uint %374 |
| %376 = OpUGreaterThanEqual %bool %373 %375 |
| OpSelectionMerge %377 None |
| OpBranchConditional %376 %378 %377 |
| %378 = OpLabel |
| OpReturn |
| %377 = OpLabel |
| %379 = OpLoad %uint %triangleIndex_0 |
| %380 = OpIMul %uint %uint_3 %379 |
| %381 = OpIAdd %uint %380 %156 |
| %382 = OpAccessChain %_ptr_StorageBuffer_uint %indices %uint_0 %381 |
| %383 = OpLoad %uint %382 |
| OpStore %i0_0 %383 |
| %385 = OpLoad %uint %triangleIndex_0 |
| %386 = OpIMul %uint %uint_3 %385 |
| %387 = OpIAdd %uint %386 %uint_1 |
| %388 = OpAccessChain %_ptr_StorageBuffer_uint %indices %uint_0 %387 |
| %389 = OpLoad %uint %388 |
| OpStore %i1_0 %389 |
| %391 = OpLoad %uint %triangleIndex_0 |
| %392 = OpIMul %uint %uint_3 %391 |
| %393 = OpIAdd %uint %392 %uint_2 |
| %394 = OpAccessChain %_ptr_StorageBuffer_uint %indices %uint_0 %393 |
| %395 = OpLoad %uint %394 |
| OpStore %i2_0 %395 |
| %398 = OpLoad %uint %i0_0 |
| %397 = OpFunctionCall %v3float %loadPosition %398 |
| OpStore %p0_0 %397 |
| %401 = OpLoad %uint %i1_0 |
| %400 = OpFunctionCall %v3float %loadPosition %401 |
| OpStore %p1_0 %400 |
| %404 = OpLoad %uint %i2_0 |
| %403 = OpFunctionCall %v3float %loadPosition %404 |
| OpStore %p2_0 %403 |
| %406 = OpLoad %v3float %p0_0 |
| %407 = OpLoad %v3float %p1_0 |
| %408 = OpFAdd %v3float %406 %407 |
| %409 = OpLoad %v3float %p2_0 |
| %410 = OpFAdd %v3float %408 %409 |
| %413 = OpCompositeConstruct %v3float %float_3 %float_3 %float_3 |
| %411 = OpFDiv %v3float %410 %413 |
| OpStore %center_0 %411 |
| %416 = OpLoad %v3float %center_0 |
| %415 = OpFunctionCall %v3float %toVoxelPos %416 |
| OpStore %voxelPos_1 %415 |
| %419 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0 %uint_1 |
| %420 = OpLoad %uint %419 |
| %421 = OpLoad %v3float %voxelPos_1 |
| %418 = OpFunctionCall %uint %toIndex1D %420 %421 |
| OpStore %voxelIndex_1 %418 |
| %425 = OpLoad %uint %voxelIndex_1 |
| %426 = OpAccessChain %_ptr_StorageBuffer_int %LUT %uint_0 %425 |
| %423 = OpAtomicIAdd %int %426 %uint_1 %uint_0 %int_1 |
| OpStore %triangleOffset %423 |
| OpReturn |
| OpFunctionEnd |
| %main_sort_triangles = OpFunction %void None %207 |
| %430 = OpLabel |
| %432 = OpLoad %v3uint %GlobalInvocationID_3 |
| %431 = OpFunctionCall %void %main_sort_triangles_inner %432 |
| OpReturn |
| OpFunctionEnd |