diff --git a/dom/canvas/WebGLShaderValidator.cpp b/dom/canvas/WebGLShaderValidator.cpp index a338844f01f1..5336d8401e8e 100644 --- a/dom/canvas/WebGLShaderValidator.cpp +++ b/dom/canvas/WebGLShaderValidator.cpp @@ -148,7 +148,10 @@ WebGLContext::CreateShaderValidator(GLenum shaderType) const resources.MaxCombinedTextureImageUnits = mGLMaxTextureUnits; resources.MaxTextureImageUnits = mGLMaxTextureImageUnits; resources.MaxFragmentUniformVectors = mGLMaxFragmentUniformVectors; - resources.MaxDrawBuffers = mGLMaxDrawBuffers; + + const bool hasMRTs = (IsWebGL2() || + IsExtensionEnabled(WebGLExtensionID::WEBGL_draw_buffers)); + resources.MaxDrawBuffers = (hasMRTs ? mGLMaxDrawBuffers : 1); if (IsExtensionEnabled(WebGLExtensionID::EXT_frag_depth)) resources.EXT_frag_depth = 1;