PDA

View Full Version : glLinkProgram throws an INVALID_VALUE without errors.



hjeldin
10-22-2013, 02:20 AM
Hello everyone,
i'm trying to understand why my code throws an INVALID_VALUE when trying to link a successful attached set of shaders to a program.
I've checked the specifications and it seems that INVALID_VALUE is thrown only when the parameter specified is not a program created by OpenGL, but i'm quite sure it is.

The odd thing is that with NVIDIA drivers v.310 the problem disappears.
The code is the following:


glLinkProgram(m_programId);

GLint linkStatus;
glGetProgramiv(m_programId, GL_LINK_STATUS, &linkStatus);
m_linked = (linkStatus == GL_TRUE);

if(!m_linked)
{
GLint logLength;
glGetProgramiv(m_programId, GL_INFO_LOG_LENGTH, &logLength);

char* log = new char[logLength];
GLsizei length;
glGetProgramInfoLog(m_programId, logLength, &length, log);

m_linkLog = log;

delete[] log;
}
else
m_linkLog = "";

return m_linked;


But glGetProgramiv(m_programId, GL_LINK_STATUS, &linkStatus); returns GL_TRUE, and if i check the INFO_LOG anyways it's always

Any suggestions?

Thanks

hjeldin
10-22-2013, 05:55 AM
Seems like compiling an empty GEOMETRY_SHADER and linking it to the program raises an INVALID_VALUE but the LINK_STATUS and INFO_LOG are empty.
Should i report this to NVIDIA?