ac: be careful with stencil_offset override

Check surf->has_stencil first to avoid trashing surf->u.gfx9.color.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26106>
This commit is contained in:
Chia-I Wu 2023-11-07 13:12:30 -08:00 committed by Marge Bot
parent 7718bad474
commit c905aeb4e4

View file

@ -3093,8 +3093,9 @@ bool ac_surface_override_offset_stride(const struct radeon_info *info, struct ra
surf->total_size = surf->surf_size = surf->u.gfx9.surf_slice_size * slices;
}
}
surf->u.gfx9.surf_offset = offset;
if (surf->u.gfx9.zs.stencil_offset)
if (surf->has_stencil)
surf->u.gfx9.zs.stencil_offset += offset;
} else {
if (pitch) {