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

Marta Lofstedt marta.lofstedt at linux.intel.com
Tue Jun 23 05:23:11 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_
invalid_and_border_case_texture_sizes.

Textures of size 0x0 are not allowed for
GL_TEXTURE_2D_MULTISAMPLE.

Signed-off-by: Marta Lofstedt <marta.lofstedt at linux.intel.com>
---
 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;
+
       return GL_TRUE;
 
    case GL_TEXTURE_3D:
-- 
1.9.1



More information about the mesa-dev mailing list