Bug 1048745 - [WebGL2] Extend UniformInfo with WebGL2/GLES3 types. r=jgilbert
authorDan Glastonbury <dglastonbury@mozilla.com>
Tue, 11 Nov 2014 11:18:52 +1000
changeset 242244 d29f55692d810eaea60e836f4b03e78658bd2638
parent 242243 e2888d03c5e88c05761d71b7966fa8002c948a55
child 242245 5b7fe3af9b7014beb596edb527b8e0187ad410ff
push id4311
push userraliiev@mozilla.com
push dateMon, 12 Jan 2015 19:37:41 +0000
treeherdermozilla-beta@150c9fed433b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgilbert
bugs1048745
milestone36.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1048745 - [WebGL2] Extend UniformInfo with WebGL2/GLES3 types. r=jgilbert
dom/canvas/WebGLContextValidate.cpp
dom/canvas/WebGLUniformInfo.h
--- a/dom/canvas/WebGLContextValidate.cpp
+++ b/dom/canvas/WebGLContextValidate.cpp
@@ -1540,30 +1540,48 @@ IsUniformSetterTypeValid(GLenum setterTy
     switch (uniformType) {
     case LOCAL_GL_BOOL:
     case LOCAL_GL_BOOL_VEC2:
     case LOCAL_GL_BOOL_VEC3:
     case LOCAL_GL_BOOL_VEC4:
         return true; // GLfloat(0.0) sets a bool to false.
 
     case LOCAL_GL_INT:
-    case LOCAL_GL_SAMPLER_2D:
-    case LOCAL_GL_SAMPLER_CUBE:
+    case LOCAL_GL_INT_SAMPLER_2D:
+    case LOCAL_GL_INT_SAMPLER_2D_ARRAY:
+    case LOCAL_GL_INT_SAMPLER_3D:
+    case LOCAL_GL_INT_SAMPLER_CUBE:
     case LOCAL_GL_INT_VEC2:
     case LOCAL_GL_INT_VEC3:
     case LOCAL_GL_INT_VEC4:
+    case LOCAL_GL_SAMPLER_2D:
+    case LOCAL_GL_SAMPLER_2D_ARRAY:
+    case LOCAL_GL_SAMPLER_2D_ARRAY_SHADOW:
+    case LOCAL_GL_SAMPLER_2D_SHADOW:
+    case LOCAL_GL_SAMPLER_CUBE:
+    case LOCAL_GL_SAMPLER_CUBE_SHADOW:
+    case LOCAL_GL_UNSIGNED_INT_SAMPLER_2D:
+    case LOCAL_GL_UNSIGNED_INT_SAMPLER_2D_ARRAY:
+    case LOCAL_GL_UNSIGNED_INT_SAMPLER_3D:
+    case LOCAL_GL_UNSIGNED_INT_SAMPLER_CUBE:
         return setterType == LOCAL_GL_INT;
 
     case LOCAL_GL_FLOAT:
+    case LOCAL_GL_FLOAT_MAT2:
+    case LOCAL_GL_FLOAT_MAT2x3:
+    case LOCAL_GL_FLOAT_MAT2x4:
+    case LOCAL_GL_FLOAT_MAT3:
+    case LOCAL_GL_FLOAT_MAT3x2:
+    case LOCAL_GL_FLOAT_MAT3x4:
+    case LOCAL_GL_FLOAT_MAT4:
+    case LOCAL_GL_FLOAT_MAT4x2:
+    case LOCAL_GL_FLOAT_MAT4x3:
     case LOCAL_GL_FLOAT_VEC2:
     case LOCAL_GL_FLOAT_VEC3:
     case LOCAL_GL_FLOAT_VEC4:
-    case LOCAL_GL_FLOAT_MAT2:
-    case LOCAL_GL_FLOAT_MAT3:
-    case LOCAL_GL_FLOAT_MAT4:
         return setterType == LOCAL_GL_FLOAT;
 
     default:
         MOZ_ASSERT(false); // should never get here
         return false;
     }
 }
 
--- a/dom/canvas/WebGLUniformInfo.h
+++ b/dom/canvas/WebGLUniformInfo.h
@@ -23,27 +23,27 @@ struct WebGLUniformInfo {
         switch (type) {
             case LOCAL_GL_FLOAT:
             case LOCAL_GL_INT:
             case LOCAL_GL_UNSIGNED_INT:
             case LOCAL_GL_BOOL:
             case LOCAL_GL_SAMPLER_2D:
             case LOCAL_GL_SAMPLER_3D:
             case LOCAL_GL_SAMPLER_CUBE:
-            case LOCAL_GL_SAMPLER_2D_SHADOW:
-            case LOCAL_GL_SAMPLER_2D_ARRAY:
-            case LOCAL_GL_SAMPLER_2D_ARRAY_SHADOW:
-            case LOCAL_GL_SAMPLER_CUBE_SHADOW:
-            case LOCAL_GL_INT_SAMPLER_2D:
-            case LOCAL_GL_INT_SAMPLER_3D:
-            case LOCAL_GL_INT_SAMPLER_CUBE:
-            case LOCAL_GL_INT_SAMPLER_2D_ARRAY:
-            case LOCAL_GL_UNSIGNED_INT_SAMPLER_2D:
-            case LOCAL_GL_UNSIGNED_INT_SAMPLER_3D:
-            case LOCAL_GL_UNSIGNED_INT_SAMPLER_CUBE:
+            case LOCAL_GL_SAMPLER_2D_SHADOW:
+            case LOCAL_GL_SAMPLER_2D_ARRAY:
+            case LOCAL_GL_SAMPLER_2D_ARRAY_SHADOW:
+            case LOCAL_GL_SAMPLER_CUBE_SHADOW:
+            case LOCAL_GL_INT_SAMPLER_2D:
+            case LOCAL_GL_INT_SAMPLER_3D:
+            case LOCAL_GL_INT_SAMPLER_CUBE:
+            case LOCAL_GL_INT_SAMPLER_2D_ARRAY:
+            case LOCAL_GL_UNSIGNED_INT_SAMPLER_2D:
+            case LOCAL_GL_UNSIGNED_INT_SAMPLER_3D:
+            case LOCAL_GL_UNSIGNED_INT_SAMPLER_CUBE:
             case LOCAL_GL_UNSIGNED_INT_SAMPLER_2D_ARRAY:
                 return 1;
             case LOCAL_GL_FLOAT_VEC2:
             case LOCAL_GL_INT_VEC2:
             case LOCAL_GL_UNSIGNED_INT_VEC2:
             case LOCAL_GL_BOOL_VEC2:
                 return 2;
             case LOCAL_GL_FLOAT_VEC3:
@@ -53,26 +53,26 @@ struct WebGLUniformInfo {
                 return 3;
             case LOCAL_GL_FLOAT_VEC4:
             case LOCAL_GL_INT_VEC4:
             case LOCAL_GL_UNSIGNED_INT_VEC4:
             case LOCAL_GL_BOOL_VEC4:
             case LOCAL_GL_FLOAT_MAT2:
                 return 4;
             case LOCAL_GL_FLOAT_MAT2x3:
-            case LOCAL_GL_FLOAT_MAT3x2:
+            case LOCAL_GL_FLOAT_MAT3x2:
                 return 6;
-            case LOCAL_GL_FLOAT_MAT2x4:
-            case LOCAL_GL_FLOAT_MAT4x2:
-                return 8;
+            case LOCAL_GL_FLOAT_MAT2x4:
+            case LOCAL_GL_FLOAT_MAT4x2:
+                return 8;
             case LOCAL_GL_FLOAT_MAT3:
                 return 9;
-            case LOCAL_GL_FLOAT_MAT3x4:
-            case LOCAL_GL_FLOAT_MAT4x3:
-                return 12;
+            case LOCAL_GL_FLOAT_MAT3x4:
+            case LOCAL_GL_FLOAT_MAT4x3:
+                return 12;
             case LOCAL_GL_FLOAT_MAT4:
                 return 16;
             default:
                 MOZ_ASSERT(false); // should never get here
                 return 0;
         }
     }
 };