Bug 1278403 - WebGL doesn't need validation. - r=jrmuizel
We do all validation in our WebGL layer, we only really generate GL_OOM
from the driver, no other errors.
This is opposed to SkiaGL, which may or may not rely on errors returned
from the driver. This is why I am not just turning on ABORT_ON_ERROR for
all GLContexts.
(Also, later, we should be creating no-error contexts on non-DEBUG builds,
so the driver doesn't replicate our validation. ANGLE already supports
this)
MozReview-Commit-ID: A4RSgzUXfHA
--- a/dom/canvas/WebGLContext.cpp
+++ b/dom/canvas/WebGLContext.cpp
@@ -713,17 +713,18 @@ WebGLContext::CreateAndInitGL(bool force
bool useANGLE = false;
#ifdef XP_WIN
const bool disableANGLE = (gfxPrefs::WebGLDisableANGLE() ||
PR_GetEnv("MOZ_WEBGL_FORCE_OPENGL"));
useANGLE = !disableANGLE;
#endif
- gl::CreateContextFlags flags = gl::CreateContextFlags::NONE;
+ gl::CreateContextFlags flags = gl::CreateContextFlags::NO_VALIDATION;
+
if (forceEnabled) flags |= gl::CreateContextFlags::FORCE_ENABLE_HARDWARE;
if (!IsWebGL2()) flags |= gl::CreateContextFlags::REQUIRE_COMPAT_PROFILE;
if (IsWebGL2()) flags |= gl::CreateContextFlags::PREFER_ES3;
const gl::SurfaceCaps baseCaps = BaseCaps(mOptions, this);
if (useEGL)
return CreateAndInitGLWith(CreateGLWithEGL, baseCaps, flags, out_failReason, out_failureId);