From e560028c8e76727b6459cc9e7769200792dc68a7 Mon Sep 17 00:00:00 2001 From: Icecream95 Date: Wed, 23 Sep 2020 19:09:23 +1200 Subject: [PATCH] panfrost: Remove redundant casts of viewport position The position is already converted to int when clamping to framebuffer size. Reviewed-by: Alyssa Rosenzweig Part-of: --- src/gallium/drivers/panfrost/pan_cmdstream.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c index 5a8cbde..fd90107 100644 --- a/src/gallium/drivers/panfrost/pan_cmdstream.c +++ b/src/gallium/drivers/panfrost/pan_cmdstream.c @@ -595,10 +595,10 @@ panfrost_emit_viewport(struct panfrost_batch *batch) /* Derive min/max from translate/scale. Note since |x| >= 0 by * definition, we have that -|x| <= |x| hence translate - |scale| <= * translate + |scale|, so the ordering is correct here. */ - float vp_minx = (int) (vp->translate[0] - fabsf(vp->scale[0])); - float vp_maxx = (int) (vp->translate[0] + fabsf(vp->scale[0])); - float vp_miny = (int) (vp->translate[1] - fabsf(vp->scale[1])); - float vp_maxy = (int) (vp->translate[1] + fabsf(vp->scale[1])); + float vp_minx = vp->translate[0] - fabsf(vp->scale[0]); + float vp_maxx = vp->translate[0] + fabsf(vp->scale[0]); + float vp_miny = vp->translate[1] - fabsf(vp->scale[1]); + float vp_maxy = vp->translate[1] + fabsf(vp->scale[1]); float minz = (vp->translate[2] - fabsf(vp->scale[2])); float maxz = (vp->translate[2] + fabsf(vp->scale[2])); -- 2.7.4