mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:37:35 +00:00
LibGL: Implement glGetProgramiv
This commit is contained in:
parent
424e0a2792
commit
1b7b6e6c91
6 changed files with 56 additions and 0 deletions
|
@ -177,4 +177,39 @@ void GLContext::gl_use_program(GLuint program)
|
|||
m_current_program = it->value;
|
||||
}
|
||||
|
||||
void GLContext::gl_get_program(GLuint program, GLenum pname, GLint* params)
|
||||
{
|
||||
auto it = m_allocated_programs.find(program);
|
||||
|
||||
// FIXME: implement check "GL_INVALID_VALUE is generated if program is not a value generated by OpenGL."
|
||||
RETURN_WITH_ERROR_IF(it == m_allocated_programs.end(), GL_INVALID_OPERATION);
|
||||
// FIXME: implement check "GL_INVALID_OPERATION is generated if pname is GL_GEOMETRY_VERTICES_OUT, GL_GEOMETRY_INPUT_TYPE, or GL_GEOMETRY_OUTPUT_TYPE, and program does not contain a geometry shader."
|
||||
|
||||
// FIXME: implement all the other allowed pname values (https://registry.khronos.org/OpenGL-Refpages/gl4/html/glGetProgram.xhtml)
|
||||
RETURN_WITH_ERROR_IF(pname != GL_DELETE_STATUS
|
||||
&& pname != GL_LINK_STATUS
|
||||
&& pname != GL_INFO_LOG_LENGTH,
|
||||
GL_INVALID_ENUM);
|
||||
|
||||
// FIXME: implement check "GL_INVALID_OPERATION is generated if pname is GL_COMPUTE_WORK_GROUP_SIZE and program does not contain a binary for the compute shader stage."
|
||||
|
||||
switch (pname) {
|
||||
case GL_DELETE_STATUS:
|
||||
// FIXME: Return the actual delete status once we implement this missing feature
|
||||
*params = GL_FALSE;
|
||||
break;
|
||||
|
||||
case GL_LINK_STATUS:
|
||||
*params = it->value->link_status() ? GL_TRUE : GL_FALSE;
|
||||
break;
|
||||
|
||||
case GL_INFO_LOG_LENGTH:
|
||||
*params = it->value->info_log_length();
|
||||
break;
|
||||
|
||||
default:
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue