[Mesa-dev] [PATCH V2 14/22] mesa: adjust texture completeness for multisample

Eric Anholt eric at anholt.net
Tue Feb 5 15:00:23 PST 2013


Chris Forbes <chrisf at ijw.co.nz> writes:

> 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;
> +      }
>     }

In _mesa_initialize_texture_object, we've got target-dependent init of
the MinFilter.  Wouldn't it make sense to just set that to NEAREST for
MS textures?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20130205/2157997e/attachment.pgp>


More information about the mesa-dev mailing list