mesa: Add missing types in _mesa_texstore_xx_xx() functions
authorAnuj Phogat <anuj.phogat@gmail.com>
Fri, 21 Mar 2014 19:55:19 +0000 (12:55 -0700)
committerAnuj Phogat <anuj.phogat@gmail.com>
Thu, 1 May 2014 17:58:40 +0000 (10:58 -0700)
Depth-stencil teture targets are allowed to use source data of type
GL_UNSIGNED_INT_24_8_EXT and GL_FLOAT_32_UNSIGNED_INT_24_8_REV.

Fixes few crashes in Khronos OpenGL CTS packed_pixels tests.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/main/texstore.c

index d9096ab..8b369fc 100644 (file)
@@ -2478,7 +2478,9 @@ _mesa_texstore_z24_s8(TEXSTORE_PARAMS)
    ASSERT(srcFormat == GL_DEPTH_STENCIL_EXT ||
           srcFormat == GL_DEPTH_COMPONENT ||
           srcFormat == GL_STENCIL_INDEX);
-   ASSERT(srcFormat != GL_DEPTH_STENCIL_EXT || srcType == GL_UNSIGNED_INT_24_8_EXT);
+   ASSERT(srcFormat != GL_DEPTH_STENCIL_EXT ||
+          srcType == GL_UNSIGNED_INT_24_8_EXT ||
+          srcType == GL_FLOAT_32_UNSIGNED_INT_24_8_REV);
 
    if (srcFormat == GL_DEPTH_COMPONENT ||
        srcFormat == GL_STENCIL_INDEX) {
@@ -2563,7 +2565,8 @@ _mesa_texstore_s8_z24(TEXSTORE_PARAMS)
           srcFormat == GL_DEPTH_COMPONENT ||
           srcFormat == GL_STENCIL_INDEX);
    ASSERT(srcFormat != GL_DEPTH_STENCIL_EXT ||
-          srcType == GL_UNSIGNED_INT_24_8_EXT);
+          srcType == GL_UNSIGNED_INT_24_8_EXT ||
+          srcType == GL_FLOAT_32_UNSIGNED_INT_24_8_REV);
 
    depth = malloc(srcWidth * sizeof(GLuint));
    stencil = malloc(srcWidth * sizeof(GLubyte));
@@ -3422,6 +3425,7 @@ _mesa_texstore_z32f_x24s8(TEXSTORE_PARAMS)
           srcFormat == GL_DEPTH_COMPONENT ||
           srcFormat == GL_STENCIL_INDEX);
    ASSERT(srcFormat != GL_DEPTH_STENCIL ||
+          srcType == GL_UNSIGNED_INT_24_8 ||
           srcType == GL_FLOAT_32_UNSIGNED_INT_24_8_REV);
 
    if (srcFormat == GL_DEPTH_COMPONENT ||