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 <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9844>
This commit is contained in:
parent
33f832e079
commit
8b9d454cef
|
@ -63,21 +63,6 @@ draw_pt_arrays(struct draw_context *draw,
|
||||||
struct draw_pt_middle_end *middle = NULL;
|
struct draw_pt_middle_end *middle = NULL;
|
||||||
unsigned opt = 0;
|
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) {
|
if (!draw->force_passthrough) {
|
||||||
unsigned out_prim = prim;
|
unsigned out_prim = prim;
|
||||||
|
|
||||||
|
@ -155,6 +140,22 @@ draw_pt_arrays(struct draw_context *draw,
|
||||||
draw->pt.rebind_parameters = FALSE;
|
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 );
|
frontend->run( frontend, start, count );
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
Loading…
Reference in New Issue