diff options
author | Brian Paul <[email protected]> | 2012-03-17 16:30:03 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2012-03-20 08:23:32 -0600 |
commit | f4a93e0665881dd58a95abb6525676bd1cc2e6af (patch) | |
tree | b7195582ab9d2e5f9e91a964de36dfb06fb057f4 /src/mesa/swrast | |
parent | b219b2c310911286f375d6b9967d5fd39ec1188a (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/swrast')
-rw-r--r-- | src/mesa/swrast/s_context.c | 5 | ||||
-rw-r--r-- | src/mesa/swrast/s_texfilter.c | 6 | ||||
-rw-r--r-- | src/mesa/swrast/s_texfilter.h | 3 |
3 files changed, 10 insertions, 4 deletions
diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c index beb9158794e..432db71c8b0 100644 --- a/src/mesa/swrast/s_context.c +++ b/src/mesa/swrast/s_context.c @@ -30,6 +30,7 @@ #include "main/bufferobj.h" #include "main/colormac.h" #include "main/mtypes.h" +#include "main/samplerobj.h" #include "main/teximage.h" #include "program/prog_parameter.h" #include "program/prog_statevars.h" @@ -482,7 +483,9 @@ _swrast_update_texture_samplers(struct gl_context *ctx) if (tObj) { _mesa_update_fetch_functions(tObj); } - swrast->TextureSample[u] = _swrast_choose_texture_sample_func(ctx, tObj); + swrast->TextureSample[u] = + _swrast_choose_texture_sample_func(ctx, tObj, + _mesa_get_samplerobj(ctx, u)); } } diff --git a/src/mesa/swrast/s_texfilter.c b/src/mesa/swrast/s_texfilter.c index d142d3d0762..412316f369f 100644 --- a/src/mesa/swrast/s_texfilter.c +++ b/src/mesa/swrast/s_texfilter.c @@ -27,6 +27,7 @@ #include "main/context.h" #include "main/colormac.h" #include "main/imports.h" +#include "main/texobj.h" #include "s_context.h" #include "s_texfilter.h" @@ -3612,9 +3613,10 @@ null_sample_func( struct gl_context *ctx, */ texture_sample_func _swrast_choose_texture_sample_func( struct gl_context *ctx, - const struct gl_texture_object *t ) + const struct gl_texture_object *t, + const struct gl_sampler_object *sampler) { - if (!t || !t->_Complete) { + if (!t || !_mesa_is_texture_complete(t, sampler)) { return &null_sample_func; } else { diff --git a/src/mesa/swrast/s_texfilter.h b/src/mesa/swrast/s_texfilter.h index 69f2d80003a..58b57365c72 100644 --- a/src/mesa/swrast/s_texfilter.h +++ b/src/mesa/swrast/s_texfilter.h @@ -35,7 +35,8 @@ struct gl_texture_object; extern texture_sample_func _swrast_choose_texture_sample_func( struct gl_context *ctx, - const struct gl_texture_object *tObj ); + const struct gl_texture_object *tObj, + const struct gl_sampler_object *sampler); #endif |