我試圖編譯我在OpenGLES 2.0着色器:glGetShaderiv回報率大於1的值
/* Try compiling the shader. */
GL_CHECK(glCompileShader(*pShader));
GL_CHECK(glGetShaderiv(*pShader, GL_COMPILE_STATUS, &iStatus));
glGetShaderiv返回iStatus大於1,當我嘗試獲取登錄信息,我得到空字符串:
if (iStatus > 1)
{
GLsizei slen = 0;
GLchar* compiler_log = (GLchar*)malloc(iStatus);
glGetShaderInfoLog(*pShader, iStatus, &slen, compiler_log);
cout <<"compiler_log:\n"<<compiler_log<<endl;
free (compiler_log);
}
着色器:
attribute vec4 av4position;
attribute vec3 av3colour;
attribute vec2 av2texture;
uniform mat4 mvp;
varying vec3 vv3colour;
varying vec2 vv2texture;
void main()
{
// Pass the texture coordinate attribute to a varying.
vv2texture = av2texture;
// Pass the color value to a varying.
vv3colour = av3colour;
gl_Position = mvp * av4position;
}
是否有人有任何想法,爲什麼?
你剛剛在解決這個問題後就放棄了這個問題,或者你對已發佈的答案有任何疑問? –
我剛剛解決了它,我將重新格式化我的問題,並在下班後添加答案。 –
仍在等待該解決方案,與已有的現有答案不同。 –