diff options
author | Ilia Mirkin <[email protected]> | 2014-12-30 23:19:47 -0500 |
---|---|---|
committer | Ilia Mirkin <[email protected]> | 2014-12-30 23:30:23 -0500 |
commit | be0311c9626eef841f6d245359759cf1e082aebf (patch) | |
tree | 35180d95102abd447bd5efc2264108a713745443 /src/gallium/drivers/nouveau/nv50 | |
parent | 609c3e51f5ca8abb15867537997369e7e8a678e3 (diff) |
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 <[email protected]>
Cc: "10.3 10.4" <[email protected]>
Diffstat (limited to 'src/gallium/drivers/nouveau/nv50')
-rw-r--r-- | src/gallium/drivers/nouveau/nv50/nv50_screen.c | 7 | ||||
-rw-r--r-- | src/gallium/drivers/nouveau/nv50/nv50_vbo.c | 8 |
2 files changed, 15 insertions, 0 deletions
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; } |