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/nouveau/nv30/nv30_vbo.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/gallium/drivers/nouveau/nv30') diff --git a/src/gallium/drivers/nouveau/nv30/nv30_vbo.c b/src/gallium/drivers/nouveau/nv30/nv30_vbo.c index bc9b9a16ea8..9338f2ed700 100644 --- a/src/gallium/drivers/nouveau/nv30/nv30_vbo.c +++ b/src/gallium/drivers/nouveau/nv30/nv30_vbo.c @@ -25,6 +25,7 @@ #include "util/u_format.h" #include "util/u_inlines.h" +#include "util/u_prim.h" #include "translate/translate.h" #include "nouveau_fence.h" @@ -550,6 +551,10 @@ nv30_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info) struct nouveau_pushbuf *push = nv30->base.pushbuf; int i; + if (!info->primitive_restart && + !u_trim_pipe_prim(info->mode, (unsigned*)&info->count)) + return; + /* For picking only a few vertices from a large user buffer, push is better, * if index count is larger and we expect repeated vertices, suggest upload. */ -- cgit v1.2.3