无法使用iOS SDK 11.4构建金属库

时间:2018-07-10 12:02:12

标签: ios macos sdk metal ios11.4

我正在尝试在iPad Pro上启动我的应用程序,并尝试使用已调度的数据创建新库时出现错误,如下图所示 Error on creating new library with existing built .metallib

The library format is not supported or was built with old version of the tools

这是我收到此错误的.metal代码:

#include <metal_stdlib>
#include <simd/simd.h>

using namespace metal;


struct VtxIn
{
packed_float2 pos;
packed_float2 uv0;
};

struct VtxOut
{
float4 pos [[position]];
float2 uv0;
};


vertex VtxOut MainVS    (   device VtxIn*   iVtxA   [[ buffer(0) ]],
                        uint            iIdx    [[ vertex_id ]])
{
VtxOut oVtx;

oVtx.pos = float4( iVtxA[iIdx].pos, 0.0, 1.0 );
oVtx.uv0 = iVtxA[iIdx].uv0;

return oVtx;
}

fragment float4 MainPS  (   VtxOut           iVtx       [[ stage_in]],
                        texture2d<float> iTex2D     [[ texture(0) ]],
                        sampler          iSampler2D [[ sampler(0) ]] )
{
    return iTex2D.sample( iSampler2D, iVtx.uv0 );
};

0 个答案:

没有答案