Mesa (main): zink: make batch_rp and norp static inlines

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jul 22 00:31:33 UTC 2021


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

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Tue May 11 19:42:20 2021 -0400

zink: make batch_rp and norp static inlines

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

---

 src/gallium/drivers/zink/zink_context.c | 20 ------------------
 src/gallium/drivers/zink/zink_context.h | 37 ++++++++++++++++++++++-----------
 2 files changed, 25 insertions(+), 32 deletions(-)

diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c
index 5a1691753b5..79318c7eb18 100644
--- a/src/gallium/drivers/zink/zink_context.c
+++ b/src/gallium/drivers/zink/zink_context.c
@@ -1916,26 +1916,6 @@ flush_batch(struct zink_context *ctx, bool sync)
    }
 }
 
-struct zink_batch *
-zink_batch_rp(struct zink_context *ctx)
-{
-   struct zink_batch *batch = &ctx->batch;
-   if (!batch->in_rp) {
-      zink_begin_render_pass(ctx, batch);
-      assert(ctx->framebuffer && ctx->framebuffer->rp);
-   }
-   return batch;
-}
-
-struct zink_batch *
-zink_batch_no_rp(struct zink_context *ctx)
-{
-   struct zink_batch *batch = &ctx->batch;
-   zink_end_render_pass(ctx, batch);
-   assert(!batch->in_rp);
-   return batch;
-}
-
 void
 zink_flush_queue(struct zink_context *ctx)
 {
diff --git a/src/gallium/drivers/zink/zink_context.h b/src/gallium/drivers/zink/zink_context.h
index b33389453b8..d54a61b4fcf 100644
--- a/src/gallium/drivers/zink/zink_context.h
+++ b/src/gallium/drivers/zink/zink_context.h
@@ -321,12 +321,6 @@ zink_fb_clear_enabled(const struct zink_context *ctx, unsigned idx)
    return ctx->clears_enabled & (PIPE_CLEAR_COLOR0 << idx);
 }
 
-struct zink_batch *
-zink_batch_rp(struct zink_context *ctx);
-
-struct zink_batch *
-zink_batch_no_rp(struct zink_context *ctx);
-
 void
 zink_fence_wait(struct pipe_context *ctx);
 
@@ -363,6 +357,31 @@ zink_update_descriptor_refs(struct zink_context *ctx, bool compute);
 void
 zink_init_vk_sample_locations(struct zink_context *ctx, VkSampleLocationsInfoEXT *loc);
 
+void
+zink_begin_render_pass(struct zink_context *ctx,
+                       struct zink_batch *batch);
+void
+zink_end_render_pass(struct zink_context *ctx, struct zink_batch *batch);
+
+static inline struct zink_batch *
+zink_batch_rp(struct zink_context *ctx)
+{
+   struct zink_batch *batch = &ctx->batch;
+   if (!batch->in_rp) {
+      zink_begin_render_pass(ctx, batch);
+   }
+   return batch;
+}
+
+static inline struct zink_batch *
+zink_batch_no_rp(struct zink_context *ctx)
+{
+   struct zink_batch *batch = &ctx->batch;
+   zink_end_render_pass(ctx, batch);
+   assert(!batch->in_rp);
+   return batch;
+}
+
 static inline VkPipelineStageFlags
 zink_pipeline_flags_from_pipe_stage(enum pipe_shader_type pstage)
 {
@@ -394,12 +413,6 @@ zink_init_grid_functions(struct zink_context *ctx);
 #endif
 
 #ifndef __cplusplus
- void
- zink_begin_render_pass(struct zink_context *ctx,
-                        struct zink_batch *batch);
-void
-zink_end_render_pass(struct zink_context *ctx, struct zink_batch *batch);
-
 VkPipelineStageFlags
 zink_pipeline_flags_from_stage(VkShaderStageFlagBits stage);
 



More information about the mesa-commit mailing list