在片段着色器中,以下编译良好:
uniform isampler2D testTexture;
/* in main() x, y, xoff and yoff are declared as int and assigned here, then... */
int tmp = texelFetchOffset(testTexture, ivec2(x, y), 0, ivec2(xoff, yoff)).r;
但是,以下内容无法编译:
uniform usampler2D testTexture;
/* in main() x, y, xoff and yoff are declared as uint and assigned here, then... */
uint tmp = texelFetchOffset(testTexture, uvec2(x, y), 0, uvec2(xoff, yoff)).r;
OpenGL 4.2 驱动程序提供以下编译器错误消息:
错误 C1115: 无法找到兼容的重载函数 "texelFetchOffset(usampler2D, uvec2, int, uvec2)
这是用于 Quadro 5010M 的 Nvidia 的 Linux 驱动程序 290.* - 但我想知道我是否犯了(初学者)错误并且没有在这里以某种方式进行规范?