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

Author: Marek Olšák <[email protected]>
Date:   Fri May  8 16:12:56 2020 -0400

ac/surface: fix broken pitch override on gfx8

Fixes: 441eaef6a9e - amd: unify code for overriding offset and stride for 
imported buffers

Closes: #2920

Reviewed-by: Samuel Pitoiset <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4968>

---

 src/amd/common/ac_surface.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/amd/common/ac_surface.c b/src/amd/common/ac_surface.c
index 86519f216e1..98f1276f425 100644
--- a/src/amd/common/ac_surface.c
+++ b/src/amd/common/ac_surface.c
@@ -2207,9 +2207,11 @@ void ac_surface_override_offset_stride(const struct 
radeon_info *info,
       if (surf->u.gfx9.stencil_offset)
          surf->u.gfx9.stencil_offset += offset;
    } else {
-      surf->u.legacy.level[0].nblk_x = pitch;
-      surf->u.legacy.level[0].slice_size_dw =
-            ((uint64_t)pitch * surf->u.legacy.level[0].nblk_y * surf->bpe) / 4;
+      if (pitch) {
+         surf->u.legacy.level[0].nblk_x = pitch;
+         surf->u.legacy.level[0].slice_size_dw =
+               ((uint64_t)pitch * surf->u.legacy.level[0].nblk_y * surf->bpe) 
/ 4;
+      }
 
       if (offset) {
          for (unsigned i = 0; i < ARRAY_SIZE(surf->u.legacy.level); ++i)

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to