blob: a4f8d90e19491fac806c0ba3a60501c7d7b49fa1 [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)
}
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
%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
%15:i32 = load %f
%x_262:i32 = let %15
store %k, %x_262
%17:i32 = load %f
%x_263:i32 = let %17
store %i, %x_263
%19:i32 = load %mid
%x_264:i32 = let %19
%21:i32 = add %x_264, 1i
store %j, %21
loop [b: $B3, c: $B4] { # loop_1
$B3: { # body
%22:i32 = load %i
%x_270:i32 = let %22
%24:i32 = load %mid
%x_271:i32 = let %24
%26:i32 = load %j
%x_273:i32 = let %26
%28:i32 = load %to
%x_274:i32 = let %28
%30:bool = lte %x_270, %x_271
%31:bool = lte %x_273, %x_274
%32:bool = and %30, %31
if %32 [t: $B5, f: $B6] { # if_1
$B5: { # true
exit_if # if_1
}
$B6: { # false
exit_loop # loop_1
}
}
%33:i32 = load %i
%x_278:i32 = let %33
%35:ptr<private, i32, read_write> = access %data, %x_278
%36:i32 = load %35
%x_280:i32 = let %36
%38:i32 = load %j
%x_281:i32 = let %38
%40:ptr<private, i32, read_write> = access %data, %x_281
%41:i32 = load %40
%x_283:i32 = let %41
%43:bool = lt %x_280, %x_283
if %43 [t: $B7, f: $B8] { # if_2
$B7: { # true
%44:i32 = load %k
%x_288:i32 = let %44
%46:i32 = add %x_288, 1i
store %k, %46
%47:i32 = load %i
%x_290:i32 = let %47
%49:i32 = add %x_290, 1i
store %i, %49
%50:ptr<private, i32, read_write> = access %data, %x_290
%51:i32 = load %50
%x_293:i32 = let %51
%53:ptr<private, i32, read_write> = access %temp, %x_288
store %53, %x_293
exit_if # if_2
}
$B8: { # false
%54:i32 = load %k
%x_295:i32 = let %54
%56:i32 = add %x_295, 1i
store %k, %56
%57:i32 = load %j
%x_297:i32 = let %57
%59:i32 = add %x_297, 1i
store %j, %59
%60:ptr<private, i32, read_write> = access %data, %x_297
%61:i32 = load %60
%x_300:i32 = let %61
%63:ptr<private, i32, read_write> = access %temp, %x_295
store %63, %x_300
exit_if # if_2
}
}
continue # -> $B4
}
$B4: { # continuing
next_iteration # -> $B3
}
}
loop [b: $B9, c: $B10] { # loop_2
$B9: { # body
%64:i32 = load %i
%x_306:i32 = let %64
%66:i32 = load %i
%x_308:i32 = let %66
%68:i32 = load %mid
%x_309:i32 = let %68
%70:bool = lt %x_306, 10i
%71:bool = lte %x_308, %x_309
%72:bool = and %70, %71
if %72 [t: $B11, f: $B12] { # if_3
$B11: { # true
exit_if # if_3
}
$B12: { # false
exit_loop # loop_2
}
}
%73:i32 = load %k
%x_313:i32 = let %73
%75:i32 = add %x_313, 1i
store %k, %75
%76:i32 = load %i
%x_315:i32 = let %76
%78:i32 = add %x_315, 1i
store %i, %78
%79:ptr<private, i32, read_write> = access %data, %x_315
%80:i32 = load %79
%x_318:i32 = let %80
%82:ptr<private, i32, read_write> = access %temp, %x_313
store %82, %x_318
continue # -> $B10
}
$B10: { # continuing
next_iteration # -> $B9
}
}
%83:i32 = load %f
%x_320:i32 = let %83
store %i_1, %x_320
loop [b: $B13, c: $B14] { # loop_3
$B13: { # body
%85:i32 = load %i_1
%x_325:i32 = let %85
%87:i32 = load %to
%x_326:i32 = let %87
%89:bool = lte %x_325, %x_326
if %89 [t: $B15, f: $B16] { # if_4
$B15: { # true
exit_if # if_4
}
$B16: { # false
exit_loop # loop_3
}
}
%90:i32 = load %i_1
%x_329:i32 = let %90
%92:i32 = load %i_1
%x_330:i32 = let %92
%94:ptr<private, i32, read_write> = access %temp, %x_330
%95:i32 = load %94
%x_332:i32 = let %95
%97:ptr<private, i32, read_write> = access %data, %x_329
store %97, %x_332
continue # -> $B14
}
$B14: { # continuing
%98:i32 = load %i_1
%x_334:i32 = let %98
%100:i32 = add %x_334, 1i
store %i_1, %100
next_iteration # -> $B13
}
}
ret
}
}
%mergeSort_ = func():void {
$B17: {
%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: $B18, c: $B19] { # loop_4
$B18: { # body
%112:i32 = load %m
%x_341:i32 = let %112
%114:i32 = load %high
%x_342:i32 = let %114
%116:bool = lte %x_341, %x_342
if %116 [t: $B20, f: $B21] { # if_5
$B20: { # true
exit_if # if_5
}
$B21: { # false
exit_loop # loop_4
}
}
%117:i32 = load %low
%x_345:i32 = let %117
store %i_2, %x_345
loop [b: $B22, c: $B23] { # loop_5
$B22: { # body
%119:i32 = load %i_2
%x_350:i32 = let %119
%121:i32 = load %high
%x_351:i32 = let %121
%123:bool = lt %x_350, %x_351
if %123 [t: $B24, f: $B25] { # if_6
$B24: { # true
exit_if # if_6
}
$B25: { # false
exit_loop # loop_5
}
}
%124:i32 = load %i_2
%x_354:i32 = let %124
store %f_1, %x_354
%126:i32 = load %i_2
%x_355:i32 = let %126
%128:i32 = load %m
%x_356:i32 = let %128
%130:i32 = add %x_355, %x_356
%131:i32 = sub %130, 1i
store %mid_1, %131
%132:i32 = load %i_2
%x_359:i32 = let %132
%134:i32 = load %m
%x_360:i32 = let %134
%136:i32 = load %high
%x_364:i32 = let %136
%138:i32 = mul 2i, %x_360
%139:i32 = add %x_359, %138
%140:i32 = sub %139, 1i
%141:i32 = min %140, %x_364
store %to_1, %141
%142:i32 = load %f_1
%x_366:i32 = let %142
store %param, %x_366
%144:i32 = load %mid_1
%x_367:i32 = let %144
store %param_1, %x_367
%146:i32 = load %to_1
%x_368:i32 = let %146
store %param_2, %x_368
%148:void = call %merge_i1_i1_i1_, %param, %param_1, %param_2
continue # -> $B23
}
$B23: { # continuing
%149:i32 = load %m
%x_370:i32 = let %149
%151:i32 = load %i_2
%x_372:i32 = let %151
%153:i32 = mul 2i, %x_370
%154:i32 = add %x_372, %153
store %i_2, %154
next_iteration # -> $B22
}
}
continue # -> $B19
}
$B19: { # continuing
%155:i32 = load %m
%x_374:i32 = let %155
%157:i32 = mul 2i, %x_374
store %m, %157
next_iteration # -> $B18
}
}
ret
}
}
%main_1 = func():void {
$B26: {
%i_3:ptr<function, i32, read_write> = var
%j_1:ptr<function, i32, read_write> = var
%grey:ptr<function, f32, read_write> = var
%int_i:ptr<function, i32, read_write> = var
%163:ptr<uniform, vec2<f32>, read> = access %x_28, 0u
%164:f32 = load_vector_element %163, 0u
%x_85:f32 = let %164
%166:i32 = call %tint_f32_to_i32, %x_85
store %i_3, %166
loop [b: $B27, c: $B28] { # loop_6
$B27: { # body
%168:i32 = load %i_3
%x_91:i32 = let %168
switch %x_91 [c: (9i, $B29), c: (8i, $B30), c: (7i, $B31), c: (6i, $B32), c: (5i, $B33), c: (4i, $B34), c: (3i, $B35), c: (2i, $B36), c: (1i, $B37), c: (0i, $B38), c: (default, $B39)] { # switch_1
$B29: { # case
%170:i32 = load %i_3
%x_121:i32 = let %170
%172:ptr<private, i32, read_write> = access %data, %x_121
store %172, -5i
exit_switch # switch_1
}
$B30: { # case
%173:i32 = load %i_3
%x_119:i32 = let %173
%175:ptr<private, i32, read_write> = access %data, %x_119
store %175, -4i
exit_switch # switch_1
}
$B31: { # case
%176:i32 = load %i_3
%x_117:i32 = let %176
%178:ptr<private, i32, read_write> = access %data, %x_117
store %178, -3i
exit_switch # switch_1
}
$B32: { # case
%179:i32 = load %i_3
%x_115:i32 = let %179
%181:ptr<private, i32, read_write> = access %data, %x_115
store %181, -2i
exit_switch # switch_1
}
$B33: { # case
%182:i32 = load %i_3
%x_113:i32 = let %182
%184:ptr<private, i32, read_write> = access %data, %x_113
store %184, -1i
exit_switch # switch_1
}
$B34: { # case
%185:i32 = load %i_3
%x_111:i32 = let %185
%187:ptr<private, i32, read_write> = access %data, %x_111
store %187, 0i
exit_switch # switch_1
}
$B35: { # case
%188:i32 = load %i_3
%x_109:i32 = let %188
%190:ptr<private, i32, read_write> = access %data, %x_109
store %190, 1i
exit_switch # switch_1
}
$B36: { # case
%191:i32 = load %i_3
%x_107:i32 = let %191
%193:ptr<private, i32, read_write> = access %data, %x_107
store %193, 2i
exit_switch # switch_1
}
$B37: { # case
%194:i32 = load %i_3
%x_105:i32 = let %194
%196:ptr<private, i32, read_write> = access %data, %x_105
store %196, 3i
exit_switch # switch_1
}
$B38: { # case
%197:i32 = load %i_3
%x_103:i32 = let %197
%199:ptr<private, i32, read_write> = access %data, %x_103
store %199, 4i
exit_switch # switch_1
}
$B39: { # case
exit_switch # switch_1
}
}
%200:i32 = load %i_3
%x_123:i32 = let %200
%202:i32 = add %x_123, 1i
store %i_3, %202
continue # -> $B28
}
$B28: { # continuing
%203:i32 = load %i_3
%x_125:i32 = let %203
%205:bool = lt %x_125, 10i
%206:bool = eq %205, false
break_if %206 # -> [t: exit_loop loop_6, f: $B27]
}
}
store %j_1, 0i
loop [b: $B40, c: $B41] { # loop_7
$B40: { # body
%207:i32 = load %j_1
%x_131:i32 = let %207
%209:bool = lt %x_131, 10i
if %209 [t: $B42, f: $B43] { # if_7
$B42: { # true
exit_if # if_7
}
$B43: { # false
exit_loop # loop_7
}
}
%210:i32 = load %j_1
%x_134:i32 = let %210
%212:i32 = load %j_1
%x_135:i32 = let %212
%214:ptr<private, i32, read_write> = access %data, %x_135
%215:i32 = load %214
%x_137:i32 = let %215
%217:ptr<private, i32, read_write> = access %temp, %x_134
store %217, %x_137
continue # -> $B41
}
$B41: { # continuing
%218:i32 = load %j_1
%x_139:i32 = let %218
%220:i32 = add %x_139, 1i
store %j_1, %220
next_iteration # -> $B40
}
}
%221:void = call %mergeSort_
%222:f32 = load_vector_element %gl_FragCoord, 1u
%x_143:f32 = let %222
%224:i32 = call %tint_f32_to_i32, %x_143
%225:bool = lt %224, 30i
if %225 [t: $B44, f: $B45] { # if_8
$B44: { # true
%226:ptr<private, i32, read_write> = access %data, 0i
%227:i32 = load %226
%x_150:i32 = let %227
%229:f32 = convert %x_150
%230:f32 = div %229, 10.0f
%231:f32 = add 0.5f, %230
store %grey, %231
exit_if # if_8
}
$B45: { # false
%232:f32 = load_vector_element %gl_FragCoord, 1u
%x_155:f32 = let %232
%234:i32 = call %tint_f32_to_i32, %x_155
%235:bool = lt %234, 60i
if %235 [t: $B46, f: $B47] { # if_9
$B46: { # true
%236:ptr<private, i32, read_write> = access %data, 1i
%237:i32 = load %236
%x_162:i32 = let %237
%239:f32 = convert %x_162
%240:f32 = div %239, 10.0f
%241:f32 = add 0.5f, %240
store %grey, %241
exit_if # if_9
}
$B47: { # false
%242:f32 = load_vector_element %gl_FragCoord, 1u
%x_167:f32 = let %242
%244:i32 = call %tint_f32_to_i32, %x_167
%245:bool = lt %244, 90i
if %245 [t: $B48, f: $B49] { # if_10
$B48: { # true
%246:ptr<private, i32, read_write> = access %data, 2i
%247:i32 = load %246
%x_174:i32 = let %247
%249:f32 = convert %x_174
%250:f32 = div %249, 10.0f
%251:f32 = add 0.5f, %250
store %grey, %251
exit_if # if_10
}
$B49: { # false
%252:f32 = load_vector_element %gl_FragCoord, 1u
%x_179:f32 = let %252
%254:i32 = call %tint_f32_to_i32, %x_179
%255:bool = lt %254, 120i
if %255 [t: $B50, f: $B51] { # if_11
$B50: { # true
%256:ptr<private, i32, read_write> = access %data, 3i
%257:i32 = load %256
%x_186:i32 = let %257
%259:f32 = convert %x_186
%260:f32 = div %259, 10.0f
%261:f32 = add 0.5f, %260
store %grey, %261
exit_if # if_11
}
$B51: { # false
%262:f32 = load_vector_element %gl_FragCoord, 1u
%x_191:f32 = let %262
%264:i32 = call %tint_f32_to_i32, %x_191
%265:bool = lt %264, 150i
if %265 [t: $B52, f: $B53] { # if_12
$B52: { # true
store %int_i, 1i
loop [b: $B54, c: $B55] { # loop_8
$B54: { # body
%266:i32 = load %int_i
%x_201:i32 = let %266
%268:ptr<uniform, vec2<f32>, read> = access %x_28, 0u
%269:f32 = load_vector_element %268, 0u
%x_203:f32 = let %269
%271:i32 = call %tint_f32_to_i32, %x_203
%272:bool = gt %x_201, %271
if %272 [t: $B56, f: $B57] { # if_13
$B56: { # true
exit_if # if_13
}
$B57: { # false
exit_loop # loop_8
}
}
store %continue_execution, false
continue # -> $B55
}
$B55: { # continuing
next_iteration # -> $B54
}
}
exit_if # if_12
}
$B53: { # false
%273:f32 = load_vector_element %gl_FragCoord, 1u
%x_208:f32 = let %273
%275:i32 = call %tint_f32_to_i32, %x_208
%276:bool = lt %275, 180i
if %276 [t: $B58, f: $B59] { # if_14
$B58: { # true
%277:ptr<private, i32, read_write> = access %data, 5i
%278:i32 = load %277
%x_215:i32 = let %278
%280:f32 = convert %x_215
%281:f32 = div %280, 10.0f
%282:f32 = add 0.5f, %281
store %grey, %282
exit_if # if_14
}
$B59: { # false
%283:f32 = load_vector_element %gl_FragCoord, 1u
%x_220:f32 = let %283
%285:i32 = call %tint_f32_to_i32, %x_220
%286:bool = lt %285, 210i
if %286 [t: $B60, f: $B61] { # if_15
$B60: { # true
%287:ptr<private, i32, read_write> = access %data, 6i
%288:i32 = load %287
%x_227:i32 = let %288
%290:f32 = convert %x_227
%291:f32 = div %290, 10.0f
%292:f32 = add 0.5f, %291
store %grey, %292
exit_if # if_15
}
$B61: { # false
%293:f32 = load_vector_element %gl_FragCoord, 1u
%x_232:f32 = let %293
%295:i32 = call %tint_f32_to_i32, %x_232
%296:bool = lt %295, 240i
if %296 [t: $B62, f: $B63] { # if_16
$B62: { # true
%297:ptr<private, i32, read_write> = access %data, 7i
%298:i32 = load %297
%x_239:i32 = let %298
%300:f32 = convert %x_239
%301:f32 = div %300, 10.0f
%302:f32 = add 0.5f, %301
store %grey, %302
exit_if # if_16
}
$B63: { # false
%303:f32 = load_vector_element %gl_FragCoord, 1u
%x_244:f32 = let %303
%305:i32 = call %tint_f32_to_i32, %x_244
%306:bool = lt %305, 270i
if %306 [t: $B64, f: $B65] { # if_17
$B64: { # true
%307:ptr<private, i32, read_write> = access %data, 8i
%308:i32 = load %307
%x_251:i32 = let %308
%310:f32 = convert %x_251
%311:f32 = div %310, 10.0f
%312:f32 = add 0.5f, %311
store %grey, %312
exit_if # if_17
}
$B65: { # false
store %continue_execution, false
exit_if # if_17
}
}
exit_if # if_16
}
}
exit_if # if_15
}
}
exit_if # if_14
}
}
exit_if # if_12
}
}
exit_if # if_11
}
}
exit_if # if_10
}
}
exit_if # if_9
}
}
exit_if # if_8
}
}
%313:f32 = load %grey
%x_255:f32 = let %313
%315:vec3<f32> = construct %x_255, %x_255, %x_255
%x_256:vec3<f32> = let %315
%317:f32 = access %x_256, 0u
%318:f32 = access %x_256, 1u
%319:f32 = access %x_256, 2u
%320:vec4<f32> = construct %317, %318, %319, 1.0f
store %x_GLF_color, %320
ret
}
}
%tint_symbol = @fragment func(%gl_FragCoord_param:vec4<f32> [@position]):main_out {
$B66: {
store %gl_FragCoord, %gl_FragCoord_param
%323:void = call %main_1
%324:vec4<f32> = load %x_GLF_color
%325:main_out = construct %324
%326:bool = load %continue_execution
%327:bool = eq %326, false
if %327 [t: $B67] { # if_18
$B67: { # true
terminate_invocation
}
}
ret %325
}
}
%tint_f32_to_i32 = func(%value:f32):i32 {
$B68: {
%329:i32 = convert %value
%330:bool = gte %value, -2147483648.0f
%331:i32 = select -2147483648i, %329, %330
%332:bool = lte %value, 2147483520.0f
%333:i32 = select 2147483647i, %331, %332
ret %333
}
}
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. *
********************************************************************