Hello,
i’m getting tons of “” errors with the Radeon 2400 and Catalyst 7.7 ( the latests ) on the glLinkProgramARB call.
My code is pretty simple:
//Create the GLSL program
shader.program = glCreateProgramObjectARB();
if ( 0==shader.program )
{
throw Exception(L"The glCreateProgramObjectARB returned NULL. Can't create GLSL program.");
}
//More local variables
GLcharARB info[8192];
GLsizei infoLen;
GLint vsResult, psResult, linkResult;
//-------------------------------------------------
//Vertex shader
//-------------------------------------------------
shader.vs = glCreateShaderObjectARB(GL_VERTEX_SHADER_ARB);
if ( 0==shader.vs )
{
throw Exception(L"The glCreateShaderObjectARB returned NULL."
L"Can't create GLSL fragment shader. Please sure your graphics card supports"
L"vertex shaders 2.0 or above.");
}
const char* vv = _vsCode.c_str();
glShaderSourceARB(shader.vs, 1, &vv, 0);
glCompileShaderARB(shader.vs);
glGetObjectParameterivARB(shader.vs, GL_OBJECT_COMPILE_STATUS_ARB, &vsResult);
glGetInfoLogARB(shader.vs,sizeof(info), &infoLen, info);
l_strInfo += info;
if ( vsResult!=0 )
{
glAttachObjectARB(shader.program, shader.vs);
}
else
{
throw Exception(L"Error compiling vertex shader: "+Utils::UTF8ToUNICODE(info)+
L"With defines : "+Utils::UTF8ToUNICODE(defines));
}
//-------------------------------------------------
//Pixel shader
//-------------------------------------------------
shader.ps = glCreateShaderObjectARB(GL_FRAGMENT_SHADER_ARB);
if ( 0==shader.ps )
{
throw Exception(L"The glCreateShaderObjectARB returned NULL."
L"Can't create GLSL fragment shader. Please sure your graphics card supports"
L"pixel/fragment shaders 2.0 or above.");
}
const char* pp = _psCode.c_str();
glShaderSourceARB(shader.ps, 1, &pp, 0);
glCompileShaderARB(shader.ps);
glGetObjectParameterivARB(shader.ps, GL_OBJECT_COMPILE_STATUS_ARB, &psResult);
glGetInfoLogARB(shader.ps,sizeof(info), &infoLen, info);
l_strInfo += info;
if ( psResult!=0 )
{
glAttachObjectARB(shader.program, shader.ps);
}
else
{
throw Exception(L"Error compiling fragment shader: "+Utils::UTF8ToUNICODE(info)+
L"With defines : "+Utils::UTF8ToUNICODE(defines));
}
//-------------------------------------------------
//Link shader. See http://oss.sgi.com/projects/ogl-sample/registry/ARB/fragment_shader.txt
//-------------------------------------------------
glDeleteObjectARB(shader.vs);//yes, delete them after both are attached
glDeleteObjectARB(shader.ps);
glLinkProgramARB(shader.program);
glGetObjectParameterivARB(shader.program, GL_OBJECT_LINK_STATUS_ARB, &linkResult);
glGetInfoLogARB(shader.program,sizeof(info), &infoLen, info);
l_strInfo += info;
if ( 0==linkResult )
{
throw Exception(L"Error linking GLSL program shader: "+Utils::UTF8ToUNICODE(info)+
L"With defines : "+Utils::UTF8ToUNICODE(defines));
}
In the shader i’m using 10 “uniform sampler2D” and 2 “uniform samplerCube” … which exceed 8 samplers, but the # texture units of the Rad2400 is 16.
Any idea why please? Btw, works ok with an NVIDIA, perhaps is an ATI bug with the new cards only?