gpt4 book ai didi

c++ - GLSL 错误 : 2001 - What does this error code mean?

转载 作者:塔克拉玛干 更新时间:2023-11-03 08:02:24 26 4
gpt4 key购买 nike

这是我在编译出错时查询信息日志后得到的。我一直无法找到一个资源来告诉我错误代码的含义!

使用 Ubuntu 9.10 和支持 glsl 1.1 的英特尔移动芯片组。台面驱动程序。

顶点着色器:

#version 110
in vec3 m2d_blendcolor;

out vec3 color;
// out vec2 texcoord0;

void main(void)
{
gl_Position = ftransform();
color = m2d_blendcolor;
}

片段着色器:

#version 110

in vec3 color;

void main(void)
{
gl_FragColor = vec4(color, 1.0);
}

当我初始化我的着色器对象时,我调用:

shader.bindAttrib(0, "m2d_vertex");
shader.bindAttrib(1, "m2d_texcoord0");
shader.bindAttrib(2, "m2d_blend_color");

这些电话

glBindAttribLocation(m_programID/*internal GLuint*/, index, attribName.c_str());

是不是我过早地绑定(bind)了顶点属性?绑定(bind)shader的时候也一定要绑定(bind)吗?

最佳答案

已修复。对于 glsl 1.1,in 和 out 限定符无效。

参见 Khronos OpenGL wiki - Type Qualifier (GLSL) :

The following qualifiers are deprecated as of GLSL 1.30 (OpenGL 3.0) and removed from GLSL 1.40 and above.

The attribute qualifier is effectively equivalent to an input qualifier in vertex shaders. It cannot be used in any other shader stage. It cannot be used in interface blocks.

The varying qualifier is equivalent to the input of a fragment shader or the output of a vertex shader. It cannot be used in any other shader stages. It cannot be used in interface blocks.

关于c++ - GLSL 错误 : 2001 - What does this error code mean?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2394369/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com