【发布时间】:2016-08-03 07:58:42
【问题描述】:
我正在尝试在金属着色器中包含一个头文件。 对于这样的原型,
float4 someFunction(float4 v);
我收到此错误消息,
Unknown type name 'float4'; did you mean 'float'?
似乎它不理解它是着色器程序的标题......尽管其他错误表明它确实如此。比如我这里不指定地址空间,
static float someK = 2.0;
我收到此错误,
Global variables must have a constant address space qualifier
如果我添加可以修复
constant static float someK = 2.0;
如果我使用引用,我也会遇到这些类型的错误,
Reference type must include device, threadgroup, constant, or thread address space qualifier
所以它看起来好像编译器知道它是一个着色器。为什么它不知道float4? :(
【问题讨论】: