1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
4 * You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include "WebGLExtensions.h"
10 #include "mozilla/dom/WebGLRenderingContextBinding.h"
11 #include "WebGLContext.h"
12 #include "WebGLFramebuffer.h"
13 #include "WebGLRenderbuffer.h"
14 #include "WebGLTexture.h"
18 WebGLExtensionDrawBuffers::WebGLExtensionDrawBuffers(WebGLContext
* webgl
)
19 : WebGLExtensionBase(webgl
) {
20 MOZ_ASSERT(IsSupported(webgl
), "Don't construct extension if unsupported.");
23 bool WebGLExtensionDrawBuffers::IsSupported(const WebGLContext
* webgl
) {
24 if (webgl
->IsWebGL2()) return false;
26 gl::GLContext
* gl
= webgl
->GL();
27 if (gl
->IsGLES() && gl
->Version() >= 300) {
28 // ANGLE's shader translator can't translate ESSL1 exts to ESSL3. (bug
32 return gl
->IsSupported(gl::GLFeature::draw_buffers
);
35 } // namespace mozilla