我正在尝试在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 );
};