On Tue, Jun 23, 2015 at 2:23 PM, Marta Lofstedt
<marta.lofst...@linux.intel.com> wrote:
> From: Marta Lofstedt <marta.lofst...@intel.com>
>
> According to GLES 3.1 CTS test:
> ES31-CTS.texture_storage_multisample.
> APIGLTexStorage2DMultisample.
> multisample_texture_tex_storage_2d_zero_sample-
>
> A call to glTexStorageMultisample with target
> GL_TEXTURE_2D_MULTISAMPLE and zero samples,
> should return GL_INVALID_VALUE.
>

OpenGL ES 3.1, section 8.8:
"An INVALID_VALUE error is generated if samples is zero"

> However, with above the piglit test:
> gl-3.2-layered-rendering-framebuffertexture fails.
> Hence, only limit this for GLES 3.1 contexts.
>

OpenGL 4.5 say the following about TexStorage2DMultisample:

"Calling TexStorage2DMultisample is equivalent to calling
TexImage2DMultisample with the equivalently named parameters set to
the same values, except that the resulting texture has immutable
format."

and defines the following for TexImage*Multisample():

"An INVALID_VALUE error is generated if samples is zero"

This should cause the INVALID_VALUE error to happen for non-GLES. So
it seems either the Piglit test is wrong, or there's something more
going on. I'd expect the latter, due to some layered rendering
interaction. But I don't know for sure.

> Signed-off-by: Marta Lofstedt <marta.lofst...@linux.intel.com>
> ---
>  src/mesa/main/teximage.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
>
> diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
> index 14af9cd..98f0223 100644
> --- a/src/mesa/main/teximage.c
> +++ b/src/mesa/main/teximage.c
> @@ -5588,6 +5588,16 @@ _mesa_texture_image_multisample(struct gl_context 
> *ctx, GLuint dims,
>     GLenum sample_count_error;
>     bool dsa = strstr(func, "ture") ? true : false;
>
> +   /*
> +    *  According to OpenGL ES 3.1 CTS zero samples
> +    *  should generate GL_INVALID_VALUE
> +    */
> +   if(samples == 0 && _mesa_is_gles31(ctx))
> +   {
> +      _mesa_error(ctx, GL_INVALID_VALUE, "%s(target)", func);
> +      return;
> +   }
> +
>     if (!(ctx->Extensions.ARB_texture_multisample
>        && _mesa_is_desktop_gl(ctx))) {
>        _mesa_error(ctx, GL_INVALID_OPERATION, "%s(unsupported)", func);
> --
> 1.9.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to