blob: 61531d0fc0936f467d58fc98aac774d42aded4f9 [file]
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 1
; Bound: 482
; Schema: 0
OpCapability Shader
%55 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %main "main" %main_global_invocation_id_Input
OpExecutionMode %main LocalSize 64 1 1
OpMemberName %LightData 0 "position"
OpMemberName %LightData 1 "color"
OpMemberName %LightData 2 "radius"
OpName %LightData "LightData"
OpMemberName %LightsBuffer_tint_explicit_layout 0 "lights"
OpName %LightsBuffer_tint_explicit_layout "LightsBuffer_tint_explicit_layout"
OpName %lightsBuffer "lightsBuffer"
OpMemberName %TileLightIdData_tint_explicit_layout 0 "count"
OpMemberName %TileLightIdData_tint_explicit_layout 1 "lightId"
OpName %TileLightIdData_tint_explicit_layout "TileLightIdData_tint_explicit_layout"
OpMemberName %Tiles_tint_explicit_layout 0 "data"
OpName %Tiles_tint_explicit_layout "Tiles_tint_explicit_layout"
OpMemberName %tileLightId_block_tint_explicit_layout 0 "inner"
OpName %tileLightId_block_tint_explicit_layout "tileLightId_block_tint_explicit_layout"
OpMemberName %Config 0 "numLights"
OpMemberName %Config 1 "numTiles"
OpMemberName %Config 2 "tileCountX"
OpMemberName %Config 3 "tileCountY"
OpMemberName %Config 4 "numTileLightSlot"
OpMemberName %Config 5 "tileSize"
OpName %Config "Config"
OpMemberName %config_block 0 "inner"
OpName %config_block "config_block"
OpMemberName %Uniforms 0 "min"
OpMemberName %Uniforms 1 "max"
OpMemberName %Uniforms 2 "viewMatrix"
OpMemberName %Uniforms 3 "projectionMatrix"
OpMemberName %Uniforms 4 "fullScreenSize"
OpName %Uniforms "Uniforms"
OpMemberName %uniforms_block 0 "inner"
OpName %uniforms_block "uniforms_block"
OpName %main_global_invocation_id_Input "main_global_invocation_id_Input"
OpName %main_inner "main_inner"
OpName %GlobalInvocationID "GlobalInvocationID"
OpName %index "index"
OpName %M "M"
OpName %viewNear "viewNear"
OpName %viewFar "viewFar"
OpName %lightPos "lightPos"
OpName %lightRadius "lightRadius"
OpName %boxMin "boxMin"
OpName %boxMax "boxMax"
OpName %frustumPlanes "frustumPlanes"
OpName %TILE_SIZE "TILE_SIZE"
OpName %TILE_COUNT_X "TILE_COUNT_X"
OpName %TILE_COUNT_X "TILE_COUNT_Y"
OpName %y "y"
OpName %x "x"
OpName %tilePixel0Idx "tilePixel0Idx"
OpName %floorCoord "floorCoord"
OpName %ceilCoord "ceilCoord"
OpName %viewFloorCoord "viewFloorCoord"
OpName %viewCeilCoord "viewCeilCoord"
OpName %dp "dp"
OpName %i "i"
OpName %p "p"
OpName %tileId "tileId"
OpName %offset "offset"
OpName %main "main"
OpMemberDecorate %LightData 0 Offset 0
OpMemberDecorate %LightData 1 Offset 16
OpMemberDecorate %LightData 2 Offset 28
OpDecorate %_runtimearr_LightData ArrayStride 32
OpMemberDecorate %LightsBuffer_tint_explicit_layout 0 Offset 0
OpDecorate %LightsBuffer_tint_explicit_layout Block
OpDecorate %lightsBuffer DescriptorSet 0
OpDecorate %lightsBuffer Binding 0
OpDecorate %lightsBuffer Coherent
OpMemberDecorate %TileLightIdData_tint_explicit_layout 0 Offset 0
OpDecorate %_arr_uint_uint_64 ArrayStride 4
OpMemberDecorate %TileLightIdData_tint_explicit_layout 1 Offset 4
OpDecorate %_arr_TileLightIdData_tint_explicit_layout_uint_4 ArrayStride 260
OpMemberDecorate %Tiles_tint_explicit_layout 0 Offset 0
OpMemberDecorate %tileLightId_block_tint_explicit_layout 0 Offset 0
OpDecorate %tileLightId_block_tint_explicit_layout Block
OpDecorate %9 DescriptorSet 1
OpDecorate %9 Binding 0
OpDecorate %9 Coherent
OpMemberDecorate %Config 0 Offset 0
OpMemberDecorate %Config 1 Offset 4
OpMemberDecorate %Config 2 Offset 8
OpMemberDecorate %Config 3 Offset 12
OpMemberDecorate %Config 4 Offset 16
OpMemberDecorate %Config 5 Offset 20
OpMemberDecorate %config_block 0 Offset 0
OpDecorate %config_block Block
OpDecorate %19 DescriptorSet 2
OpDecorate %19 Binding 0
OpDecorate %19 NonWritable
OpMemberDecorate %Uniforms 0 Offset 0
OpMemberDecorate %Uniforms 1 Offset 16
OpMemberDecorate %Uniforms 2 Offset 32
OpMemberDecorate %Uniforms 2 ColMajor
OpMemberDecorate %Uniforms 2 MatrixStride 16
OpMemberDecorate %Uniforms 3 Offset 96
OpMemberDecorate %Uniforms 3 ColMajor
OpMemberDecorate %Uniforms 3 MatrixStride 16
OpMemberDecorate %Uniforms 4 Offset 160
OpMemberDecorate %uniforms_block 0 Offset 0
OpDecorate %uniforms_block Block
OpDecorate %23 DescriptorSet 3
OpDecorate %23 Binding 0
OpDecorate %23 NonWritable
OpDecorate %main_global_invocation_id_Input BuiltIn GlobalInvocationId
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%v3float = OpTypeVector %float 3
%LightData = OpTypeStruct %v4float %v3float %float
%_runtimearr_LightData = OpTypeRuntimeArray %LightData
%LightsBuffer_tint_explicit_layout = OpTypeStruct %_runtimearr_LightData
%_ptr_StorageBuffer_LightsBuffer_tint_explicit_layout = OpTypePointer StorageBuffer %LightsBuffer_tint_explicit_layout
%lightsBuffer = OpVariable %_ptr_StorageBuffer_LightsBuffer_tint_explicit_layout StorageBuffer
%uint = OpTypeInt 32 0
%uint_64 = OpConstant %uint 64
%_arr_uint_uint_64 = OpTypeArray %uint %uint_64
%TileLightIdData_tint_explicit_layout = OpTypeStruct %uint %_arr_uint_uint_64
%uint_4 = OpConstant %uint 4
%_arr_TileLightIdData_tint_explicit_layout_uint_4 = OpTypeArray %TileLightIdData_tint_explicit_layout %uint_4
%Tiles_tint_explicit_layout = OpTypeStruct %_arr_TileLightIdData_tint_explicit_layout_uint_4
%tileLightId_block_tint_explicit_layout = OpTypeStruct %Tiles_tint_explicit_layout
%_ptr_StorageBuffer_tileLightId_block_tint_explicit_layout = OpTypePointer StorageBuffer %tileLightId_block_tint_explicit_layout
%9 = OpVariable %_ptr_StorageBuffer_tileLightId_block_tint_explicit_layout StorageBuffer
%Config = OpTypeStruct %uint %uint %uint %uint %uint %uint
%config_block = OpTypeStruct %Config
%_ptr_Uniform_config_block = OpTypePointer Uniform %config_block
%19 = OpVariable %_ptr_Uniform_config_block Uniform
%mat4v4float = OpTypeMatrix %v4float 4
%Uniforms = OpTypeStruct %v4float %v4float %mat4v4float %mat4v4float %v4float
%uniforms_block = OpTypeStruct %Uniforms
%_ptr_Uniform_uniforms_block = OpTypePointer Uniform %uniforms_block
%23 = OpVariable %_ptr_Uniform_uniforms_block Uniform
%v3uint = OpTypeVector %uint 3
%_ptr_Input_v3uint = OpTypePointer Input %v3uint
%main_global_invocation_id_Input = OpVariable %_ptr_Input_v3uint Input
%void = OpTypeVoid
%34 = OpTypeFunction %void %v3uint
%_ptr_Function_uint = OpTypePointer Function %uint
%_ptr_Uniform_uint = OpTypePointer Uniform %uint
%uint_0 = OpConstant %uint 0
%bool = OpTypeBool
%_ptr_StorageBuffer__runtimearr_LightData = OpTypePointer StorageBuffer %_runtimearr_LightData
%uint_1 = OpConstant %uint 1
%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
%float_0_100000001 = OpConstant %float 0.100000001
%float_64 = OpConstant %float 64
%float_0_00100000005 = OpConstant %float 0.00100000005
%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
%_ptr_Uniform_float = OpTypePointer Uniform %float
%_ptr_Uniform_mat4v4float = OpTypePointer Uniform %mat4v4float
%uint_3 = OpConstant %uint 3
%_ptr_Function_mat4v4float = OpTypePointer Function %mat4v4float
%_ptr_Function_v4float = OpTypePointer Function %v4float
%_ptr_Function_float = OpTypePointer Function %float
%uint_2 = OpConstant %uint 2
%float_n1 = OpConstant %float -1
%float_1 = OpConstant %float 1
%float_0 = OpConstant %float 0
%uint_6 = OpConstant %uint 6
%_arr_v4float_uint_6 = OpTypeArray %v4float %uint_6
%_ptr_Function__arr_v4float_uint_6 = OpTypePointer Function %_arr_v4float_uint_6
%171 = OpConstantNull %_arr_v4float_uint_6
%uint_5 = OpConstant %uint 5
%int = OpTypeInt 32 1
%TILE_SIZE = OpConstant %int 16
%TILE_COUNT_X = OpConstant %int 2
%_ptr_Function_int = OpTypePointer Function %int
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
%v2int = OpTypeVector %int 2
%_ptr_Function_v2int = OpTypePointer Function %v2int
%v2float = OpTypeVector %float 2
%float_2 = OpConstant %float 2
%245 = OpConstantComposite %v2float %float_1 %float_1
%_ptr_Function_v2float = OpTypePointer Function %v2float
%v2uint = OpTypeVector %uint 2
%374 = OpConstantNull %v4float
%true = OpConstantTrue %bool
%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
%uint_63 = OpConstant %uint 63
%_ptr_StorageBuffer_uint_0 = OpTypePointer StorageBuffer %uint
%478 = OpTypeFunction %void
%main_inner = OpFunction %void None %34
%GlobalInvocationID = OpFunctionParameter %v3uint
%35 = OpLabel
%index = OpVariable %_ptr_Function_uint Function
%M = OpVariable %_ptr_Function_mat4v4float Function
%viewNear = OpVariable %_ptr_Function_float Function
%viewFar = OpVariable %_ptr_Function_float Function
%lightPos = OpVariable %_ptr_Function_v4float Function
%lightRadius = OpVariable %_ptr_Function_float Function
%boxMin = OpVariable %_ptr_Function_v4float Function
%boxMax = OpVariable %_ptr_Function_v4float Function
%frustumPlanes = OpVariable %_ptr_Function__arr_v4float_uint_6 Function %171
%y = OpVariable %_ptr_Function_int Function
%x = OpVariable %_ptr_Function_int Function
%tilePixel0Idx = OpVariable %_ptr_Function_v2int Function
%floorCoord = OpVariable %_ptr_Function_v2float Function
%ceilCoord = OpVariable %_ptr_Function_v2float Function
%viewFloorCoord = OpVariable %_ptr_Function_v2float Function
%viewCeilCoord = OpVariable %_ptr_Function_v2float Function
%dp = OpVariable %_ptr_Function_float Function
%i = OpVariable %_ptr_Function_uint Function
%p = OpVariable %_ptr_Function_v4float Function %374
%tileId = OpVariable %_ptr_Function_uint Function
%offset = OpVariable %_ptr_Function_uint Function
%36 = OpCompositeExtract %uint %GlobalInvocationID 0
OpStore %index %36
%39 = OpLoad %uint %index None
%40 = OpAccessChain %_ptr_Uniform_uint %19 %uint_0 %uint_0
%43 = OpLoad %uint %40 None
%44 = OpUGreaterThanEqual %bool %39 %43
OpSelectionMerge %46 None
OpBranchConditional %44 %47 %46
%47 = OpLabel
OpReturn
%46 = OpLabel
%48 = OpLoad %uint %index None
%49 = OpAccessChain %_ptr_StorageBuffer__runtimearr_LightData %lightsBuffer %uint_0
%51 = OpArrayLength %uint %lightsBuffer 0
%52 = OpISub %uint %51 %uint_1
%54 = OpExtInst %uint %55 UMin %48 %52
%56 = OpAccessChain %_ptr_StorageBuffer_v4float %lightsBuffer %uint_0 %54 %uint_0
%58 = OpLoad %uint %index None
%59 = OpAccessChain %_ptr_StorageBuffer__runtimearr_LightData %lightsBuffer %uint_0
%60 = OpArrayLength %uint %lightsBuffer 0
%61 = OpISub %uint %60 %uint_1
%62 = OpExtInst %uint %55 UMin %58 %61
%63 = OpAccessChain %_ptr_StorageBuffer_v4float %lightsBuffer %uint_0 %62 %uint_0
%64 = OpAccessChain %_ptr_StorageBuffer_float %63 %uint_1
%66 = OpLoad %float %64 None
%67 = OpFSub %float %66 %float_0_100000001
%69 = OpLoad %uint %index None
%70 = OpConvertUToF %float %69
%71 = OpLoad %uint %index None
%72 = OpConvertUToF %float %71
%73 = OpFDiv %float %72 %float_64
%75 = OpExtInst %float %55 Floor %73
%76 = OpFMul %float %float_64 %75
%77 = OpFSub %float %70 %76
%78 = OpFMul %float %float_0_00100000005 %77
%80 = OpFAdd %float %67 %78
%81 = OpAccessChain %_ptr_StorageBuffer_float %56 %uint_1
OpStore %81 %80 None
%82 = OpLoad %uint %index None
%83 = OpAccessChain %_ptr_StorageBuffer__runtimearr_LightData %lightsBuffer %uint_0
%84 = OpArrayLength %uint %lightsBuffer 0
%85 = OpISub %uint %84 %uint_1
%86 = OpExtInst %uint %55 UMin %82 %85
%87 = OpAccessChain %_ptr_StorageBuffer_v4float %lightsBuffer %uint_0 %86 %uint_0
%88 = OpAccessChain %_ptr_StorageBuffer_float %87 %uint_1
%89 = OpLoad %float %88 None
%90 = OpAccessChain %_ptr_Uniform_v4float %23 %uint_0 %uint_0
%92 = OpAccessChain %_ptr_Uniform_float %90 %uint_1
%94 = OpLoad %float %92 None
%95 = OpFOrdLessThan %bool %89 %94
OpSelectionMerge %96 None
OpBranchConditional %95 %97 %96
%97 = OpLabel
%188 = OpLoad %uint %index None
%189 = OpAccessChain %_ptr_StorageBuffer__runtimearr_LightData %lightsBuffer %uint_0
%190 = OpArrayLength %uint %lightsBuffer 0
%191 = OpISub %uint %190 %uint_1
%192 = OpExtInst %uint %55 UMin %188 %191
%193 = OpAccessChain %_ptr_StorageBuffer_v4float %lightsBuffer %uint_0 %192 %uint_0
%194 = OpAccessChain %_ptr_Uniform_v4float %23 %uint_0 %uint_1
%195 = OpAccessChain %_ptr_Uniform_float %194 %uint_1
%196 = OpLoad %float %195 None
%197 = OpAccessChain %_ptr_StorageBuffer_float %193 %uint_1
OpStore %197 %196 None
OpBranch %96
%96 = OpLabel
%98 = OpAccessChain %_ptr_Uniform_mat4v4float %23 %uint_0 %uint_3
%101 = OpLoad %mat4v4float %98 None
OpStore %M %101
%104 = OpAccessChain %_ptr_Function_v4float %M %uint_3
%106 = OpAccessChain %_ptr_Function_float %104 %uint_2
%109 = OpLoad %float %106 None
%110 = OpFNegate %float %109
%111 = OpAccessChain %_ptr_Function_v4float %M %uint_2
%112 = OpAccessChain %_ptr_Function_float %111 %uint_2
%113 = OpLoad %float %112 None
%114 = OpFAdd %float %float_n1 %113
%116 = OpFDiv %float %110 %114
OpStore %viewNear %116
%118 = OpAccessChain %_ptr_Function_v4float %M %uint_3
%119 = OpAccessChain %_ptr_Function_float %118 %uint_2
%120 = OpLoad %float %119 None
%121 = OpFNegate %float %120
%122 = OpAccessChain %_ptr_Function_v4float %M %uint_2
%123 = OpAccessChain %_ptr_Function_float %122 %uint_2
%124 = OpLoad %float %123 None
%125 = OpFAdd %float %float_1 %124
%127 = OpFDiv %float %121 %125
OpStore %viewFar %127
%129 = OpLoad %uint %index None
%130 = OpAccessChain %_ptr_StorageBuffer__runtimearr_LightData %lightsBuffer %uint_0
%131 = OpArrayLength %uint %lightsBuffer 0
%132 = OpISub %uint %131 %uint_1
%133 = OpExtInst %uint %55 UMin %129 %132
%134 = OpAccessChain %_ptr_StorageBuffer_v4float %lightsBuffer %uint_0 %133 %uint_0
%135 = OpLoad %v4float %134 None
OpStore %lightPos %135
%137 = OpAccessChain %_ptr_Uniform_mat4v4float %23 %uint_0 %uint_2
%138 = OpLoad %mat4v4float %137 None
%139 = OpLoad %v4float %lightPos None
%140 = OpMatrixTimesVector %v4float %138 %139
OpStore %lightPos %140 None
%141 = OpLoad %v4float %lightPos None
%142 = OpAccessChain %_ptr_Function_float %lightPos %uint_3
%143 = OpLoad %float %142 None
%144 = OpCompositeConstruct %v4float %143 %143 %143 %143
%145 = OpFDiv %v4float %141 %144
OpStore %lightPos %145 None
%146 = OpLoad %uint %index None
%147 = OpAccessChain %_ptr_StorageBuffer__runtimearr_LightData %lightsBuffer %uint_0
%148 = OpArrayLength %uint %lightsBuffer 0
%149 = OpISub %uint %148 %uint_1
%150 = OpExtInst %uint %55 UMin %146 %149
%151 = OpAccessChain %_ptr_StorageBuffer_float %lightsBuffer %uint_0 %150 %uint_2
%152 = OpLoad %float %151 None
OpStore %lightRadius %152
%154 = OpLoad %v4float %lightPos None
%155 = OpLoad %float %lightRadius None
%156 = OpCompositeConstruct %v3float %155 %155 %155
%157 = OpCompositeConstruct %v4float %156 %float_0
%159 = OpFSub %v4float %154 %157
OpStore %boxMin %159
%161 = OpLoad %v4float %lightPos None
%162 = OpLoad %float %lightRadius None
%163 = OpCompositeConstruct %v3float %162 %162 %162
%164 = OpCompositeConstruct %v4float %163 %float_0
%165 = OpFAdd %v4float %161 %164
OpStore %boxMax %165
%172 = OpAccessChain %_ptr_Function_v4float %frustumPlanes %uint_4
%173 = OpLoad %float %viewNear None
%174 = OpCompositeConstruct %v4float %float_0 %float_0 %float_n1 %173
OpStore %172 %174 None
%175 = OpAccessChain %_ptr_Function_v4float %frustumPlanes %uint_5
%177 = OpLoad %float %viewFar None
%178 = OpFNegate %float %177
%179 = OpCompositeConstruct %v4float %float_0 %float_0 %float_1 %178
OpStore %175 %179 None
OpBranch %183
%183 = OpLabel
OpStore %y %int_0
OpBranch %186
%186 = OpLabel
OpLoopMerge %187 %185 None
OpBranch %184
%184 = OpLabel
%201 = OpLoad %int %y None
%202 = OpSLessThan %bool %201 %TILE_COUNT_X
OpSelectionMerge %203 None
OpBranchConditional %202 %203 %204
%204 = OpLabel
OpBranch %187
%203 = OpLabel
OpBranch %205
%205 = OpLabel
OpStore %x %int_0
OpBranch %208
%208 = OpLabel
OpLoopMerge %209 %207 None
OpBranch %206
%206 = OpLabel
%217 = OpLoad %int %x None
%218 = OpSLessThan %bool %217 %TILE_COUNT_X
OpSelectionMerge %219 None
OpBranchConditional %218 %219 %220
%220 = OpLabel
OpBranch %209
%219 = OpLabel
%221 = OpLoad %int %x None
%222 = OpBitcast %uint %221
%223 = OpBitcast %uint %TILE_SIZE
%224 = OpIMul %uint %222 %223
%225 = OpBitcast %int %224
%226 = OpLoad %int %y None
%227 = OpBitcast %uint %226
%228 = OpBitcast %uint %TILE_SIZE
%229 = OpIMul %uint %227 %228
%230 = OpBitcast %int %229
%232 = OpCompositeConstruct %v2int %225 %230
OpStore %tilePixel0Idx %232
%235 = OpLoad %v2int %tilePixel0Idx None
%237 = OpConvertSToF %v2float %235
%238 = OpVectorTimesScalar %v2float %237 %float_2
%240 = OpAccessChain %_ptr_Uniform_v4float %23 %uint_0 %uint_4
%241 = OpLoad %v4float %240 None
%242 = OpVectorShuffle %v2float %241 %241 0 1
%243 = OpFDiv %v2float %238 %242
%244 = OpFSub %v2float %243 %245
OpStore %floorCoord %244
%248 = OpLoad %v2int %tilePixel0Idx None
%249 = OpCompositeConstruct %v2int %TILE_SIZE %TILE_SIZE
%251 = OpBitcast %v2uint %248
%252 = OpBitcast %v2uint %249
%253 = OpIAdd %v2uint %251 %252
%254 = OpBitcast %v2int %253
%255 = OpConvertSToF %v2float %254
%256 = OpVectorTimesScalar %v2float %255 %float_2
%257 = OpAccessChain %_ptr_Uniform_v4float %23 %uint_0 %uint_4
%258 = OpLoad %v4float %257 None
%259 = OpVectorShuffle %v2float %258 %258 0 1
%260 = OpFDiv %v2float %256 %259
%261 = OpFSub %v2float %260 %245
OpStore %ceilCoord %261
%263 = OpLoad %float %viewNear None
%264 = OpFNegate %float %263
%265 = OpAccessChain %_ptr_Function_float %floorCoord %uint_0
%266 = OpLoad %float %265 None
%267 = OpFMul %float %264 %266
%268 = OpAccessChain %_ptr_Function_v4float %M %uint_2
%269 = OpAccessChain %_ptr_Function_float %268 %uint_0
%270 = OpLoad %float %269 None
%271 = OpLoad %float %viewNear None
%272 = OpFMul %float %270 %271
%273 = OpFSub %float %267 %272
%274 = OpAccessChain %_ptr_Function_v4float %M %uint_0
%275 = OpAccessChain %_ptr_Function_float %274 %uint_0
%276 = OpLoad %float %275 None
%277 = OpFDiv %float %273 %276
%278 = OpLoad %float %viewNear None
%279 = OpFNegate %float %278
%280 = OpAccessChain %_ptr_Function_float %floorCoord %uint_1
%281 = OpLoad %float %280 None
%282 = OpFMul %float %279 %281
%283 = OpAccessChain %_ptr_Function_v4float %M %uint_2
%284 = OpAccessChain %_ptr_Function_float %283 %uint_1
%285 = OpLoad %float %284 None
%286 = OpLoad %float %viewNear None
%287 = OpFMul %float %285 %286
%288 = OpFSub %float %282 %287
%289 = OpAccessChain %_ptr_Function_v4float %M %uint_1
%290 = OpAccessChain %_ptr_Function_float %289 %uint_1
%291 = OpLoad %float %290 None
%292 = OpFDiv %float %288 %291
%293 = OpCompositeConstruct %v2float %277 %292
OpStore %viewFloorCoord %293
%295 = OpLoad %float %viewNear None
%296 = OpFNegate %float %295
%297 = OpAccessChain %_ptr_Function_float %ceilCoord %uint_0
%298 = OpLoad %float %297 None
%299 = OpFMul %float %296 %298
%300 = OpAccessChain %_ptr_Function_v4float %M %uint_2
%301 = OpAccessChain %_ptr_Function_float %300 %uint_0
%302 = OpLoad %float %301 None
%303 = OpLoad %float %viewNear None
%304 = OpFMul %float %302 %303
%305 = OpFSub %float %299 %304
%306 = OpAccessChain %_ptr_Function_v4float %M %uint_0
%307 = OpAccessChain %_ptr_Function_float %306 %uint_0
%308 = OpLoad %float %307 None
%309 = OpFDiv %float %305 %308
%310 = OpLoad %float %viewNear None
%311 = OpFNegate %float %310
%312 = OpAccessChain %_ptr_Function_float %ceilCoord %uint_1
%313 = OpLoad %float %312 None
%314 = OpFMul %float %311 %313
%315 = OpAccessChain %_ptr_Function_v4float %M %uint_2
%316 = OpAccessChain %_ptr_Function_float %315 %uint_1
%317 = OpLoad %float %316 None
%318 = OpLoad %float %viewNear None
%319 = OpFMul %float %317 %318
%320 = OpFSub %float %314 %319
%321 = OpAccessChain %_ptr_Function_v4float %M %uint_1
%322 = OpAccessChain %_ptr_Function_float %321 %uint_1
%323 = OpLoad %float %322 None
%324 = OpFDiv %float %320 %323
%325 = OpCompositeConstruct %v2float %309 %324
OpStore %viewCeilCoord %325
%327 = OpAccessChain %_ptr_Function_v4float %frustumPlanes %uint_0
%328 = OpAccessChain %_ptr_Function_float %viewFloorCoord %uint_0
%329 = OpLoad %float %328 None
%330 = OpFNegate %float %329
%331 = OpLoad %float %viewNear None
%332 = OpFDiv %float %330 %331
%333 = OpCompositeConstruct %v4float %float_1 %float_0 %332 %float_0
OpStore %327 %333 None
%334 = OpAccessChain %_ptr_Function_v4float %frustumPlanes %uint_1
%335 = OpAccessChain %_ptr_Function_float %viewCeilCoord %uint_0
%336 = OpLoad %float %335 None
%337 = OpLoad %float %viewNear None
%338 = OpFDiv %float %336 %337
%339 = OpCompositeConstruct %v4float %float_n1 %float_0 %338 %float_0
OpStore %334 %339 None
%340 = OpAccessChain %_ptr_Function_v4float %frustumPlanes %uint_2
%341 = OpAccessChain %_ptr_Function_float %viewFloorCoord %uint_1
%342 = OpLoad %float %341 None
%343 = OpFNegate %float %342
%344 = OpLoad %float %viewNear None
%345 = OpFDiv %float %343 %344
%346 = OpCompositeConstruct %v4float %float_0 %float_1 %345 %float_0
OpStore %340 %346 None
%347 = OpAccessChain %_ptr_Function_v4float %frustumPlanes %uint_3
%348 = OpAccessChain %_ptr_Function_float %viewCeilCoord %uint_1
%349 = OpLoad %float %348 None
%350 = OpLoad %float %viewNear None
%351 = OpFDiv %float %349 %350
%352 = OpCompositeConstruct %v4float %float_0 %float_n1 %351 %float_0
OpStore %347 %352 None
OpStore %dp %float_0
OpBranch %354
%354 = OpLabel
OpStore %i %uint_0
OpBranch %357
%357 = OpLabel
OpLoopMerge %358 %356 None
OpBranch %355
%355 = OpLabel
%369 = OpLoad %uint %i None
%370 = OpULessThan %bool %369 %uint_6
OpSelectionMerge %371 None
OpBranchConditional %370 %371 %372
%372 = OpLabel
OpBranch %358
%371 = OpLabel
%375 = OpLoad %uint %i None
%376 = OpExtInst %uint %55 UMin %375 %uint_5
%377 = OpAccessChain %_ptr_Function_v4float %frustumPlanes %376
%378 = OpAccessChain %_ptr_Function_float %377 %uint_0
%379 = OpLoad %float %378 None
%380 = OpFOrdGreaterThan %bool %379 %float_0
OpSelectionMerge %381 None
OpBranchConditional %380 %382 %383
%382 = OpLabel
%456 = OpAccessChain %_ptr_Function_float %boxMax %uint_0
%457 = OpLoad %float %456 None
%458 = OpAccessChain %_ptr_Function_float %p %uint_0
OpStore %458 %457 None
OpBranch %381
%383 = OpLabel
%459 = OpAccessChain %_ptr_Function_float %boxMin %uint_0
%460 = OpLoad %float %459 None
%461 = OpAccessChain %_ptr_Function_float %p %uint_0
OpStore %461 %460 None
OpBranch %381
%381 = OpLabel
%384 = OpLoad %uint %i None
%385 = OpExtInst %uint %55 UMin %384 %uint_5
%386 = OpAccessChain %_ptr_Function_v4float %frustumPlanes %385
%387 = OpAccessChain %_ptr_Function_float %386 %uint_1
%388 = OpLoad %float %387 None
%389 = OpFOrdGreaterThan %bool %388 %float_0
OpSelectionMerge %390 None
OpBranchConditional %389 %391 %392
%391 = OpLabel
%462 = OpAccessChain %_ptr_Function_float %boxMax %uint_1
%463 = OpLoad %float %462 None
%464 = OpAccessChain %_ptr_Function_float %p %uint_1
OpStore %464 %463 None
OpBranch %390
%392 = OpLabel
%465 = OpAccessChain %_ptr_Function_float %boxMin %uint_1
%466 = OpLoad %float %465 None
%467 = OpAccessChain %_ptr_Function_float %p %uint_1
OpStore %467 %466 None
OpBranch %390
%390 = OpLabel
%393 = OpLoad %uint %i None
%394 = OpExtInst %uint %55 UMin %393 %uint_5
%395 = OpAccessChain %_ptr_Function_v4float %frustumPlanes %394
%396 = OpAccessChain %_ptr_Function_float %395 %uint_2
%397 = OpLoad %float %396 None
%398 = OpFOrdGreaterThan %bool %397 %float_0
OpSelectionMerge %399 None
OpBranchConditional %398 %400 %401
%400 = OpLabel
%468 = OpAccessChain %_ptr_Function_float %boxMax %uint_2
%469 = OpLoad %float %468 None
%470 = OpAccessChain %_ptr_Function_float %p %uint_2
OpStore %470 %469 None
OpBranch %399
%401 = OpLabel
%471 = OpAccessChain %_ptr_Function_float %boxMin %uint_2
%472 = OpLoad %float %471 None
%473 = OpAccessChain %_ptr_Function_float %p %uint_2
OpStore %473 %472 None
OpBranch %399
%399 = OpLabel
%402 = OpAccessChain %_ptr_Function_float %p %uint_3
OpStore %402 %float_1 None
%403 = OpLoad %float %dp None
%404 = OpLoad %v4float %p None
%405 = OpLoad %uint %i None
%406 = OpExtInst %uint %55 UMin %405 %uint_5
%407 = OpAccessChain %_ptr_Function_v4float %frustumPlanes %406
%408 = OpLoad %v4float %407 None
%409 = OpDot %float %404 %408
%410 = OpExtInst %float %55 NMin %float_0 %409
%411 = OpFAdd %float %403 %410
OpStore %dp %411 None
OpBranch %356
%356 = OpLabel
%412 = OpLoad %uint %i None
%413 = OpIAdd %uint %412 %uint_1
OpStore %i %413 None
OpBranch %357
%358 = OpLabel
%359 = OpLoad %float %dp None
%360 = OpFOrdGreaterThanEqual %bool %359 %float_0
OpSelectionMerge %361 None
OpBranchConditional %360 %362 %361
%362 = OpLabel
%414 = OpLoad %int %x None
%415 = OpLoad %int %y None
%416 = OpBitcast %uint %415
%417 = OpBitcast %uint %TILE_COUNT_X
%418 = OpIMul %uint %416 %417
%419 = OpBitcast %int %418
%420 = OpBitcast %uint %414
%421 = OpBitcast %uint %419
%422 = OpIAdd %uint %420 %421
%423 = OpBitcast %int %422
%424 = OpBitcast %uint %423
OpStore %tileId %424
%426 = OpLoad %uint %tileId None
%427 = OpULessThan %bool %426 %uint_0
OpSelectionMerge %428 None
OpBranchConditional %427 %429 %430
%429 = OpLabel
OpBranch %428
%430 = OpLabel
%474 = OpLoad %uint %tileId None
%475 = OpAccessChain %_ptr_Uniform_uint %19 %uint_0 %uint_1
%476 = OpLoad %uint %475 None
%433 = OpUGreaterThanEqual %bool %474 %476
OpBranch %428
%428 = OpLabel
%431 = OpPhi %bool %true %429 %433 %430
OpSelectionMerge %434 None
OpBranchConditional %431 %435 %434
%435 = OpLabel
OpBranch %207
%434 = OpLabel
%436 = OpLoad %uint %tileId None
%437 = OpExtInst %uint %55 UMin %436 %uint_3
%438 = OpAccessChain %_ptr_StorageBuffer_uint %9 %uint_0 %uint_0 %437 %uint_0
%440 = OpAtomicIAdd %uint %438 %uint_1 %uint_0 %uint_1
OpStore %offset %440
%442 = OpLoad %uint %offset None
%443 = OpAccessChain %_ptr_Uniform_uint %19 %uint_0 %uint_4
%444 = OpLoad %uint %443 None
%445 = OpUGreaterThanEqual %bool %442 %444
OpSelectionMerge %446 None
OpBranchConditional %445 %447 %446
%447 = OpLabel
OpBranch %207
%446 = OpLabel
%448 = OpLoad %uint %tileId None
%449 = OpLoad %uint %offset None
%450 = OpExtInst %uint %55 UMin %448 %uint_3
%451 = OpExtInst %uint %55 UMin %449 %uint_63
%453 = OpAccessChain %_ptr_StorageBuffer_uint_0 %9 %uint_0 %uint_0 %450 %uint_1 %451
%455 = OpCompositeExtract %uint %GlobalInvocationID 0
OpStore %453 %455 None
OpBranch %361
%361 = OpLabel
OpBranch %207
%207 = OpLabel
%363 = OpLoad %int %x None
%364 = OpBitcast %uint %363
%365 = OpBitcast %uint %int_1
%366 = OpIAdd %uint %364 %365
%367 = OpBitcast %int %366
OpStore %x %367 None
OpBranch %208
%209 = OpLabel
OpBranch %185
%185 = OpLabel
%210 = OpLoad %int %y None
%211 = OpBitcast %uint %210
%212 = OpBitcast %uint %int_1
%214 = OpIAdd %uint %211 %212
%215 = OpBitcast %int %214
OpStore %y %215 None
OpBranch %186
%187 = OpLabel
OpReturn
OpFunctionEnd
%main = OpFunction %void None %478
%479 = OpLabel
%480 = OpLoad %v3uint %main_global_invocation_id_Input None
%481 = OpFunctionCall %void %main_inner %480
OpReturn
OpFunctionEnd