LibWeb: Allow WebGL getParameter when WEBGL_draw_buffers is enabled

When that extensions is enabled we should allow getting the parameter
value of MAX_COLOR_ATTACHMENTS_WEBGL.
This commit is contained in:
Undefine 2025-11-05 22:05:23 +01:00 committed by Andreas Kling
parent d4ac9fc5c6
commit 5caead88fc
Notes: github-actions[bot] 2025-11-06 18:04:16 +00:00
6 changed files with 15 additions and 2 deletions

View file

@ -1246,8 +1246,8 @@ JS::Value WebGLRenderingContextImpl::get_parameter(WebIDL::UnsignedLong pname)
set_error(GL_INVALID_ENUM);
return JS::js_null();
}
case GL_MAX_COLOR_ATTACHMENTS: {
if (m_context->webgl_version() == OpenGLContext::WebGLVersion::WebGL2) { // FIXME: Allow this code path for MAX_COLOR_ATTACHMENTS_WEBGL
case GL_MAX_COLOR_ATTACHMENTS: { // NOTE: This has the same value as MAX_COLOR_ATTACHMENTS_WEBGL
if (webgl_draw_buffers_extension_enabled() || m_context->webgl_version() == OpenGLContext::WebGLVersion::WebGL2) {
GLint result { 0 };
glGetIntegervRobustANGLE(GL_MAX_COLOR_ATTACHMENTS, 1, nullptr, &result);
return JS::Value(result);