diff options
author | Ilia Mirkin <imirkin@alum.mit.edu> | 2015-08-24 11:49:05 -0400 |
---|---|---|
committer | Ilia Mirkin <imirkin@alum.mit.edu> | 2015-09-05 23:04:21 -0400 |
commit | c830d193db5c90cf0af57ff73606e2aa12aed9a8 (patch) | |
tree | f003f3405bf7b537f1cef45073f294dca2f455d0 /src/gallium/drivers/nouveau/nv50/nv50_vbo.c | |
parent | 4a025c6bc835387a31007fdf30a130e612e54e19 (diff) | |
download | external_mesa3d-c830d193db5c90cf0af57ff73606e2aa12aed9a8.zip external_mesa3d-c830d193db5c90cf0af57ff73606e2aa12aed9a8.tar.gz external_mesa3d-c830d193db5c90cf0af57ff73606e2aa12aed9a8.tar.bz2 |
nv50: avoid using inline vertex data submit when gl_VertexID is used
The hardware only generates vertexid when vertices come from a VBO. This
fixes:
vertexid-drawelements
vertexid-drawarrays
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "11.0" <mesa-stable@lists.freedesktop.org>
Diffstat (limited to 'src/gallium/drivers/nouveau/nv50/nv50_vbo.c')
-rw-r--r-- | src/gallium/drivers/nouveau/nv50/nv50_vbo.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/gallium/drivers/nouveau/nv50/nv50_vbo.c b/src/gallium/drivers/nouveau/nv50/nv50_vbo.c index 600b973..e798473 100644 --- a/src/gallium/drivers/nouveau/nv50/nv50_vbo.c +++ b/src/gallium/drivers/nouveau/nv50/nv50_vbo.c @@ -293,7 +293,8 @@ nv50_vertex_arrays_validate(struct nv50_context *nv50) uint64_t addrs[PIPE_MAX_ATTRIBS]; uint32_t limits[PIPE_MAX_ATTRIBS]; struct nouveau_pushbuf *push = nv50->base.pushbuf; - struct nv50_vertex_stateobj *vertex = nv50->vertex; + struct nv50_vertex_stateobj dummy = {}; + struct nv50_vertex_stateobj *vertex = nv50->vertex ? nv50->vertex : &dummy; struct pipe_vertex_buffer *vb; struct nv50_vertex_element *ve; uint32_t mask; @@ -301,6 +302,14 @@ nv50_vertex_arrays_validate(struct nv50_context *nv50) unsigned i; const unsigned n = MAX2(vertex->num_elements, nv50->state.num_vtxelts); + /* A vertexid is not generated for inline data uploads. Have to use a + * VBO. This check must come after the vertprog has been validated, + * otherwise vertexid may be unset. + */ + assert(nv50->vertprog->translated); + if (nv50->vertprog->vp.vertexid) + nv50->vbo_push_hint = 0; + if (unlikely(vertex->need_conversion)) nv50->vbo_fifo = ~0; else |