blob: ce13e24770810b428934bf7413077883f465164e [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
store %k, %16
%17:i32 = load %f
store %i, %17
%18:i32 = load %mid
%19:i32 = add %18, 1i
store %j, %19
loop [b: $B3, c: $B4] { # loop_1
$B3: { # body
%20:i32 = load %i
%21:i32 = load %mid
%22:bool = lte %20, %21
%23:i32 = load %j
%24:i32 = load %to
%25:bool = lte %23, %24
%26:bool = and %22, %25
if %26 [t: $B5, f: $B6] { # if_1
$B5: { # true
exit_if # if_1
}
$B6: { # false
exit_loop # loop_1
}
}
%27:i32 = load %i
%28:ptr<private, i32, read_write> = access %data, %27
%29:i32 = load %28
%30:i32 = load %j
%31:ptr<private, i32, read_write> = access %data, %30
%32:i32 = load %31
%33:bool = lt %29, %32
if %33 [t: $B7, f: $B8] { # if_2
$B7: { # true
%34:i32 = load %k
%x_282:i32 = let %34
%36:i32 = load %k
%37:i32 = add %36, 1i
store %k, %37
%38:i32 = load %i
%x_284:i32 = let %38
%40:i32 = load %i
%41:i32 = add %40, 1i
store %i, %41
%42:ptr<private, i32, read_write> = access %temp, %x_282
%43:ptr<private, i32, read_write> = access %data, %x_284
%44:i32 = load %43
store %42, %44
exit_if # if_2
}
$B8: { # false
%45:i32 = load %k
%x_289:i32 = let %45
%47:i32 = load %k
%48:i32 = add %47, 1i
store %k, %48
%49:i32 = load %j
%x_291:i32 = let %49
%51:i32 = load %j
%52:i32 = add %51, 1i
store %j, %52
%53:ptr<private, i32, read_write> = access %temp, %x_289
%54:ptr<private, i32, read_write> = access %data, %x_291
%55:i32 = load %54
store %53, %55
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
}
}
%56:i32 = load %i
%57:bool = lt %56, 10i
%58:i32 = load %i
%59:i32 = load %mid
%60:bool = lte %58, %59
%61:bool = and %57, %60
if %61 [t: $B13, f: $B14] { # if_4
$B13: { # true
exit_if # if_4
}
$B14: { # false
exit_loop # loop_2
}
}
%62:i32 = load %k
%x_309:i32 = let %62
%64:i32 = load %k
%65:i32 = add %64, 1i
store %k, %65
%66:i32 = load %i
%x_311:i32 = let %66
%68:i32 = load %i
%69:i32 = add %68, 1i
store %i, %69
%70:ptr<private, i32, read_write> = access %temp, %x_309
%71:ptr<private, i32, read_write> = access %data, %x_311
%72:i32 = load %71
store %70, %72
continue # -> $B10
}
$B10: { # continuing
next_iteration # -> $B9
}
}
%73:i32 = load %f
store %i_1, %73
loop [b: $B15, c: $B16] { # loop_3
$B15: { # body
%74:i32 = load %i_1
%75:i32 = load %to
%76:bool = lte %74, %75
if %76 [t: $B17, f: $B18] { # if_5
$B17: { # true
exit_if # if_5
}
$B18: { # false
exit_loop # loop_3
}
}
%77:i32 = load %i_1
%x_325:i32 = let %77
%79:ptr<private, i32, read_write> = access %data, %x_325
%80:i32 = load %i_1
%81:ptr<private, i32, read_write> = access %temp, %80
%82:i32 = load %81
store %79, %82
continue # -> $B16
}
$B16: { # continuing
%83:i32 = load %i_1
%84:i32 = add %83, 1i
store %i_1, %84
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
%96:i32 = load %m
%97:i32 = load %high
%98:bool = lte %96, %97
if %98 [t: $B22, f: $B23] { # if_6
$B22: { # true
exit_if # if_6
}
$B23: { # false
exit_loop # loop_4
}
}
%99:i32 = load %low
store %i_2, %99
loop [b: $B24, c: $B25] { # loop_5
$B24: { # body
%100:i32 = load %i_2
%101:i32 = load %high
%102:bool = lt %100, %101
if %102 [t: $B26, f: $B27] { # if_7
$B26: { # true
exit_if # if_7
}
$B27: { # false
exit_loop # loop_5
}
}
%103:i32 = load %i_2
store %f_1, %103
%104:i32 = load %i_2
%105:i32 = load %m
%106:i32 = add %104, %105
%107:i32 = sub %106, 1i
store %mid_1, %107
%108:i32 = load %i_2
%109:i32 = load %m
%110:i32 = mul 2i, %109
%111:i32 = add %108, %110
%112:i32 = sub %111, 1i
%113:i32 = load %high
%114:i32 = min %112, %113
store %to_1, %114
%115:i32 = load %f_1
store %param, %115
%116:i32 = load %mid_1
store %param_1, %116
%117:i32 = load %to_1
store %param_2, %117
%118:void = call %merge_i1_i1_i1_, %param, %param_1, %param_2
continue # -> $B25
}
$B25: { # continuing
%119:i32 = load %i_2
%120:i32 = load %m
%121:i32 = mul 2i, %120
%122:i32 = add %119, %121
store %i_2, %122
next_iteration # -> $B24
}
}
continue # -> $B21
}
$B21: { # continuing
%123:i32 = load %m
%124:i32 = mul 2i, %123
store %m, %124
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
%129:ptr<uniform, vec2<f32>, read> = access %x_28, 0u
%130:f32 = load_vector_element %129, 0u
%131:i32 = call %tint_f32_to_i32, %130
store %i_3, %131
loop [b: $B29, c: $B30] { # loop_6
$B29: { # body
%133:i32 = load %i_3
%x_95:i32 = let %133
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
%135:i32 = load %i_3
%x_125:i32 = let %135
%137:ptr<private, i32, read_write> = access %data, %x_125
store %137, -5i
exit_switch # switch_1
}
$B32: { # case
%138:i32 = load %i_3
%x_123:i32 = let %138
%140:ptr<private, i32, read_write> = access %data, %x_123
store %140, -4i
exit_switch # switch_1
}
$B33: { # case
%141:i32 = load %i_3
%x_121:i32 = let %141
%143:ptr<private, i32, read_write> = access %data, %x_121
store %143, -3i
exit_switch # switch_1
}
$B34: { # case
%144:i32 = load %i_3
%x_119:i32 = let %144
%146:ptr<private, i32, read_write> = access %data, %x_119
store %146, -2i
exit_switch # switch_1
}
$B35: { # case
%147:i32 = load %i_3
%x_117:i32 = let %147
%149:ptr<private, i32, read_write> = access %data, %x_117
store %149, -1i
exit_switch # switch_1
}
$B36: { # case
%150:i32 = load %i_3
%x_115:i32 = let %150
%152:ptr<private, i32, read_write> = access %data, %x_115
store %152, 0i
exit_switch # switch_1
}
$B37: { # case
%153:i32 = load %i_3
%x_113:i32 = let %153
%155:ptr<private, i32, read_write> = access %data, %x_113
store %155, 1i
exit_switch # switch_1
}
$B38: { # case
%156:i32 = load %i_3
%x_111:i32 = let %156
%158:ptr<private, i32, read_write> = access %data, %x_111
store %158, 2i
exit_switch # switch_1
}
$B39: { # case
%159:i32 = load %i_3
%x_109:i32 = let %159
%161:ptr<private, i32, read_write> = access %data, %x_109
store %161, 3i
exit_switch # switch_1
}
$B40: { # case
%162:i32 = load %i_3
%x_107:i32 = let %162
%164:ptr<private, i32, read_write> = access %data, %x_107
store %164, 4i
exit_switch # switch_1
}
$B41: { # case
exit_switch # switch_1
}
}
%165:i32 = load %i_3
%166:i32 = add %165, 1i
store %i_3, %166
continue # -> $B30
}
$B30: { # continuing
%167:i32 = load %i_3
%x_129:i32 = let %167
%169:bool = lt %x_129, 10i
%170:bool = eq %169, false
break_if %170 # -> [t: exit_loop loop_6, f: $B29]
}
}
store %j_1, 0i
loop [b: $B42, c: $B43] { # loop_7
$B42: { # body
%171:i32 = load %j_1
%172:bool = lt %171, 10i
if %172 [t: $B44, f: $B45] { # if_8
$B44: { # true
exit_if # if_8
}
$B45: { # false
exit_loop # loop_7
}
}
%173:i32 = load %j_1
%x_138:i32 = let %173
%175:ptr<private, i32, read_write> = access %temp, %x_138
%176:i32 = load %j_1
%177:ptr<private, i32, read_write> = access %data, %176
%178:i32 = load %177
store %175, %178
continue # -> $B43
}
$B43: { # continuing
%179:i32 = load %j_1
%180:i32 = add %179, 1i
store %j_1, %180
next_iteration # -> $B42
}
}
%181:void = call %mergeSort_
%182:f32 = load_vector_element %gl_FragCoord, 1u
%183:i32 = call %tint_f32_to_i32, %182
%184:bool = lt %183, 30i
if %184 [t: $B46, f: $B47] { # if_9
$B46: { # true
%185:ptr<private, i32, read_write> = access %data, 0i
%186:i32 = load %185
%187:f32 = convert %186
%188:f32 = div %187, 10.0f
%189:f32 = add 0.5f, %188
store %grey, %189
exit_if # if_9
}
$B47: { # false
%190:f32 = load_vector_element %gl_FragCoord, 1u
%191:i32 = call %tint_f32_to_i32, %190
%192:bool = lt %191, 60i
if %192 [t: $B48, f: $B49] { # if_10
$B48: { # true
%193:ptr<private, i32, read_write> = access %data, 1i
%194:i32 = load %193
%195:f32 = convert %194
%196:f32 = div %195, 10.0f
%197:f32 = add 0.5f, %196
store %grey, %197
exit_if # if_10
}
$B49: { # false
%198:f32 = load_vector_element %gl_FragCoord, 1u
%199:i32 = call %tint_f32_to_i32, %198
%200:bool = lt %199, 90i
if %200 [t: $B50, f: $B51] { # if_11
$B50: { # true
%201:ptr<private, i32, read_write> = access %data, 2i
%202:i32 = load %201
%203:f32 = convert %202
%204:f32 = div %203, 10.0f
%205:f32 = add 0.5f, %204
store %grey, %205
exit_if # if_11
}
$B51: { # false
%206:f32 = load_vector_element %gl_FragCoord, 1u
%207:i32 = call %tint_f32_to_i32, %206
%208:bool = lt %207, 120i
if %208 [t: $B52, f: $B53] { # if_12
$B52: { # true
%209:ptr<private, i32, read_write> = access %data, 3i
%210:i32 = load %209
%211:f32 = convert %210
%212:f32 = div %211, 10.0f
%213:f32 = add 0.5f, %212
store %grey, %213
exit_if # if_12
}
$B53: { # false
%214:f32 = load_vector_element %gl_FragCoord, 1u
%215:i32 = call %tint_f32_to_i32, %214
%216:bool = lt %215, 150i
if %216 [t: $B54, f: $B55] { # if_13
$B54: { # true
store %continue_execution, false
exit_if # if_13
}
$B55: { # false
%217:f32 = load_vector_element %gl_FragCoord, 1u
%218:i32 = call %tint_f32_to_i32, %217
%219:bool = lt %218, 180i
if %219 [t: $B56, f: $B57] { # if_14
$B56: { # true
%220:ptr<private, i32, read_write> = access %data, 5i
%221:i32 = load %220
%222:f32 = convert %221
%223:f32 = div %222, 10.0f
%224:f32 = add 0.5f, %223
store %grey, %224
exit_if # if_14
}
$B57: { # false
%225:f32 = load_vector_element %gl_FragCoord, 1u
%226:i32 = call %tint_f32_to_i32, %225
%227:bool = lt %226, 210i
if %227 [t: $B58, f: $B59] { # if_15
$B58: { # true
%228:ptr<private, i32, read_write> = access %data, 6i
%229:i32 = load %228
%230:f32 = convert %229
%231:f32 = div %230, 10.0f
%232:f32 = add 0.5f, %231
store %grey, %232
exit_if # if_15
}
$B59: { # false
%233:f32 = load_vector_element %gl_FragCoord, 1u
%234:i32 = call %tint_f32_to_i32, %233
%235:bool = lt %234, 240i
if %235 [t: $B60, f: $B61] { # if_16
$B60: { # true
%236:ptr<private, i32, read_write> = access %data, 7i
%237:i32 = load %236
%238:f32 = convert %237
%239:f32 = div %238, 10.0f
%240:f32 = add 0.5f, %239
store %grey, %240
exit_if # if_16
}
$B61: { # false
%241:f32 = load_vector_element %gl_FragCoord, 1u
%242:i32 = call %tint_f32_to_i32, %241
%243:bool = lt %242, 270i
if %243 [t: $B62, f: $B63] { # if_17
$B62: { # true
%244:ptr<private, i32, read_write> = access %data, 8i
%245:i32 = load %244
%246:f32 = convert %245
%247:f32 = div %246, 10.0f
%248:f32 = add 0.5f, %247
store %grey, %248
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
}
}
%249:f32 = load %grey
%250:vec3<f32> = construct %249
%x_250:vec3<f32> = let %250
%252:f32 = access %x_250, 0u
%253:f32 = access %x_250, 1u
%254:f32 = access %x_250, 2u
%255:vec4<f32> = construct %252, %253, %254, 1.0f
store %x_GLF_color, %255
ret
}
}
%tint_symbol = @fragment func(%gl_FragCoord_param:vec4<f32> [@position]):main_out {
$B64: {
store %gl_FragCoord, %gl_FragCoord_param
%258:void = call %main_1
%259:vec4<f32> = load %x_GLF_color
%260:main_out = construct %259
%261:bool = load %continue_execution
%262:bool = eq %261, false
if %262 [t: $B65] { # if_18
$B65: { # true
terminate_invocation
}
}
ret %260
}
}
%tint_f32_to_i32 = func(%value:f32):i32 {
$B66: {
%264:i32 = convert %value
%265:bool = gte %value, -2147483648.0f
%266:i32 = select -2147483648i, %264, %265
%267:bool = lte %value, 2147483520.0f
%268:i32 = select 2147483647i, %266, %267
ret %268
}
}
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. *
********************************************************************