panfrost: Clean up panfrost_frag_meta_rasterizer_update
authorIcecream95 <ixn@keemail.me>
Thu, 14 May 2020 03:54:09 +0000 (15:54 +1200)
committerMarge Bot <eric+marge@anholt.net>
Tue, 16 Jun 2020 12:59:10 +0000 (12:59 +0000)
Create a pointer to ctx->rasterizer->base so it isn't repeatedly
referred to.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5453>

src/gallium/drivers/panfrost/pan_cmdstream.c

index 2691193738ca2a7ad12a7af2c6a853ed048f33c0..aa82d0ca3391d75449d5c7ae5087245b6d2cae11 100644 (file)
@@ -553,20 +553,20 @@ panfrost_frag_meta_rasterizer_update(struct panfrost_context *ctx,
                 return;
         }
 
-        bool msaa = ctx->rasterizer->base.multisample;
+        struct pipe_rasterizer_state *rast = &ctx->rasterizer->base;
+
+        bool msaa = rast->multisample;
 
         /* TODO: Sample size */
         SET_BIT(fragmeta->unknown2_3, MALI_HAS_MSAA, msaa);
         SET_BIT(fragmeta->unknown2_4, MALI_NO_MSAA, !msaa);
-        fragmeta->depth_units = ctx->rasterizer->base.offset_units * 2.0f;
-        fragmeta->depth_factor = ctx->rasterizer->base.offset_scale;
+        fragmeta->depth_units = rast->offset_units * 2.0f;
+        fragmeta->depth_factor = rast->offset_scale;
 
         /* XXX: Which bit is which? Does this maybe allow offseting not-tri? */
 
-        SET_BIT(fragmeta->unknown2_4, MALI_DEPTH_RANGE_A,
-                ctx->rasterizer->base.offset_tri);
-        SET_BIT(fragmeta->unknown2_4, MALI_DEPTH_RANGE_B,
-                ctx->rasterizer->base.offset_tri);
+        SET_BIT(fragmeta->unknown2_4, MALI_DEPTH_RANGE_A, rast->offset_tri);
+        SET_BIT(fragmeta->unknown2_4, MALI_DEPTH_RANGE_B, rast->offset_tri);
 }
 
 static void