From d54ce00f028f18f642fb176b6f755e106e4719e2 Mon Sep 17 00:00:00 2001 From: Matt Borgerson Date: Sat, 8 Jan 2022 19:48:24 -0700 Subject: [PATCH] nv2a: Simplify swizzled<>linear logic --- hw/xbox/nv2a/pgraph.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/hw/xbox/nv2a/pgraph.c b/hw/xbox/nv2a/pgraph.c index e74cc4c7a7..c35bdae86e 100644 --- a/hw/xbox/nv2a/pgraph.c +++ b/hw/xbox/nv2a/pgraph.c @@ -5555,16 +5555,11 @@ static void pgraph_update_surface_part(NV2AState *d, bool upload, bool color) * to be marked swizzled. Strictly match size to avoid * pathological cases. */ - if (pg->clearing || found->cleared) { - is_compatible &= - pgraph_check_surface_compatibility(found, &entry, true); - if (is_compatible) { - NV2A_XPRINTF(DBG_SURFACES, - "Migrating surface type to %s\n", - entry.swizzle ? "swizzled" : "linear"); - } - } else { - is_compatible = false; + is_compatible &= (pg->clearing || found->cleared) && + pgraph_check_surface_compatibility(found, &entry, true); + if (is_compatible) { + NV2A_XPRINTF(DBG_SURFACES, "Migrating surface type to %s\n", + entry.swizzle ? "swizzled" : "linear"); } }