From 8b9d454cef5c427421b255580f00886bbcf63e8a Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 25 Mar 2021 15:08:18 -0400 Subject: [PATCH] aux/draw: move draw param sanitization to end of function this triggers more work if sanitizing no-ops the draw, but the rest of the time it won't matter Reviewed-by: Dave Airlie Part-of: --- src/gallium/auxiliary/draw/draw_pt.c | 31 ++++++++++++++-------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/src/gallium/auxiliary/draw/draw_pt.c b/src/gallium/auxiliary/draw/draw_pt.c index ad5257ce369..6a43f0ba886 100644 --- a/src/gallium/auxiliary/draw/draw_pt.c +++ b/src/gallium/auxiliary/draw/draw_pt.c @@ -63,21 +63,6 @@ draw_pt_arrays(struct draw_context *draw, struct draw_pt_middle_end *middle = NULL; unsigned opt = 0; - /* Sanitize primitive length: - */ - { - unsigned first, incr; - - if (prim == PIPE_PRIM_PATCHES) { - first = draw->pt.vertices_per_patch; - 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; - } - if (!draw->force_passthrough) { unsigned out_prim = prim; @@ -155,6 +140,22 @@ draw_pt_arrays(struct draw_context *draw, draw->pt.rebind_parameters = FALSE; } + + /* Sanitize primitive length: + */ + { + unsigned first, incr; + + if (prim == PIPE_PRIM_PATCHES) { + first = draw->pt.vertices_per_patch; + 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; + } + frontend->run( frontend, start, count ); return TRUE;