mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 05:07:35 +00:00
LibGL: Immediately dereference vertex attribute data in display lists
According to the spec, pointers to client data need to be dereferenced immediately when adding calls such as `glDrawElements` or `glArrayElement` to a display list. We were trying to support display lists for these calls but since they only invoke _other_ calls that also support display lists, we can simply defer the display list functionality to them. This fixes the rendering of the ClassiCube port by cflip.
This commit is contained in:
parent
0ea4d228e6
commit
0cf3cb6279
4 changed files with 32 additions and 6 deletions
|
@ -14,7 +14,8 @@ namespace GL {
|
|||
|
||||
void GLContext::gl_array_element(GLint i)
|
||||
{
|
||||
APPEND_TO_CALL_LIST_AND_RETURN_IF_NEEDED(gl_array_element, i);
|
||||
// NOTE: This always dereferences data; display list support is deferred to the
|
||||
// individual vertex attribute calls such as `gl_color`, `gl_normal` etc.
|
||||
RETURN_WITH_ERROR_IF(i < 0, GL_INVALID_VALUE);
|
||||
|
||||
// This is effectively the same as `gl_draw_elements`, except we only output a single
|
||||
|
@ -79,7 +80,8 @@ void GLContext::gl_color_pointer(GLint size, GLenum type, GLsizei stride, void c
|
|||
|
||||
void GLContext::gl_draw_arrays(GLenum mode, GLint first, GLsizei count)
|
||||
{
|
||||
APPEND_TO_CALL_LIST_AND_RETURN_IF_NEEDED(gl_draw_arrays, mode, first, count);
|
||||
// NOTE: This always dereferences data; display list support is deferred to the
|
||||
// individual vertex attribute calls such as `gl_color`, `gl_normal` etc.
|
||||
RETURN_WITH_ERROR_IF(m_in_draw_state, GL_INVALID_OPERATION);
|
||||
|
||||
// FIXME: Some modes are still missing (GL_POINTS, GL_LINE_STRIP, GL_LINE_LOOP, GL_LINES)
|
||||
|
@ -129,7 +131,8 @@ void GLContext::gl_draw_arrays(GLenum mode, GLint first, GLsizei count)
|
|||
|
||||
void GLContext::gl_draw_elements(GLenum mode, GLsizei count, GLenum type, void const* indices)
|
||||
{
|
||||
APPEND_TO_CALL_LIST_AND_RETURN_IF_NEEDED(gl_draw_elements, mode, count, type, indices);
|
||||
// NOTE: This always dereferences data; display list support is deferred to the
|
||||
// individual vertex attribute calls such as `gl_color`, `gl_normal` etc.
|
||||
RETURN_WITH_ERROR_IF(m_in_draw_state, GL_INVALID_OPERATION);
|
||||
|
||||
// FIXME: Some modes are still missing (GL_POINTS, GL_LINE_STRIP, GL_LINE_LOOP, GL_LINES)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue