nv2a: Simplify surface clip to scissor size calculation

This commit is contained in:
Matt Borgerson 2025-03-17 14:25:46 -07:00 committed by mborgerson
parent 860bccb722
commit c3a8b9569f
2 changed files with 5 additions and 9 deletions

View File

@ -334,11 +334,10 @@ void pgraph_gl_draw_begin(NV2AState *d)
/* FIXME: Consider moving to PSH w/ window clip */
unsigned int xmin = pg->surface_shape.clip_x,
ymin = pg->surface_shape.clip_y;
unsigned int xmax = xmin + pg->surface_shape.clip_width - 1,
ymax = ymin + pg->surface_shape.clip_height - 1;
unsigned int scissor_width = xmax - xmin + 1,
scissor_height = ymax - ymin + 1;
unsigned int scissor_width = pg->surface_shape.clip_width,
scissor_height = pg->surface_shape.clip_height;
pgraph_apply_anti_aliasing_factor(pg, &xmin, &ymin);
pgraph_apply_anti_aliasing_factor(pg, &scissor_width, &scissor_height);
ymin = pg->surface_binding_dim.height - (ymin + scissor_height);

View File

@ -1475,11 +1475,8 @@ static void begin_draw(PGRAPHState *pg)
unsigned int xmin = pg->surface_shape.clip_x,
ymin = pg->surface_shape.clip_y;
unsigned int xmax = xmin + pg->surface_shape.clip_width - 1,
ymax = ymin + pg->surface_shape.clip_height - 1;
unsigned int scissor_width = xmax - xmin + 1,
scissor_height = ymax - ymin + 1;
unsigned int scissor_width = pg->surface_shape.clip_width,
scissor_height = pg->surface_shape.clip_height;
pgraph_apply_anti_aliasing_factor(pg, &xmin, &ymin);
pgraph_apply_anti_aliasing_factor(pg, &scissor_width, &scissor_height);