Mesa (main): zink: make descriptor update functions return the updated resource

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Aug 24 14:36:55 UTC 2021


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

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Thu Jun  3 15:09:24 2021 -0400

zink: make descriptor update functions return the updated resource

convenience++

Reviewed-by: Dave Airlie <airlied at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12425>

---

 src/gallium/drivers/zink/zink_context.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c
index f674ec7bfdb..ad096ef3d82 100644
--- a/src/gallium/drivers/zink/zink_context.c
+++ b/src/gallium/drivers/zink/zink_context.c
@@ -430,7 +430,7 @@ get_bufferview_for_binding(struct zink_context *ctx, enum pipe_shader_type stage
    return VK_NULL_HANDLE;
 }
 
-ALWAYS_INLINE static void
+ALWAYS_INLINE static struct zink_resource *
 update_descriptor_state_ubo(struct zink_context *ctx, enum pipe_shader_type shader, unsigned slot)
 {
    struct zink_screen *screen = zink_screen(ctx->base.screen);
@@ -454,9 +454,10 @@ update_descriptor_state_ubo(struct zink_context *ctx, enum pipe_shader_type shad
       else
          ctx->di.push_valid &= ~BITFIELD64_BIT(shader);
    }
+   return res;
 }
 
-ALWAYS_INLINE static void
+ALWAYS_INLINE static struct zink_resource *
 update_descriptor_state_ssbo(struct zink_context *ctx, enum pipe_shader_type shader, unsigned slot)
 {
    struct zink_screen *screen = zink_screen(ctx->base.screen);
@@ -473,9 +474,10 @@ update_descriptor_state_ssbo(struct zink_context *ctx, enum pipe_shader_type sha
       ctx->di.ssbos[shader][slot].buffer = have_null_descriptors ? VK_NULL_HANDLE : null_buffer;
       ctx->di.ssbos[shader][slot].range = VK_WHOLE_SIZE;
    }
+   return res;
 }
 
-ALWAYS_INLINE static void
+ALWAYS_INLINE static struct zink_resource *
 update_descriptor_state_sampler(struct zink_context *ctx, enum pipe_shader_type shader, unsigned slot)
 {
    struct zink_screen *screen = zink_screen(ctx->base.screen);
@@ -510,9 +512,10 @@ update_descriptor_state_sampler(struct zink_context *ctx, enum pipe_shader_type
       }
       memset(&ctx->di.sampler_surfaces[shader][slot], 0, sizeof(ctx->di.sampler_surfaces[shader][slot]));
    }
+   return res;
 }
 
-ALWAYS_INLINE static void
+ALWAYS_INLINE static struct zink_resource *
 update_descriptor_state_image(struct zink_context *ctx, enum pipe_shader_type shader, unsigned slot)
 {
    struct zink_screen *screen = zink_screen(ctx->base.screen);
@@ -546,6 +549,7 @@ update_descriptor_state_image(struct zink_context *ctx, enum pipe_shader_type sh
       }
       memset(&ctx->di.image_surfaces[shader][slot], 0, sizeof(ctx->di.image_surfaces[shader][slot]));
    }
+   return res;
 }
 
 static void
@@ -905,7 +909,7 @@ update_existing_vbo(struct zink_context *ctx, unsigned slot)
    update_res_bind_count(ctx, res, false, true);
 }
 
-ALWAYS_INLINE static void
+ALWAYS_INLINE static struct zink_resource *
 set_vertex_buffer_clamped(struct zink_context *ctx, unsigned slot)
 {
    const struct pipe_vertex_buffer *ctx_vb = &ctx->vertex_buffers[slot];
@@ -927,6 +931,7 @@ set_vertex_buffer_clamped(struct zink_context *ctx, unsigned slot)
       ctx->vbuf_offsets[slot] = ctx_vb->buffer_offset;
    }
    assert(ctx->vbufs[slot]);
+   return res;
 }
 
 static void



More information about the mesa-commit mailing list