From 707d2e8b3e53c761720adaca7137b242dff344b6 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sun, 9 Apr 2017 15:57:45 +0200 Subject: gallium: fold u_trim_pipe_prim call from st/mesa to drivers Most drivers don't need it and shouldn't need it because it can't be used in some cases (indirect draws, primitive restart, count from streamout). Reviewed-by: Brian Paul --- src/gallium/drivers/vc4/vc4_draw.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/gallium/drivers/vc4/vc4_draw.c') diff --git a/src/gallium/drivers/vc4/vc4_draw.c b/src/gallium/drivers/vc4/vc4_draw.c index ebd080298a4..61694ecda6c 100644 --- a/src/gallium/drivers/vc4/vc4_draw.c +++ b/src/gallium/drivers/vc4/vc4_draw.c @@ -283,6 +283,11 @@ vc4_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info) { struct vc4_context *vc4 = vc4_context(pctx); + if (!info->count_from_stream_output && !info->indirect && + !info->primitive_restart && + !u_trim_pipe_prim(info->mode, (unsigned*)&info->count)) + return; + if (info->mode >= PIPE_PRIM_QUADS) { util_primconvert_save_index_buffer(vc4->primconvert, &vc4->indexbuf); util_primconvert_save_rasterizer_state(vc4->primconvert, &vc4->rasterizer->base); -- cgit v1.2.3