GL_TEXTURE_2D_MULTISAMPLE and GL_TEXTURE_2D_MULTISAMPLE_ARRAY targets
don't allow filtering state to be set, but the default state fails the
completeness check for integer formats.

We still care about other reasons the texture might be considered
incomplete though, so can't skip this entirely like GL_TEXTURE_BUFFER.

Signed-off-by: Chris Forbes <chr...@ijw.co.nz>
---
 src/mesa/main/texobj.h | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/mesa/main/texobj.h b/src/mesa/main/texobj.h
index f86b4eb..f8a935b 100644
--- a/src/mesa/main/texobj.h
+++ b/src/mesa/main/texobj.h
@@ -107,7 +107,13 @@ _mesa_is_texture_complete(const struct gl_texture_object 
*texObj,
         (sampler->MinFilter != GL_NEAREST &&
          sampler->MinFilter != GL_NEAREST_MIPMAP_NEAREST))) {
       /* If the format is integer, only nearest filtering is allowed */
-      return GL_FALSE;
+      /* ignore this for texture targets that don't have filtering state:
+       * multisample, multisample array, maybe texture buffer (but TBO
+       * bypasses validation entirely) */
+      if (texObj->Target != GL_TEXTURE_2D_MULTISAMPLE &&
+         texObj->Target != GL_TEXTURE_2D_MULTISAMPLE_ARRAY) {
+         return GL_FALSE;
+      }
    }
 
    if (_mesa_is_mipmap_filter(sampler))
-- 
1.8.1.2

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to