Mesa (master): r600g: inline r600_upload_index_buffer

Marek Olšák mareko at kemper.freedesktop.org
Wed Apr 4 11:15:02 UTC 2012


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

Author: Marek Olšák <maraeo at gmail.com>
Date:   Mon Apr  2 03:01:01 2012 +0200

r600g: inline r600_upload_index_buffer

---

 src/gallium/drivers/r600/r600_buffer.c       |    9 ---------
 src/gallium/drivers/r600/r600_pipe.h         |    3 ---
 src/gallium/drivers/r600/r600_state_common.c |    7 +++++--
 3 files changed, 5 insertions(+), 14 deletions(-)

diff --git a/src/gallium/drivers/r600/r600_buffer.c b/src/gallium/drivers/r600/r600_buffer.c
index b165c31..4708d01 100644
--- a/src/gallium/drivers/r600/r600_buffer.c
+++ b/src/gallium/drivers/r600/r600_buffer.c
@@ -257,12 +257,3 @@ struct pipe_resource *r600_user_buffer_create(struct pipe_screen *screen,
 	rbuffer->buf = NULL;
 	return &rbuffer->b.b.b;
 }
-
-void r600_upload_index_buffer(struct r600_context *rctx,
-			      struct pipe_index_buffer *ib, unsigned count)
-{
-	struct r600_resource *rbuffer = r600_resource(ib->buffer);
-
-	u_upload_data(rctx->vbuf_mgr->uploader, 0, count * ib->index_size,
-		      rbuffer->b.user_ptr, &ib->offset, &ib->buffer);
-}
diff --git a/src/gallium/drivers/r600/r600_pipe.h b/src/gallium/drivers/r600/r600_pipe.h
index 1f4368d..a84f9cc 100644
--- a/src/gallium/drivers/r600/r600_pipe.h
+++ b/src/gallium/drivers/r600/r600_pipe.h
@@ -398,9 +398,6 @@ struct pipe_resource *r600_buffer_create(struct pipe_screen *screen,
 struct pipe_resource *r600_user_buffer_create(struct pipe_screen *screen,
 					      void *ptr, unsigned bytes,
 					      unsigned bind);
-void r600_upload_index_buffer(struct r600_context *rctx,
-			      struct pipe_index_buffer *ib, unsigned count);
-
 
 /* r600_pipe.c */
 void r600_flush(struct pipe_context *ctx, struct pipe_fence_handle **fence,
diff --git a/src/gallium/drivers/r600/r600_state_common.c b/src/gallium/drivers/r600/r600_state_common.c
index 1738d30..59336cf 100644
--- a/src/gallium/drivers/r600/r600_state_common.c
+++ b/src/gallium/drivers/r600/r600_state_common.c
@@ -744,6 +744,7 @@ void r600_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info *dinfo)
 	struct r600_atom *state = NULL, *next_state = NULL;
 	struct radeon_winsys_cs *cs = rctx->cs;
 	uint64_t va;
+	uint8_t *ptr;
 
 	if ((!info.count && (info.indexed || !info.count_from_stream_output)) ||
 	    (info.indexed && !rctx->vbuf_mgr->index_buffer.buffer) ||
@@ -778,8 +779,10 @@ void r600_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info *dinfo)
 		/* Translate or upload, if needed. */
 		r600_translate_index_buffer(rctx, &ib, info.count);
 
-		if (u_vbuf_resource(ib.buffer)->user_ptr) {
-			r600_upload_index_buffer(rctx, &ib, info.count);
+		ptr = u_vbuf_resource(ib.buffer)->user_ptr;
+		if (ptr) {
+			u_upload_data(rctx->vbuf_mgr->uploader, 0, info.count * ib.index_size,
+				      ptr, &ib.offset, &ib.buffer);
 		}
 	} else {
 		info.index_bias = info.start;




More information about the mesa-commit mailing list