Mesa (7.10): mesa: fix texstore of DEPTH24_STENCIL8 if srcFormat is STENCIL_INDEX

Marek Olšák mareko at kemper.freedesktop.org
Fri Jun 24 21:19:35 UTC 2011


Module: Mesa
Branch: 7.10
Commit: a312052add1a1454d46e5065708dad841deaeaae
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a312052add1a1454d46e5065708dad841deaeaae

Author: Marek Olšák <maraeo at gmail.com>
Date:   Tue Jun 21 05:10:26 2011 +0200

mesa: fix texstore of DEPTH24_STENCIL8 if srcFormat is STENCIL_INDEX

NOTE: This is a candidate for the 7.10 branch.
(cherry picked from commit e41a91cea764cc1ba95906251cd907d837225293)

---

 src/mesa/main/texstore.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c
index 2e6b667..558037b 100644
--- a/src/mesa/main/texstore.c
+++ b/src/mesa/main/texstore.c
@@ -3038,10 +3038,12 @@ _mesa_texstore_z24_s8(TEXSTORE_PARAMS)
    GLint img, row;
 
    ASSERT(dstFormat == MESA_FORMAT_Z24_S8);
-   ASSERT(srcFormat == GL_DEPTH_STENCIL_EXT || srcFormat == GL_DEPTH_COMPONENT);
+   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);
 
-   if (srcFormat != GL_DEPTH_COMPONENT && ctx->Pixel.DepthScale == 1.0f &&
+   if (srcFormat == GL_DEPTH_STENCIL && ctx->Pixel.DepthScale == 1.0f &&
        ctx->Pixel.DepthBias == 0.0f &&
        !srcPacking->SwapBytes) {
       /* simple path */
@@ -3052,7 +3054,8 @@ _mesa_texstore_z24_s8(TEXSTORE_PARAMS)
                      srcWidth, srcHeight, srcDepth, srcFormat, srcType,
                      srcAddr, srcPacking);
    }
-   else if (srcFormat == GL_DEPTH_COMPONENT) {
+   else if (srcFormat == GL_DEPTH_COMPONENT ||
+            srcFormat == GL_STENCIL_INDEX) {
       /* In case we only upload depth we need to preserve the stencil */
       for (img = 0; img < srcDepth; img++) {
 	 GLuint *dstRow = (GLuint *) dstAddr




More information about the mesa-commit mailing list