Don't ask the driver about FB attachment color encoding.
draft
Don't ask the driver about FB attachment color encoding.
--- a/dom/canvas/WebGLFramebuffer.cpp
+++ b/dom/canvas/WebGLFramebuffer.cpp
@@ -404,17 +404,19 @@ WebGLFBAttachPoint::GetParameter(const c
MOZ_ASSERT(attachment != LOCAL_GL_DEPTH_STENCIL_ATTACHMENT);
isPNameValid = true;
break;
case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:
if (webgl->IsWebGL2() ||
webgl->IsExtensionEnabled(WebGLExtensionID::EXT_sRGB))
{
- isPNameValid = true;
+ const auto format = Format()->format;
+ return JS::Int32Value(format->isSRGB ? LOCAL_GL_SRGB
+ : LOCAL_GL_LINEAR);
}
break;
////////////////
case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:
if (mTexturePtr)
return JS::Int32Value(MipLevel());