Bug 1273752 - Replace GL_VERTEX_PROGRAM_POINT_SIZE with GL_PROGRAM_POINT_SIZE. r=jgilbert draft
authorMorris Tseng <mtseng@mozilla.com>
Mon, 26 Sep 2016 14:31:33 +0800
changeset 418727 e2daa4d606dff003e3166634c9a0a7021ba4effa
parent 417383 29beaebdfaccbdaeb4c1ee5a43a9795ab015ef49
child 532426 81fdb1968a1c51495e5986e582b9f25b043ca19d
push id30765
push userbmo:mtseng@mozilla.com
push dateThu, 29 Sep 2016 01:48:13 +0000
reviewersjgilbert
bugs1273752
milestone52.0a1
Bug 1273752 - Replace GL_VERTEX_PROGRAM_POINT_SIZE with GL_PROGRAM_POINT_SIZE. r=jgilbert MozReview-Commit-ID: 7GO5SwgnI8j
dom/canvas/WebGLContextValidate.cpp
--- a/dom/canvas/WebGLContextValidate.cpp
+++ b/dom/canvas/WebGLContextValidate.cpp
@@ -863,29 +863,21 @@ WebGLContext::InitAndValidateGL(FailureR
                 mGLMaxVaryingVectors = 16;
                 // 16 = 64/4, and 64 is the min value for
                 // maxVertexOutputComponents in the OpenGL 3.2 spec.
             }
         }
     }
 
     if (gl->IsCompatibilityProfile()) {
-        // gl_PointSize is always available in ES2 GLSL, but has to be
-        // specifically enabled on desktop GLSL.
-        gl->fEnable(LOCAL_GL_VERTEX_PROGRAM_POINT_SIZE);
+        gl->fEnable(LOCAL_GL_POINT_SPRITE);
+    }
 
-        /* gl_PointCoord is always available in ES2 GLSL and in newer desktop
-         * GLSL versions, but apparently not in OpenGL 2 and apparently not (due
-         * to a driver bug) on certain NVIDIA setups. See:
-         *   http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=261472
-         *
-         * Note that this used to cause crashes on old ATI drivers... Hopefully
-         * not a significant anymore. See bug 602183.
-         */
-        gl->fEnable(LOCAL_GL_POINT_SPRITE);
+    if (!gl->IsGLES()) {
+        gl->fEnable(LOCAL_GL_PROGRAM_POINT_SIZE);
     }
 
 #ifdef XP_MACOSX
     if (gl->WorkAroundDriverBugs() &&
         gl->Vendor() == gl::GLVendor::ATI &&
         !nsCocoaFeatures::IsAtLeastVersion(10,9))
     {
         // The Mac ATI driver, in all known OSX version up to and including