summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/texobj.h
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2012-03-17 16:30:03 -0600
committerBrian Paul <brianp@vmware.com>2012-03-20 08:23:32 -0600
commit73fd269d2f5aa2a0b9bc03ef904b81e263e3cc37 (patch)
tree1839105a2ce1d882e774437f78e78f28763fbc0f /src/mesa/main/texobj.h
parentf4a93e0665881dd58a95abb6525676bd1cc2e6af (diff)
downloadexternal_mesa3d-73fd269d2f5aa2a0b9bc03ef904b81e263e3cc37.zip
external_mesa3d-73fd269d2f5aa2a0b9bc03ef904b81e263e3cc37.tar.gz
external_mesa3d-73fd269d2f5aa2a0b9bc03ef904b81e263e3cc37.tar.bz2
mesa: add integer texture completeness check
Per the spec, only nearest filtering is supported for integer textures. Otherwise, the texture is incomplete. Reviewed-by: José Fonseca <jfonseca@vmware.com> Reviewed-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'src/mesa/main/texobj.h')
-rw-r--r--src/mesa/main/texobj.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mesa/main/texobj.h b/src/mesa/main/texobj.h
index 850091e..c020b90 100644
--- a/src/mesa/main/texobj.h
+++ b/src/mesa/main/texobj.h
@@ -83,6 +83,14 @@ static inline GLboolean
_mesa_is_texture_complete(const struct gl_texture_object *texObj,
const struct gl_sampler_object *sampler)
{
+ if (texObj->_IsIntegerFormat &&
+ (sampler->MagFilter != GL_NEAREST ||
+ (sampler->MinFilter != GL_NEAREST &&
+ sampler->MinFilter != GL_NEAREST_MIPMAP_NEAREST))) {
+ /* If the format is integer, only nearest filtering is allowed */
+ return GL_FALSE;
+ }
+
if (_mesa_is_mipmap_filter(sampler))
return texObj->_MipmapComplete;
else