Mesa (main): zink: make a local resource var in fb_clears_apply_internal

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Oct 1 13:41:10 UTC 2021


Module: Mesa
Branch: main
Commit: fed9243078f928f631ade0f50054c8ca89a34445
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=fed9243078f928f631ade0f50054c8ca89a34445

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Wed Sep 29 09:13:56 2021 -0400

zink: make a local resource var in fb_clears_apply_internal

no functional changes

Reviewed-by: Adam Jackson <ajax at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13126>

---

 src/gallium/drivers/zink/zink_clear.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/zink/zink_clear.c b/src/gallium/drivers/zink/zink_clear.c
index 660203f7f07..b99449512e7 100644
--- a/src/gallium/drivers/zink/zink_clear.c
+++ b/src/gallium/drivers/zink/zink_clear.c
@@ -542,12 +542,13 @@ static void
 fb_clears_apply_internal(struct zink_context *ctx, struct pipe_resource *pres, int i)
 {
    struct zink_framebuffer_clear *fb_clear = &ctx->fb_clears[i];
+   struct zink_resource *res = zink_resource(pres);
 
    if (!zink_fb_clear_enabled(ctx, i))
       return;
    if (ctx->batch.in_rp)
       zink_clear_framebuffer(ctx, BITFIELD_BIT(i));
-   else if (zink_resource(pres)->aspect == VK_IMAGE_ASPECT_COLOR_BIT) {
+   else if (res->aspect == VK_IMAGE_ASPECT_COLOR_BIT) {
       if (zink_fb_clear_needs_explicit(fb_clear) || !check_3d_layers(ctx->fb_state.cbufs[i]))
          /* this will automatically trigger all the clears */
          zink_batch_rp(ctx);
@@ -557,7 +558,7 @@ fb_clears_apply_internal(struct zink_context *ctx, struct pipe_resource *pres, i
          union pipe_color_union color;
          zink_fb_clear_util_unpack_clear_color(clear, psurf->format, &color);
 
-         clear_color_no_rp(ctx, zink_resource(pres), &color,
+         clear_color_no_rp(ctx, res, &color,
                                 psurf->u.tex.level, psurf->u.tex.first_layer,
                                 psurf->u.tex.last_layer - psurf->u.tex.first_layer + 1);
       }
@@ -575,7 +576,7 @@ fb_clears_apply_internal(struct zink_context *ctx, struct pipe_resource *pres, i
             aspects |= VK_IMAGE_ASPECT_DEPTH_BIT;
          if (clear->zs.bits & PIPE_CLEAR_STENCIL)
             aspects |= VK_IMAGE_ASPECT_STENCIL_BIT;
-         clear_zs_no_rp(ctx, zink_resource(pres), aspects, clear->zs.depth, clear->zs.stencil,
+         clear_zs_no_rp(ctx, res, aspects, clear->zs.depth, clear->zs.stencil,
                              psurf->u.tex.level, psurf->u.tex.first_layer,
                              psurf->u.tex.last_layer - psurf->u.tex.first_layer + 1);
       }



More information about the mesa-commit mailing list