| 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 |
| %gl_FragCoord:ptr<private, vec4<f32>, read_write> = var |
| %x_34:ptr<uniform, buf0, read> = var @binding_point(0, 0) |
| %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 |
| store %k, %15 |
| %16:i32 = load %f |
| store %i, %16 |
| %17:i32 = load %mid |
| %18:i32 = add %17, 1i |
| store %j, %18 |
| loop [b: $B3, c: $B4] { # loop_1 |
| $B3: { # body |
| %19:i32 = load %i |
| %20:i32 = load %mid |
| %21:bool = lte %19, %20 |
| %22:i32 = load %j |
| %23:i32 = load %to |
| %24:bool = lte %22, %23 |
| %25:bool = and %21, %24 |
| if %25 [t: $B5, f: $B6] { # if_1 |
| $B5: { # true |
| exit_if # if_1 |
| } |
| $B6: { # false |
| exit_loop # loop_1 |
| } |
| } |
| %26:i32 = load %i |
| %27:ptr<private, i32, read_write> = access %data, %26 |
| %28:i32 = load %27 |
| %29:i32 = load %j |
| %30:ptr<private, i32, read_write> = access %data, %29 |
| %31:i32 = load %30 |
| %32:bool = lt %28, %31 |
| if %32 [t: $B7, f: $B8] { # if_2 |
| $B7: { # true |
| %33:i32 = load %k |
| %x_286:i32 = let %33 |
| %35:i32 = load %k |
| %36:i32 = add %35, 1i |
| store %k, %36 |
| %37:i32 = load %i |
| %x_288:i32 = let %37 |
| %39:i32 = load %i |
| %40:i32 = add %39, 1i |
| store %i, %40 |
| %41:ptr<private, i32, read_write> = access %temp, %x_286 |
| %42:ptr<private, i32, read_write> = access %data, %x_288 |
| %43:i32 = load %42 |
| store %41, %43 |
| exit_if # if_2 |
| } |
| $B8: { # false |
| %44:i32 = load %k |
| %x_293:i32 = let %44 |
| %46:i32 = load %k |
| %47:i32 = add %46, 1i |
| store %k, %47 |
| %48:i32 = load %j |
| %x_295:i32 = let %48 |
| %50:i32 = load %j |
| %51:i32 = add %50, 1i |
| store %j, %51 |
| %52:ptr<private, i32, read_write> = access %temp, %x_293 |
| %53:ptr<private, i32, read_write> = access %data, %x_295 |
| %54:i32 = load %53 |
| store %52, %54 |
| exit_if # if_2 |
| } |
| } |
| continue # -> $B4 |
| } |
| $B4: { # continuing |
| next_iteration # -> $B3 |
| } |
| } |
| loop [b: $B9, c: $B10] { # loop_2 |
| $B9: { # body |
| %55:i32 = load %i |
| %56:bool = lt %55, 10i |
| %57:i32 = load %i |
| %58:i32 = load %mid |
| %59:bool = lte %57, %58 |
| %60:bool = and %56, %59 |
| if %60 [t: $B11, f: $B12] { # if_3 |
| $B11: { # true |
| exit_if # if_3 |
| } |
| $B12: { # false |
| exit_loop # loop_2 |
| } |
| } |
| %61:i32 = load %k |
| %x_311:i32 = let %61 |
| %63:i32 = load %k |
| %64:i32 = add %63, 1i |
| store %k, %64 |
| %65:i32 = load %i |
| %x_313:i32 = let %65 |
| %67:i32 = load %i |
| %68:i32 = add %67, 1i |
| store %i, %68 |
| %69:ptr<private, i32, read_write> = access %temp, %x_311 |
| %70:ptr<private, i32, read_write> = access %data, %x_313 |
| %71:i32 = load %70 |
| store %69, %71 |
| continue # -> $B10 |
| } |
| $B10: { # continuing |
| next_iteration # -> $B9 |
| } |
| } |
| %72:i32 = load %f |
| store %i_1, %72 |
| loop [b: $B13, c: $B14] { # loop_3 |
| $B13: { # body |
| %73:i32 = load %i_1 |
| %74:i32 = load %to |
| %75:bool = lte %73, %74 |
| if %75 [t: $B15, f: $B16] { # if_4 |
| $B15: { # true |
| exit_if # if_4 |
| } |
| $B16: { # false |
| exit_loop # loop_3 |
| } |
| } |
| %76:i32 = load %i_1 |
| %x_327:i32 = let %76 |
| %78:ptr<private, i32, read_write> = access %data, %x_327 |
| %79:i32 = load %i_1 |
| %80:ptr<private, i32, read_write> = access %temp, %79 |
| %81:i32 = load %80 |
| store %78, %81 |
| continue # -> $B14 |
| } |
| $B14: { # continuing |
| %82:i32 = load %i_1 |
| %83:i32 = add %82, 1i |
| store %i_1, %83 |
| next_iteration # -> $B13 |
| } |
| } |
| ret |
| } |
| } |
| %func_i1_i1_ = func(%m:ptr<function, i32, read_write>, %high:ptr<function, i32, read_write>):i32 { |
| $B17: { |
| %x:ptr<function, i32, read_write> = var |
| %x_335:ptr<function, i32, read_write> = var |
| %x_336:ptr<function, i32, read_write> = var |
| %90:f32 = load_vector_element %gl_FragCoord, 0u |
| %91:bool = gte %90, 0.0f |
| if %91 [t: $B18, f: $B19] { # if_5 |
| $B18: { # true |
| if false [t: $B20, f: $B21] { # if_6 |
| $B20: { # true |
| %92:i32 = load %high |
| %93:u32 = and 0u, 31u |
| %94:i32 = shl %92, %93 |
| store %x_336, %94 |
| exit_if # if_6 |
| } |
| $B21: { # false |
| store %x_336, 4i |
| exit_if # if_6 |
| } |
| } |
| %95:i32 = load %x_336 |
| %96:u32 = bitcast %95 |
| %97:u32 = and %96, 31u |
| %98:i32 = shl 1i, %97 |
| store %x_335, %98 |
| exit_if # if_5 |
| } |
| $B19: { # false |
| store %x_335, 1i |
| exit_if # if_5 |
| } |
| } |
| %99:i32 = load %x_335 |
| store %x, %99 |
| %100:i32 = load %x |
| %101:u32 = and 4u, 31u |
| %102:i32 = shr %100, %101 |
| store %x, %102 |
| %103:i32 = load %m |
| %x_353:i32 = let %103 |
| %105:i32 = load %m |
| %x_355:i32 = let %105 |
| %107:i32 = load %m |
| %x_357:i32 = let %107 |
| %109:i32 = load %x |
| %x_359:i32 = let %109 |
| %111:i32 = mul 2i, %x_353 |
| %112:i32 = mul 2i, %x_355 |
| %113:i32 = mul 2i, %x_357 |
| %114:i32 = call %tint_div_i32, %113, %x_359 |
| %116:i32 = let %114 |
| %117:i32 = max %111, %112 |
| %118:i32 = min %117, %116 |
| ret %118 |
| } |
| } |
| %mergeSort_ = func():void { |
| $B22: { |
| %low:ptr<function, i32, read_write> = var |
| %high_1:ptr<function, i32, read_write> = var |
| %m_1: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 |
| %param_3:ptr<function, i32, read_write> = var |
| %param_4:ptr<function, i32, read_write> = var |
| store %low, 0i |
| store %high_1, 9i |
| store %m_1, 1i |
| loop [b: $B23, c: $B24] { # loop_4 |
| $B23: { # body |
| %132:i32 = load %m_1 |
| %133:i32 = load %high_1 |
| %134:bool = lte %132, %133 |
| if %134 [t: $B25, f: $B26] { # if_7 |
| $B25: { # true |
| exit_if # if_7 |
| } |
| $B26: { # false |
| exit_loop # loop_4 |
| } |
| } |
| %135:i32 = load %low |
| store %i_2, %135 |
| loop [b: $B27, c: $B28] { # loop_5 |
| $B27: { # body |
| %136:i32 = load %i_2 |
| %137:i32 = load %high_1 |
| %138:bool = lt %136, %137 |
| if %138 [t: $B29, f: $B30] { # if_8 |
| $B29: { # true |
| exit_if # if_8 |
| } |
| $B30: { # false |
| exit_loop # loop_5 |
| } |
| } |
| %139:i32 = load %i_2 |
| store %f_1, %139 |
| %140:i32 = load %i_2 |
| %141:i32 = load %m_1 |
| %142:i32 = add %140, %141 |
| %143:i32 = sub %142, 1i |
| store %mid_1, %143 |
| %144:i32 = load %i_2 |
| %145:i32 = load %m_1 |
| %146:i32 = mul 2i, %145 |
| %147:i32 = add %144, %146 |
| %148:i32 = sub %147, 1i |
| %149:i32 = load %high_1 |
| %150:i32 = min %148, %149 |
| store %to_1, %150 |
| %151:i32 = load %f_1 |
| store %param, %151 |
| %152:i32 = load %mid_1 |
| store %param_1, %152 |
| %153:i32 = load %to_1 |
| store %param_2, %153 |
| %154:void = call %merge_i1_i1_i1_, %param, %param_1, %param_2 |
| continue # -> $B28 |
| } |
| $B28: { # continuing |
| %155:i32 = load %m_1 |
| store %param_3, %155 |
| %156:i32 = load %high_1 |
| store %param_4, %156 |
| %157:i32 = call %func_i1_i1_, %param_3, %param_4 |
| %x_398:i32 = let %157 |
| %159:i32 = load %i_2 |
| %160:i32 = add %159, %x_398 |
| store %i_2, %160 |
| next_iteration # -> $B27 |
| } |
| } |
| continue # -> $B24 |
| } |
| $B24: { # continuing |
| %161:i32 = load %m_1 |
| %162:i32 = mul 2i, %161 |
| store %m_1, %162 |
| next_iteration # -> $B23 |
| } |
| } |
| ret |
| } |
| } |
| %main_1 = func():void { |
| $B31: { |
| %i_3:ptr<function, i32, read_write> = var |
| %j_1:ptr<function, i32, read_write> = var |
| %grey:ptr<function, f32, read_write> = var |
| %167:ptr<uniform, vec2<f32>, read> = access %x_34, 0u |
| %168:f32 = load_vector_element %167, 0u |
| %169:i32 = call %tint_f32_to_i32, %168 |
| store %i_3, %169 |
| loop [b: $B32, c: $B33] { # loop_6 |
| $B32: { # body |
| %171:i32 = load %i_3 |
| %x_99:i32 = let %171 |
| switch %x_99 [c: (9i, $B34), c: (8i, $B35), c: (7i, $B36), c: (6i, $B37), c: (5i, $B38), c: (4i, $B39), c: (3i, $B40), c: (2i, $B41), c: (1i, $B42), c: (0i, $B43), c: (default, $B44)] { # switch_1 |
| $B34: { # case |
| %173:i32 = load %i_3 |
| %x_129:i32 = let %173 |
| %175:ptr<private, i32, read_write> = access %data, %x_129 |
| store %175, -5i |
| exit_switch # switch_1 |
| } |
| $B35: { # case |
| %176:i32 = load %i_3 |
| %x_127:i32 = let %176 |
| %178:ptr<private, i32, read_write> = access %data, %x_127 |
| store %178, -4i |
| exit_switch # switch_1 |
| } |
| $B36: { # case |
| %179:i32 = load %i_3 |
| %x_125:i32 = let %179 |
| %181:ptr<private, i32, read_write> = access %data, %x_125 |
| store %181, -3i |
| exit_switch # switch_1 |
| } |
| $B37: { # case |
| %182:i32 = load %i_3 |
| %x_123:i32 = let %182 |
| %184:ptr<private, i32, read_write> = access %data, %x_123 |
| store %184, -2i |
| exit_switch # switch_1 |
| } |
| $B38: { # case |
| %185:i32 = load %i_3 |
| %x_121:i32 = let %185 |
| %187:ptr<private, i32, read_write> = access %data, %x_121 |
| store %187, -1i |
| exit_switch # switch_1 |
| } |
| $B39: { # case |
| %188:i32 = load %i_3 |
| %x_119:i32 = let %188 |
| %190:ptr<private, i32, read_write> = access %data, %x_119 |
| store %190, 0i |
| exit_switch # switch_1 |
| } |
| $B40: { # case |
| %191:i32 = load %i_3 |
| %x_117:i32 = let %191 |
| %193:ptr<private, i32, read_write> = access %data, %x_117 |
| store %193, 1i |
| exit_switch # switch_1 |
| } |
| $B41: { # case |
| %194:i32 = load %i_3 |
| %x_115:i32 = let %194 |
| %196:ptr<private, i32, read_write> = access %data, %x_115 |
| store %196, 2i |
| exit_switch # switch_1 |
| } |
| $B42: { # case |
| %197:i32 = load %i_3 |
| %x_113:i32 = let %197 |
| %199:ptr<private, i32, read_write> = access %data, %x_113 |
| store %199, 3i |
| exit_switch # switch_1 |
| } |
| $B43: { # case |
| %200:i32 = load %i_3 |
| %x_111:i32 = let %200 |
| %202:ptr<private, i32, read_write> = access %data, %x_111 |
| store %202, 4i |
| exit_switch # switch_1 |
| } |
| $B44: { # case |
| exit_switch # switch_1 |
| } |
| } |
| %203:i32 = load %i_3 |
| %204:i32 = add %203, 1i |
| store %i_3, %204 |
| continue # -> $B33 |
| } |
| $B33: { # continuing |
| %205:i32 = load %i_3 |
| %x_133:i32 = let %205 |
| %207:bool = lt %x_133, 10i |
| %208:bool = eq %207, false |
| break_if %208 # -> [t: exit_loop loop_6, f: $B32] |
| } |
| } |
| store %j_1, 0i |
| loop [b: $B45, c: $B46] { # loop_7 |
| $B45: { # body |
| %209:i32 = load %j_1 |
| %210:bool = lt %209, 10i |
| if %210 [t: $B47, f: $B48] { # if_9 |
| $B47: { # true |
| exit_if # if_9 |
| } |
| $B48: { # false |
| exit_loop # loop_7 |
| } |
| } |
| %211:i32 = load %j_1 |
| %x_142:i32 = let %211 |
| %213:ptr<private, i32, read_write> = access %temp, %x_142 |
| %214:i32 = load %j_1 |
| %215:ptr<private, i32, read_write> = access %data, %214 |
| %216:i32 = load %215 |
| store %213, %216 |
| continue # -> $B46 |
| } |
| $B46: { # continuing |
| %217:i32 = load %j_1 |
| %218:i32 = add %217, 1i |
| store %j_1, %218 |
| next_iteration # -> $B45 |
| } |
| } |
| %219:void = call %mergeSort_ |
| %220:f32 = load_vector_element %gl_FragCoord, 1u |
| %221:i32 = call %tint_f32_to_i32, %220 |
| %222:bool = lt %221, 30i |
| if %222 [t: $B49, f: $B50] { # if_10 |
| $B49: { # true |
| %223:ptr<private, i32, read_write> = access %data, 0i |
| %224:i32 = load %223 |
| %225:f32 = convert %224 |
| %226:f32 = div %225, 10.0f |
| %227:f32 = add 0.5f, %226 |
| store %grey, %227 |
| exit_if # if_10 |
| } |
| $B50: { # false |
| %228:f32 = load_vector_element %gl_FragCoord, 1u |
| %229:i32 = call %tint_f32_to_i32, %228 |
| %230:bool = lt %229, 60i |
| if %230 [t: $B51, f: $B52] { # if_11 |
| $B51: { # true |
| %231:ptr<private, i32, read_write> = access %data, 1i |
| %232:i32 = load %231 |
| %233:f32 = convert %232 |
| %234:f32 = div %233, 10.0f |
| %235:f32 = add 0.5f, %234 |
| store %grey, %235 |
| exit_if # if_11 |
| } |
| $B52: { # false |
| %236:f32 = load_vector_element %gl_FragCoord, 1u |
| %237:i32 = call %tint_f32_to_i32, %236 |
| %238:bool = lt %237, 90i |
| if %238 [t: $B53, f: $B54] { # if_12 |
| $B53: { # true |
| %239:ptr<private, i32, read_write> = access %data, 2i |
| %240:i32 = load %239 |
| %241:f32 = convert %240 |
| %242:f32 = div %241, 10.0f |
| %243:f32 = add 0.5f, %242 |
| store %grey, %243 |
| exit_if # if_12 |
| } |
| $B54: { # false |
| %244:f32 = load_vector_element %gl_FragCoord, 1u |
| %245:i32 = call %tint_f32_to_i32, %244 |
| %246:bool = lt %245, 120i |
| if %246 [t: $B55, f: $B56] { # if_13 |
| $B55: { # true |
| %247:ptr<private, i32, read_write> = access %data, 3i |
| %248:i32 = load %247 |
| %249:f32 = convert %248 |
| %250:f32 = div %249, 10.0f |
| %251:f32 = add 0.5f, %250 |
| store %grey, %251 |
| exit_if # if_13 |
| } |
| $B56: { # false |
| %252:f32 = load_vector_element %gl_FragCoord, 1u |
| %253:i32 = call %tint_f32_to_i32, %252 |
| %254:bool = lt %253, 150i |
| if %254 [t: $B57, f: $B58] { # if_14 |
| $B57: { # true |
| store %continue_execution, false |
| exit_if # if_14 |
| } |
| $B58: { # false |
| %255:f32 = load_vector_element %gl_FragCoord, 1u |
| %256:i32 = call %tint_f32_to_i32, %255 |
| %257:bool = lt %256, 180i |
| if %257 [t: $B59, f: $B60] { # if_15 |
| $B59: { # true |
| %258:ptr<private, i32, read_write> = access %data, 5i |
| %259:i32 = load %258 |
| %260:f32 = convert %259 |
| %261:f32 = div %260, 10.0f |
| %262:f32 = add 0.5f, %261 |
| store %grey, %262 |
| exit_if # if_15 |
| } |
| $B60: { # false |
| %263:f32 = load_vector_element %gl_FragCoord, 1u |
| %264:i32 = call %tint_f32_to_i32, %263 |
| %265:bool = lt %264, 210i |
| if %265 [t: $B61, f: $B62] { # if_16 |
| $B61: { # true |
| %266:ptr<private, i32, read_write> = access %data, 6i |
| %267:i32 = load %266 |
| %268:f32 = convert %267 |
| %269:f32 = div %268, 10.0f |
| %270:f32 = add 0.5f, %269 |
| store %grey, %270 |
| exit_if # if_16 |
| } |
| $B62: { # false |
| %271:f32 = load_vector_element %gl_FragCoord, 1u |
| %272:i32 = call %tint_f32_to_i32, %271 |
| %273:bool = lt %272, 240i |
| if %273 [t: $B63, f: $B64] { # if_17 |
| $B63: { # true |
| %274:ptr<private, i32, read_write> = access %data, 7i |
| %275:i32 = load %274 |
| %276:f32 = convert %275 |
| %277:f32 = div %276, 10.0f |
| %278:f32 = add 0.5f, %277 |
| store %grey, %278 |
| exit_if # if_17 |
| } |
| $B64: { # false |
| %279:f32 = load_vector_element %gl_FragCoord, 1u |
| %280:i32 = call %tint_f32_to_i32, %279 |
| %281:bool = lt %280, 270i |
| if %281 [t: $B65, f: $B66] { # if_18 |
| $B65: { # true |
| %282:ptr<private, i32, read_write> = access %data, 8i |
| %283:i32 = load %282 |
| %284:f32 = convert %283 |
| %285:f32 = div %284, 10.0f |
| %286:f32 = add 0.5f, %285 |
| store %grey, %286 |
| exit_if # if_18 |
| } |
| $B66: { # false |
| store %continue_execution, false |
| exit_if # if_18 |
| } |
| } |
| 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 |
| } |
| } |
| %287:f32 = load %grey |
| %288:vec3<f32> = construct %287 |
| %x_254:vec3<f32> = let %288 |
| %290:f32 = access %x_254, 0u |
| %291:f32 = access %x_254, 1u |
| %292:f32 = access %x_254, 2u |
| %293:vec4<f32> = construct %290, %291, %292, 1.0f |
| store %x_GLF_color, %293 |
| ret |
| } |
| } |
| %tint_symbol = @fragment func(%gl_FragCoord_param:vec4<f32> [@position]):main_out { |
| $B67: { |
| store %gl_FragCoord, %gl_FragCoord_param |
| %296:void = call %main_1 |
| %297:vec4<f32> = load %x_GLF_color |
| %298:main_out = construct %297 |
| %299:bool = load %continue_execution |
| %300:bool = eq %299, false |
| if %300 [t: $B68] { # if_19 |
| $B68: { # true |
| terminate_invocation |
| } |
| } |
| ret %298 |
| } |
| } |
| %tint_div_i32 = func(%lhs:i32, %rhs:i32):i32 { |
| $B69: { |
| %303:bool = eq %rhs, 0i |
| %304:bool = eq %lhs, -2147483648i |
| %305:bool = eq %rhs, -1i |
| %306:bool = and %304, %305 |
| %307:bool = or %303, %306 |
| %308:i32 = select %rhs, 1i, %307 |
| %309:i32 = div %lhs, %308 |
| ret %309 |
| } |
| } |
| %tint_f32_to_i32 = func(%value:f32):i32 { |
| $B70: { |
| %311:i32 = convert %value |
| %312:bool = gte %value, -2147483648.0f |
| %313:i32 = select -2147483648i, %311, %312 |
| %314:bool = lte %value, 2147483520.0f |
| %315:i32 = select 2147483647i, %313, %314 |
| ret %315 |
| } |
| } |
| |
| 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. * |
| ******************************************************************** |