Mesa (master): r600g: drop index_offset parameter to index buffer translate .

Dave Airlie airlied at kemper.freedesktop.org
Fri Sep 24 02:40:20 UTC 2010


Module: Mesa
Branch: master
Commit: 4e27e935ca670d0cb1748e40a46a2357d4331a6f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=4e27e935ca670d0cb1748e40a46a2357d4331a6f

Author: Dave Airlie <airlied at redhat.com>
Date:   Fri Sep 24 12:36:08 2010 +1000

r600g: drop index_offset parameter to index buffer translate.

r600 doesn't need this as we always have working index bias

---

 src/gallium/drivers/r600/r600_draw.c |   30 +++++++++++++-----------------
 1 files changed, 13 insertions(+), 17 deletions(-)

diff --git a/src/gallium/drivers/r600/r600_draw.c b/src/gallium/drivers/r600/r600_draw.c
index 4978a3c..5b38946 100644
--- a/src/gallium/drivers/r600/r600_draw.c
+++ b/src/gallium/drivers/r600/r600_draw.c
@@ -40,29 +40,25 @@
 
 static void r600_translate_index_buffer(struct r600_context *r600,
 					struct pipe_resource **index_buffer,
-					unsigned *index_size, unsigned index_offset,
+					unsigned *index_size,
 					unsigned *start, unsigned count)
 {
     switch (*index_size) {
         case 1:
-            util_shorten_ubyte_elts(&r600->context, index_buffer, index_offset, *start, count);
-            *index_size = 2;
-            *start = 0;
-            break;
+		util_shorten_ubyte_elts(&r600->context, index_buffer, 0, *start, count);
+		*index_size = 2;
+		*start = 0;
+		break;
 
         case 2:
-            if (*start % 2 != 0 || index_offset) {
-                util_rebuild_ushort_elts(&r600->context, index_buffer, index_offset, *start, count);
-                *start = 0;
-            }
-            break;
-
+		if (*start % 2 != 0) {
+			util_rebuild_ushort_elts(&r600->context, index_buffer, 0, *start, count);
+			*start = 0;
+		}
+		break;
+		
         case 4:
-            if (index_offset) {
-                util_rebuild_uint_elts(&r600->context, index_buffer, index_offset, *start, count);
-                *start = 0;
-            }
-            break;
+		break;
     }
 }
 
@@ -168,7 +164,7 @@ void r600_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info *info)
 
 		r600_translate_index_buffer(rctx, &rctx->index_buffer.buffer,
 					    &rctx->index_buffer.index_size,
-					    0, &draw.start,
+					    &draw.start,
 					    info->count);
 
 		draw.index_size = rctx->index_buffer.index_size;




More information about the mesa-commit mailing list