mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 13:57:35 +00:00
LibGL: Prevent limbo state if glEnd
does not support drawing mode
If an unsupported drawing mode was configured, `glEnd` would not reach the line where `m_in_draw_state` was set to `false`. This caused all subsequent invocations to `glBegin` to fail.
This commit is contained in:
parent
52d6ae36cb
commit
12c4491cca
1 changed files with 3 additions and 2 deletions
|
@ -217,6 +217,8 @@ void SoftwareGLContext::gl_end()
|
||||||
// Make sure we had a `glBegin` before this call...
|
// Make sure we had a `glBegin` before this call...
|
||||||
RETURN_WITH_ERROR_IF(!m_in_draw_state, GL_INVALID_OPERATION);
|
RETURN_WITH_ERROR_IF(!m_in_draw_state, GL_INVALID_OPERATION);
|
||||||
|
|
||||||
|
m_in_draw_state = false;
|
||||||
|
|
||||||
triangle_list.clear_with_capacity();
|
triangle_list.clear_with_capacity();
|
||||||
processed_triangles.clear_with_capacity();
|
processed_triangles.clear_with_capacity();
|
||||||
|
|
||||||
|
@ -267,6 +269,7 @@ void SoftwareGLContext::gl_end()
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
vertex_list.clear_with_capacity();
|
vertex_list.clear_with_capacity();
|
||||||
|
dbgln_if(GL_DEBUG, "gl_end: draw mode {:#x} unsupported", m_current_draw_mode);
|
||||||
RETURN_WITH_ERROR_IF(true, GL_INVALID_ENUM);
|
RETURN_WITH_ERROR_IF(true, GL_INVALID_ENUM);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -355,8 +358,6 @@ void SoftwareGLContext::gl_end()
|
||||||
|
|
||||||
m_rasterizer.submit_triangle(triangle, m_texture_units);
|
m_rasterizer.submit_triangle(triangle, m_texture_units);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_in_draw_state = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SoftwareGLContext::gl_frustum(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near_val, GLdouble far_val)
|
void SoftwareGLContext::gl_frustum(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near_val, GLdouble far_val)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue