David Neto dffa60ca98 spir-writer: handle break continuing block
The continuing block can exit the loop in very constrained ways:

When a break statement is placed such that it would exit from a loop’s
§ 7.3.8 Continuing Statement, then:

   - The break statement must appear as either:
     - The only statement in the if clause of an if statement that has:
       - no else clause or an empty else clause
       - no elseif clauses
     - The only statement in the else clause of an if statement that has an
       empty if clause and no elseif clauses.
   - That if statement must appear last in the continuing clause.

By design, this allows a lossless round-trip from SPIR-V to WGSL and
back to SPIR-V.  But that requires this special case construct in WGSL
to be translated to an OpBranchConditional with one target being
the loop's megre block (which is where 'break' branches to), and the
other targets the loop header (which is the loop backedge).  That
OpBranchConditional takes the place of the normal case of an
unconditional backedge.

Avoids errors like this:
 continue construct with the continue target X is not
 post dominated by the back-edge block Y

Fixed: 1034
Change-Id: If472a179380b8d77af746a3cd8e279c8a5e56b37
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/59800
Auto-Submit: David Neto <dneto@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: David Neto <dneto@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
2021-07-27 15:12:27 +00:00

771 lines
32 KiB
Plaintext

; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 509
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main" %tint_symbol %tint_symbol_2
OpExecutionMode %main OriginUpperLeft
OpName %gl_FragCoord "gl_FragCoord"
OpName %buf0 "buf0"
OpMemberName %buf0 0 "resolution"
OpName %x_7 "x_7"
OpName %map "map"
OpName %x_GLF_color "x_GLF_color"
OpName %tint_symbol "tint_symbol"
OpName %tint_symbol_2 "tint_symbol_2"
OpName %main_1 "main_1"
OpName %pos "pos"
OpName %ipos "ipos"
OpName %i "i"
OpName %p "p"
OpName %canwalk "canwalk"
OpName %v "v"
OpName %directions "directions"
OpName %j "j"
OpName %d "d"
OpName %x_104 "x_104"
OpName %x_124 "x_124"
OpName %x_144 "x_144"
OpName %x_164 "x_164"
OpName %x_105_phi "x_105_phi"
OpName %x_125_phi "x_125_phi"
OpName %x_145_phi "x_145_phi"
OpName %x_165_phi "x_165_phi"
OpName %x_229 "x_229"
OpName %x_242 "x_242"
OpName %x_281 "x_281"
OpName %x_295 "x_295"
OpName %x_335 "x_335"
OpName %x_348 "x_348"
OpName %x_387 "x_387"
OpName %x_400 "x_400"
OpName %x_230_phi "x_230_phi"
OpName %x_243_phi "x_243_phi"
OpName %x_282_phi "x_282_phi"
OpName %x_296_phi "x_296_phi"
OpName %x_336_phi "x_336_phi"
OpName %x_349_phi "x_349_phi"
OpName %x_388_phi "x_388_phi"
OpName %x_401_phi "x_401_phi"
OpName %main_out "main_out"
OpMemberName %main_out 0 "x_GLF_color_1"
OpName %tint_symbol_3 "tint_symbol_3"
OpName %tint_symbol_1 "tint_symbol_1"
OpName %main "main"
OpDecorate %buf0 Block
OpMemberDecorate %buf0 0 Offset 0
OpDecorate %x_7 NonWritable
OpDecorate %x_7 DescriptorSet 0
OpDecorate %x_7 Binding 0
OpDecorate %_arr_int_uint_256 ArrayStride 4
OpDecorate %tint_symbol BuiltIn FragCoord
OpDecorate %tint_symbol_2 Location 0
OpMemberDecorate %main_out 0 Offset 0
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Private_v4float = OpTypePointer Private %v4float
%5 = OpConstantNull %v4float
%gl_FragCoord = OpVariable %_ptr_Private_v4float Private %5
%v2float = OpTypeVector %float 2
%buf0 = OpTypeStruct %v2float
%_ptr_Uniform_buf0 = OpTypePointer Uniform %buf0
%x_7 = OpVariable %_ptr_Uniform_buf0 Uniform
%int = OpTypeInt 32 1
%uint = OpTypeInt 32 0
%uint_256 = OpConstant %uint 256
%_arr_int_uint_256 = OpTypeArray %int %uint_256
%_ptr_Private__arr_int_uint_256 = OpTypePointer Private %_arr_int_uint_256
%16 = OpConstantNull %_arr_int_uint_256
%map = OpVariable %_ptr_Private__arr_int_uint_256 Private %16
%x_GLF_color = OpVariable %_ptr_Private_v4float Private %5
%_ptr_Input_v4float = OpTypePointer Input %v4float
%tint_symbol = OpVariable %_ptr_Input_v4float Input
%_ptr_Output_v4float = OpTypePointer Output %v4float
%tint_symbol_2 = OpVariable %_ptr_Output_v4float Output %5
%void = OpTypeVoid
%22 = OpTypeFunction %void
%_ptr_Function_v2float = OpTypePointer Function %v2float
%28 = OpConstantNull %v2float
%v2int = OpTypeVector %int 2
%_ptr_Function_v2int = OpTypePointer Function %v2int
%32 = OpConstantNull %v2int
%_ptr_Function_int = OpTypePointer Function %int
%35 = OpConstantNull %int
%bool = OpTypeBool
%_ptr_Function_bool = OpTypePointer Function %bool
%40 = OpConstantNull %bool
%uint_0 = OpConstant %uint 0
%_ptr_Uniform_v2float = OpTypePointer Uniform %v2float
%_ptr_Function_float = OpTypePointer Function %float
%uint_1 = OpConstant %uint 1
%float_16 = OpConstant %float 16
%int_0 = OpConstant %int 0
%int_256 = OpConstant %int 256
%_ptr_Private_int = OpTypePointer Private %int
%int_1 = OpConstant %int 1
%83 = OpConstantComposite %v2int %int_0 %int_0
%true = OpConstantTrue %bool
%int_2 = OpConstant %int 2
%int_16 = OpConstant %int 16
%int_14 = OpConstant %int 14
%false = OpConstantFalse %bool
%int_8 = OpConstant %int 8
%331 = OpConstantComposite %_arr_int_uint_256 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0
%float_1 = OpConstant %float 1
%492 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
%float_0 = OpConstant %float 0
%495 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_1
%main_out = OpTypeStruct %v4float
%496 = OpTypeFunction %void %main_out
%main_1 = OpFunction %void None %22
%25 = OpLabel
%pos = OpVariable %_ptr_Function_v2float Function %28
%ipos = OpVariable %_ptr_Function_v2int Function %32
%i = OpVariable %_ptr_Function_int Function %35
%p = OpVariable %_ptr_Function_v2int Function %32
%canwalk = OpVariable %_ptr_Function_bool Function %40
%v = OpVariable %_ptr_Function_int Function %35
%directions = OpVariable %_ptr_Function_int Function %35
%j = OpVariable %_ptr_Function_int Function %35
%d = OpVariable %_ptr_Function_int Function %35
%x_104 = OpVariable %_ptr_Function_bool Function %40
%x_124 = OpVariable %_ptr_Function_bool Function %40
%x_144 = OpVariable %_ptr_Function_bool Function %40
%x_164 = OpVariable %_ptr_Function_bool Function %40
%x_105_phi = OpVariable %_ptr_Function_bool Function %40
%x_125_phi = OpVariable %_ptr_Function_bool Function %40
%x_145_phi = OpVariable %_ptr_Function_bool Function %40
%x_165_phi = OpVariable %_ptr_Function_bool Function %40
%x_229 = OpVariable %_ptr_Function_bool Function %40
%x_242 = OpVariable %_ptr_Function_bool Function %40
%x_281 = OpVariable %_ptr_Function_bool Function %40
%x_295 = OpVariable %_ptr_Function_bool Function %40
%x_335 = OpVariable %_ptr_Function_bool Function %40
%x_348 = OpVariable %_ptr_Function_bool Function %40
%x_387 = OpVariable %_ptr_Function_bool Function %40
%x_400 = OpVariable %_ptr_Function_bool Function %40
%x_230_phi = OpVariable %_ptr_Function_bool Function %40
%x_243_phi = OpVariable %_ptr_Function_bool Function %40
%x_282_phi = OpVariable %_ptr_Function_bool Function %40
%x_296_phi = OpVariable %_ptr_Function_bool Function %40
%x_336_phi = OpVariable %_ptr_Function_bool Function %40
%x_349_phi = OpVariable %_ptr_Function_bool Function %40
%x_388_phi = OpVariable %_ptr_Function_bool Function %40
%x_401_phi = OpVariable %_ptr_Function_bool Function %40
%45 = OpLoad %v4float %gl_FragCoord
%48 = OpAccessChain %_ptr_Uniform_v2float %x_7 %uint_0
%49 = OpLoad %v2float %48
%50 = OpCompositeExtract %float %45 0
%51 = OpCompositeExtract %float %45 1
%52 = OpCompositeConstruct %v2float %50 %51
%53 = OpFDiv %v2float %52 %49
OpStore %pos %53
%55 = OpAccessChain %_ptr_Function_float %pos %uint_0
%56 = OpLoad %float %55
%58 = OpAccessChain %_ptr_Function_float %pos %uint_1
%59 = OpLoad %float %58
%62 = OpFMul %float %56 %float_16
%60 = OpConvertFToS %int %62
%64 = OpFMul %float %59 %float_16
%63 = OpConvertFToS %int %64
%65 = OpCompositeConstruct %v2int %60 %63
OpStore %ipos %65
OpStore %i %int_0
OpBranch %67
%67 = OpLabel
OpLoopMerge %68 %69 None
OpBranch %70
%70 = OpLabel
%71 = OpLoad %int %i
%73 = OpSLessThan %bool %71 %int_256
OpSelectionMerge %74 None
OpBranchConditional %73 %75 %76
%75 = OpLabel
OpBranch %74
%76 = OpLabel
OpBranch %68
%74 = OpLabel
%77 = OpLoad %int %i
%79 = OpAccessChain %_ptr_Private_int %map %77
OpStore %79 %int_0
OpBranch %69
%69 = OpLabel
%80 = OpLoad %int %i
%82 = OpIAdd %int %80 %int_1
OpStore %i %82
OpBranch %67
%68 = OpLabel
OpStore %p %83
OpStore %canwalk %true
OpStore %v %int_0
OpBranch %85
%85 = OpLabel
OpLoopMerge %86 %87 None
OpBranch %88
%88 = OpLabel
%97 = OpLoad %int %v
%98 = OpIAdd %int %97 %int_1
OpStore %v %98
OpStore %directions %int_0
%99 = OpAccessChain %_ptr_Function_int %p %uint_0
%100 = OpLoad %int %99
%101 = OpSGreaterThan %bool %100 %int_0
OpStore %x_105_phi %101
OpSelectionMerge %102 None
OpBranchConditional %101 %103 %102
%103 = OpLabel
%104 = OpAccessChain %_ptr_Function_int %p %uint_0
%105 = OpLoad %int %104
%106 = OpAccessChain %_ptr_Function_int %p %uint_1
%107 = OpLoad %int %106
%109 = OpISub %int %105 %int_2
%111 = OpIMul %int %107 %int_16
%112 = OpIAdd %int %109 %111
%113 = OpAccessChain %_ptr_Private_int %map %112
%114 = OpLoad %int %113
%115 = OpIEqual %bool %114 %int_0
OpStore %x_104 %115
%116 = OpLoad %bool %x_104
OpStore %x_105_phi %116
OpBranch %102
%102 = OpLabel
%117 = OpLoad %bool %x_105_phi
OpSelectionMerge %118 None
OpBranchConditional %117 %119 %118
%119 = OpLabel
%120 = OpLoad %int %directions
%121 = OpIAdd %int %120 %int_1
OpStore %directions %121
OpBranch %118
%118 = OpLabel
%122 = OpAccessChain %_ptr_Function_int %p %uint_1
%123 = OpLoad %int %122
%124 = OpSGreaterThan %bool %123 %int_0
OpStore %x_125_phi %124
OpSelectionMerge %125 None
OpBranchConditional %124 %126 %125
%126 = OpLabel
%127 = OpAccessChain %_ptr_Function_int %p %uint_0
%128 = OpLoad %int %127
%129 = OpAccessChain %_ptr_Function_int %p %uint_1
%130 = OpLoad %int %129
%131 = OpISub %int %130 %int_2
%132 = OpIMul %int %131 %int_16
%133 = OpIAdd %int %128 %132
%134 = OpAccessChain %_ptr_Private_int %map %133
%135 = OpLoad %int %134
%136 = OpIEqual %bool %135 %int_0
OpStore %x_124 %136
%137 = OpLoad %bool %x_124
OpStore %x_125_phi %137
OpBranch %125
%125 = OpLabel
%138 = OpLoad %bool %x_125_phi
OpSelectionMerge %139 None
OpBranchConditional %138 %140 %139
%140 = OpLabel
%141 = OpLoad %int %directions
%142 = OpIAdd %int %141 %int_1
OpStore %directions %142
OpBranch %139
%139 = OpLabel
%143 = OpAccessChain %_ptr_Function_int %p %uint_0
%144 = OpLoad %int %143
%146 = OpSLessThan %bool %144 %int_14
OpStore %x_145_phi %146
OpSelectionMerge %147 None
OpBranchConditional %146 %148 %147
%148 = OpLabel
%149 = OpAccessChain %_ptr_Function_int %p %uint_0
%150 = OpLoad %int %149
%151 = OpAccessChain %_ptr_Function_int %p %uint_1
%152 = OpLoad %int %151
%153 = OpIAdd %int %150 %int_2
%154 = OpIMul %int %152 %int_16
%155 = OpIAdd %int %153 %154
%156 = OpAccessChain %_ptr_Private_int %map %155
%157 = OpLoad %int %156
%158 = OpIEqual %bool %157 %int_0
OpStore %x_144 %158
%159 = OpLoad %bool %x_144
OpStore %x_145_phi %159
OpBranch %147
%147 = OpLabel
%160 = OpLoad %bool %x_145_phi
OpSelectionMerge %161 None
OpBranchConditional %160 %162 %161
%162 = OpLabel
%163 = OpLoad %int %directions
%164 = OpIAdd %int %163 %int_1
OpStore %directions %164
OpBranch %161
%161 = OpLabel
%165 = OpAccessChain %_ptr_Function_int %p %uint_1
%166 = OpLoad %int %165
%167 = OpSLessThan %bool %166 %int_14
OpStore %x_165_phi %167
OpSelectionMerge %168 None
OpBranchConditional %167 %169 %168
%169 = OpLabel
%170 = OpAccessChain %_ptr_Function_int %p %uint_0
%171 = OpLoad %int %170
%172 = OpAccessChain %_ptr_Function_int %p %uint_1
%173 = OpLoad %int %172
%174 = OpIAdd %int %173 %int_2
%175 = OpIMul %int %174 %int_16
%176 = OpIAdd %int %171 %175
%177 = OpAccessChain %_ptr_Private_int %map %176
%178 = OpLoad %int %177
%179 = OpIEqual %bool %178 %int_0
OpStore %x_164 %179
%180 = OpLoad %bool %x_164
OpStore %x_165_phi %180
OpBranch %168
%168 = OpLabel
%181 = OpLoad %bool %x_165_phi
OpSelectionMerge %182 None
OpBranchConditional %181 %183 %182
%183 = OpLabel
%184 = OpLoad %int %directions
%185 = OpIAdd %int %184 %int_1
OpStore %directions %185
OpBranch %182
%182 = OpLabel
%202 = OpLoad %int %directions
%203 = OpIEqual %bool %202 %int_0
OpSelectionMerge %204 None
OpBranchConditional %203 %205 %206
%205 = OpLabel
OpStore %canwalk %false
OpStore %i %int_0
OpBranch %208
%208 = OpLabel
OpLoopMerge %209 %210 None
OpBranch %211
%211 = OpLabel
%212 = OpLoad %int %i
%214 = OpSLessThan %bool %212 %int_8
OpSelectionMerge %215 None
OpBranchConditional %214 %216 %217
%216 = OpLabel
OpBranch %215
%217 = OpLabel
OpBranch %209
%215 = OpLabel
OpStore %j %int_0
OpBranch %218
%218 = OpLabel
OpLoopMerge %219 %220 None
OpBranch %221
%221 = OpLabel
%222 = OpLoad %int %j
%223 = OpSLessThan %bool %222 %int_8
OpSelectionMerge %224 None
OpBranchConditional %223 %225 %226
%225 = OpLabel
OpBranch %224
%226 = OpLabel
OpBranch %219
%224 = OpLabel
%227 = OpLoad %int %j
%228 = OpLoad %int %i
%229 = OpIMul %int %227 %int_2
%230 = OpIMul %int %228 %int_2
%231 = OpIMul %int %230 %int_16
%232 = OpIAdd %int %229 %231
%233 = OpAccessChain %_ptr_Private_int %map %232
%234 = OpLoad %int %233
%235 = OpIEqual %bool %234 %int_0
OpSelectionMerge %236 None
OpBranchConditional %235 %237 %236
%237 = OpLabel
%238 = OpLoad %int %j
%239 = OpAccessChain %_ptr_Function_int %p %uint_0
%240 = OpIMul %int %238 %int_2
OpStore %239 %240
%241 = OpLoad %int %i
%242 = OpAccessChain %_ptr_Function_int %p %uint_1
%243 = OpIMul %int %241 %int_2
OpStore %242 %243
OpStore %canwalk %true
OpBranch %236
%236 = OpLabel
OpBranch %220
%220 = OpLabel
%244 = OpLoad %int %j
%245 = OpIAdd %int %244 %int_1
OpStore %j %245
OpBranch %218
%219 = OpLabel
OpBranch %210
%210 = OpLabel
%246 = OpLoad %int %i
%247 = OpIAdd %int %246 %int_1
OpStore %i %247
OpBranch %208
%209 = OpLabel
%248 = OpAccessChain %_ptr_Function_int %p %uint_0
%249 = OpLoad %int %248
%250 = OpAccessChain %_ptr_Function_int %p %uint_1
%251 = OpLoad %int %250
%252 = OpIMul %int %251 %int_16
%253 = OpIAdd %int %249 %252
%254 = OpAccessChain %_ptr_Private_int %map %253
OpStore %254 %int_1
OpBranch %204
%206 = OpLabel
%255 = OpLoad %int %v
%256 = OpLoad %int %directions
%257 = OpSMod %int %255 %256
OpStore %d %257
%258 = OpLoad %int %directions
%259 = OpLoad %int %v
%260 = OpIAdd %int %259 %258
OpStore %v %260
%261 = OpLoad %int %d
%262 = OpSGreaterThanEqual %bool %261 %int_0
OpStore %x_230_phi %262
OpSelectionMerge %263 None
OpBranchConditional %262 %264 %263
%264 = OpLabel
%265 = OpAccessChain %_ptr_Function_int %p %uint_0
%266 = OpLoad %int %265
%267 = OpSGreaterThan %bool %266 %int_0
OpStore %x_229 %267
%268 = OpLoad %bool %x_229
OpStore %x_230_phi %268
OpBranch %263
%263 = OpLabel
%269 = OpLoad %bool %x_230_phi
OpStore %x_243_phi %269
OpSelectionMerge %270 None
OpBranchConditional %269 %271 %270
%271 = OpLabel
%272 = OpAccessChain %_ptr_Function_int %p %uint_0
%273 = OpLoad %int %272
%274 = OpAccessChain %_ptr_Function_int %p %uint_1
%275 = OpLoad %int %274
%276 = OpISub %int %273 %int_2
%277 = OpIMul %int %275 %int_16
%278 = OpIAdd %int %276 %277
%279 = OpAccessChain %_ptr_Private_int %map %278
%280 = OpLoad %int %279
%281 = OpIEqual %bool %280 %int_0
OpStore %x_242 %281
%282 = OpLoad %bool %x_242
OpStore %x_243_phi %282
OpBranch %270
%270 = OpLabel
%283 = OpLoad %bool %x_243_phi
OpSelectionMerge %284 None
OpBranchConditional %283 %285 %284
%285 = OpLabel
%286 = OpLoad %int %d
%287 = OpISub %int %286 %int_1
OpStore %d %287
%288 = OpAccessChain %_ptr_Function_int %p %uint_0
%289 = OpLoad %int %288
%290 = OpAccessChain %_ptr_Function_int %p %uint_1
%291 = OpLoad %int %290
%292 = OpIMul %int %291 %int_16
%293 = OpIAdd %int %289 %292
%294 = OpAccessChain %_ptr_Private_int %map %293
OpStore %294 %int_1
%295 = OpAccessChain %_ptr_Function_int %p %uint_0
%296 = OpLoad %int %295
%297 = OpAccessChain %_ptr_Function_int %p %uint_1
%298 = OpLoad %int %297
%299 = OpISub %int %296 %int_1
%300 = OpIMul %int %298 %int_16
%301 = OpIAdd %int %299 %300
%302 = OpAccessChain %_ptr_Private_int %map %301
OpStore %302 %int_1
%303 = OpAccessChain %_ptr_Function_int %p %uint_0
%304 = OpLoad %int %303
%305 = OpAccessChain %_ptr_Function_int %p %uint_1
%306 = OpLoad %int %305
%307 = OpISub %int %304 %int_2
%308 = OpIMul %int %306 %int_16
%309 = OpIAdd %int %307 %308
%310 = OpAccessChain %_ptr_Private_int %map %309
OpStore %310 %int_1
%311 = OpAccessChain %_ptr_Function_int %p %uint_0
%312 = OpLoad %int %311
%313 = OpAccessChain %_ptr_Function_int %p %uint_0
%314 = OpISub %int %312 %int_2
OpStore %313 %314
OpBranch %284
%284 = OpLabel
%315 = OpLoad %int %d
%316 = OpSGreaterThanEqual %bool %315 %int_0
OpStore %x_282_phi %316
OpSelectionMerge %317 None
OpBranchConditional %316 %318 %317
%318 = OpLabel
%319 = OpAccessChain %_ptr_Function_int %p %uint_1
%320 = OpLoad %int %319
%321 = OpSGreaterThan %bool %320 %int_0
OpStore %x_281 %321
%322 = OpLoad %bool %x_281
OpStore %x_282_phi %322
OpBranch %317
%317 = OpLabel
%323 = OpLoad %bool %x_282_phi
OpStore %x_296_phi %323
OpSelectionMerge %324 None
OpBranchConditional %323 %325 %324
%325 = OpLabel
%326 = OpAccessChain %_ptr_Function_int %p %uint_0
%327 = OpLoad %int %326
%328 = OpAccessChain %_ptr_Function_int %p %uint_1
%329 = OpLoad %int %328
%330 = OpLoad %_arr_int_uint_256 %map
OpStore %map %331
OpStore %map %330
%332 = OpISub %int %329 %int_2
%333 = OpIMul %int %332 %int_16
%334 = OpIAdd %int %327 %333
%335 = OpAccessChain %_ptr_Private_int %map %334
%336 = OpLoad %int %335
%337 = OpIEqual %bool %336 %int_0
OpStore %x_295 %337
%338 = OpLoad %bool %x_295
OpStore %x_296_phi %338
OpBranch %324
%324 = OpLabel
%339 = OpLoad %bool %x_296_phi
OpSelectionMerge %340 None
OpBranchConditional %339 %341 %340
%341 = OpLabel
%342 = OpLoad %int %d
%343 = OpISub %int %342 %int_1
OpStore %d %343
%344 = OpAccessChain %_ptr_Function_int %p %uint_0
%345 = OpLoad %int %344
%346 = OpAccessChain %_ptr_Function_int %p %uint_1
%347 = OpLoad %int %346
%348 = OpIMul %int %347 %int_16
%349 = OpIAdd %int %345 %348
%350 = OpAccessChain %_ptr_Private_int %map %349
OpStore %350 %int_1
%351 = OpAccessChain %_ptr_Function_int %p %uint_0
%352 = OpLoad %int %351
%353 = OpAccessChain %_ptr_Function_int %p %uint_1
%354 = OpLoad %int %353
%355 = OpISub %int %354 %int_1
%356 = OpIMul %int %355 %int_16
%357 = OpIAdd %int %352 %356
%358 = OpAccessChain %_ptr_Private_int %map %357
OpStore %358 %int_1
%359 = OpAccessChain %_ptr_Function_int %p %uint_0
%360 = OpLoad %int %359
%361 = OpAccessChain %_ptr_Function_int %p %uint_1
%362 = OpLoad %int %361
%363 = OpLoad %_arr_int_uint_256 %map
OpStore %map %331
OpStore %map %363
%364 = OpISub %int %362 %int_2
%365 = OpIMul %int %364 %int_16
%366 = OpIAdd %int %360 %365
%367 = OpAccessChain %_ptr_Private_int %map %366
OpStore %367 %int_1
%368 = OpAccessChain %_ptr_Function_int %p %uint_1
%369 = OpLoad %int %368
%370 = OpAccessChain %_ptr_Function_int %p %uint_1
%371 = OpISub %int %369 %int_2
OpStore %370 %371
OpBranch %340
%340 = OpLabel
%372 = OpLoad %int %d
%373 = OpSGreaterThanEqual %bool %372 %int_0
OpStore %x_336_phi %373
OpSelectionMerge %374 None
OpBranchConditional %373 %375 %374
%375 = OpLabel
%376 = OpAccessChain %_ptr_Function_int %p %uint_0
%377 = OpLoad %int %376
%378 = OpSLessThan %bool %377 %int_14
OpStore %x_335 %378
%379 = OpLoad %bool %x_335
OpStore %x_336_phi %379
OpBranch %374
%374 = OpLabel
%380 = OpLoad %bool %x_336_phi
OpStore %x_349_phi %380
OpSelectionMerge %381 None
OpBranchConditional %380 %382 %381
%382 = OpLabel
%383 = OpAccessChain %_ptr_Function_int %p %uint_0
%384 = OpLoad %int %383
%385 = OpAccessChain %_ptr_Function_int %p %uint_1
%386 = OpLoad %int %385
%387 = OpIAdd %int %384 %int_2
%388 = OpIMul %int %386 %int_16
%389 = OpIAdd %int %387 %388
%390 = OpAccessChain %_ptr_Private_int %map %389
%391 = OpLoad %int %390
%392 = OpIEqual %bool %391 %int_0
OpStore %x_348 %392
%393 = OpLoad %bool %x_348
OpStore %x_349_phi %393
OpBranch %381
%381 = OpLabel
%394 = OpLoad %bool %x_349_phi
OpSelectionMerge %395 None
OpBranchConditional %394 %396 %395
%396 = OpLabel
%397 = OpLoad %int %d
%398 = OpISub %int %397 %int_1
OpStore %d %398
%399 = OpAccessChain %_ptr_Function_int %p %uint_0
%400 = OpLoad %int %399
%401 = OpAccessChain %_ptr_Function_int %p %uint_1
%402 = OpLoad %int %401
%403 = OpIMul %int %402 %int_16
%404 = OpIAdd %int %400 %403
%405 = OpAccessChain %_ptr_Private_int %map %404
OpStore %405 %int_1
%406 = OpAccessChain %_ptr_Function_int %p %uint_0
%407 = OpLoad %int %406
%408 = OpAccessChain %_ptr_Function_int %p %uint_1
%409 = OpLoad %int %408
%410 = OpIAdd %int %407 %int_1
%411 = OpIMul %int %409 %int_16
%412 = OpIAdd %int %410 %411
%413 = OpAccessChain %_ptr_Private_int %map %412
OpStore %413 %int_1
%414 = OpAccessChain %_ptr_Function_int %p %uint_0
%415 = OpLoad %int %414
%416 = OpAccessChain %_ptr_Function_int %p %uint_1
%417 = OpLoad %int %416
%418 = OpIAdd %int %415 %int_2
%419 = OpIMul %int %417 %int_16
%420 = OpIAdd %int %418 %419
%421 = OpAccessChain %_ptr_Private_int %map %420
OpStore %421 %int_1
%422 = OpAccessChain %_ptr_Function_int %p %uint_0
%423 = OpLoad %int %422
%424 = OpAccessChain %_ptr_Function_int %p %uint_0
%425 = OpIAdd %int %423 %int_2
OpStore %424 %425
OpBranch %395
%395 = OpLabel
%426 = OpLoad %int %d
%427 = OpSGreaterThanEqual %bool %426 %int_0
OpStore %x_388_phi %427
OpSelectionMerge %428 None
OpBranchConditional %427 %429 %428
%429 = OpLabel
%430 = OpAccessChain %_ptr_Function_int %p %uint_1
%431 = OpLoad %int %430
%432 = OpSLessThan %bool %431 %int_14
OpStore %x_387 %432
%433 = OpLoad %bool %x_387
OpStore %x_388_phi %433
OpBranch %428
%428 = OpLabel
%434 = OpLoad %bool %x_388_phi
OpStore %x_401_phi %434
OpSelectionMerge %435 None
OpBranchConditional %434 %436 %435
%436 = OpLabel
%437 = OpAccessChain %_ptr_Function_int %p %uint_0
%438 = OpLoad %int %437
%439 = OpAccessChain %_ptr_Function_int %p %uint_1
%440 = OpLoad %int %439
%441 = OpIAdd %int %440 %int_2
%442 = OpIMul %int %441 %int_16
%443 = OpIAdd %int %438 %442
%444 = OpAccessChain %_ptr_Private_int %map %443
%445 = OpLoad %int %444
%446 = OpIEqual %bool %445 %int_0
OpStore %x_400 %446
%447 = OpLoad %bool %x_400
OpStore %x_401_phi %447
OpBranch %435
%435 = OpLabel
%448 = OpLoad %bool %x_401_phi
OpSelectionMerge %449 None
OpBranchConditional %448 %450 %449
%450 = OpLabel
%451 = OpLoad %int %d
%452 = OpISub %int %451 %int_1
OpStore %d %452
%453 = OpAccessChain %_ptr_Function_int %p %uint_0
%454 = OpLoad %int %453
%455 = OpAccessChain %_ptr_Function_int %p %uint_1
%456 = OpLoad %int %455
%457 = OpIMul %int %456 %int_16
%458 = OpIAdd %int %454 %457
%459 = OpAccessChain %_ptr_Private_int %map %458
OpStore %459 %int_1
%460 = OpAccessChain %_ptr_Function_int %p %uint_0
%461 = OpLoad %int %460
%462 = OpAccessChain %_ptr_Function_int %p %uint_1
%463 = OpLoad %int %462
%464 = OpIAdd %int %463 %int_1
%465 = OpIMul %int %464 %int_16
%466 = OpIAdd %int %461 %465
%467 = OpAccessChain %_ptr_Private_int %map %466
OpStore %467 %int_1
%468 = OpAccessChain %_ptr_Function_int %p %uint_0
%469 = OpLoad %int %468
%470 = OpAccessChain %_ptr_Function_int %p %uint_1
%471 = OpLoad %int %470
%472 = OpIAdd %int %471 %int_2
%473 = OpIMul %int %472 %int_16
%474 = OpIAdd %int %469 %473
%475 = OpAccessChain %_ptr_Private_int %map %474
OpStore %475 %int_1
%476 = OpAccessChain %_ptr_Function_int %p %uint_1
%477 = OpLoad %int %476
%478 = OpAccessChain %_ptr_Function_int %p %uint_1
%479 = OpIAdd %int %477 %int_2
OpStore %478 %479
OpBranch %449
%449 = OpLabel
OpBranch %204
%204 = OpLabel
%480 = OpAccessChain %_ptr_Function_int %ipos %uint_1
%481 = OpLoad %int %480
%482 = OpAccessChain %_ptr_Function_int %ipos %uint_0
%483 = OpLoad %int %482
%484 = OpIMul %int %481 %int_16
%485 = OpIAdd %int %484 %483
%486 = OpAccessChain %_ptr_Private_int %map %485
%487 = OpLoad %int %486
%488 = OpIEqual %bool %487 %int_1
OpSelectionMerge %489 None
OpBranchConditional %488 %490 %489
%490 = OpLabel
OpStore %x_GLF_color %492
OpReturn
%489 = OpLabel
OpBranch %87
%87 = OpLabel
%493 = OpLoad %bool %canwalk
OpBranchConditional %493 %85 %86
%86 = OpLabel
OpStore %x_GLF_color %495
OpReturn
OpFunctionEnd
%tint_symbol_3 = OpFunction %void None %496
%tint_symbol_1 = OpFunctionParameter %main_out
%500 = OpLabel
%501 = OpCompositeExtract %v4float %tint_symbol_1 0
OpStore %tint_symbol_2 %501
OpReturn
OpFunctionEnd
%main = OpFunction %void None %22
%503 = OpLabel
%504 = OpLoad %v4float %tint_symbol
OpStore %gl_FragCoord %504
%505 = OpFunctionCall %void %main_1
%507 = OpLoad %v4float %x_GLF_color
%508 = OpCompositeConstruct %main_out %507
%506 = OpFunctionCall %void %tint_symbol_3 %508
OpReturn
OpFunctionEnd