summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.pick_status.json2
-rw-r--r--src/amd/common/ac_surface.c8
2 files changed, 7 insertions, 3 deletions
diff --git a/.pick_status.json b/.pick_status.json
index 807a214ef6b..6950c823fc8 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -130,7 +130,7 @@
"description": "ac/surface: fix epitch when modifying surf_pitch",
"nominated": true,
"nomination_type": 1,
- "resolution": 0,
+ "resolution": 1,
"master_sha": null,
"because_sha": "69aadc493310bb7306d10559bf48412eb5865962"
},
diff --git a/src/amd/common/ac_surface.c b/src/amd/common/ac_surface.c
index cbbb1dd1cac..288b8b71771 100644
--- a/src/amd/common/ac_surface.c
+++ b/src/amd/common/ac_surface.c
@@ -1146,10 +1146,14 @@ static int gfx9_compute_miptree(ADDR_HANDLE addrlib,
surf->u.gfx9.surf_slice_size = out.sliceSize;
surf->u.gfx9.surf_pitch = out.pitch;
- if (!compressed && surf->blk_w > 1 && out.pitch == out.pixelPitch) {
+ if (!compressed && surf->blk_w > 1 && out.pitch == out.pixelPitch &&
+ surf->u.gfx9.surf.swizzle_mode == ADDR_SW_LINEAR) {
/* Adjust surf_pitch to be in elements units,
* not in pixels */
- surf->u.gfx9.surf_pitch /= surf->blk_w;
+ surf->u.gfx9.surf_pitch =
+ align(surf->u.gfx9.surf_pitch / surf->blk_w, 256 / surf->bpe);
+ surf->u.gfx9.surf.epitch = MAX2(surf->u.gfx9.surf.epitch,
+ surf->u.gfx9.surf_pitch * surf->blk_w - 1);
}
surf->u.gfx9.surf_height = out.height;
surf->surf_size = out.surfSize;