From 9fafe92b25561a8da6b045c85bccb82656d071a8 Mon Sep 17 00:00:00 2001 From: Matt Borgerson Date: Wed, 18 May 2022 15:56:27 -0700 Subject: [PATCH] nv2a: Don't add clip offset to swizzled surfaces --- hw/xbox/nv2a/pgraph.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/xbox/nv2a/pgraph.c b/hw/xbox/nv2a/pgraph.c index 6c184ff67f..c2ed972b31 100644 --- a/hw/xbox/nv2a/pgraph.c +++ b/hw/xbox/nv2a/pgraph.c @@ -5758,8 +5758,10 @@ static void pgraph_populate_surface_binding_entry(NV2AState *d, bool color, /* Since we determine surface dimensions based on the clipping * rectangle, make sure to include the surface offset as well. */ - width += pg->surface_shape.clip_x; - height += pg->surface_shape.clip_y; + if (pg->surface_type != NV097_SET_SURFACE_FORMAT_TYPE_SWIZZLE) { + width += pg->surface_shape.clip_x; + height += pg->surface_shape.clip_y; + } } else { width = pg->color_binding->width; height = pg->color_binding->height;