blob: 0d82f344ec9c60544d9ae72025dd0dc8b43f3f22 [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
%x_25: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
}
%drawShape_vf2_ = func(%pos:ptr<function, vec2<f32>, read_write>):vec3<f32> {
$B2: {
%c2:ptr<function, bool, read_write> = var
%c3:ptr<function, bool, read_write> = var
%c4:ptr<function, bool, read_write> = var
%c5:ptr<function, bool, read_write> = var
%c6:ptr<function, bool, read_write> = var
%GLF_live4i:ptr<function, i32, read_write> = var
%GLF_live4_looplimiter5:ptr<function, i32, read_write> = var
%GLF_live7m42:ptr<function, mat4x2<f32>, read_write> = var
%GLF_live7m33:ptr<function, mat3x3<f32>, read_write> = var
%GLF_live7cols:ptr<function, i32, read_write> = var
%GLF_live7_looplimiter3:ptr<function, i32, read_write> = var
%GLF_live7rows:ptr<function, i32, read_write> = var
%GLF_live7_looplimiter2:ptr<function, i32, read_write> = var
%GLF_live7_looplimiter1:ptr<function, i32, read_write> = var
%GLF_live7c:ptr<function, i32, read_write> = var
%GLF_live7r:ptr<function, i32, read_write> = var
%GLF_live7_looplimiter0:ptr<function, i32, read_write> = var
%GLF_live7sum_index:ptr<function, i32, read_write> = var
%GLF_live7_looplimiter7:ptr<function, i32, read_write> = var
%GLF_live7cols_1:ptr<function, i32, read_write> = var
%GLF_live7rows_1:ptr<function, i32, read_write> = var
%GLF_live7sums:ptr<function, array<f32, 9>, read_write> = var
%GLF_live7c_1:ptr<function, i32, read_write> = var
%GLF_live7r_1:ptr<function, i32, read_write> = var
%x_180:ptr<function, i32, read_write> = var
%indexable:ptr<function, mat3x3<f32>, read_write> = var
%32:f32 = load_vector_element %pos, 0u
%x_182:f32 = let %32
%34:bool = gt %x_182, 1.0f
store %c2, %34
%35:bool = load %c2
%x_184:bool = let %35
if %x_184 [t: $B3] { # if_1
$B3: { # true
ret vec3<f32>(1.0f)
}
}
%37:f32 = load_vector_element %pos, 1u
%x_188:f32 = let %37
%39:bool = lt %x_188, 1.0f
store %c3, %39
%40:bool = load %c3
%x_190:bool = let %40
if %x_190 [t: $B4] { # if_2
$B4: { # true
ret vec3<f32>(1.0f)
}
}
%42:f32 = load_vector_element %pos, 1u
%x_194:f32 = let %42
%44:bool = gt %x_194, 1.0f
store %c4, %44
%45:bool = load %c4
%x_196:bool = let %45
if %x_196 [t: $B5] { # if_3
$B5: { # true
ret vec3<f32>(1.0f)
}
}
%47:f32 = load_vector_element %pos, 0u
%x_200:f32 = let %47
%49:bool = lt %x_200, 1.0f
store %c5, %49
%50:bool = load %c5
%x_202:bool = let %50
if %x_202 [t: $B6] { # if_4
$B6: { # true
ret vec3<f32>(1.0f)
}
}
%52:f32 = load_vector_element %pos, 0u
%x_206:f32 = let %52
%54:f32 = add %x_206, 1.0f
%55:bool = gt %54, 1.0f
store %c6, %55
%56:bool = load %c6
%x_209:bool = let %56
if %x_209 [t: $B7] { # if_5
$B7: { # true
ret vec3<f32>(1.0f)
}
}
store %GLF_live4i, 0i
loop [b: $B8, c: $B9] { # loop_1
$B8: { # body
%58:i32 = load %GLF_live4i
%x_39:i32 = let %58
%60:bool = lt %x_39, 4i
if %60 [t: $B10, f: $B11] { # if_6
$B10: { # true
exit_if # if_6
}
$B11: { # false
exit_loop # loop_1
}
}
%61:i32 = load %GLF_live4_looplimiter5
%x_40:i32 = let %61
%63:bool = gte %x_40, 7i
if %63 [t: $B12] { # if_7
$B12: { # true
exit_loop # loop_1
}
}
%64:i32 = load %GLF_live4_looplimiter5
%x_41:i32 = let %64
%66:i32 = add %x_41, 1i
store %GLF_live4_looplimiter5, %66
store %GLF_live7m42, mat4x2<f32>(vec2<f32>(1.0f, 0.0f), vec2<f32>(0.0f, 1.0f), vec2<f32>(0.0f), vec2<f32>(1.0f, 0.0f))
store %GLF_live7m33, mat3x3<f32>(vec3<f32>(1.0f, 0.0f, 0.0f), vec3<f32>(0.0f, 1.0f, 0.0f), vec3<f32>(0.0f, 0.0f, 1.0f))
store %GLF_live7cols, 2i
loop [b: $B13, c: $B14] { # loop_2
$B13: { # body
%67:i32 = load %GLF_live7cols
%x_43:i32 = let %67
%69:bool = lt %x_43, 4i
if %69 [t: $B15, f: $B16] { # if_8
$B15: { # true
exit_if # if_8
}
$B16: { # false
exit_loop # loop_2
}
}
%70:i32 = load %GLF_live7_looplimiter3
%x_44:i32 = let %70
%72:bool = gte %x_44, 7i
if %72 [t: $B17] { # if_9
$B17: { # true
exit_loop # loop_2
}
}
%73:i32 = load %GLF_live7_looplimiter3
%x_45:i32 = let %73
%75:i32 = add %x_45, 1i
store %GLF_live7_looplimiter3, %75
store %GLF_live7rows, 2i
loop [b: $B18, c: $B19] { # loop_3
$B18: { # body
%76:i32 = load %GLF_live7rows
%x_47:i32 = let %76
%78:bool = lt %x_47, 4i
if %78 [t: $B20, f: $B21] { # if_10
$B20: { # true
exit_if # if_10
}
$B21: { # false
exit_loop # loop_3
}
}
%79:i32 = load %GLF_live7_looplimiter2
%x_48:i32 = let %79
%81:bool = gte %x_48, 7i
if %81 [t: $B22] { # if_11
$B22: { # true
exit_loop # loop_3
}
}
%82:i32 = load %GLF_live7_looplimiter2
%x_49:i32 = let %82
%84:i32 = add %x_49, 1i
store %GLF_live7_looplimiter2, %84
store %GLF_live7_looplimiter1, 0i
store %GLF_live7c, 0i
loop [b: $B23, c: $B24] { # loop_4
$B23: { # body
%85:i32 = load %GLF_live7c
%x_51:i32 = let %85
%87:bool = lt %x_51, 3i
if %87 [t: $B25, f: $B26] { # if_12
$B25: { # true
exit_if # if_12
}
$B26: { # false
exit_loop # loop_4
}
}
%88:i32 = load %GLF_live7_looplimiter1
%x_52:i32 = let %88
%90:bool = gte %x_52, 7i
if %90 [t: $B27] { # if_13
$B27: { # true
exit_loop # loop_4
}
}
%91:i32 = load %GLF_live7_looplimiter1
%x_53:i32 = let %91
%93:i32 = add %x_53, 1i
store %GLF_live7_looplimiter1, %93
store %GLF_live7r, 0i
loop [b: $B28, c: $B29] { # loop_5
$B28: { # body
%94:i32 = load %GLF_live7r
%x_55:i32 = let %94
%96:bool = lt %x_55, 2i
if %96 [t: $B30, f: $B31] { # if_14
$B30: { # true
exit_if # if_14
}
$B31: { # false
exit_loop # loop_5
}
}
%97:i32 = load %GLF_live7_looplimiter0
%x_56:i32 = let %97
%99:bool = gte %x_56, 7i
if %99 [t: $B32] { # if_15
$B32: { # true
exit_loop # loop_5
}
}
%100:i32 = load %GLF_live7_looplimiter0
%x_57:i32 = let %100
%102:i32 = add %x_57, 1i
store %GLF_live7_looplimiter0, %102
%103:i32 = load %GLF_live7c
%x_59:i32 = let %103
%105:i32 = load %GLF_live7c
%x_60:i32 = let %105
%107:i32 = load %GLF_live7c
%x_61:i32 = let %107
%109:i32 = load %GLF_live7r
%x_62:i32 = let %109
%111:i32 = load %GLF_live7r
%x_63:i32 = let %111
%113:i32 = load %GLF_live7r
%x_64:i32 = let %113
%115:bool = gte %x_59, 0i
%116:bool = lt %x_60, 3i
%117:bool = and %115, %116
%118:i32 = select 0i, %x_61, %117
%119:ptr<function, vec3<f32>, read_write> = access %GLF_live7m33, %118
%120:ptr<function, vec3<f32>, read_write> = let %119
%121:bool = gte %x_62, 0i
%122:bool = lt %x_63, 3i
%123:bool = and %121, %122
%124:i32 = select 0i, %x_64, %123
store_vector_element %120, %124, 1.0f
%125:ptr<uniform, vec2<f32>, read> = access %x_25, 0u
%126:f32 = load_vector_element %125, 1u
%x_267:f32 = let %126
%128:bool = gt 0.0f, %x_267
if %128 [t: $B33, f: $B34] { # if_16
$B33: { # true
exit_if # if_16
}
$B34: { # false
%129:i32 = load %GLF_live7c
%x_65:i32 = let %129
%131:i32 = load %GLF_live7c
%x_66:i32 = let %131
%133:i32 = load %GLF_live7c
%x_67:i32 = let %133
%135:i32 = load %GLF_live7r
%x_68:i32 = let %135
%137:i32 = load %GLF_live7r
%x_69:i32 = let %137
%139:i32 = load %GLF_live7r
%x_70:i32 = let %139
%141:bool = gte %x_65, 0i
%142:bool = lt %x_66, 4i
%143:bool = and %141, %142
%144:i32 = select 0i, %x_67, %143
%145:ptr<function, vec2<f32>, read_write> = access %GLF_live7m42, %144
%146:ptr<function, vec2<f32>, read_write> = let %145
%147:bool = gte %x_68, 0i
%148:bool = lt %x_69, 2i
%149:bool = and %147, %148
%150:i32 = select 0i, %x_70, %149
store_vector_element %146, %150, 1.0f
exit_if # if_16
}
}
continue # -> $B29
}
$B29: { # continuing
%151:i32 = load %GLF_live7r
%x_71:i32 = let %151
%153:i32 = add %x_71, 1i
store %GLF_live7r, %153
next_iteration # -> $B28
}
}
continue # -> $B24
}
$B24: { # continuing
%154:i32 = load %GLF_live7c
%x_73:i32 = let %154
%156:i32 = add %x_73, 1i
store %GLF_live7c, %156
next_iteration # -> $B23
}
}
continue # -> $B19
}
$B19: { # continuing
%157:i32 = load %GLF_live7rows
%x_75:i32 = let %157
%159:i32 = add %x_75, 1i
store %GLF_live7rows, %159
next_iteration # -> $B18
}
}
continue # -> $B14
}
$B14: { # continuing
%160:i32 = load %GLF_live7cols
%x_77:i32 = let %160
%162:i32 = add %x_77, 1i
store %GLF_live7cols, %162
next_iteration # -> $B13
}
}
store %GLF_live7sum_index, 0i
store %GLF_live7_looplimiter7, 0i
store %GLF_live7cols_1, 2i
loop [b: $B35, c: $B36] { # loop_6
$B35: { # body
%163:i32 = load %GLF_live7cols_1
%x_79:i32 = let %163
%165:bool = lt %x_79, 4i
if %165 [t: $B37, f: $B38] { # if_17
$B37: { # true
exit_if # if_17
}
$B38: { # false
exit_loop # loop_6
}
}
%166:i32 = load %GLF_live7_looplimiter7
%x_80:i32 = let %166
%168:bool = gte %x_80, 7i
if %168 [t: $B39] { # if_18
$B39: { # true
exit_loop # loop_6
}
}
%169:i32 = load %GLF_live7_looplimiter7
%x_81:i32 = let %169
%171:i32 = add %x_81, 1i
store %GLF_live7_looplimiter7, %171
store %GLF_live7rows_1, 2i
%172:i32 = load %GLF_live7sum_index
%x_83:i32 = let %172
%174:i32 = load %GLF_live7sum_index
%x_84:i32 = let %174
%176:i32 = load %GLF_live7sum_index
%x_85:i32 = let %176
%178:bool = gte %x_83, 0i
%179:bool = lt %x_84, 9i
%180:bool = and %178, %179
%181:i32 = select 0i, %x_85, %180
%182:ptr<function, f32, read_write> = access %GLF_live7sums, %181
store %182, 0.0f
store %GLF_live7c_1, 0i
loop [b: $B40, c: $B41] { # loop_7
$B40: { # body
%183:i32 = load %GLF_live7c_1
%x_86:i32 = let %183
%185:bool = lt %x_86, 1i
if %185 [t: $B42, f: $B43] { # if_19
$B42: { # true
exit_if # if_19
}
$B43: { # false
exit_loop # loop_7
}
}
store %GLF_live7r_1, 0i
loop [b: $B44, c: $B45] { # loop_8
$B44: { # body
%186:i32 = load %GLF_live7r_1
%x_87:i32 = let %186
%188:i32 = load %GLF_live7rows_1
%x_88:i32 = let %188
%190:bool = lt %x_87, %x_88
if %190 [t: $B46, f: $B47] { # if_20
$B46: { # true
exit_if # if_20
}
$B47: { # false
exit_loop # loop_8
}
}
%191:i32 = load %GLF_live7sum_index
%x_89:i32 = let %191
%193:i32 = load %GLF_live7sum_index
%x_90:i32 = let %193
%195:i32 = load %GLF_live7sum_index
%x_91:i32 = let %195
%197:bool = gte %x_89, 0i
%198:bool = lt %x_90, 9i
%199:bool = and %197, %198
%200:i32 = select 0i, %x_91, %199
%x_310:i32 = let %200
%202:mat3x3<f32> = load %GLF_live7m33
%x_311:mat3x3<f32> = let %202
%204:mat3x3<f32> = transpose %x_311
%x_312:mat3x3<f32> = let %204
%206:i32 = load %GLF_live7c_1
%x_92:i32 = let %206
%208:bool = lt %x_92, 3i
if %208 [t: $B48, f: $B49] { # if_21
$B48: { # true
store %x_180, 1i
exit_if # if_21
}
$B49: { # false
%209:ptr<uniform, vec2<f32>, read> = access %x_25, 0u
%210:f32 = load_vector_element %209, 0u
%x_318:f32 = let %210
%212:i32 = call %tint_f32_to_i32, %x_318
store %x_180, %212
exit_if # if_21
}
}
%214:i32 = load %x_180
%x_320:i32 = let %214
%216:i32 = load %GLF_live7r_1
%x_93:i32 = let %216
store %indexable, %x_312
%218:ptr<function, vec3<f32>, read_write> = access %indexable, %x_320
%219:bool = lt %x_93, 3i
%220:i32 = select 0i, 1i, %219
%221:f32 = load_vector_element %218, %220
%x_324:f32 = let %221
%223:ptr<function, f32, read_write> = access %GLF_live7sums, %x_310
%224:f32 = load %223
%x_326:f32 = let %224
%226:ptr<function, f32, read_write> = access %GLF_live7sums, %x_310
%227:f32 = add %x_326, %x_324
store %226, %227
%228:i32 = load %GLF_live7sum_index
%x_94:i32 = let %228
%230:i32 = load %GLF_live7sum_index
%x_95:i32 = let %230
%232:i32 = load %GLF_live7sum_index
%x_96:i32 = let %232
%234:bool = gte %x_94, 0i
%235:bool = lt %x_95, 9i
%236:bool = and %234, %235
%237:i32 = select 0i, %x_96, %236
%x_332:i32 = let %237
%239:i32 = load %GLF_live7r_1
%x_97:i32 = let %239
%241:ptr<function, vec2<f32>, read_write> = access %GLF_live7m42, 1i
%242:f32 = load_vector_element %241, %x_97
%x_334:f32 = let %242
%244:ptr<function, f32, read_write> = access %GLF_live7sums, %x_332
%245:f32 = load %244
%x_336:f32 = let %245
%247:ptr<function, f32, read_write> = access %GLF_live7sums, %x_332
%248:f32 = add %x_336, %x_334
store %247, %248
continue # -> $B45
}
$B45: { # continuing
%249:i32 = load %GLF_live7r_1
%x_98:i32 = let %249
%251:i32 = add %x_98, 1i
store %GLF_live7r_1, %251
next_iteration # -> $B44
}
}
continue # -> $B41
}
$B41: { # continuing
%252:i32 = load %GLF_live7c_1
%x_100:i32 = let %252
%254:i32 = add %x_100, 1i
store %GLF_live7c_1, %254
next_iteration # -> $B40
}
}
%255:i32 = load %GLF_live7sum_index
%x_102:i32 = let %255
%257:i32 = add %x_102, 1i
store %GLF_live7sum_index, %257
continue # -> $B36
}
$B36: { # continuing
%258:i32 = load %GLF_live7cols_1
%x_104:i32 = let %258
%260:i32 = add %x_104, 1i
store %GLF_live7cols_1, %260
next_iteration # -> $B35
}
}
continue # -> $B9
}
$B9: { # continuing
%261:i32 = load %GLF_live4i
%x_106:i32 = let %261
%263:i32 = add %x_106, 1i
store %GLF_live4i, %263
next_iteration # -> $B8
}
}
ret vec3<f32>(1.0f)
}
}
%main_1 = func():void {
$B50: {
%position:ptr<function, vec2<f32>, read_write> = var
%param:ptr<function, vec2<f32>, read_write> = var
%param_1:ptr<function, vec2<f32>, read_write> = var
%i:ptr<function, i32, read_write> = var
%param_2:ptr<function, vec2<f32>, read_write> = var
%270:ptr<uniform, vec2<f32>, read> = access %x_25, 0u
%271:f32 = load_vector_element %270, 0u
%x_161:f32 = let %271
%273:bool = gte %x_161, 2.0f
if %273 [t: $B51] { # if_22
$B51: { # true
%274:vec4<f32> = load %gl_FragCoord
%x_165:vec4<f32> = let %274
%276:f32 = access %x_165, 0u
%277:f32 = access %x_165, 1u
%278:vec2<f32> = construct %276, %277
store %position, %278
%279:vec2<f32> = load %position
%x_167:vec2<f32> = let %279
store %param, %x_167
%281:vec3<f32> = call %drawShape_vf2_, %param
%x_168:vec3<f32> = let %281
%283:vec2<f32> = load %position
%x_169:vec2<f32> = let %283
store %param_1, %x_169
%285:vec3<f32> = call %drawShape_vf2_, %param_1
%x_170:vec3<f32> = let %285
store %i, 25i
loop [b: $B52, c: $B53] { # loop_9
$B52: { # body
%287:i32 = load %i
%x_108:i32 = let %287
%289:bool = gt %x_108, 0i
if %289 [t: $B54, f: $B55] { # if_23
$B54: { # true
exit_if # if_23
}
$B55: { # false
exit_loop # loop_9
}
}
%290:vec2<f32> = load %position
%x_177:vec2<f32> = let %290
store %param_2, %x_177
%292:vec3<f32> = call %drawShape_vf2_, %param_2
%x_178:vec3<f32> = let %292
continue # -> $B53
}
$B53: { # continuing
%294:i32 = load %i
%x_109:i32 = let %294
%296:i32 = sub %x_109, 1i
store %i, %296
next_iteration # -> $B52
}
}
exit_if # if_22
}
}
store %x_GLF_color, vec4<f32>(1.0f, 0.0f, 0.0f, 1.0f)
ret
}
}
%tint_symbol = @fragment func(%gl_FragCoord_param:vec4<f32> [@position]):main_out {
$B56: {
store %gl_FragCoord, %gl_FragCoord_param
%299:void = call %main_1
%300:vec4<f32> = load %x_GLF_color
%301:main_out = construct %300
ret %301
}
}
%tint_f32_to_i32 = func(%value:f32):i32 {
$B57: {
%303:i32 = convert %value
%304:bool = gte %value, -2147483648.0f
%305:i32 = select -2147483648i, %303, %304
%306:bool = lte %value, 2147483520.0f
%307:i32 = select 2147483647i, %305, %306
ret %307
}
}
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. *
********************************************************************