diff options
author | Jelle Raaijmakers <jelle@gmta.nl> | 2021-12-24 14:46:45 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-12-27 11:58:43 +0100 |
commit | b455e6ca0d84c73d28fc990975655a2158aea1b8 (patch) | |
tree | 1592006f21122dcb5976bee7b54e05c35e58caad | |
parent | 688adba1a88f028f19de7274794fa29a8f653615 (diff) | |
download | serenity-b455e6ca0d84c73d28fc990975655a2158aea1b8.zip |
LibGL: Stub `glClear` support for stencil buffer
Previously, if the client supplied `GL_STENCIL_BUFFER_BIT`, `glClear`
would return an error. Since it is a valid parameter, we now continue
and report that this parameter is unimplemented instead.
-rw-r--r-- | Userland/Libraries/LibGL/SoftwareGLContext.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Userland/Libraries/LibGL/SoftwareGLContext.cpp b/Userland/Libraries/LibGL/SoftwareGLContext.cpp index 2aad429270..d786b2f01d 100644 --- a/Userland/Libraries/LibGL/SoftwareGLContext.cpp +++ b/Userland/Libraries/LibGL/SoftwareGLContext.cpp @@ -181,7 +181,7 @@ void SoftwareGLContext::gl_clear(GLbitfield mask) APPEND_TO_CALL_LIST_AND_RETURN_IF_NEEDED(gl_clear, mask); RETURN_WITH_ERROR_IF(m_in_draw_state, GL_INVALID_OPERATION); - RETURN_WITH_ERROR_IF(mask & ~(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT), GL_INVALID_ENUM); + RETURN_WITH_ERROR_IF(mask & ~(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT), GL_INVALID_ENUM); if (mask & GL_COLOR_BUFFER_BIT) m_rasterizer.clear_color(m_clear_color); @@ -190,6 +190,8 @@ void SoftwareGLContext::gl_clear(GLbitfield mask) m_rasterizer.clear_depth(static_cast<float>(m_clear_depth)); // FIXME: implement GL_STENCIL_BUFFER_BIT + if (mask & GL_STENCIL_BUFFER_BIT) + dbgln_if(GL_DEBUG, "gl_clear(): GL_STENCIL_BUFFER_BIT is unimplemented"); } void SoftwareGLContext::gl_clear_color(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) |