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/main/texobj.h | |
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/main/texobj.h')
-rw-r--r-- | src/mesa/main/texobj.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mesa/main/texobj.h b/src/mesa/main/texobj.h index 03dfbe3045d..850091e9636 100644 --- a/src/mesa/main/texobj.h +++ b/src/mesa/main/texobj.h @@ -35,6 +35,7 @@ #include "compiler.h" #include "glheader.h" #include "mtypes.h" +#include "samplerobj.h" /** @@ -77,6 +78,18 @@ _mesa_reference_texobj(struct gl_texture_object **ptr, } +/** Is the texture "complete" with respect to the given sampler state? */ +static inline GLboolean +_mesa_is_texture_complete(const struct gl_texture_object *texObj, + const struct gl_sampler_object *sampler) +{ + if (_mesa_is_mipmap_filter(sampler)) + return texObj->_MipmapComplete; + else + return texObj->_BaseComplete; +} + + extern void _mesa_test_texobj_completeness( const struct gl_context *ctx, struct gl_texture_object *obj ); |