mesa/st: drop Draw from dd function table.
authorDave Airlie <airlied@redhat.com>
Tue, 7 Dec 2021 03:53:48 +0000 (13:53 +1000)
committerMarge Bot <emma+marge@anholt.net>
Wed, 8 Dec 2021 19:06:48 +0000 (19:06 +0000)
Draw is only called in the feedback paths now, and the only thing
it is set to is the st feedback draw path.

So just always have the fallback call the draw feedback path and
get rid of the draw entry.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14100>

src/mesa/main/dd.h
src/mesa/main/draw.c
src/mesa/state_tracker/st_cb_feedback.c
src/mesa/state_tracker/st_draw.c

index 0e173fd..9431c06 100644 (file)
@@ -149,26 +149,6 @@ struct dd_function_table {
     */
 
    /**
-    * Draw a number of primitives.
-    * \param prims  array [nr_prims] describing what to draw (prim type,
-    *               vertex count, first index, instance count, etc).
-    * \param ib  index buffer for indexed drawing, NULL for array drawing
-    * \param index_bounds_valid  are min_index and max_index valid?
-    * \param min_index  lowest vertex index used
-    * \param max_index  highest vertex index used
-    * \param num_instances  instance count from ARB_draw_instanced
-    * \param base_instance  base instance from ARB_base_instance
-    */
-   void (*Draw)(struct gl_context *ctx,
-                const struct _mesa_prim *prims, unsigned nr_prims,
-                const struct _mesa_index_buffer *ib,
-                bool index_bounds_valid,
-                bool primitive_restart,
-                unsigned restart_index,
-                unsigned min_index, unsigned max_index,
-                unsigned num_instances, unsigned base_instance);
-
-   /**
     * Optimal Gallium version of Draw() that doesn't require translation
     * of draw info in the state tracker.
     *
index 80a50ec..c96f988 100644 (file)
@@ -1017,10 +1017,10 @@ _mesa_draw_gallium_fallback(struct gl_context *ctx,
             max_index = draws[i].start + draws[i].count - 1;
          }
 
-         ctx->Driver.Draw(ctx, &prim, 1, index_size ? &ib : NULL,
-                          index_bounds_valid, info->primitive_restart,
-                          info->restart_index, min_index, max_index,
-                          info->instance_count, info->start_instance);
+         st_feedback_draw_vbo(ctx, &prim, 1, index_size ? &ib : NULL,
+                              index_bounds_valid, info->primitive_restart,
+                              info->restart_index, min_index, max_index,
+                              info->instance_count, info->start_instance);
       }
       return;
    }
@@ -1069,10 +1069,10 @@ _mesa_draw_gallium_fallback(struct gl_context *ctx,
    }
 
    if (num_prims)
-      ctx->Driver.Draw(ctx, prim, num_prims, index_size ? &ib : NULL,
-                       index_bounds_valid, info->primitive_restart,
-                       info->restart_index, min_index, max_index,
-                       info->instance_count, info->start_instance);
+      st_feedback_draw_vbo(ctx, prim, num_prims, index_size ? &ib : NULL,
+                           index_bounds_valid, info->primitive_restart,
+                           info->restart_index, min_index, max_index,
+                           info->instance_count, info->start_instance);
    FREE_PRIMS(prim, num_draws);
 }
 
index 73c7386..78000b5 100644 (file)
@@ -292,7 +292,6 @@ st_RenderMode(struct gl_context *ctx, GLenum newMode )
          st->selection_stage = draw_glselect_stage(ctx, draw);
       draw_set_rasterize_stage(draw, st->selection_stage);
       /* Plug in new vbo draw function */
-      ctx->Driver.Draw = st_feedback_draw_vbo;
       ctx->Driver.DrawGallium = _mesa_draw_gallium_fallback;
       ctx->Driver.DrawGalliumMultiMode = _mesa_draw_gallium_multimode_fallback;
    }
@@ -303,7 +302,6 @@ st_RenderMode(struct gl_context *ctx, GLenum newMode )
          st->feedback_stage = draw_glfeedback_stage(ctx, draw);
       draw_set_rasterize_stage(draw, st->feedback_stage);
       /* Plug in new vbo draw function */
-      ctx->Driver.Draw = st_feedback_draw_vbo;
       ctx->Driver.DrawGallium = _mesa_draw_gallium_fallback;
       ctx->Driver.DrawGalliumMultiMode = _mesa_draw_gallium_multimode_fallback;
       /* need to generate/use a vertex program that emits pos/color/tex */
index 89424b9..4d0420a 100644 (file)
@@ -372,7 +372,6 @@ void
 st_init_draw_functions(struct pipe_screen *screen,
                        struct dd_function_table *functions)
 {
-   functions->Draw = NULL;
    functions->DrawGallium = st_draw_gallium;
    functions->DrawGalliumMultiMode = st_draw_gallium_multimode;