blob: 53042c0a8827c89fb6bf2afb1014e1a5a3657081 [file] [log] [blame]
SKIP: FAILED
../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: buf0 = 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
%gl_FragCoord:ptr<private, vec4<f32>, read_write> = var
%x_10:ptr<uniform, buf0, read> = var @binding_point(0, 0)
%x_GLF_color:ptr<private, vec4<f32>, read_write> = var
}
%collatz_i1_ = func(%v:ptr<function, i32, read_write>):i32 {
$B2: {
%count:ptr<function, i32, read_write> = var
store %count, 0i
loop [b: $B3, c: $B4] { # loop_1
$B3: { # body
%7:i32 = load %v
%x_89:i32 = let %7
%9:bool = gt %x_89, 1i
if %9 [t: $B5, f: $B6] { # if_1
$B5: { # true
exit_if # if_1
}
$B6: { # false
exit_loop # loop_1
}
}
%10:i32 = load %v
%x_92:i32 = let %10
%12:i32 = and %x_92, 1i
%13:bool = eq %12, 1i
if %13 [t: $B7, f: $B8] { # if_2
$B7: { # true
%14:i32 = load %v
%x_98:i32 = let %14
%16:i32 = mul 3i, %x_98
%17:i32 = add %16, 1i
store %v, %17
exit_if # if_2
}
$B8: { # false
%18:i32 = load %v
%x_101:i32 = let %18
%20:i32 = call %tint_div_i32, %x_101, 2i
store %v, %20
exit_if # if_2
}
}
%22:i32 = load %count
%x_103:i32 = let %22
%24:i32 = add %x_103, 1i
store %count, %24
continue # -> $B4
}
$B4: { # continuing
next_iteration # -> $B3
}
}
%25:i32 = load %count
%x_105:i32 = let %25
ret %x_105
}
}
%main_1 = func():void {
$B9: {
%lin:ptr<function, vec2<f32>, read_write> = var
%v_1:ptr<function, i32, read_write> = var
%param:ptr<function, i32, read_write> = var
%indexable:ptr<function, array<vec4<f32>, 16>, read_write> = var
%32:vec4<f32> = load %gl_FragCoord
%x_63:vec4<f32> = let %32
%34:ptr<uniform, vec2<f32>, read> = access %x_10, 0u
%35:vec2<f32> = load %34
%x_66:vec2<f32> = let %35
%37:f32 = access %x_63, 0u
%38:f32 = access %x_63, 1u
%39:vec2<f32> = construct %37, %38
%40:vec2<f32> = div %39, %x_66
store %lin, %40
%41:vec2<f32> = load %lin
%x_68:vec2<f32> = let %41
%43:vec2<f32> = mul %x_68, 8.0f
%44:vec2<f32> = floor %43
store %lin, %44
%45:f32 = load_vector_element %lin, 0u
%x_72:f32 = let %45
%47:f32 = load_vector_element %lin, 1u
%x_76:f32 = let %47
%49:i32 = call %tint_f32_to_i32, %x_72
%51:i32 = mul %49, 8i
%52:i32 = let %51
%53:i32 = call %tint_f32_to_i32, %x_76
%54:i32 = add %52, %53
store %v_1, %54
%55:i32 = load %v_1
%x_79:i32 = let %55
store %param, %x_79
%57:i32 = call %collatz_i1_, %param
%x_80:i32 = let %57
store %indexable, array<vec4<f32>, 16>(vec4<f32>(0.0f, 0.0f, 0.0f, 1.0f), vec4<f32>(0.5f, 0.0f, 0.0f, 1.0f), vec4<f32>(0.0f, 0.5f, 0.0f, 1.0f), vec4<f32>(0.5f, 0.5f, 0.0f, 1.0f), vec4<f32>(0.0f, 0.0f, 0.5f, 1.0f), vec4<f32>(0.5f, 0.0f, 0.5f, 1.0f), vec4<f32>(0.0f, 0.5f, 0.5f, 1.0f), vec4<f32>(0.5f, 0.5f, 0.5f, 1.0f), vec4<f32>(0.0f, 0.0f, 0.0f, 1.0f), vec4<f32>(1.0f, 0.0f, 0.0f, 1.0f), vec4<f32>(0.0f, 1.0f, 0.0f, 1.0f), vec4<f32>(1.0f, 1.0f, 0.0f, 1.0f), vec4<f32>(0.0f, 0.0f, 1.0f, 1.0f), vec4<f32>(1.0f, 0.0f, 1.0f, 1.0f), vec4<f32>(0.0f, 1.0f, 1.0f, 1.0f), vec4<f32>(1.0f))
%59:i32 = call %tint_mod_i32, %x_80, 16i
%61:ptr<function, vec4<f32>, read_write> = access %indexable, %59
%62:vec4<f32> = load %61
%x_83:vec4<f32> = let %62
store %x_GLF_color, %x_83
ret
}
}
%tint_symbol = @fragment func(%gl_FragCoord_param:vec4<f32> [@position]):main_out {
$B10: {
store %gl_FragCoord, %gl_FragCoord_param
%66:void = call %main_1
%67:vec4<f32> = load %x_GLF_color
%68:main_out = construct %67
ret %68
}
}
%tint_div_i32 = func(%lhs:i32, %rhs:i32):i32 {
$B11: {
%71:bool = eq %rhs, 0i
%72:bool = eq %lhs, -2147483648i
%73:bool = eq %rhs, -1i
%74:bool = and %72, %73
%75:bool = or %71, %74
%76:i32 = select %rhs, 1i, %75
%77:i32 = div %lhs, %76
ret %77
}
}
%tint_mod_i32 = func(%lhs_1:i32, %rhs_1:i32):i32 { # %lhs_1: 'lhs', %rhs_1: 'rhs'
$B12: {
%80:bool = eq %rhs_1, 0i
%81:bool = eq %lhs_1, -2147483648i
%82:bool = eq %rhs_1, -1i
%83:bool = and %81, %82
%84:bool = or %80, %83
%85:i32 = select %rhs_1, 1i, %84
%86:i32 = let %85
%87:i32 = div %lhs_1, %86
%88:i32 = mul %87, %86
%89:i32 = sub %lhs_1, %88
ret %89
}
}
%tint_f32_to_i32 = func(%value:f32):i32 {
$B13: {
%91:i32 = convert %value
%92:bool = gte %value, -2147483648.0f
%93:i32 = select -2147483648i, %91, %92
%94:bool = lte %value, 2147483520.0f
%95:i32 = select 2147483647i, %93, %94
ret %95
}
}
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. *
********************************************************************