blob: 46deb35cacfacf44b380dad37fc76e676f4106c4 [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_255:i32 = let %16
store %k, %x_255
%18:i32 = load %f
%x_256:i32 = let %18
store %i, %x_256
%20:i32 = load %mid
%x_257:i32 = let %20
%22:i32 = add %x_257, 1i
store %j, %22
loop [b: $B3, c: $B4] { # loop_1
$B3: { # body
%23:i32 = load %i
%x_263:i32 = let %23
%25:i32 = load %mid
%x_264:i32 = let %25
%27:i32 = load %j
%x_266:i32 = let %27
%29:i32 = load %to
%x_267:i32 = let %29
%31:bool = lte %x_263, %x_264
%32:bool = lte %x_266, %x_267
%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_271:i32 = let %34
%36:ptr<private, i32, read_write> = access %data, %x_271
%37:i32 = load %36
%x_273:i32 = let %37
%39:i32 = load %j
%x_274:i32 = let %39
%41:ptr<private, i32, read_write> = access %data, %x_274
%42:i32 = load %41
%x_276:i32 = let %42
%44:bool = lt %x_273, %x_276
if %44 [t: $B7, f: $B8] { # if_2
$B7: { # true
%45:i32 = load %k
%x_281:i32 = let %45
%47:i32 = add %x_281, 1i
store %k, %47
%48:i32 = load %i
%x_283:i32 = let %48
%50:i32 = add %x_283, 1i
store %i, %50
%51:ptr<private, i32, read_write> = access %data, %x_283
%52:i32 = load %51
%x_286:i32 = let %52
%54:ptr<private, i32, read_write> = access %temp, %x_281
store %54, %x_286
exit_if # if_2
}
$B8: { # false
%55:i32 = load %k
%x_288:i32 = let %55
%57:i32 = add %x_288, 1i
store %k, %57
%58:i32 = load %j
%x_290:i32 = let %58
%60:i32 = add %x_290, 1i
store %j, %60
%61:ptr<private, i32, read_write> = access %data, %x_290
%62:i32 = load %61
%x_293:i32 = let %62
%64:ptr<private, i32, read_write> = access %temp, %x_288
store %64, %x_293
exit_if # if_2
}
}
continue # -> $B4
}
$B4: { # continuing
next_iteration # -> $B3
}
}
loop [b: $B9, c: $B10] { # loop_2
$B9: { # body
%65:i32 = load %i
%x_299:i32 = let %65
%67:i32 = load %i
%x_301:i32 = let %67
%69:i32 = load %mid
%x_302:i32 = let %69
%71:bool = lt %x_299, 10i
%72:bool = lte %x_301, %x_302
%73:bool = and %71, %72
if %73 [t: $B11, f: $B12] { # if_3
$B11: { # true
exit_if # if_3
}
$B12: { # false
exit_loop # loop_2
}
}
%74:i32 = load %k
%x_306:i32 = let %74
%76:i32 = add %x_306, 1i
store %k, %76
%77:i32 = load %i
%x_308:i32 = let %77
%79:i32 = add %x_308, 1i
store %i, %79
%80:ptr<private, i32, read_write> = access %data, %x_308
%81:i32 = load %80
%x_311:i32 = let %81
%83:ptr<private, i32, read_write> = access %temp, %x_306
store %83, %x_311
continue # -> $B10
}
$B10: { # continuing
next_iteration # -> $B9
}
}
%84:i32 = load %f
%x_313:i32 = let %84
store %i_1, %x_313
loop [b: $B13, c: $B14] { # loop_3
$B13: { # body
%86:i32 = load %i_1
%x_318:i32 = let %86
%88:i32 = load %to
%x_319:i32 = let %88
%90:bool = lte %x_318, %x_319
if %90 [t: $B15, f: $B16] { # if_4
$B15: { # true
exit_if # if_4
}
$B16: { # false
exit_loop # loop_3
}
}
%91:i32 = load %i_1
%x_322:i32 = let %91
%93:i32 = load %i_1
%x_323:i32 = let %93
%95:ptr<private, i32, read_write> = access %temp, %x_323
%96:i32 = load %95
%x_325:i32 = let %96
%98:ptr<private, i32, read_write> = access %data, %x_322
store %98, %x_325
continue # -> $B14
}
$B14: { # continuing
%99:i32 = load %i_1
%x_327:i32 = let %99
%101:i32 = add %x_327, 1i
store %i_1, %101
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
%113:i32 = load %m
%x_334:i32 = let %113
%115:i32 = load %high
%x_335:i32 = let %115
%117:bool = lte %x_334, %x_335
if %117 [t: $B20, f: $B21] { # if_5
$B20: { # true
exit_if # if_5
}
$B21: { # false
exit_loop # loop_4
}
}
%118:i32 = load %low
%x_338:i32 = let %118
store %i_2, %x_338
loop [b: $B22, c: $B23] { # loop_5
$B22: { # body
%120:i32 = load %i_2
%x_343:i32 = let %120
%122:i32 = load %high
%x_344:i32 = let %122
%124:bool = lt %x_343, %x_344
if %124 [t: $B24, f: $B25] { # if_6
$B24: { # true
exit_if # if_6
}
$B25: { # false
exit_loop # loop_5
}
}
%125:i32 = load %i_2
%x_347:i32 = let %125
store %f_1, %x_347
%127:i32 = load %i_2
%x_348:i32 = let %127
%129:i32 = load %m
%x_349:i32 = let %129
%131:i32 = add %x_348, %x_349
%132:i32 = sub %131, 1i
store %mid_1, %132
%133:i32 = load %i_2
%x_352:i32 = let %133
%135:i32 = load %m
%x_353:i32 = let %135
%137:i32 = load %high
%x_357:i32 = let %137
%139:i32 = mul 2i, %x_353
%140:i32 = add %x_352, %139
%141:i32 = sub %140, 1i
%142:i32 = min %141, %x_357
store %to_1, %142
%143:i32 = load %f_1
%x_359:i32 = let %143
store %param, %x_359
%145:i32 = load %mid_1
%x_360:i32 = let %145
store %param_1, %x_360
%147:i32 = load %to_1
%x_361:i32 = let %147
store %param_2, %x_361
%149:void = call %merge_i1_i1_i1_, %param, %param_1, %param_2
continue # -> $B23
}
$B23: { # continuing
%150:i32 = load %m
%x_363:i32 = let %150
%152:i32 = load %i_2
%x_365:i32 = let %152
%154:i32 = mul 2i, %x_363
%155:i32 = add %x_365, %154
store %i_2, %155
next_iteration # -> $B22
}
}
continue # -> $B19
}
$B19: { # continuing
%156:i32 = load %m
%x_367:i32 = let %156
%158:i32 = mul 2i, %x_367
store %m, %158
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
%163:ptr<uniform, vec2<f32>, read> = access %x_28, 0u
%164:f32 = load_vector_element %163, 0u
%x_88:f32 = let %164
%166:i32 = call %tint_f32_to_i32, %x_88
store %i_3, %166
loop [b: $B27, c: $B28] { # loop_6
$B27: { # body
%168:i32 = load %i_3
%x_94:i32 = let %168
switch %x_94 [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_124:i32 = let %170
%172:ptr<private, i32, read_write> = access %data, %x_124
store %172, -5i
if true [t: $B40, f: $B41] { # if_7
$B40: { # true
exit_if # if_7
}
$B41: { # false
continue # -> $B28
}
}
exit_switch # switch_1
}
$B30: { # case
%173:i32 = load %i_3
%x_122:i32 = let %173
%175:ptr<private, i32, read_write> = access %data, %x_122
store %175, -4i
exit_switch # switch_1
}
$B31: { # case
%176:i32 = load %i_3
%x_120:i32 = let %176
%178:ptr<private, i32, read_write> = access %data, %x_120
store %178, -3i
exit_switch # switch_1
}
$B32: { # case
%179:i32 = load %i_3
%x_118:i32 = let %179
%181:ptr<private, i32, read_write> = access %data, %x_118
store %181, -2i
exit_switch # switch_1
}
$B33: { # case
%182:i32 = load %i_3
%x_116:i32 = let %182
%184:ptr<private, i32, read_write> = access %data, %x_116
store %184, -1i
exit_switch # switch_1
}
$B34: { # case
%185:i32 = load %i_3
%x_114:i32 = let %185
%187:ptr<private, i32, read_write> = access %data, %x_114
store %187, 0i
exit_switch # switch_1
}
$B35: { # case
%188:i32 = load %i_3
%x_112:i32 = let %188
%190:ptr<private, i32, read_write> = access %data, %x_112
store %190, 1i
exit_switch # switch_1
}
$B36: { # case
%191:i32 = load %i_3
%x_110:i32 = let %191
%193:ptr<private, i32, read_write> = access %data, %x_110
store %193, 2i
exit_switch # switch_1
}
$B37: { # case
%194:i32 = load %i_3
%x_108:i32 = let %194
%196:ptr<private, i32, read_write> = access %data, %x_108
store %196, 3i
exit_switch # switch_1
}
$B38: { # case
%197:i32 = load %i_3
%x_106:i32 = let %197
%199:ptr<private, i32, read_write> = access %data, %x_106
store %199, 4i
exit_switch # switch_1
}
$B39: { # case
exit_switch # switch_1
}
}
%200:i32 = load %i_3
%x_126:i32 = let %200
%202:i32 = add %x_126, 1i
store %i_3, %202
continue # -> $B28
}
$B28: { # continuing
%203:i32 = load %i_3
%x_128:i32 = let %203
%205:bool = lt %x_128, 10i
%206:bool = eq %205, false
break_if %206 # -> [t: exit_loop loop_6, f: $B27]
}
}
store %j_1, 0i
loop [b: $B42, c: $B43] { # loop_7
$B42: { # body
%207:i32 = load %j_1
%x_134:i32 = let %207
%209:bool = lt %x_134, 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_137:i32 = let %210
%212:i32 = load %j_1
%x_138:i32 = let %212
%214:ptr<private, i32, read_write> = access %data, %x_138
%215:i32 = load %214
%x_140:i32 = let %215
%217:ptr<private, i32, read_write> = access %temp, %x_137
store %217, %x_140
continue # -> $B43
}
$B43: { # continuing
%218:i32 = load %j_1
%x_142:i32 = let %218
%220:i32 = add %x_142, 1i
store %j_1, %220
next_iteration # -> $B42
}
}
%221:void = call %mergeSort_
%222:f32 = load_vector_element %gl_FragCoord, 1u
%x_146:f32 = let %222
%224:i32 = call %tint_f32_to_i32, %x_146
%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_153:i32 = let %227
%229:f32 = convert %x_153
%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_158:f32 = let %232
%234:i32 = call %tint_f32_to_i32, %x_158
%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_165:i32 = let %237
%239:f32 = convert %x_165
%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_170:f32 = let %242
%244:i32 = call %tint_f32_to_i32, %x_170
%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_177:i32 = let %247
%249:f32 = convert %x_177
%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_182:f32 = let %252
%254:i32 = call %tint_f32_to_i32, %x_182
%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_189:i32 = let %257
%259:f32 = convert %x_189
%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_194:f32 = let %262
%264:i32 = call %tint_f32_to_i32, %x_194
%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_201:f32 = let %266
%268:i32 = call %tint_f32_to_i32, %x_201
%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_208:i32 = let %271
%273:f32 = convert %x_208
%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_213:f32 = let %276
%278:i32 = call %tint_f32_to_i32, %x_213
%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_220:i32 = let %281
%283:f32 = convert %x_220
%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_225:f32 = let %286
%288:i32 = call %tint_f32_to_i32, %x_225
%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_232:i32 = let %291
%293:f32 = convert %x_232
%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_237:f32 = let %296
%298:i32 = call %tint_f32_to_i32, %x_237
%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_244:i32 = let %301
%303:f32 = convert %x_244
%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_248:f32 = let %306
%308:vec3<f32> = construct %x_248, %x_248, %x_248
%x_249:vec3<f32> = let %308
%310:f32 = access %x_249, 0u
%311:f32 = access %x_249, 1u
%312:f32 = access %x_249, 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. *
********************************************************************