From d92047c74da2f4c15926351d7f7f0798a77f5e38 Mon Sep 17 00:00:00 2001 From: Jelle Raaijmakers Date: Mon, 21 Feb 2022 01:30:23 +0100 Subject: [PATCH] LibGL: Clamp color in `glClearColor` to 0..1 --- Userland/Libraries/LibGL/SoftwareGLContext.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Userland/Libraries/LibGL/SoftwareGLContext.cpp b/Userland/Libraries/LibGL/SoftwareGLContext.cpp index eb751807a7..fe2b858b81 100644 --- a/Userland/Libraries/LibGL/SoftwareGLContext.cpp +++ b/Userland/Libraries/LibGL/SoftwareGLContext.cpp @@ -280,6 +280,7 @@ void SoftwareGLContext::gl_clear_color(GLclampf red, GLclampf green, GLclampf bl RETURN_WITH_ERROR_IF(m_in_draw_state, GL_INVALID_OPERATION); m_clear_color = { red, green, blue, alpha }; + m_clear_color.clamp(0.f, 1.f); } void SoftwareGLContext::gl_clear_depth(GLdouble depth)