Commit 1a59590e authored by Marek Olšák's avatar Marek Olšák

ac/surface: fix broken pitch override on gfx8

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

Closes: #2920Reviewed-by: Samuel Pitoiset's avatarSamuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <!4968>
parent c9e8df61
Pipeline #144217 passed with stages
in 6 minutes and 49 seconds
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment