freedreno/a6xx: Use the right resource for separate stencil stride
authorKristian H. Kristensen <hoegsberg@chromium.org>
Thu, 31 Jan 2019 23:00:34 +0000 (15:00 -0800)
committerKristian H. Kristensen <hoegsberg@chromium.org>
Mon, 11 Feb 2019 20:26:21 +0000 (12:26 -0800)
Reviewed-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Kristian H. Kristensen <hoegsberg@chromium.org>
src/gallium/drivers/freedreno/a6xx/fd6_gmem.c

index cb5c582476ff7ebfcb4ca942a60f118d4c971f8b..3c9df929655b50ff5e00ec48353b92d4a7881271 100644 (file)
@@ -200,7 +200,7 @@ emit_zs(struct fd_ringbuffer *ring, struct pipe_surface *zsbuf,
 
                if (rsc->stencil) {
                        struct fd_resource_slice *slice = fd_resource_slice(rsc->stencil, 0);
-                       stride = slice->pitch * rsc->cpp;
+                       stride = slice->pitch * rsc->stencil->cpp;
                        size = slice->size0;
                        uint32_t base = gmem ? gmem->zsbuf_base[1] : 0;