Bug 1048747 - [WebGL2] Implement GetTexParameter for all valid WebGL2 pnames. r=jgilbert
authorDan Glastonbury <dglastonbury@mozilla.com>
Thu, 06 Nov 2014 13:07:26 +1000
changeset 217929 e2888d03c5e88c05761d71b7966fa8002c948a55
parent 217928 471b25bef3ece5d9e88e6e1ab314f13730db9ac0
child 217930 d29f55692d810eaea60e836f4b03e78658bd2638
push id27898
push usercbook@mozilla.com
push dateFri, 28 Nov 2014 12:40:28 +0000
treeherdermozilla-central@925290052100 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgilbert
bugs1048747
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 1048747 - [WebGL2] Implement GetTexParameter for all valid WebGL2 pnames. r=jgilbert
dom/canvas/WebGL2ContextTextures.cpp
--- a/dom/canvas/WebGL2ContextTextures.cpp
+++ b/dom/canvas/WebGL2ContextTextures.cpp
@@ -455,19 +455,36 @@ WebGL2Context::CompressedTexSubImage3D(G
 {
     MOZ_CRASH("Not Implemented.");
 }
 
 JS::Value
 WebGL2Context::GetTexParameterInternal(const TexTarget& target, GLenum pname)
 {
     switch (pname) {
+        case LOCAL_GL_TEXTURE_BASE_LEVEL:
+        case LOCAL_GL_TEXTURE_COMPARE_FUNC:
+        case LOCAL_GL_TEXTURE_COMPARE_MODE:
         case LOCAL_GL_TEXTURE_IMMUTABLE_FORMAT:
-        case LOCAL_GL_TEXTURE_BASE_LEVEL:
+        case LOCAL_GL_TEXTURE_IMMUTABLE_LEVELS:
         case LOCAL_GL_TEXTURE_MAX_LEVEL:
+        case LOCAL_GL_TEXTURE_SWIZZLE_A:
+        case LOCAL_GL_TEXTURE_SWIZZLE_B:
+        case LOCAL_GL_TEXTURE_SWIZZLE_G:
+        case LOCAL_GL_TEXTURE_SWIZZLE_R:
+        case LOCAL_GL_TEXTURE_WRAP_R:
         {
             GLint i = 0;
             gl->fGetTexParameteriv(target.get(), pname, &i);
             return JS::NumberValue(uint32_t(i));
         }
+
+        case LOCAL_GL_TEXTURE_MAX_LOD:
+        case LOCAL_GL_TEXTURE_MIN_LOD:
+        {
+            GLfloat f = 0.0f;
+            gl->fGetTexParameterfv(target.get(), pname, &f);
+            return JS::NumberValue(float(f));
+        }
     }
+
     return WebGLContext::GetTexParameterInternal(target, pname);
 }