panfrost: Pass batch to panfrost_get_index_buffer_bounded
authorAlyssa Rosenzweig <alyssa@rosenzweig.io>
Tue, 18 May 2021 14:26:27 +0000 (10:26 -0400)
committerMarge Bot <eric+marge@anholt.net>
Tue, 18 May 2021 22:51:56 +0000 (22:51 +0000)
Calling batch_for_fbo outside of Gallium entrypoints is an antipattern.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10869>

src/gallium/drivers/panfrost/pan_cmdstream.c
src/gallium/drivers/panfrost/pan_cmdstream.h
src/gallium/drivers/panfrost/pan_context.c

index 76c7096..7c84ebd 100644 (file)
@@ -81,13 +81,13 @@ panfrost_bo_access_for_stage(enum pipe_shader_type stage)
  * require them to be together. */
 
 mali_ptr
-panfrost_get_index_buffer_bounded(struct panfrost_context *ctx,
+panfrost_get_index_buffer_bounded(struct panfrost_batch *batch,
                                   const struct pipe_draw_info *info,
                                   const struct pipe_draw_start_count_bias *draw,
                                   unsigned *min_index, unsigned *max_index)
 {
         struct panfrost_resource *rsrc = pan_resource(info->index.resource);
-        struct panfrost_batch *batch = panfrost_get_batch_for_fbo(ctx);
+        struct panfrost_context *ctx = batch->ctx;
         off_t offset = draw->start * info->index_size;
         bool needs_indices = true;
         mali_ptr out = 0;
index 4fca581..5090ce2 100644 (file)
@@ -71,7 +71,7 @@ panfrost_emit_vertex_data(struct panfrost_batch *batch,
                           mali_ptr *buffers);
 
 mali_ptr
-panfrost_get_index_buffer_bounded(struct panfrost_context *ctx,
+panfrost_get_index_buffer_bounded(struct panfrost_batch *batch,
                                   const struct pipe_draw_info *info,
                                   const struct pipe_draw_start_count_bias *draw,
                                   unsigned *min_index, unsigned *max_index);
index 354c48a..bd68983 100644 (file)
@@ -458,7 +458,7 @@ panfrost_direct_draw(struct panfrost_batch *batch,
         mali_ptr indices = 0;
 
         if (info->index_size) {
-                indices = panfrost_get_index_buffer_bounded(ctx, info, draw,
+                indices = panfrost_get_index_buffer_bounded(batch, info, draw,
                                                             &min_index,
                                                             &max_index);