From be0311c9626eef841f6d245359759cf1e082aebf Mon Sep 17 00:00:00 2001 From: Ilia Mirkin Date: Tue, 30 Dec 2014 23:19:47 -0500 Subject: nv50,nvc0: set vertex id base to index_bias Fixes the piglits which check that gl_VertexID includes the base vertex offset: arb_draw_indirect-vertexid elements gl-3.2-basevertex-vertexid Note that this leaves out the original G80, for which this will continue to fail. It could be fixed by passing a driver constbuf value in, but that's beyond the scope of this change. Signed-off-by: Ilia Mirkin Cc: "10.3 10.4" --- src/gallium/drivers/nouveau/nv50/nv50_screen.c | 7 +++++++ src/gallium/drivers/nouveau/nv50/nv50_vbo.c | 8 ++++++++ 2 files changed, 15 insertions(+) (limited to 'src/gallium/drivers/nouveau/nv50') diff --git a/src/gallium/drivers/nouveau/nv50/nv50_screen.c b/src/gallium/drivers/nouveau/nv50/nv50_screen.c index ff087341de1..2d8347b0ad8 100644 --- a/src/gallium/drivers/nouveau/nv50/nv50_screen.c +++ b/src/gallium/drivers/nouveau/nv50/nv50_screen.c @@ -608,6 +608,13 @@ nv50_screen_init_hwctx(struct nv50_screen *screen) BEGIN_NV04(push, NV50_3D(EDGEFLAG), 1); PUSH_DATA (push, 1); + BEGIN_NV04(push, NV50_3D(VB_ELEMENT_BASE), 1); + PUSH_DATA (push, 0); + if (screen->base.class_3d >= NV84_3D_CLASS) { + BEGIN_NV04(push, SUBC_3D(NV84_3D_VERTEX_ID_BASE), 1); + PUSH_DATA (push, 0); + } + PUSH_KICK (push); } diff --git a/src/gallium/drivers/nouveau/nv50/nv50_vbo.c b/src/gallium/drivers/nouveau/nv50/nv50_vbo.c index 5a4a4578d51..c1590eefe9f 100644 --- a/src/gallium/drivers/nouveau/nv50/nv50_vbo.c +++ b/src/gallium/drivers/nouveau/nv50/nv50_vbo.c @@ -472,6 +472,10 @@ nv50_draw_arrays(struct nv50_context *nv50, if (nv50->state.index_bias) { BEGIN_NV04(push, NV50_3D(VB_ELEMENT_BASE), 1); PUSH_DATA (push, 0); + if (nv50->screen->base.class_3d >= NV84_3D_CLASS) { + BEGIN_NV04(push, SUBC_3D(NV84_3D_VERTEX_ID_BASE), 1); + PUSH_DATA (push, 0); + } nv50->state.index_bias = 0; } @@ -594,6 +598,10 @@ nv50_draw_elements(struct nv50_context *nv50, boolean shorten, if (index_bias != nv50->state.index_bias) { BEGIN_NV04(push, NV50_3D(VB_ELEMENT_BASE), 1); PUSH_DATA (push, index_bias); + if (nv50->screen->base.class_3d >= NV84_3D_CLASS) { + BEGIN_NV04(push, SUBC_3D(NV84_3D_VERTEX_ID_BASE), 1); + PUSH_DATA (push, index_bias); + } nv50->state.index_bias = index_bias; } -- cgit v1.2.3