[Mesa-dev] [RFC PATCH 17/26] mesa: adjust texture completeness for multisample

Chris Forbes chrisf at ijw.co.nz
Sat Dec 29 04:35:30 PST 2012


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 <chrisf at 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.0.3



More information about the mesa-dev mailing list