mesa: print the Git SHA1 in GL_VERSION for ES1 and ES2.
[mesa.git] / src / mesa / main / texparam.c
index f4ec6338866b3d360174c7b75d448d70bdec4832..9abc503e3149915230dfdc3e91e78c3edc96290a 100644 (file)
@@ -41,6 +41,7 @@
 #include "main/mtypes.h"
 #include "main/state.h"
 #include "main/texcompress.h"
+#include "main/texobj.h"
 #include "main/texparam.h"
 #include "main/teximage.h"
 #include "main/texstate.h"
@@ -211,8 +212,7 @@ flush(struct gl_context *ctx)
 
 /**
  * This is called just prior to changing any texture object state which
- * can effect texture completeness (texture base level, max level,
- * minification filter).
+ * can effect texture completeness (texture base level, max level).
  * Any pending rendering will be flushed out, we'll set the _NEW_TEXTURE
  * state flag and then mark the texture object as 'incomplete' so that any
  * per-texture derived state gets recomputed.
@@ -221,7 +221,7 @@ static inline void
 incomplete(struct gl_context *ctx, struct gl_texture_object *texObj)
 {
    FLUSH_VERTICES(ctx, _NEW_TEXTURE);
-   texObj->_Complete = GL_FALSE;
+   _mesa_dirty_texobj(ctx, texObj, GL_TRUE);
 }
 
 
@@ -241,7 +241,7 @@ set_tex_parameteri(struct gl_context *ctx,
       switch (params[0]) {
       case GL_NEAREST:
       case GL_LINEAR:
-         incomplete(ctx, texObj);
+         flush(ctx);
          texObj->Sampler.MinFilter = params[0];
          return GL_TRUE;
       case GL_NEAREST_MIPMAP_NEAREST:
@@ -250,7 +250,7 @@ set_tex_parameteri(struct gl_context *ctx,
       case GL_LINEAR_MIPMAP_LINEAR:
          if (texObj->Target != GL_TEXTURE_RECTANGLE_NV &&
              texObj->Target != GL_TEXTURE_EXTERNAL_OES) {
-            incomplete(ctx, texObj);
+            flush(ctx);
             texObj->Sampler.MinFilter = params[0];
             return GL_TRUE;
          }
@@ -1114,8 +1114,7 @@ _mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params )
          }
          break;
       case GL_TEXTURE_RESIDENT:
-         *params = ctx->Driver.IsTextureResident ?
-            ctx->Driver.IsTextureResident(ctx, obj) : 1.0F;
+         *params = 1.0F;
          break;
       case GL_TEXTURE_PRIORITY:
          *params = obj->Priority;
@@ -1234,19 +1233,19 @@ _mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params )
    switch (pname) {
       case GL_TEXTURE_MAG_FILTER:
          *params = (GLint) obj->Sampler.MagFilter;
-         break;;
+         break;
       case GL_TEXTURE_MIN_FILTER:
          *params = (GLint) obj->Sampler.MinFilter;
-         break;;
+         break;
       case GL_TEXTURE_WRAP_S:
          *params = (GLint) obj->Sampler.WrapS;
-         break;;
+         break;
       case GL_TEXTURE_WRAP_T:
          *params = (GLint) obj->Sampler.WrapT;
-         break;;
+         break;
       case GL_TEXTURE_WRAP_R:
          *params = (GLint) obj->Sampler.WrapR;
-         break;;
+         break;
       case GL_TEXTURE_BORDER_COLOR:
          {
             GLfloat b[4];
@@ -1259,26 +1258,25 @@ _mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params )
             params[2] = FLOAT_TO_INT(b[2]);
             params[3] = FLOAT_TO_INT(b[3]);
          }
-         break;;
+         break;
       case GL_TEXTURE_RESIDENT:
-         *params = ctx->Driver.IsTextureResident ?
-            ctx->Driver.IsTextureResident(ctx, obj) : 1;
-         break;;
+         *params = 1;
+         break;
       case GL_TEXTURE_PRIORITY:
          *params = FLOAT_TO_INT(obj->Priority);
-         break;;
+         break;
       case GL_TEXTURE_MIN_LOD:
          *params = (GLint) obj->Sampler.MinLod;
-         break;;
+         break;
       case GL_TEXTURE_MAX_LOD:
          *params = (GLint) obj->Sampler.MaxLod;
-         break;;
+         break;
       case GL_TEXTURE_BASE_LEVEL:
          *params = obj->BaseLevel;
-         break;;
+         break;
       case GL_TEXTURE_MAX_LEVEL:
          *params = obj->MaxLevel;
-         break;;
+         break;
       case GL_TEXTURE_MAX_ANISOTROPY_EXT:
          if (!ctx->Extensions.EXT_texture_filter_anisotropic)
             goto invalid_pname;