https://bugs.llvm.org/show_bug.cgi?id=42028

            Bug ID: 42028
           Summary: Metal Crash
           Product: new-bugs
           Version: unspecified
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]

Created attachment 22020
  --> https://bugs.llvm.org/attachment.cgi?id=22020&action=edit
Crash backtrace

Compile the Code and metal compiler crash

#include <metal_stdlib>
using namespace metal;

struct VertexOutput
{
    float4 gl_Position [[position]];
};

struct VertexContext
{
    constant float4x4& projection;
    constant float3& position;
    union
    {
        VertexOutput out;
        struct
        {
            float4 gl_Position;
        };
    };

    VertexOutput main()
    {
        out.gl_Position = float4(position, 1.0);
        return out;
    }
};

vertex VertexOutput vertexShader(constant float4x4& projection [[buffer(0)]],
                                 constant float3& position [[buffer(1)]])
{
    auto b = VertexContext
    {
        .position = position,
        .projection = projection,
    }.main();
    VertexOutput d = b;
    return d;
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to