1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
3 * You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #include "WebGLExtensions.h"
8 #include "mozilla/dom/WebGL2RenderingContextBinding.h"
9 #include "WebGLContext.h"
10 #include "WebGLFormats.h"
14 WebGLExtensionEXTColorBufferFloat::WebGLExtensionEXTColorBufferFloat(
16 : WebGLExtensionBase(webgl
) {
17 MOZ_ASSERT(IsSupported(webgl
), "Don't construct extension if unsupported.");
19 auto& fua
= webgl
->mFormatUsage
;
21 auto fnUpdateUsage
= [&fua
](GLenum sizedFormat
,
22 webgl::EffectiveFormat effFormat
) {
23 auto usage
= fua
->EditUsage(effFormat
);
24 usage
->SetRenderable();
25 fua
->AllowRBFormat(sizedFormat
, usage
);
28 #define FOO(x) fnUpdateUsage(LOCAL_GL_##x, webgl::EffectiveFormat::x)
44 bool WebGLExtensionEXTColorBufferFloat::IsSupported(const WebGLContext
* webgl
) {
45 if (!webgl
->IsWebGL2()) return false;
47 const gl::GLContext
* gl
= webgl
->GL();
48 return gl
->IsSupported(gl::GLFeature::EXT_color_buffer_float
);
51 } // namespace mozilla