Mesa (master): u_vbuf_mgr: add a way to specify the BIND flag for the upload buffer

Marek Olšák mareko at kemper.freedesktop.org
Tue Feb 8 15:02:02 UTC 2011


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

Author: Marek Olšák <maraeo at gmail.com>
Date:   Tue Feb  8 15:20:11 2011 +0100

u_vbuf_mgr: add a way to specify the BIND flag for the upload buffer

---

 src/gallium/auxiliary/util/u_vbuf_mgr.c |    3 ++-
 src/gallium/auxiliary/util/u_vbuf_mgr.h |    1 +
 src/gallium/drivers/r300/r300_context.c |    1 +
 src/gallium/drivers/r600/r600_pipe.c    |    1 +
 4 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_vbuf_mgr.c b/src/gallium/auxiliary/util/u_vbuf_mgr.c
index 7ebea7e..ca3b4dc 100644
--- a/src/gallium/auxiliary/util/u_vbuf_mgr.c
+++ b/src/gallium/auxiliary/util/u_vbuf_mgr.c
@@ -114,6 +114,7 @@ struct u_vbuf_mgr *
 u_vbuf_mgr_create(struct pipe_context *pipe,
                   unsigned upload_buffer_size,
                   unsigned upload_buffer_alignment,
+                  unsigned upload_buffer_bind,
                   enum u_fetch_alignment fetch_alignment)
 {
    struct u_vbuf_mgr_priv *mgr = CALLOC_STRUCT(u_vbuf_mgr_priv);
@@ -123,7 +124,7 @@ u_vbuf_mgr_create(struct pipe_context *pipe,
 
    mgr->b.uploader = u_upload_create(pipe, upload_buffer_size,
                                      upload_buffer_alignment,
-                                     PIPE_BIND_VERTEX_BUFFER);
+                                     upload_buffer_bind);
 
    mgr->caps.fetch_dword_unaligned =
          fetch_alignment == U_VERTEX_FETCH_BYTE_ALIGNED;
diff --git a/src/gallium/auxiliary/util/u_vbuf_mgr.h b/src/gallium/auxiliary/util/u_vbuf_mgr.h
index 068459a..8b24185 100644
--- a/src/gallium/auxiliary/util/u_vbuf_mgr.h
+++ b/src/gallium/auxiliary/util/u_vbuf_mgr.h
@@ -83,6 +83,7 @@ struct u_vbuf_mgr *
 u_vbuf_mgr_create(struct pipe_context *pipe,
                   unsigned upload_buffer_size,
                   unsigned upload_buffer_alignment,
+                  unsigned upload_buffer_bind,
                   enum u_fetch_alignment fetch_alignment);
 
 void u_vbuf_mgr_destroy(struct u_vbuf_mgr *mgr);
diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c
index b8b7afa..7e0c068 100644
--- a/src/gallium/drivers/r300/r300_context.c
+++ b/src/gallium/drivers/r300/r300_context.c
@@ -434,6 +434,7 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen,
     r300_init_resource_functions(r300);
 
     r300->vbuf_mgr = u_vbuf_mgr_create(&r300->context, 1024 * 1024, 16,
+				       PIPE_BIND_VERTEX_BUFFER,
 				       U_VERTEX_FETCH_DWORD_ALIGNED);
     if (!r300->vbuf_mgr)
         goto fail;
diff --git a/src/gallium/drivers/r600/r600_pipe.c b/src/gallium/drivers/r600/r600_pipe.c
index ad609fb..9826bf4 100644
--- a/src/gallium/drivers/r600/r600_pipe.c
+++ b/src/gallium/drivers/r600/r600_pipe.c
@@ -166,6 +166,7 @@ static struct pipe_context *r600_create_context(struct pipe_screen *screen, void
 	}
 
 	rctx->vbuf_mgr = u_vbuf_mgr_create(&rctx->context, 1024 * 1024, 16,
+					   PIPE_BIND_VERTEX_BUFFER,
 					   U_VERTEX_FETCH_BYTE_ALIGNED);
 	if (!rctx->vbuf_mgr) {
 		r600_destroy_context(&rctx->context);




More information about the mesa-commit mailing list