1, glGetAttribLocation返回-1
如果在顶点着色器中定义了attribute,但glGetAttribLocation返回-1,其中一个原因是这个attribute没有使用
If the named attribute variable is not an active attribute in the specified program object or if name
starts with the reserved prefix "gl_", a value of -1 is returned.
2, shader创建失败
if必须加花括号,否则某些设备上会创建shader会失败
if()
return ;
必须写成
if()
{
return
}
else
{return ;
}
GPU里面shader注意一下