Mesa (master): nv40: enable base vertex
Ilia Mirkin
imirkin at kemper.freedesktop.org
Mon Jun 29 04:48:28 UTC 2015
Module: Mesa
Branch: master
Commit: b5622313ea2e070cc0c20c7cdccd844d383713d0
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=b5622313ea2e070cc0c20c7cdccd844d383713d0
Author: Ilia Mirkin <imirkin at alum.mit.edu>
Date: Sun Jun 28 22:30:27 2015 -0400
nv40: enable base vertex
Still appears to have issues with negative indices less than -1M, but
that's a corner case of a corner case.
Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
---
src/gallium/drivers/nouveau/nv30/nv30-40_3d.xml.h | 2 ++
src/gallium/drivers/nouveau/nv30/nv30_context.h | 1 +
src/gallium/drivers/nouveau/nv30/nv30_vbo.c | 6 ++----
3 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/gallium/drivers/nouveau/nv30/nv30-40_3d.xml.h b/src/gallium/drivers/nouveau/nv30/nv30-40_3d.xml.h
index 447f4b3..95468e5 100644
--- a/src/gallium/drivers/nouveau/nv30/nv30-40_3d.xml.h
+++ b/src/gallium/drivers/nouveau/nv30/nv30-40_3d.xml.h
@@ -1459,6 +1459,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define NV40_3D_VTX_CACHE_INVALIDATE 0x00001714
+#define NV40_3D_VB_ELEMENT_BASE 0x0000173c
+
#define NV30_3D_VTXFMT(i0) (0x00001740 + 0x4*(i0))
#define NV30_3D_VTXFMT__ESIZE 0x00000004
#define NV30_3D_VTXFMT__LEN 0x00000010
diff --git a/src/gallium/drivers/nouveau/nv30/nv30_context.h b/src/gallium/drivers/nouveau/nv30/nv30_context.h
index 592cdbe..7181336 100644
--- a/src/gallium/drivers/nouveau/nv30/nv30_context.h
+++ b/src/gallium/drivers/nouveau/nv30/nv30_context.h
@@ -51,6 +51,7 @@ struct nv30_context {
unsigned rt_enable;
unsigned scissor_off;
unsigned num_vtxelts;
+ int index_bias;
boolean prim_restart;
struct nv30_fragprog *fragprog;
} state;
diff --git a/src/gallium/drivers/nouveau/nv30/nv30_vbo.c b/src/gallium/drivers/nouveau/nv30/nv30_vbo.c
index d4e384b..faa8812 100644
--- a/src/gallium/drivers/nouveau/nv30/nv30_vbo.c
+++ b/src/gallium/drivers/nouveau/nv30/nv30_vbo.c
@@ -461,13 +461,11 @@ nv30_draw_elements(struct nv30_context *nv30, boolean shorten,
struct nouveau_object *eng3d = nv30->screen->eng3d;
unsigned prim = nv30_prim_gl(mode);
-#if 0 /*XXX*/
- if (index_bias != nv30->state.index_bias) {
- BEGIN_NV04(push, NV30_3D(VB_ELEMENT_BASE), 1);
+ if (eng3d->oclass >= NV40_3D_CLASS && index_bias != nv30->state.index_bias) {
+ BEGIN_NV04(push, NV40_3D(VB_ELEMENT_BASE), 1);
PUSH_DATA (push, index_bias);
nv30->state.index_bias = index_bias;
}
-#endif
if (eng3d->oclass == NV40_3D_CLASS && index_size > 1 &&
nv30->idxbuf.buffer) {
More information about the mesa-commit
mailing list