summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/texobj.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
commit73fd269d2f5aa2a0b9bc03ef904b81e263e3cc37 (patch)
tree1839105a2ce1d882e774437f78e78f28763fbc0f /src/mesa/main/texobj.c
parentf4a93e0665881dd58a95abb6525676bd1cc2e6af (diff)
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 <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/mesa/main/texobj.c')
-rw-r--r--src/mesa/main/texobj.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c
index da27d9236e9..d641e40ad72 100644
--- a/src/mesa/main/texobj.c
+++ b/src/mesa/main/texobj.c
@@ -478,6 +478,12 @@ _mesa_test_texobj_completeness( const struct gl_context *ctx,
return;
}
+ /* Check if the texture values are integer */
+ {
+ GLenum datatype = _mesa_get_format_datatype(baseImage->TexFormat);
+ t->_IsIntegerFormat = datatype == GL_INT || datatype == GL_UNSIGNED_INT;
+ }
+
/* Compute _MaxLevel (the maximum mipmap level we'll sample from given the
* mipmap image sizes and GL_TEXTURE_MAX_LEVEL state).
*/