[MPlayer-cvslog] r35067 - in trunk/libvo: gl_common.c gl_common.h

reimar subversion at mplayerhq.hu
Thu Aug 9 20:49:46 CEST 2012


Author: reimar
Date: Thu Aug  9 20:49:45 2012
New Revision: 35067

Log:
Query correct component to get luminance texture bit depth
and sanity-check result.

Modified:
   trunk/libvo/gl_common.c
   trunk/libvo/gl_common.h

Modified: trunk/libvo/gl_common.c
==============================================================================
--- trunk/libvo/gl_common.c	Wed Aug  8 21:18:02 2012	(r35066)
+++ trunk/libvo/gl_common.c	Thu Aug  9 20:49:45 2012	(r35067)
@@ -573,9 +573,9 @@ void glCreateClearTex(GLenum target, GLe
   mpglTexImage2D(target, 0, fmt, w, h, 0, format, type, init);
   if (format == GL_LUMINANCE && type == GL_UNSIGNED_SHORT) {
     // ensure we get enough bits
-    GLint rs = 16;
-    glGetTexLevelParameteriv(target, 0, GL_TEXTURE_RED_SIZE, &rs);
-    use_depth_l16 = rs < 14;
+    GLint bits = 0;
+    glGetTexLevelParameteriv(target, 0, GL_TEXTURE_LUMINANCE_SIZE, &bits);
+    use_depth_l16 = bits > 0 && bits < 14;
     if (use_depth_l16) {
       fmt = GL_DEPTH_COMPONENT16;
       format = GL_DEPTH_COMPONENT;

Modified: trunk/libvo/gl_common.h
==============================================================================
--- trunk/libvo/gl_common.h	Wed Aug  8 21:18:02 2012	(r35066)
+++ trunk/libvo/gl_common.h	Thu Aug  9 20:49:45 2012	(r35067)
@@ -275,8 +275,8 @@
 #ifndef GL_DEPTH_COMPONENT16
 #define GL_DEPTH_COMPONENT16 0x81A5
 #endif
-#ifndef GL_TEXTURE_RED_SIZE
-#define GL_TEXTURE_RED_SIZE 0x805C
+#ifndef GL_TEXTURE_LUMINANCE_SIZE
+#define GL_TEXTURE_LUMINANCE_SIZE 0x8060
 #endif
 #ifndef GL_DEPTH_TEXTURE_MODE
 #define GL_DEPTH_TEXTURE_MODE 0x884B


More information about the MPlayer-cvslog mailing list