[Mesa-dev] [PATCH 1/6] mesa/es3.1: Do not allow zero size multisampled textures

Erik Faye-Lund kusmabite at gmail.com
Tue Jun 23 06:09:04 PDT 2015


On Tue, Jun 23, 2015 at 2:23 PM, Marta Lofstedt
<marta.lofstedt at linux.intel.com> wrote:
> From: Marta Lofstedt <marta.lofstedt at intel.com>
>
> According to GLES 3.1 CTS test:
> ES31-CTS.texture_storage_multisample.
> APIGLTexStorage2DMultisample.
> multisample_texture_tex_storage_2d_
> invalid_and_border_case_texture_sizes.
>
> Textures of size 0x0 are not allowed for
> GL_TEXTURE_2D_MULTISAMPLE.
>

Please quote the spec rather than the CTS. The spec does define this,
in section 8.8 "Multisample Textures":

"An INVALID_VALUE error is generated if width or height is less than 1."

>  src/mesa/main/teximage.c | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
> index 3d85615..c76ad54 100644
> --- a/src/mesa/main/teximage.c
> +++ b/src/mesa/main/teximage.c
> @@ -1483,6 +1483,13 @@ _mesa_legal_texture_dimensions(struct gl_context *ctx, GLenum target,
>           if (height > 0 && !_mesa_is_pow_two(height - 2 * border))
>              return GL_FALSE;
>        }
> +      /*
> +      *  according to GLES 3.1 CTS it is not OK with
> +      *  zero size multisampled textures
> +      */
> +      if (width == 0 && height == 0 && GL_TEXTURE_2D_MULTISAMPLE == target)
> +         return GL_FALSE;
> +

However, this is also the case for TexStorage2D, see section 8.17
"Immutable-Format Texture Images":

"An INVALID_VALUE error is generated if width, height, depth or levels
are less than 1, for commands with the corresponding parameters."

So it seems this patch is somewhat incomplete, and only papers over a
CTS failure.


More information about the mesa-dev mailing list