aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main/texparam.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2012-03-17 16:30:03 -0600
committerBrian Paul <[email protected]>2012-03-20 08:23:32 -0600
commitf4a93e0665881dd58a95abb6525676bd1cc2e6af (patch)
treeb7195582ab9d2e5f9e91a964de36dfb06fb057f4 /src/mesa/main/texparam.c
parentb219b2c310911286f375d6b9967d5fd39ec1188a (diff)
mesa: rework texture completeness testing
Instead of gl_texture_object::_Complete there are now two fields: _BaseComplete and _MipmapComplete. The former indicates whether the base texture level is valid. The later indicates whether the whole mipmap is valid. With sampler objects, a single texture can appear to be both complete and incomplete at the same time. See the GL_ARB_sampler_objects spec for more details. To implement this we now check if the texture is complete with respect to a sampler state. Another benefit of this is we no longer need to invalidate a texture's completeness state when we change the minification/magnification filters with glTexParameter(). Reviewed-by: José Fonseca <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/mesa/main/texparam.c')
-rw-r--r--src/mesa/main/texparam.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c
index 205f51f4231..9abc503e314 100644
--- a/src/mesa/main/texparam.c
+++ b/src/mesa/main/texparam.c
@@ -212,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.
@@ -242,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:
@@ -251,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;
}