mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 09:48:07 +02:00
ac/surface: do not allocate FMASK or CMASK for stencil-only surfaces on GFX9+
FMASK/CMASK make no sense with depth/stencil or stencil-only surfaces. gfx9_compute_miptree() was called twice for stencil-only surfaces, and the first call was allocating FMASK/CMASK. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9612>
This commit is contained in:
parent
da45f3f35c
commit
fa712d9e17
1 changed files with 8 additions and 3 deletions
|
|
@ -2329,10 +2329,15 @@ static int gfx9_compute_surface(struct ac_addrlib *addrlib, const struct radeon_
|
|||
surf->u.gfx9.dcc_retile_num_elements = 0;
|
||||
surf->u.gfx9.dcc_retile_map = NULL;
|
||||
|
||||
const bool only_stencil =
|
||||
(surf->flags & RADEON_SURF_SBUFFER) && !(surf->flags & RADEON_SURF_ZBUFFER);
|
||||
|
||||
/* Calculate texture layout information. */
|
||||
r = gfx9_compute_miptree(addrlib, info, config, surf, compressed, &AddrSurfInfoIn);
|
||||
if (r)
|
||||
return r;
|
||||
if (!only_stencil) {
|
||||
r = gfx9_compute_miptree(addrlib, info, config, surf, compressed, &AddrSurfInfoIn);
|
||||
if (r)
|
||||
return r;
|
||||
}
|
||||
|
||||
/* Calculate texture layout information for stencil. */
|
||||
if (surf->flags & RADEON_SURF_SBUFFER) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue