From de40016d8be6f4b6fee70b067199393f8c545cf6 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Tue, 18 May 2021 15:55:12 -0400 Subject: [PATCH] panfrost: Express viewport in terms of the batch Easier to say the state dependencies. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/gallium/drivers/panfrost/pan_cmdstream.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c index 7c84ebd2806..0903ba1acde 100644 --- a/src/gallium/drivers/panfrost/pan_cmdstream.c +++ b/src/gallium/drivers/panfrost/pan_cmdstream.c @@ -725,7 +725,6 @@ panfrost_emit_viewport(struct panfrost_batch *batch) const struct pipe_viewport_state *vp = &ctx->pipe_viewport; const struct pipe_scissor_state *ss = &ctx->scissor; const struct pipe_rasterizer_state *rast = &ctx->rasterizer->base; - const struct pipe_framebuffer_state *fb = &ctx->pipe_framebuffer; /* Derive min/max from translate/scale. Note since |x| >= 0 by * definition, we have that -|x| <= |x| hence translate - |scale| <= @@ -740,10 +739,10 @@ panfrost_emit_viewport(struct panfrost_batch *batch) /* Scissor to the intersection of viewport and to the scissor, clamped * to the framebuffer */ - unsigned minx = MIN2(fb->width, MAX2((int) vp_minx, 0)); - unsigned maxx = MIN2(fb->width, MAX2((int) vp_maxx, 0)); - unsigned miny = MIN2(fb->height, MAX2((int) vp_miny, 0)); - unsigned maxy = MIN2(fb->height, MAX2((int) vp_maxy, 0)); + unsigned minx = MIN2(batch->key.width, MAX2((int) vp_minx, 0)); + unsigned maxx = MIN2(batch->key.width, MAX2((int) vp_maxx, 0)); + unsigned miny = MIN2(batch->key.height, MAX2((int) vp_miny, 0)); + unsigned maxy = MIN2(batch->key.height, MAX2((int) vp_maxy, 0)); if (ss && rast->scissor) { minx = MAX2(ss->minx, minx);