Mesa (master): mesa: fix texStore for FORMAT_Z32_FLOAT_S8X24_UINT

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Sep 13 03:29:19 UTC 2019


Module: Mesa
Branch: master
Commit: 33aa039acf9ca8d1049a772e97ecdf769416aeb4
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=33aa039acf9ca8d1049a772e97ecdf769416aeb4

Author: Jiadong Zhu <Jiadong.Zhu at amd.com>
Date:   Tue Jul 30 04:13:15 2019 -0400

mesa: fix texStore for FORMAT_Z32_FLOAT_S8X24_UINT

_mesa_texstore_z32f_x24s8 calculates source rowStride at a
pace of 64-bit, this will make inaccuracy offset if the width
of src image is an odd number. Modify src pointer to int_32* as
source image format is gl_float which is 32-bit per pixel.

Reviewed by Ilia Mirkin

Signed-off-by: Jiadong Zhu <Jiadong.Zhu at amd.com>
Signed-off-by: Marek Olšák <marek.olsak at amd.com>

---

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

diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c
old mode 100644
new mode 100755
index 2913d4bc067..207695041a7
--- a/src/mesa/main/texstore.c
+++ b/src/mesa/main/texstore.c
@@ -538,7 +538,7 @@ _mesa_texstore_z32f_x24s8(TEXSTORE_PARAMS)
    GLint img, row;
    const GLint srcRowStride
       = _mesa_image_row_stride(srcPacking, srcWidth, srcFormat, srcType)
-      / sizeof(uint64_t);
+         / sizeof(int32_t);
 
    assert(dstFormat == MESA_FORMAT_Z32_FLOAT_S8X24_UINT);
    assert(srcFormat == GL_DEPTH_STENCIL ||
@@ -551,8 +551,8 @@ _mesa_texstore_z32f_x24s8(TEXSTORE_PARAMS)
    /* In case we only upload depth we need to preserve the stencil */
    for (img = 0; img < srcDepth; img++) {
       uint64_t *dstRow = (uint64_t *) dstSlices[img];
-      const uint64_t *src
-         = (const uint64_t *) _mesa_image_address(dims, srcPacking, srcAddr,
+      const int32_t *src
+         = (const int32_t *) _mesa_image_address(dims, srcPacking, srcAddr,
                srcWidth, srcHeight,
                srcFormat, srcType,
                img, 0, 0);




More information about the mesa-commit mailing list