金属:未知的类型名称数组

时间:2017-05-15 04:16:56

标签: ios macos graphics metal

当我尝试编译项目时,Xcode在

处返回了一个解析错误
fragment half4 f(VertexOutput v [[stage_in]],
             array<texture2d<float>, 10>  src [[ texture(0) ]],
             const * int length,
             sampler samp [[sampler(0)]]){
float4 col = src[0].sample(samp, v.texCoord);
return half4(col);

}

我需要帮助。 xcode表示数组不是有效类型。

1 个答案:

答案 0 :(得分:0)

这一行有几个问题:

const * int length,
  1. 这是无效的C ++。我建议您看this
  2. 在金属中,所有指针都必须使用deviceconstant等地址空间进行限定。
  3. 你可能想要这样的东西:

    device const int *length,