Module: Mesa
Branch: master
Commit: 65ef79be7a38c9da6b894d51ffbbf2b0975c1b1c
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=65ef79be7a38c9da6b894d51ffbbf2b0975c1b1c

Author: Mike Blumenkrantz <[email protected]>
Date:   Thu Mar 25 15:23:33 2021 -0400

aux/draw: pass full draw params to draw_pt_arrays()

multidraw depth maximum: loop directly around the llvmpipe call

Reviewed-by: Dave Airlie <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9844>

---

 src/gallium/auxiliary/draw/draw_pt.c | 32 ++++++++++++++++----------------
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/src/gallium/auxiliary/draw/draw_pt.c 
b/src/gallium/auxiliary/draw/draw_pt.c
index 851fa90eb5c..a41a849ec87 100644
--- a/src/gallium/auxiliary/draw/draw_pt.c
+++ b/src/gallium/auxiliary/draw/draw_pt.c
@@ -56,8 +56,8 @@ DEBUG_GET_ONCE_BOOL_OPTION(draw_no_fse, "DRAW_NO_FSE", FALSE)
 static boolean
 draw_pt_arrays(struct draw_context *draw,
                unsigned prim,
-               unsigned start, 
-               unsigned count)
+               const struct pipe_draw_start_count *draw_info,
+               unsigned num_draws)
 {
    struct draw_pt_front_end *frontend = NULL;
    struct draw_pt_middle_end *middle = NULL;
@@ -141,9 +141,10 @@ draw_pt_arrays(struct draw_context *draw,
    }
 
 
-   /* Sanitize primitive length:
-    */
-   {
+   for (unsigned i = 0; i < num_draws; i++) {
+      unsigned count = draw_info[i].count;
+      /* Sanitize primitive length:
+       */
       unsigned first, incr;
 
       if (prim == PIPE_PRIM_PATCHES) {
@@ -151,12 +152,13 @@ draw_pt_arrays(struct draw_context *draw,
          incr = draw->pt.vertices_per_patch;
       } else
          draw_pt_split_prim(prim, &first, &incr);
-      count = draw_pt_trim_count(count, first, incr);
-      if (count < first)
-         return TRUE;
-   }
+      count = draw_pt_trim_count(draw_info[i].count, first, incr);
+      if (count >= first)
+         frontend->run( frontend, draw_info[i].start, count );
 
-   frontend->run( frontend, start, count );
+      if (draw->pt.user.increment_draw_id)
+         draw->pt.user.drawid++;
+   }
 
    return TRUE;
 }
@@ -389,7 +391,7 @@ prim_restart_loop(struct draw_context *draw,
       if (i < elt_max && restart_idx == info->restart_index) {
          if (cur.count > 0) {
             /* draw elts up to prev pos */
-            draw_pt_arrays(draw, info->mode, cur.start, cur.count);
+            draw_pt_arrays(draw, info->mode, &cur, 1);
          }
          /* begin new prim at next elt */
          cur.start = i + 1;
@@ -400,7 +402,7 @@ prim_restart_loop(struct draw_context *draw,
       }
    }
    if (cur.count > 0) {
-      draw_pt_arrays(draw, info->mode, cur.start, cur.count);
+      draw_pt_arrays(draw, info->mode, &cur, 1);
    }
 }
 
@@ -428,8 +430,7 @@ draw_pt_arrays_restart(struct draw_context *draw,
       /* Non-indexed prims (draw_arrays).
        * Primitive restart should have been handled in gallium frontends.
        */
-      for (unsigned i = 0; i < num_draws; i++)
-         draw_pt_arrays(draw, prim, draw_info[i].start, draw_info[i].count);
+      draw_pt_arrays(draw, prim, draw_info, num_draws);
    }
 }
 
@@ -491,8 +492,7 @@ draw_instances(struct draw_context *draw,
          draw_pt_arrays_restart(draw, info, draws, num_draws);
       }
       else {
-         for (unsigned i = 0; i < num_draws; i++)
-            draw_pt_arrays(draw, info->mode, draws[i].start, draws[i].count);
+         draw_pt_arrays(draw, info->mode, draws, num_draws);
       }
    }
 }

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to