[llvm-bugs] [Bug 42028] New: Metal Crash

via llvm-bugs llvm-bugs at lists.llvm.org
Mon May 27 00:56:32 PDT 2019


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: unassignedbugs at nondot.org
          Reporter: fanwj at mail.ustc.edu.cn
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190527/1ac40037/attachment.html>


More information about the llvm-bugs mailing list