Mesa (gallium-index-bias): nv50: Adapt for index bias interface change.

Jose Fonseca jrfonseca at kemper.freedesktop.org
Mon Apr 19 16:22:37 UTC 2010


Module: Mesa
Branch: gallium-index-bias
Commit: f6f7324bbf03494dc26e266d96919fec6a1f08ba
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f6f7324bbf03494dc26e266d96919fec6a1f08ba

Author: José Fonseca <jfonseca at vmware.com>
Date:   Mon Apr 19 18:17:45 2010 +0200

nv50: Adapt for index bias interface change.

---

 src/gallium/drivers/nv50/nv50_context.h |    4 ++--
 src/gallium/drivers/nv50/nv50_push.c    |    4 +++-
 src/gallium/drivers/nv50/nv50_vbo.c     |    9 ++++++---
 3 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/src/gallium/drivers/nv50/nv50_context.h b/src/gallium/drivers/nv50/nv50_context.h
index 8bf4653..4875f83 100644
--- a/src/gallium/drivers/nv50/nv50_context.h
+++ b/src/gallium/drivers/nv50/nv50_context.h
@@ -185,12 +185,12 @@ extern void nv50_draw_arrays_instanced(struct pipe_context *, unsigned mode,
 					unsigned instanceCount);
 extern void nv50_draw_elements(struct pipe_context *pipe,
 				  struct pipe_resource *indexBuffer,
-				  unsigned indexSize,
+				  unsigned indexSize, int indexBias,
 				  unsigned mode, unsigned start,
 				  unsigned count);
 extern void nv50_draw_elements_instanced(struct pipe_context *pipe,
 					 struct pipe_resource *indexBuffer,
-					 unsigned indexSize,
+					 unsigned indexSize, int indexBias,
 					 unsigned mode, unsigned start,
 					 unsigned count,
 					 unsigned startInstance,
diff --git a/src/gallium/drivers/nv50/nv50_push.c b/src/gallium/drivers/nv50/nv50_push.c
index 6981e5b..c54fed5 100644
--- a/src/gallium/drivers/nv50/nv50_push.c
+++ b/src/gallium/drivers/nv50/nv50_push.c
@@ -172,7 +172,8 @@ emit_verts(void *priv, unsigned start, unsigned count)
 
 void
 nv50_push_elements_instanced(struct pipe_context *pipe,
-                             struct pipe_resource *idxbuf, unsigned idxsize,
+                             struct pipe_resource *idxbuf,
+                             unsigned idxsize, int idxbias,
                              unsigned mode, unsigned start, unsigned count,
                              unsigned i_start, unsigned i_count)
 {
@@ -269,6 +270,7 @@ nv50_push_elements_instanced(struct pipe_context *pipe,
       }
       ctx.idxbuf = bo->map;
       ctx.idxsize = idxsize;
+      assert(idxbias == 0);
       nouveau_bo_unmap(bo);
    }
 
diff --git a/src/gallium/drivers/nv50/nv50_vbo.c b/src/gallium/drivers/nv50/nv50_vbo.c
index 609145d..932c1e8 100644
--- a/src/gallium/drivers/nv50/nv50_vbo.c
+++ b/src/gallium/drivers/nv50/nv50_vbo.c
@@ -387,7 +387,7 @@ nv50_draw_elements_inline(struct pipe_context *pipe,
 void
 nv50_draw_elements_instanced(struct pipe_context *pipe,
 			     struct pipe_resource *indexBuffer,
-			     unsigned indexSize,
+			     unsigned indexSize, int indexBias,
 			     unsigned mode, unsigned start, unsigned count,
 			     unsigned startInstance, unsigned instanceCount)
 {
@@ -401,6 +401,8 @@ nv50_draw_elements_instanced(struct pipe_context *pipe,
 	if (!nv50_state_validate(nv50, 13 + 16*3))
 		return;
 
+	assert(indexBias == 0);
+
 	if (nv50->vbo_fifo) {
 		nv50_push_elements_instanced(pipe, indexBuffer, indexSize,
 					     mode, start, count, startInstance,
@@ -460,10 +462,11 @@ nv50_draw_elements_instanced(struct pipe_context *pipe,
 
 void
 nv50_draw_elements(struct pipe_context *pipe,
-		   struct pipe_resource *indexBuffer, unsigned indexSize,
+		   struct pipe_resource *indexBuffer,
+		   unsigned indexSize, int indexBias,
 		   unsigned mode, unsigned start, unsigned count)
 {
-	nv50_draw_elements_instanced(pipe, indexBuffer, indexSize,
+	nv50_draw_elements_instanced(pipe, indexBuffer, indexSize, indexBias,
 				     mode, start, count, 0, 1);
 }
 




More information about the mesa-commit mailing list