ac/surface: fix determination of gfx12_enable_dcc

For surfaces without a modifier, the surf_size check wasn't
necessary, but it was also invalid since surf_size is set later
(in gfx12_compute_miptree).

Since it's not required anyway, drop this check.

Fixes: 060d5dacfd ("ac: add gfx12 DCC shared code")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31683>
(cherry picked from commit 5607c7ee49)
This commit is contained in:
Pierre-Eric Pelloux-Prayer 2024-10-15 18:18:37 +02:00 committed by Eric Engestrom
parent 8e3c36524f
commit b5a6e63cbd
2 changed files with 3 additions and 4 deletions

View file

@ -1014,7 +1014,7 @@
"description": "ac/surface: fix determination of gfx12_enable_dcc",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "060d5dacfd1f1402bad795c37713db04b299f7ea",
"notes": null

View file

@ -3247,9 +3247,8 @@ static bool gfx12_compute_surface(struct ac_addrlib *addrlib, const struct radeo
(surf->flags & RADEON_SURF_Z_OR_SBUFFER ||
config->info.samples > 1 ||
((supports_display_dcc || !(surf->flags & RADEON_SURF_SCANOUT)) &&
/* These two are not strictly necessary. */
surf->u.gfx9.swizzle_mode != ADDR3_LINEAR &&
surf->surf_size >= 4096)));
/* This one is not strictly necessary. */
surf->u.gfx9.swizzle_mode != ADDR3_LINEAR)));
surf->has_stencil = !!(surf->flags & RADEON_SURF_SBUFFER);
surf->is_linear = surf->u.gfx9.swizzle_mode == ADDR3_LINEAR;