GLSL错误日志在NVIDIA上提供错误的行号

时间:2013-11-03 20:39:40

标签: glsl nvidia

如果我在包含NVIDIA显卡的台式计算机上编译GLSL着色器,则错误消息中的行号错误。它似乎总是实际的行号加三。 在包含ATI显卡的笔记本电脑上,行号是正确的。

以下面的简单GLSL片段着色器为例。它在第6行中包含一个错误,其中texture2D用双t写入。

uniform sampler2D   dirt;
varying vec3    pos;

void main()
{
    vec3 d = ttexture2D(dirt, pos.xy).rgb;
    gl_FragColor = vec4(d, 1.0);
}

NVIDIA编译器给出了以下错误消息:

0(9) : error C1008: undefined variable "ttexture2D"

ATI编译器显示正确的行号:

Fragment shader failed to compile with the following errors:
ERROR: 1:6: error(#202) No matching overloaded function found ttexture2D
ERROR: 1:6: error(#216) Vector field selection out of range 'rgb'
ERROR: error(#273) 2 compilation errors.  No code generated

为什么NVIDIA编译器会给我错误的行号?

编辑:我使用的是NVIDIA驱动程序版本331.58

0 个答案:

没有答案