Mesa (master): mesa: condense GL_TEXTURE_RESIDENT query code

Brian Paul brianp at kemper.freedesktop.org
Thu Aug 4 07:22:48 PDT 2011


Module: Mesa
Branch: master
Commit: 1254a2b2e45c6961a57d9c60f561907183ef7de7
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=1254a2b2e45c6961a57d9c60f561907183ef7de7

Author: Brian Paul <brianp at vmware.com>
Date:   Thu Aug  4 08:22:31 2011 -0600

mesa: condense GL_TEXTURE_RESIDENT query code

---

 src/mesa/main/texparam.c |   20 ++++----------------
 1 files changed, 4 insertions(+), 16 deletions(-)

diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c
index 78dcc5d..0dec017 100644
--- a/src/mesa/main/texparam.c
+++ b/src/mesa/main/texparam.c
@@ -1133,14 +1133,8 @@ _mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params )
          }
          break;
       case GL_TEXTURE_RESIDENT:
-         {
-            GLboolean resident;
-            if (ctx->Driver.IsTextureResident)
-               resident = ctx->Driver.IsTextureResident(ctx, obj);
-            else
-               resident = GL_TRUE;
-            *params = ENUM_TO_FLOAT(resident);
-         }
+         *params = ctx->Driver.IsTextureResident ?
+            ctx->Driver.IsTextureResident(ctx, obj) : 1.0F;
          break;
       case GL_TEXTURE_PRIORITY:
          *params = obj->Priority;
@@ -1282,14 +1276,8 @@ _mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params )
          }
          break;;
       case GL_TEXTURE_RESIDENT:
-         {
-            GLboolean resident;
-            if (ctx->Driver.IsTextureResident)
-               resident = ctx->Driver.IsTextureResident(ctx, obj);
-            else
-               resident = GL_TRUE;
-            *params = (GLint) resident;
-         }
+         *params = ctx->Driver.IsTextureResident ?
+            ctx->Driver.IsTextureResident(ctx, obj) : 1;
          break;;
       case GL_TEXTURE_PRIORITY:
          *params = FLOAT_TO_INT(obj->Priority);



More information about the mesa-commit mailing list