LibWeb: Implement WebGL extension OES_standard_derivatives

This commit is contained in:
Undefine
2025-11-05 21:38:41 +01:00
committed by Andreas Kling
parent 2bf35881f9
commit d4ac9fc5c6
Notes: github-actions[bot] 2025-11-06 18:04:25 +00:00
12 changed files with 115 additions and 2 deletions

View File

@@ -1236,8 +1236,8 @@ JS::Value WebGLRenderingContextImpl::get_parameter(WebIDL::UnsignedLong pname)
return JS::Int32Array::create(m_realm, 4, array_buffer);
}
case GL_FRAGMENT_SHADER_DERIVATIVE_HINT: {
if (m_context->webgl_version() == OpenGLContext::WebGLVersion::WebGL2) { // FIXME: Allow this code path for GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES
case GL_FRAGMENT_SHADER_DERIVATIVE_HINT: { // NOTE: This has the same value as GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES
if (oes_standard_derivatives_extension_enabled() || m_context->webgl_version() == OpenGLContext::WebGLVersion::WebGL2) {
GLint result { 0 };
glGetIntegervRobustANGLE(GL_FRAGMENT_SHADER_DERIVATIVE_HINT, 1, nullptr, &result);
return JS::Value(result);