1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:38:11 +00:00

LibGL: Implement glDepthRange

This commit is contained in:
Stephan Unverwerth 2021-08-16 17:52:12 +02:00 committed by Andreas Kling
parent 3dd9efd35f
commit a97dbd2317
7 changed files with 26 additions and 1 deletions

View file

@ -1641,6 +1641,18 @@ void SoftwareGLContext::gl_draw_elements(GLenum mode, GLsizei count, GLenum type
glEnd();
}
void SoftwareGLContext::gl_depth_range(GLdouble min, GLdouble max)
{
APPEND_TO_CALL_LIST_AND_RETURN_IF_NEEDED(gl_depth_range, min, max);
RETURN_WITH_ERROR_IF(m_in_draw_state, GL_INVALID_OPERATION);
auto options = m_rasterizer.options();
options.depth_min = clamp(min, 0.f, 1.f);
options.depth_max = clamp(max, 0.f, 1.f);
m_rasterizer.set_options(options);
}
// General helper function to read arbitrary vertex attribute data into a float array
void SoftwareGLContext::read_from_vertex_attribute_pointer(VertexAttribPointer const& attrib, int index, float* elements, bool normalize)
{