[Mesa-dev] [PATCH 3/6] mesa/es3.1 : Correct error code for zero samples

Marta Lofstedt marta.lofstedt at linux.intel.com
Tue Jun 23 05:23:13 PDT 2015


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.

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

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



More information about the mesa-dev mailing list