blob: 4875de388384ddcb659bd53fde16b025b13959f4 [file] [log] [blame]
SKIP: FAILED
../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: buf0 = struct @align(8) {
injectionSwitch:vec2<f32> @offset(0)
}
buf1 = struct @align(8) {
resolution:vec2<f32> @offset(0)
}
main_out = struct @align(16) {
x_GLF_color_1:vec4<f32> @offset(0), @location(0)
}
$B1: { # root
%data:ptr<private, array<i32, 10>, read_write> = var
%temp:ptr<private, array<i32, 10>, read_write> = var
%x_28:ptr<uniform, buf0, read> = var @binding_point(0, 0)
%gl_FragCoord:ptr<private, vec4<f32>, read_write> = var
%x_GLF_color:ptr<private, vec4<f32>, read_write> = var
%x_32:ptr<uniform, buf1, read> = var @binding_point(0, 1)
%continue_execution:ptr<private, bool, read_write> = var, true
}
%merge_i1_i1_i1_ = func(%f:ptr<function, i32, read_write>, %mid:ptr<function, i32, read_write>, %to:ptr<function, i32, read_write>):void {
$B2: {
%k:ptr<function, i32, read_write> = var
%i:ptr<function, i32, read_write> = var
%j:ptr<function, i32, read_write> = var
%i_1:ptr<function, i32, read_write> = var
%16:i32 = load %f
%x_256:i32 = let %16
store %k, %x_256
%18:i32 = load %f
%x_257:i32 = let %18
store %i, %x_257
%20:i32 = load %mid
%x_258:i32 = let %20
%22:i32 = add %x_258, 1i
store %j, %22
loop [b: $B3, c: $B4] { # loop_1
$B3: { # body
%23:i32 = load %i
%x_264:i32 = let %23
%25:i32 = load %mid
%x_265:i32 = let %25
%27:i32 = load %j
%x_267:i32 = let %27
%29:i32 = load %to
%x_268:i32 = let %29
%31:bool = lte %x_264, %x_265
%32:bool = lte %x_267, %x_268
%33:bool = and %31, %32
if %33 [t: $B5, f: $B6] { # if_1
$B5: { # true
exit_if # if_1
}
$B6: { # false
exit_loop # loop_1
}
}
%34:i32 = load %i
%x_272:i32 = let %34
%36:ptr<private, i32, read_write> = access %data, %x_272
%37:i32 = load %36
%x_274:i32 = let %37
%39:i32 = load %j
%x_275:i32 = let %39
%41:ptr<private, i32, read_write> = access %data, %x_275
%42:i32 = load %41
%x_277:i32 = let %42
%44:bool = lt %x_274, %x_277
if %44 [t: $B7, f: $B8] { # if_2
$B7: { # true
%45:i32 = load %k
%x_282:i32 = let %45
%47:i32 = add %x_282, 1i
store %k, %47
%48:i32 = load %i
%x_284:i32 = let %48
%50:i32 = add %x_284, 1i
store %i, %50
%51:ptr<private, i32, read_write> = access %data, %x_284
%52:i32 = load %51
%x_287:i32 = let %52
%54:ptr<private, i32, read_write> = access %temp, %x_282
store %54, %x_287
exit_if # if_2
}
$B8: { # false
%55:i32 = load %k
%x_289:i32 = let %55
%57:i32 = add %x_289, 1i
store %k, %57
%58:i32 = load %j
%x_291:i32 = let %58
%60:i32 = add %x_291, 1i
store %j, %60
%61:ptr<private, i32, read_write> = access %data, %x_291
%62:i32 = load %61
%x_294:i32 = let %62
%64:ptr<private, i32, read_write> = access %temp, %x_289
store %64, %x_294
exit_if # if_2
}
}
continue # -> $B4
}
$B4: { # continuing
next_iteration # -> $B3
}
}
loop [b: $B9, c: $B10] { # loop_2
$B9: { # body
if true [t: $B11, f: $B12] { # if_3
$B11: { # true
exit_if # if_3
}
$B12: { # false
continue # -> $B10
}
}
%65:i32 = load %i
%x_301:i32 = let %65
%67:i32 = load %i
%x_303:i32 = let %67
%69:i32 = load %mid
%x_304:i32 = let %69
%71:bool = lt %x_301, 10i
%72:bool = lte %x_303, %x_304
%73:bool = and %71, %72
if %73 [t: $B13, f: $B14] { # if_4
$B13: { # true
exit_if # if_4
}
$B14: { # false
exit_loop # loop_2
}
}
%74:i32 = load %k
%x_309:i32 = let %74
%76:i32 = add %x_309, 1i
store %k, %76
%77:i32 = load %i
%x_311:i32 = let %77
%79:i32 = add %x_311, 1i
store %i, %79
%80:ptr<private, i32, read_write> = access %data, %x_311
%81:i32 = load %80
%x_314:i32 = let %81
%83:ptr<private, i32, read_write> = access %temp, %x_309
store %83, %x_314
continue # -> $B10
}
$B10: { # continuing
next_iteration # -> $B9
}
}
%84:i32 = load %f
%x_316:i32 = let %84
store %i_1, %x_316
loop [b: $B15, c: $B16] { # loop_3
$B15: { # body
%86:i32 = load %i_1
%x_321:i32 = let %86
%88:i32 = load %to
%x_322:i32 = let %88
%90:bool = lte %x_321, %x_322
if %90 [t: $B17, f: $B18] { # if_5
$B17: { # true
exit_if # if_5
}
$B18: { # false
exit_loop # loop_3
}
}
%91:i32 = load %i_1
%x_325:i32 = let %91
%93:i32 = load %i_1
%x_326:i32 = let %93
%95:ptr<private, i32, read_write> = access %temp, %x_326
%96:i32 = load %95
%x_328:i32 = let %96
%98:ptr<private, i32, read_write> = access %data, %x_325
store %98, %x_328
continue # -> $B16
}
$B16: { # continuing
%99:i32 = load %i_1
%x_330:i32 = let %99
%101:i32 = add %x_330, 1i
store %i_1, %101
next_iteration # -> $B15
}
}
ret
}
}
%mergeSort_ = func():void {
$B19: {
%low:ptr<function, i32, read_write> = var
%high:ptr<function, i32, read_write> = var
%m:ptr<function, i32, read_write> = var
%i_2:ptr<function, i32, read_write> = var
%f_1:ptr<function, i32, read_write> = var
%mid_1:ptr<function, i32, read_write> = var
%to_1:ptr<function, i32, read_write> = var
%param:ptr<function, i32, read_write> = var
%param_1:ptr<function, i32, read_write> = var
%param_2:ptr<function, i32, read_write> = var
store %low, 0i
store %high, 9i
store %m, 1i
loop [b: $B20, c: $B21] { # loop_4
$B20: { # body
%113:i32 = load %m
%x_337:i32 = let %113
%115:i32 = load %high
%x_338:i32 = let %115
%117:bool = lte %x_337, %x_338
if %117 [t: $B22, f: $B23] { # if_6
$B22: { # true
exit_if # if_6
}
$B23: { # false
exit_loop # loop_4
}
}
%118:i32 = load %low
%x_341:i32 = let %118
store %i_2, %x_341
loop [b: $B24, c: $B25] { # loop_5
$B24: { # body
%120:i32 = load %i_2
%x_346:i32 = let %120
%122:i32 = load %high
%x_347:i32 = let %122
%124:bool = lt %x_346, %x_347
if %124 [t: $B26, f: $B27] { # if_7
$B26: { # true
exit_if # if_7
}
$B27: { # false
exit_loop # loop_5
}
}
%125:i32 = load %i_2
%x_350:i32 = let %125
store %f_1, %x_350
%127:i32 = load %i_2
%x_351:i32 = let %127
%129:i32 = load %m
%x_352:i32 = let %129
%131:i32 = add %x_351, %x_352
%132:i32 = sub %131, 1i
store %mid_1, %132
%133:i32 = load %i_2
%x_355:i32 = let %133
%135:i32 = load %m
%x_356:i32 = let %135
%137:i32 = load %high
%x_360:i32 = let %137
%139:i32 = mul 2i, %x_356
%140:i32 = add %x_355, %139
%141:i32 = sub %140, 1i
%142:i32 = min %141, %x_360
store %to_1, %142
%143:i32 = load %f_1
%x_362:i32 = let %143
store %param, %x_362
%145:i32 = load %mid_1
%x_363:i32 = let %145
store %param_1, %x_363
%147:i32 = load %to_1
%x_364:i32 = let %147
store %param_2, %x_364
%149:void = call %merge_i1_i1_i1_, %param, %param_1, %param_2
continue # -> $B25
}
$B25: { # continuing
%150:i32 = load %m
%x_366:i32 = let %150
%152:i32 = load %i_2
%x_368:i32 = let %152
%154:i32 = mul 2i, %x_366
%155:i32 = add %x_368, %154
store %i_2, %155
next_iteration # -> $B24
}
}
continue # -> $B21
}
$B21: { # continuing
%156:i32 = load %m
%x_370:i32 = let %156
%158:i32 = mul 2i, %x_370
store %m, %158
next_iteration # -> $B20
}
}
ret
}
}
%main_1 = func():void {
$B28: {
%i_3:ptr<function, i32, read_write> = var
%j_1:ptr<function, i32, read_write> = var
%grey:ptr<function, f32, read_write> = var
%163:ptr<uniform, vec2<f32>, read> = access %x_28, 0u
%164:f32 = load_vector_element %163, 0u
%x_89:f32 = let %164
%166:i32 = call %tint_f32_to_i32, %x_89
store %i_3, %166
loop [b: $B29, c: $B30] { # loop_6
$B29: { # body
%168:i32 = load %i_3
%x_95:i32 = let %168
switch %x_95 [c: (9i, $B31), c: (8i, $B32), c: (7i, $B33), c: (6i, $B34), c: (5i, $B35), c: (4i, $B36), c: (3i, $B37), c: (2i, $B38), c: (1i, $B39), c: (0i, $B40), c: (default, $B41)] { # switch_1
$B31: { # case
%170:i32 = load %i_3
%x_125:i32 = let %170
%172:ptr<private, i32, read_write> = access %data, %x_125
store %172, -5i
exit_switch # switch_1
}
$B32: { # case
%173:i32 = load %i_3
%x_123:i32 = let %173
%175:ptr<private, i32, read_write> = access %data, %x_123
store %175, -4i
exit_switch # switch_1
}
$B33: { # case
%176:i32 = load %i_3
%x_121:i32 = let %176
%178:ptr<private, i32, read_write> = access %data, %x_121
store %178, -3i
exit_switch # switch_1
}
$B34: { # case
%179:i32 = load %i_3
%x_119:i32 = let %179
%181:ptr<private, i32, read_write> = access %data, %x_119
store %181, -2i
exit_switch # switch_1
}
$B35: { # case
%182:i32 = load %i_3
%x_117:i32 = let %182
%184:ptr<private, i32, read_write> = access %data, %x_117
store %184, -1i
exit_switch # switch_1
}
$B36: { # case
%185:i32 = load %i_3
%x_115:i32 = let %185
%187:ptr<private, i32, read_write> = access %data, %x_115
store %187, 0i
exit_switch # switch_1
}
$B37: { # case
%188:i32 = load %i_3
%x_113:i32 = let %188
%190:ptr<private, i32, read_write> = access %data, %x_113
store %190, 1i
exit_switch # switch_1
}
$B38: { # case
%191:i32 = load %i_3
%x_111:i32 = let %191
%193:ptr<private, i32, read_write> = access %data, %x_111
store %193, 2i
exit_switch # switch_1
}
$B39: { # case
%194:i32 = load %i_3
%x_109:i32 = let %194
%196:ptr<private, i32, read_write> = access %data, %x_109
store %196, 3i
exit_switch # switch_1
}
$B40: { # case
%197:i32 = load %i_3
%x_107:i32 = let %197
%199:ptr<private, i32, read_write> = access %data, %x_107
store %199, 4i
exit_switch # switch_1
}
$B41: { # case
exit_switch # switch_1
}
}
%200:i32 = load %i_3
%x_127:i32 = let %200
%202:i32 = add %x_127, 1i
store %i_3, %202
continue # -> $B30
}
$B30: { # continuing
%203:i32 = load %i_3
%x_129:i32 = let %203
%205:bool = lt %x_129, 10i
%206:bool = eq %205, false
break_if %206 # -> [t: exit_loop loop_6, f: $B29]
}
}
store %j_1, 0i
loop [b: $B42, c: $B43] { # loop_7
$B42: { # body
%207:i32 = load %j_1
%x_135:i32 = let %207
%209:bool = lt %x_135, 10i
if %209 [t: $B44, f: $B45] { # if_8
$B44: { # true
exit_if # if_8
}
$B45: { # false
exit_loop # loop_7
}
}
%210:i32 = load %j_1
%x_138:i32 = let %210
%212:i32 = load %j_1
%x_139:i32 = let %212
%214:ptr<private, i32, read_write> = access %data, %x_139
%215:i32 = load %214
%x_141:i32 = let %215
%217:ptr<private, i32, read_write> = access %temp, %x_138
store %217, %x_141
continue # -> $B43
}
$B43: { # continuing
%218:i32 = load %j_1
%x_143:i32 = let %218
%220:i32 = add %x_143, 1i
store %j_1, %220
next_iteration # -> $B42
}
}
%221:void = call %mergeSort_
%222:f32 = load_vector_element %gl_FragCoord, 1u
%x_147:f32 = let %222
%224:i32 = call %tint_f32_to_i32, %x_147
%225:bool = lt %224, 30i
if %225 [t: $B46, f: $B47] { # if_9
$B46: { # true
%226:ptr<private, i32, read_write> = access %data, 0i
%227:i32 = load %226
%x_154:i32 = let %227
%229:f32 = convert %x_154
%230:f32 = div %229, 10.0f
%231:f32 = add 0.5f, %230
store %grey, %231
exit_if # if_9
}
$B47: { # false
%232:f32 = load_vector_element %gl_FragCoord, 1u
%x_159:f32 = let %232
%234:i32 = call %tint_f32_to_i32, %x_159
%235:bool = lt %234, 60i
if %235 [t: $B48, f: $B49] { # if_10
$B48: { # true
%236:ptr<private, i32, read_write> = access %data, 1i
%237:i32 = load %236
%x_166:i32 = let %237
%239:f32 = convert %x_166
%240:f32 = div %239, 10.0f
%241:f32 = add 0.5f, %240
store %grey, %241
exit_if # if_10
}
$B49: { # false
%242:f32 = load_vector_element %gl_FragCoord, 1u
%x_171:f32 = let %242
%244:i32 = call %tint_f32_to_i32, %x_171
%245:bool = lt %244, 90i
if %245 [t: $B50, f: $B51] { # if_11
$B50: { # true
%246:ptr<private, i32, read_write> = access %data, 2i
%247:i32 = load %246
%x_178:i32 = let %247
%249:f32 = convert %x_178
%250:f32 = div %249, 10.0f
%251:f32 = add 0.5f, %250
store %grey, %251
exit_if # if_11
}
$B51: { # false
%252:f32 = load_vector_element %gl_FragCoord, 1u
%x_183:f32 = let %252
%254:i32 = call %tint_f32_to_i32, %x_183
%255:bool = lt %254, 120i
if %255 [t: $B52, f: $B53] { # if_12
$B52: { # true
%256:ptr<private, i32, read_write> = access %data, 3i
%257:i32 = load %256
%x_190:i32 = let %257
%259:f32 = convert %x_190
%260:f32 = div %259, 10.0f
%261:f32 = add 0.5f, %260
store %grey, %261
exit_if # if_12
}
$B53: { # false
%262:f32 = load_vector_element %gl_FragCoord, 1u
%x_195:f32 = let %262
%264:i32 = call %tint_f32_to_i32, %x_195
%265:bool = lt %264, 150i
if %265 [t: $B54, f: $B55] { # if_13
$B54: { # true
store %continue_execution, false
exit_if # if_13
}
$B55: { # false
%266:f32 = load_vector_element %gl_FragCoord, 1u
%x_202:f32 = let %266
%268:i32 = call %tint_f32_to_i32, %x_202
%269:bool = lt %268, 180i
if %269 [t: $B56, f: $B57] { # if_14
$B56: { # true
%270:ptr<private, i32, read_write> = access %data, 5i
%271:i32 = load %270
%x_209:i32 = let %271
%273:f32 = convert %x_209
%274:f32 = div %273, 10.0f
%275:f32 = add 0.5f, %274
store %grey, %275
exit_if # if_14
}
$B57: { # false
%276:f32 = load_vector_element %gl_FragCoord, 1u
%x_214:f32 = let %276
%278:i32 = call %tint_f32_to_i32, %x_214
%279:bool = lt %278, 210i
if %279 [t: $B58, f: $B59] { # if_15
$B58: { # true
%280:ptr<private, i32, read_write> = access %data, 6i
%281:i32 = load %280
%x_221:i32 = let %281
%283:f32 = convert %x_221
%284:f32 = div %283, 10.0f
%285:f32 = add 0.5f, %284
store %grey, %285
exit_if # if_15
}
$B59: { # false
%286:f32 = load_vector_element %gl_FragCoord, 1u
%x_226:f32 = let %286
%288:i32 = call %tint_f32_to_i32, %x_226
%289:bool = lt %288, 240i
if %289 [t: $B60, f: $B61] { # if_16
$B60: { # true
%290:ptr<private, i32, read_write> = access %data, 7i
%291:i32 = load %290
%x_233:i32 = let %291
%293:f32 = convert %x_233
%294:f32 = div %293, 10.0f
%295:f32 = add 0.5f, %294
store %grey, %295
exit_if # if_16
}
$B61: { # false
%296:f32 = load_vector_element %gl_FragCoord, 1u
%x_238:f32 = let %296
%298:i32 = call %tint_f32_to_i32, %x_238
%299:bool = lt %298, 270i
if %299 [t: $B62, f: $B63] { # if_17
$B62: { # true
%300:ptr<private, i32, read_write> = access %data, 8i
%301:i32 = load %300
%x_245:i32 = let %301
%303:f32 = convert %x_245
%304:f32 = div %303, 10.0f
%305:f32 = add 0.5f, %304
store %grey, %305
exit_if # if_17
}
$B63: { # false
store %continue_execution, false
exit_if # if_17
}
}
exit_if # if_16
}
}
exit_if # if_15
}
}
exit_if # if_14
}
}
exit_if # if_13
}
}
exit_if # if_12
}
}
exit_if # if_11
}
}
exit_if # if_10
}
}
exit_if # if_9
}
}
%306:f32 = load %grey
%x_249:f32 = let %306
%308:vec3<f32> = construct %x_249, %x_249, %x_249
%x_250:vec3<f32> = let %308
%310:f32 = access %x_250, 0u
%311:f32 = access %x_250, 1u
%312:f32 = access %x_250, 2u
%313:vec4<f32> = construct %310, %311, %312, 1.0f
store %x_GLF_color, %313
ret
}
}
%tint_symbol = @fragment func(%gl_FragCoord_param:vec4<f32> [@position]):main_out {
$B64: {
store %gl_FragCoord, %gl_FragCoord_param
%316:void = call %main_1
%317:vec4<f32> = load %x_GLF_color
%318:main_out = construct %317
%319:bool = load %continue_execution
%320:bool = eq %319, false
if %320 [t: $B65] { # if_18
$B65: { # true
terminate_invocation
}
}
ret %318
}
}
%tint_f32_to_i32 = func(%value:f32):i32 {
$B66: {
%322:i32 = convert %value
%323:bool = gte %value, -2147483648.0f
%324:i32 = select -2147483648i, %322, %323
%325:bool = lte %value, 2147483520.0f
%326:i32 = select 2147483647i, %324, %325
ret %326
}
}
unhandled variable address space
********************************************************************
* The tint shader compiler has encountered an unexpected error. *
* *
* Please help us fix this issue by submitting a bug report at *
* crbug.com/tint with the source program that triggered the bug. *
********************************************************************