blob: 22296abd12839c4ef0edef324785b8250d2ae6e2 [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
%33:bool = gt %32, 1.0f
store %c2, %33
%34:bool = load %c2
if %34 [t: $B3] { # if_1
$B3: { # true
ret vec3<f32>(1.0f)
}
}
%35:f32 = load_vector_element %pos, 1u
%36:bool = lt %35, 1.0f
store %c3, %36
%37:bool = load %c3
if %37 [t: $B4] { # if_2
$B4: { # true
ret vec3<f32>(1.0f)
}
}
%38:f32 = load_vector_element %pos, 1u
%39:bool = gt %38, 1.0f
store %c4, %39
%40:bool = load %c4
if %40 [t: $B5] { # if_3
$B5: { # true
ret vec3<f32>(1.0f)
}
}
%41:f32 = load_vector_element %pos, 0u
%42:bool = lt %41, 1.0f
store %c5, %42
%43:bool = load %c5
if %43 [t: $B6] { # if_4
$B6: { # true
ret vec3<f32>(1.0f)
}
}
%44:f32 = load_vector_element %pos, 0u
%45:f32 = add %44, 1.0f
%46:bool = gt %45, 1.0f
store %c6, %46
%47:bool = load %c6
if %47 [t: $B7] { # if_5
$B7: { # true
ret vec3<f32>(1.0f)
}
}
store %GLF_live4i, 0i
loop [b: $B8, c: $B9] { # loop_1
$B8: { # body
%48:i32 = load %GLF_live4i
%49:bool = lt %48, 4i
if %49 [t: $B10, f: $B11] { # if_6
$B10: { # true
exit_if # if_6
}
$B11: { # false
exit_loop # loop_1
}
}
%50:i32 = load %GLF_live4_looplimiter5
%51:bool = gte %50, 7i
if %51 [t: $B12] { # if_7
$B12: { # true
exit_loop # loop_1
}
}
%52:i32 = load %GLF_live4_looplimiter5
%53:i32 = add %52, 1i
store %GLF_live4_looplimiter5, %53
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
%54:i32 = load %GLF_live7cols
%55:bool = lt %54, 4i
if %55 [t: $B15, f: $B16] { # if_8
$B15: { # true
exit_if # if_8
}
$B16: { # false
exit_loop # loop_2
}
}
%56:i32 = load %GLF_live7_looplimiter3
%57:bool = gte %56, 7i
if %57 [t: $B17] { # if_9
$B17: { # true
exit_loop # loop_2
}
}
%58:i32 = load %GLF_live7_looplimiter3
%59:i32 = add %58, 1i
store %GLF_live7_looplimiter3, %59
store %GLF_live7rows, 2i
loop [b: $B18, c: $B19] { # loop_3
$B18: { # body
%60:i32 = load %GLF_live7rows
%61:bool = lt %60, 4i
if %61 [t: $B20, f: $B21] { # if_10
$B20: { # true
exit_if # if_10
}
$B21: { # false
exit_loop # loop_3
}
}
%62:i32 = load %GLF_live7_looplimiter2
%63:bool = gte %62, 7i
if %63 [t: $B22] { # if_11
$B22: { # true
exit_loop # loop_3
}
}
%64:i32 = load %GLF_live7_looplimiter2
%65:i32 = add %64, 1i
store %GLF_live7_looplimiter2, %65
store %GLF_live7_looplimiter1, 0i
store %GLF_live7c, 0i
loop [b: $B23, c: $B24] { # loop_4
$B23: { # body
%66:i32 = load %GLF_live7c
%67:bool = lt %66, 3i
if %67 [t: $B25, f: $B26] { # if_12
$B25: { # true
exit_if # if_12
}
$B26: { # false
exit_loop # loop_4
}
}
%68:i32 = load %GLF_live7_looplimiter1
%69:bool = gte %68, 7i
if %69 [t: $B27] { # if_13
$B27: { # true
exit_loop # loop_4
}
}
%70:i32 = load %GLF_live7_looplimiter1
%71:i32 = add %70, 1i
store %GLF_live7_looplimiter1, %71
store %GLF_live7r, 0i
loop [b: $B28, c: $B29] { # loop_5
$B28: { # body
%72:i32 = load %GLF_live7r
%73:bool = lt %72, 2i
if %73 [t: $B30, f: $B31] { # if_14
$B30: { # true
exit_if # if_14
}
$B31: { # false
exit_loop # loop_5
}
}
%74:i32 = load %GLF_live7_looplimiter0
%75:bool = gte %74, 7i
if %75 [t: $B32] { # if_15
$B32: { # true
exit_loop # loop_5
}
}
%76:i32 = load %GLF_live7_looplimiter0
%77:i32 = add %76, 1i
store %GLF_live7_looplimiter0, %77
%78:i32 = load %GLF_live7c
%x_59:i32 = let %78
%80:i32 = load %GLF_live7c
%x_60:i32 = let %80
%82:i32 = load %GLF_live7c
%x_61:i32 = let %82
%84:i32 = load %GLF_live7r
%x_62:i32 = let %84
%86:i32 = load %GLF_live7r
%x_63:i32 = let %86
%88:i32 = load %GLF_live7r
%x_64:i32 = let %88
%90:bool = gte %x_59, 0i
%91:bool = lt %x_60, 3i
%92:bool = and %90, %91
%93:i32 = select 0i, %x_61, %92
%94:ptr<function, vec3<f32>, read_write> = access %GLF_live7m33, %93
%95:ptr<function, vec3<f32>, read_write> = let %94
%96:bool = gte %x_62, 0i
%97:bool = lt %x_63, 3i
%98:bool = and %96, %97
%99:i32 = select 0i, %x_64, %98
store_vector_element %95, %99, 1.0f
%100:ptr<uniform, vec2<f32>, read> = access %x_25, 0u
%101:f32 = load_vector_element %100, 1u
%102:bool = gt 0.0f, %101
if %102 [t: $B33, f: $B34] { # if_16
$B33: { # true
exit_if # if_16
}
$B34: { # false
%103:i32 = load %GLF_live7c
%x_65:i32 = let %103
%105:i32 = load %GLF_live7c
%x_66:i32 = let %105
%107:i32 = load %GLF_live7c
%x_67:i32 = let %107
%109:i32 = load %GLF_live7r
%x_68:i32 = let %109
%111:i32 = load %GLF_live7r
%x_69:i32 = let %111
%113:i32 = load %GLF_live7r
%x_70:i32 = let %113
%115:bool = gte %x_65, 0i
%116:bool = lt %x_66, 4i
%117:bool = and %115, %116
%118:i32 = select 0i, %x_67, %117
%119:ptr<function, vec2<f32>, read_write> = access %GLF_live7m42, %118
%120:ptr<function, vec2<f32>, read_write> = let %119
%121:bool = gte %x_68, 0i
%122:bool = lt %x_69, 2i
%123:bool = and %121, %122
%124:i32 = select 0i, %x_70, %123
store_vector_element %120, %124, 1.0f
exit_if # if_16
}
}
continue # -> $B29
}
$B29: { # continuing
%125:i32 = load %GLF_live7r
%126:i32 = add %125, 1i
store %GLF_live7r, %126
next_iteration # -> $B28
}
}
continue # -> $B24
}
$B24: { # continuing
%127:i32 = load %GLF_live7c
%128:i32 = add %127, 1i
store %GLF_live7c, %128
next_iteration # -> $B23
}
}
continue # -> $B19
}
$B19: { # continuing
%129:i32 = load %GLF_live7rows
%130:i32 = add %129, 1i
store %GLF_live7rows, %130
next_iteration # -> $B18
}
}
continue # -> $B14
}
$B14: { # continuing
%131:i32 = load %GLF_live7cols
%132:i32 = add %131, 1i
store %GLF_live7cols, %132
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
%133:i32 = load %GLF_live7cols_1
%134:bool = lt %133, 4i
if %134 [t: $B37, f: $B38] { # if_17
$B37: { # true
exit_if # if_17
}
$B38: { # false
exit_loop # loop_6
}
}
%135:i32 = load %GLF_live7_looplimiter7
%136:bool = gte %135, 7i
if %136 [t: $B39] { # if_18
$B39: { # true
exit_loop # loop_6
}
}
%137:i32 = load %GLF_live7_looplimiter7
%138:i32 = add %137, 1i
store %GLF_live7_looplimiter7, %138
store %GLF_live7rows_1, 2i
%139:i32 = load %GLF_live7sum_index
%x_83:i32 = let %139
%141:i32 = load %GLF_live7sum_index
%x_84:i32 = let %141
%143:i32 = load %GLF_live7sum_index
%x_85:i32 = let %143
%145:bool = gte %x_83, 0i
%146:bool = lt %x_84, 9i
%147:bool = and %145, %146
%148:i32 = select 0i, %x_85, %147
%149:ptr<function, f32, read_write> = access %GLF_live7sums, %148
store %149, 0.0f
store %GLF_live7c_1, 0i
loop [b: $B40, c: $B41] { # loop_7
$B40: { # body
%150:i32 = load %GLF_live7c_1
%151:bool = lt %150, 1i
if %151 [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
%152:i32 = load %GLF_live7r_1
%153:i32 = load %GLF_live7rows_1
%154:bool = lt %152, %153
if %154 [t: $B46, f: $B47] { # if_20
$B46: { # true
exit_if # if_20
}
$B47: { # false
exit_loop # loop_8
}
}
%155:i32 = load %GLF_live7sum_index
%156:i32 = load %GLF_live7sum_index
%157:bool = gte %156, 0i
%158:i32 = load %GLF_live7sum_index
%159:bool = lt %158, 9i
%160:bool = and %157, %159
%161:i32 = select 0i, %155, %160
%x_310:i32 = let %161
%163:mat3x3<f32> = load %GLF_live7m33
%164:mat3x3<f32> = transpose %163
%x_312:mat3x3<f32> = let %164
%166:i32 = load %GLF_live7c_1
%167:bool = lt %166, 3i
if %167 [t: $B48, f: $B49] { # if_21
$B48: { # true
store %x_180, 1i
exit_if # if_21
}
$B49: { # false
%168:ptr<uniform, vec2<f32>, read> = access %x_25, 0u
%169:f32 = load_vector_element %168, 0u
%170:i32 = call %tint_f32_to_i32, %169
store %x_180, %170
exit_if # if_21
}
}
%172:i32 = load %x_180
%x_320:i32 = let %172
%174:i32 = load %GLF_live7r_1
%x_93:i32 = let %174
store %indexable, %x_312
%176:ptr<function, f32, read_write> = access %GLF_live7sums, %x_310
%177:ptr<function, f32, read_write> = access %GLF_live7sums, %x_310
%178:f32 = load %177
%179:f32 = let %178
%180:ptr<function, vec3<f32>, read_write> = access %indexable, %x_320
%181:bool = lt %x_93, 3i
%182:i32 = select 0i, 1i, %181
%183:f32 = load_vector_element %180, %182
%184:f32 = add %179, %183
store %176, %184
%185:i32 = load %GLF_live7sum_index
%186:i32 = load %GLF_live7sum_index
%187:bool = gte %186, 0i
%188:i32 = load %GLF_live7sum_index
%189:bool = lt %188, 9i
%190:bool = and %187, %189
%191:i32 = select 0i, %185, %190
%x_332:i32 = let %191
%193:ptr<function, f32, read_write> = access %GLF_live7sums, %x_332
%194:ptr<function, f32, read_write> = access %GLF_live7sums, %x_332
%195:f32 = load %194
%196:ptr<function, vec2<f32>, read_write> = access %GLF_live7m42, 1i
%197:i32 = load %GLF_live7r_1
%198:f32 = load_vector_element %196, %197
%199:f32 = add %195, %198
store %193, %199
continue # -> $B45
}
$B45: { # continuing
%200:i32 = load %GLF_live7r_1
%201:i32 = add %200, 1i
store %GLF_live7r_1, %201
next_iteration # -> $B44
}
}
continue # -> $B41
}
$B41: { # continuing
%202:i32 = load %GLF_live7c_1
%203:i32 = add %202, 1i
store %GLF_live7c_1, %203
next_iteration # -> $B40
}
}
%204:i32 = load %GLF_live7sum_index
%205:i32 = add %204, 1i
store %GLF_live7sum_index, %205
continue # -> $B36
}
$B36: { # continuing
%206:i32 = load %GLF_live7cols_1
%207:i32 = add %206, 1i
store %GLF_live7cols_1, %207
next_iteration # -> $B35
}
}
continue # -> $B9
}
$B9: { # continuing
%208:i32 = load %GLF_live4i
%209:i32 = add %208, 1i
store %GLF_live4i, %209
next_iteration # -> $B8
}
}
ret vec3<f32>(1.0f)
}
}
%main_1 = func():void {
$B50: {
%position_1: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
%216:ptr<uniform, vec2<f32>, read> = access %x_25, 0u
%217:f32 = load_vector_element %216, 0u
%218:bool = gte %217, 2.0f
if %218 [t: $B51] { # if_22
$B51: { # true
%219:vec4<f32> = load %gl_FragCoord
%220:vec2<f32> = swizzle %219, xy
store %position_1, %220
%221:vec2<f32> = load %position_1
store %param, %221
%222:vec3<f32> = call %drawShape_vf2_, %param
%x_168:vec3<f32> = let %222
%224:vec2<f32> = load %position_1
store %param_1, %224
%225:vec3<f32> = call %drawShape_vf2_, %param_1
%x_170:vec3<f32> = let %225
store %i, 25i
loop [b: $B52, c: $B53] { # loop_9
$B52: { # body
%227:i32 = load %i
%228:bool = gt %227, 0i
if %228 [t: $B54, f: $B55] { # if_23
$B54: { # true
exit_if # if_23
}
$B55: { # false
exit_loop # loop_9
}
}
%229:vec2<f32> = load %position_1
store %param_2, %229
%230:vec3<f32> = call %drawShape_vf2_, %param_2
%x_178:vec3<f32> = let %230
continue # -> $B53
}
$B53: { # continuing
%232:i32 = load %i
%233:i32 = sub %232, 1i
store %i, %233
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
%236:void = call %main_1
%237:vec4<f32> = load %x_GLF_color
%238:main_out = construct %237
ret %238
}
}
%tint_f32_to_i32 = func(%value:f32):i32 {
$B57: {
%240:i32 = convert %value
%241:bool = gte %value, -2147483648.0f
%242:i32 = select -2147483648i, %240, %241
%243:bool = lte %value, 2147483520.0f
%244:i32 = select 2147483647i, %242, %243
ret %244
}
}
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. *
********************************************************************