0

我正在尝试在 iPad pro 上启动我的应用程序,并在尝试使用分派数据 创建新库时出现错误,如下图所示使用现有构建的 .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 );
};
4

0 回答 0