Don't require draw_buffers as a native ext for WebGL2.
draft
Don't require draw_buffers as a native ext for WebGL2.
--- a/dom/canvas/WebGL2Context.cpp
+++ b/dom/canvas/WebGL2Context.cpp
@@ -56,18 +56,17 @@ WebGL2Context::WrapObject(JSContext* cx,
// WebGL 2 initialisation
// These WebGL 1 extensions are natively supported by WebGL 2.
static const WebGLExtensionID kNativelySupportedExtensions[] = {
WebGLExtensionID::ANGLE_instanced_arrays,
WebGLExtensionID::EXT_blend_minmax,
WebGLExtensionID::OES_element_index_uint,
WebGLExtensionID::OES_standard_derivatives,
- WebGLExtensionID::OES_vertex_array_object,
- WebGLExtensionID::WEBGL_draw_buffers
+ WebGLExtensionID::OES_vertex_array_object
};
static const gl::GLFeature kRequiredFeatures[] = {
gl::GLFeature::blend_minmax,
gl::GLFeature::clear_buffers,
gl::GLFeature::copy_buffer,
gl::GLFeature::depth_texture,
gl::GLFeature::draw_instanced,
--- a/dom/canvas/WebGLContextState.cpp
+++ b/dom/canvas/WebGLContextState.cpp
@@ -137,17 +137,17 @@ WebGLContext::GetParameter(JSContext* cx
return JS::Int32Value(MINVALUE_GL_MAX_RENDERBUFFER_SIZE);
default:
// Return the real value; we're not overriding this one
break;
}
}
- if (IsExtensionEnabled(WebGLExtensionID::WEBGL_draw_buffers)) {
+ if (IsWebGL2() || IsExtensionEnabled(WebGLExtensionID::WEBGL_draw_buffers)) {
if (pname == LOCAL_GL_MAX_COLOR_ATTACHMENTS) {
return JS::Int32Value(mImplMaxColorAttachments);
} else if (pname == LOCAL_GL_MAX_DRAW_BUFFERS) {
return JS::Int32Value(mImplMaxDrawBuffers);
} else if (pname >= LOCAL_GL_DRAW_BUFFER0 &&
pname < GLenum(LOCAL_GL_DRAW_BUFFER0 + mImplMaxDrawBuffers))