【发布时间】:2017-08-14 05:56:50
【问题描述】:
我在 macOS 10.12 上有一个 metal 2 着色器,我试图将一个 int 数组传递给它,但 XCode 给了我一个编译时错误Unknown type name 'array'。这是我正在使用的代码:
kernel void computeMandelbrot(texture2d<float, access::write> output [[texture(0)]], constant int &maxIterations [[buffer(1)]], const array<int, 10> &hist [[buffer(2)]], uint2 gid [[thread_position_in_grid]]) {
// Compute Mandelbrot
}
我也尝试过使用关键字constant 而不是const,但我也收到了Parameter may not be qualified with an address space 的错误。我读过 macOS 上的金属不支持纹理数组,但我不确定这是否适用于其他类型的数组。任何帮助将不胜感激,谢谢!
【问题讨论】: