1; SPIR-V
2; Version: 1.0
3; Generator: Google spiregg; 0
4; Bound: 180
5; Schema: 0
6               OpCapability Shader
7               OpCapability SampledBuffer
8               OpCapability ImageBuffer
9               OpExtension "SPV_GOOGLE_hlsl_functionality1"
10          %1 = OpExtInstImport "GLSL.std.450"
11               OpMemoryModel Logical GLSL450
12               OpEntryPoint Fragment %ShadowObjectCullPS "main" %in_var_TEXCOORD0 %gl_FragCoord %out_var_SV_Target0
13               OpExecutionMode %ShadowObjectCullPS OriginUpperLeft
14               OpSource HLSL 600
15               OpName %type_StructuredBuffer_v4float "type.StructuredBuffer.v4float"
16               OpName %CulledObjectBoxBounds "CulledObjectBoxBounds"
17               OpName %type__Globals "type.$Globals"
18               OpMemberName %type__Globals 0 "ShadowTileListGroupSize"
19               OpName %_Globals "$Globals"
20               OpName %type_buffer_image "type.buffer.image"
21               OpName %RWShadowTileNumCulledObjects "RWShadowTileNumCulledObjects"
22               OpName %in_var_TEXCOORD0 "in.var.TEXCOORD0"
23               OpName %out_var_SV_Target0 "out.var.SV_Target0"
24               OpName %ShadowObjectCullPS "ShadowObjectCullPS"
25               OpDecorateString %in_var_TEXCOORD0 UserSemantic "TEXCOORD0"
26               OpDecorate %in_var_TEXCOORD0 Flat
27               OpDecorate %gl_FragCoord BuiltIn FragCoord
28               OpDecorateString %gl_FragCoord UserSemantic "SV_POSITION"
29               OpDecorateString %out_var_SV_Target0 UserSemantic "SV_Target0"
30               OpDecorate %in_var_TEXCOORD0 Location 0
31               OpDecorate %out_var_SV_Target0 Location 0
32               OpDecorate %CulledObjectBoxBounds DescriptorSet 0
33               OpDecorate %CulledObjectBoxBounds Binding 1
34               OpDecorate %_Globals DescriptorSet 0
35               OpDecorate %_Globals Binding 2
36               OpDecorate %RWShadowTileNumCulledObjects DescriptorSet 0
37               OpDecorate %RWShadowTileNumCulledObjects Binding 0
38               OpDecorate %_runtimearr_v4float ArrayStride 16
39               OpMemberDecorate %type_StructuredBuffer_v4float 0 Offset 0
40               OpMemberDecorate %type_StructuredBuffer_v4float 0 NonWritable
41               OpDecorate %type_StructuredBuffer_v4float BufferBlock
42               OpMemberDecorate %type__Globals 0 Offset 0
43               OpDecorate %type__Globals Block
44      %float = OpTypeFloat 32
45    %v4float = OpTypeVector %float 4
46    %v3float = OpTypeVector %float 3
47    %v2float = OpTypeVector %float 2
48        %int = OpTypeInt 32 1
49       %uint = OpTypeInt 32 0
50     %uint_2 = OpConstant %uint 2
51     %uint_4 = OpConstant %uint 4
52    %float_0 = OpConstant %float 0
53         %22 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0
54      %int_1 = OpConstant %int 1
55      %int_0 = OpConstant %int 0
56     %uint_1 = OpConstant %uint 1
57    %float_2 = OpConstant %float 2
58         %27 = OpConstantComposite %v2float %float_2 %float_2
59    %float_1 = OpConstant %float 1
60         %29 = OpConstantComposite %v2float %float_1 %float_1
61%float_n1000 = OpConstant %float -1000
62      %int_2 = OpConstant %int 2
63  %float_0_5 = OpConstant %float 0.5
64         %33 = OpConstantComposite %v3float %float_0_5 %float_0_5 %float_0_5
65%float_500000 = OpConstant %float 500000
66         %35 = OpConstantComposite %v3float %float_500000 %float_500000 %float_500000
67%float_n500000 = OpConstant %float -500000
68         %37 = OpConstantComposite %v3float %float_n500000 %float_n500000 %float_n500000
69      %int_3 = OpConstant %int 3
70      %int_4 = OpConstant %int 4
71      %int_5 = OpConstant %int 5
72      %int_6 = OpConstant %int 6
73      %int_7 = OpConstant %int 7
74      %int_8 = OpConstant %int 8
75         %44 = OpConstantComposite %v3float %float_1 %float_1 %float_1
76   %float_n1 = OpConstant %float -1
77         %46 = OpConstantComposite %v3float %float_n1 %float_n1 %float_n1
78     %uint_5 = OpConstant %uint 5
79     %uint_0 = OpConstant %uint 0
80     %uint_3 = OpConstant %uint 3
81%_runtimearr_v4float = OpTypeRuntimeArray %v4float
82%type_StructuredBuffer_v4float = OpTypeStruct %_runtimearr_v4float
83%_ptr_Uniform_type_StructuredBuffer_v4float = OpTypePointer Uniform %type_StructuredBuffer_v4float
84     %v2uint = OpTypeVector %uint 2
85%type__Globals = OpTypeStruct %v2uint
86%_ptr_Uniform_type__Globals = OpTypePointer Uniform %type__Globals
87%type_buffer_image = OpTypeImage %uint Buffer 2 0 0 2 R32ui
88%_ptr_UniformConstant_type_buffer_image = OpTypePointer UniformConstant %type_buffer_image
89%_ptr_Input_uint = OpTypePointer Input %uint
90%_ptr_Input_v4float = OpTypePointer Input %v4float
91%_ptr_Output_v4float = OpTypePointer Output %v4float
92       %void = OpTypeVoid
93         %58 = OpTypeFunction %void
94%_ptr_Function_v3float = OpTypePointer Function %v3float
95     %uint_8 = OpConstant %uint 8
96%_arr_v3float_uint_8 = OpTypeArray %v3float %uint_8
97%_ptr_Function__arr_v3float_uint_8 = OpTypePointer Function %_arr_v3float_uint_8
98%_ptr_Uniform_v2uint = OpTypePointer Uniform %v2uint
99%_ptr_Uniform_uint = OpTypePointer Uniform %uint
100       %bool = OpTypeBool
101     %v2bool = OpTypeVector %bool 2
102     %v3bool = OpTypeVector %bool 3
103%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
104%_ptr_Image_uint = OpTypePointer Image %uint
105%CulledObjectBoxBounds = OpVariable %_ptr_Uniform_type_StructuredBuffer_v4float Uniform
106   %_Globals = OpVariable %_ptr_Uniform_type__Globals Uniform
107%RWShadowTileNumCulledObjects = OpVariable %_ptr_UniformConstant_type_buffer_image UniformConstant
108%in_var_TEXCOORD0 = OpVariable %_ptr_Input_uint Input
109%gl_FragCoord = OpVariable %_ptr_Input_v4float Input
110%out_var_SV_Target0 = OpVariable %_ptr_Output_v4float Output
111         %70 = OpUndef %v3float
112         %71 = OpConstantNull %v3float
113%ShadowObjectCullPS = OpFunction %void None %58
114         %72 = OpLabel
115         %73 = OpVariable %_ptr_Function__arr_v3float_uint_8 Function
116         %74 = OpLoad %uint %in_var_TEXCOORD0
117         %75 = OpLoad %v4float %gl_FragCoord
118         %76 = OpVectorShuffle %v2float %75 %75 0 1
119         %77 = OpConvertFToU %v2uint %76
120         %78 = OpCompositeExtract %uint %77 1
121         %79 = OpAccessChain %_ptr_Uniform_v2uint %_Globals %int_0
122         %80 = OpAccessChain %_ptr_Uniform_uint %_Globals %int_0 %int_0
123         %81 = OpLoad %uint %80
124         %82 = OpIMul %uint %78 %81
125         %83 = OpCompositeExtract %uint %77 0
126         %84 = OpIAdd %uint %82 %83
127         %85 = OpConvertUToF %float %83
128         %86 = OpAccessChain %_ptr_Uniform_uint %_Globals %int_0 %int_1
129         %87 = OpLoad %uint %86
130         %88 = OpISub %uint %87 %uint_1
131         %89 = OpISub %uint %88 %78
132         %90 = OpConvertUToF %float %89
133         %91 = OpCompositeConstruct %v2float %85 %90
134         %92 = OpLoad %v2uint %79
135         %93 = OpConvertUToF %v2float %92
136         %94 = OpFDiv %v2float %91 %93
137         %95 = OpFMul %v2float %94 %27
138         %96 = OpFSub %v2float %95 %29
139         %97 = OpFAdd %v2float %91 %29
140         %98 = OpFDiv %v2float %97 %93
141         %99 = OpFMul %v2float %98 %27
142        %100 = OpFSub %v2float %99 %29
143        %101 = OpVectorShuffle %v3float %70 %100 3 4 2
144        %102 = OpCompositeInsert %v3float %float_1 %101 2
145        %103 = OpIMul %uint %74 %uint_5
146        %104 = OpAccessChain %_ptr_Uniform_v4float %CulledObjectBoxBounds %int_0 %103
147        %105 = OpLoad %v4float %104
148        %106 = OpVectorShuffle %v3float %105 %105 0 1 2
149        %107 = OpIAdd %uint %103 %uint_1
150        %108 = OpAccessChain %_ptr_Uniform_v4float %CulledObjectBoxBounds %int_0 %107
151        %109 = OpLoad %v4float %108
152        %110 = OpVectorShuffle %v3float %109 %109 0 1 2
153        %111 = OpVectorShuffle %v2float %109 %71 0 1
154        %112 = OpVectorShuffle %v2float %96 %71 0 1
155        %113 = OpFOrdGreaterThan %v2bool %111 %112
156        %114 = OpAll %bool %113
157        %115 = OpFOrdLessThan %v3bool %106 %102
158        %116 = OpAll %bool %115
159        %117 = OpLogicalAnd %bool %114 %116
160               OpSelectionMerge %118 DontFlatten
161               OpBranchConditional %117 %119 %118
162        %119 = OpLabel
163        %120 = OpFAdd %v3float %106 %110
164        %121 = OpFMul %v3float %33 %120
165        %122 = OpCompositeExtract %float %96 0
166        %123 = OpCompositeExtract %float %96 1
167        %124 = OpCompositeConstruct %v3float %122 %123 %float_n1000
168        %125 = OpAccessChain %_ptr_Function_v3float %73 %int_0
169               OpStore %125 %124
170        %126 = OpCompositeExtract %float %100 0
171        %127 = OpCompositeConstruct %v3float %126 %123 %float_n1000
172        %128 = OpAccessChain %_ptr_Function_v3float %73 %int_1
173               OpStore %128 %127
174        %129 = OpCompositeExtract %float %100 1
175        %130 = OpCompositeConstruct %v3float %122 %129 %float_n1000
176        %131 = OpAccessChain %_ptr_Function_v3float %73 %int_2
177               OpStore %131 %130
178        %132 = OpCompositeConstruct %v3float %126 %129 %float_n1000
179        %133 = OpAccessChain %_ptr_Function_v3float %73 %int_3
180               OpStore %133 %132
181        %134 = OpCompositeConstruct %v3float %122 %123 %float_1
182        %135 = OpAccessChain %_ptr_Function_v3float %73 %int_4
183               OpStore %135 %134
184        %136 = OpCompositeConstruct %v3float %126 %123 %float_1
185        %137 = OpAccessChain %_ptr_Function_v3float %73 %int_5
186               OpStore %137 %136
187        %138 = OpCompositeConstruct %v3float %122 %129 %float_1
188        %139 = OpAccessChain %_ptr_Function_v3float %73 %int_6
189               OpStore %139 %138
190        %140 = OpCompositeConstruct %v3float %126 %129 %float_1
191        %141 = OpAccessChain %_ptr_Function_v3float %73 %int_7
192               OpStore %141 %140
193        %142 = OpIAdd %uint %103 %uint_2
194        %143 = OpAccessChain %_ptr_Uniform_v4float %CulledObjectBoxBounds %int_0 %142
195        %144 = OpLoad %v4float %143
196        %145 = OpVectorShuffle %v3float %144 %144 0 1 2
197        %146 = OpIAdd %uint %103 %uint_3
198        %147 = OpAccessChain %_ptr_Uniform_v4float %CulledObjectBoxBounds %int_0 %146
199        %148 = OpLoad %v4float %147
200        %149 = OpVectorShuffle %v3float %148 %148 0 1 2
201        %150 = OpIAdd %uint %103 %uint_4
202        %151 = OpAccessChain %_ptr_Uniform_v4float %CulledObjectBoxBounds %int_0 %150
203        %152 = OpLoad %v4float %151
204        %153 = OpVectorShuffle %v3float %152 %152 0 1 2
205               OpBranch %154
206        %154 = OpLabel
207        %155 = OpPhi %v3float %37 %119 %156 %157
208        %158 = OpPhi %v3float %35 %119 %159 %157
209        %160 = OpPhi %int %int_0 %119 %161 %157
210        %162 = OpSLessThan %bool %160 %int_8
211               OpLoopMerge %163 %157 Unroll
212               OpBranchConditional %162 %157 %163
213        %157 = OpLabel
214        %164 = OpAccessChain %_ptr_Function_v3float %73 %160
215        %165 = OpLoad %v3float %164
216        %166 = OpFSub %v3float %165 %121
217        %167 = OpDot %float %166 %145
218        %168 = OpDot %float %166 %149
219        %169 = OpDot %float %166 %153
220        %170 = OpCompositeConstruct %v3float %167 %168 %169
221        %159 = OpExtInst %v3float %1 FMin %158 %170
222        %156 = OpExtInst %v3float %1 FMax %155 %170
223        %161 = OpIAdd %int %160 %int_1
224               OpBranch %154
225        %163 = OpLabel
226        %171 = OpFOrdLessThan %v3bool %158 %44
227        %172 = OpAll %bool %171
228        %173 = OpFOrdGreaterThan %v3bool %155 %46
229        %174 = OpAll %bool %173
230        %175 = OpLogicalAnd %bool %172 %174
231               OpSelectionMerge %176 DontFlatten
232               OpBranchConditional %175 %177 %176
233        %177 = OpLabel
234        %178 = OpImageTexelPointer %_ptr_Image_uint %RWShadowTileNumCulledObjects %84 %uint_0
235        %179 = OpAtomicIAdd %uint %178 %uint_1 %uint_0 %uint_1
236               OpBranch %176
237        %176 = OpLabel
238               OpBranch %118
239        %118 = OpLabel
240               OpStore %out_var_SV_Target0 %22
241               OpReturn
242               OpFunctionEnd
243