Bug 1278403 - WebGL doesn't need validation. - r=jrmuizel draft
authorJeff Gilbert <jgilbert@mozilla.com>
Mon, 06 Jun 2016 17:36:08 -0700
changeset 379689 b52fc5c5cce5526f67ad05f9bca11ce4b5aab09d
parent 379688 6f8d02e3ec323e4833db96fc092ea23a6d181585
child 379690 c4a12028be705e5413be707af600ea80f09d4dcf
push id21022
push userbmo:jgilbert@mozilla.com
push dateThu, 16 Jun 2016 15:24:56 +0000
reviewersjrmuizel
bugs1278403
milestone50.0a1
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
dom/canvas/WebGLContext.cpp
--- 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);