[Mesa-dev] [PATCH 3/6] mesa/es3.1 : Correct error code for zero samples
Erik Faye-Lund
kusmabite at gmail.com
Tue Jun 23 06:20:47 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_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.lofstedt at 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 at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list