mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-07 21:59:54 +00:00
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:
parent
d4ac9fc5c6
commit
5caead88fc
Notes:
github-actions[bot]
2025-11-06 18:04:16 +00:00
Author: https://github.com/cqundefine
Commit: 5caead88fc
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6711
Reviewed-by: https://github.com/awesomekling
6 changed files with 15 additions and 2 deletions
|
|
@ -257,6 +257,11 @@ bool WebGL2RenderingContext::oes_standard_derivatives_extension_enabled() const
|
|||
return false;
|
||||
}
|
||||
|
||||
bool WebGL2RenderingContext::webgl_draw_buffers_extension_enabled() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
ReadonlySpan<WebIDL::UnsignedLong> WebGL2RenderingContext::enabled_compressed_texture_formats() const
|
||||
{
|
||||
return m_enabled_compressed_texture_formats;
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@ public:
|
|||
virtual bool ext_texture_filter_anisotropic_extension_enabled() const override;
|
||||
virtual bool angle_instanced_arrays_extension_enabled() const override;
|
||||
virtual bool oes_standard_derivatives_extension_enabled() const override;
|
||||
virtual bool webgl_draw_buffers_extension_enabled() const override;
|
||||
virtual ReadonlySpan<WebIDL::UnsignedLong> enabled_compressed_texture_formats() const override;
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -295,6 +295,11 @@ bool WebGLRenderingContext::oes_standard_derivatives_extension_enabled() const
|
|||
return !!m_oes_standard_derivatives_object_extension;
|
||||
}
|
||||
|
||||
bool WebGLRenderingContext::webgl_draw_buffers_extension_enabled() const
|
||||
{
|
||||
return !!m_webgl_draw_buffers_extension;
|
||||
}
|
||||
|
||||
ReadonlySpan<WebIDL::UnsignedLong> WebGLRenderingContext::enabled_compressed_texture_formats() const
|
||||
{
|
||||
return m_enabled_compressed_texture_formats;
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@ public:
|
|||
virtual bool ext_texture_filter_anisotropic_extension_enabled() const override;
|
||||
virtual bool angle_instanced_arrays_extension_enabled() const override;
|
||||
virtual bool oes_standard_derivatives_extension_enabled() const override;
|
||||
virtual bool webgl_draw_buffers_extension_enabled() const override;
|
||||
virtual ReadonlySpan<WebIDL::UnsignedLong> enabled_compressed_texture_formats() const override;
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ public:
|
|||
virtual bool ext_texture_filter_anisotropic_extension_enabled() const = 0;
|
||||
virtual bool angle_instanced_arrays_extension_enabled() const = 0;
|
||||
virtual bool oes_standard_derivatives_extension_enabled() const = 0;
|
||||
virtual bool webgl_draw_buffers_extension_enabled() const = 0;
|
||||
virtual ReadonlySpan<WebIDL::UnsignedLong> enabled_compressed_texture_formats() const = 0;
|
||||
|
||||
template<typename T>
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue