u_vbuf_mgr: add a way to specify the BIND flag for the upload buffer
authorMarek Olšák <maraeo@gmail.com>
Tue, 8 Feb 2011 14:20:11 +0000 (15:20 +0100)
committerMarek Olšák <maraeo@gmail.com>
Tue, 8 Feb 2011 14:20:11 +0000 (15:20 +0100)
src/gallium/auxiliary/util/u_vbuf_mgr.c
src/gallium/auxiliary/util/u_vbuf_mgr.h
src/gallium/drivers/r300/r300_context.c
src/gallium/drivers/r600/r600_pipe.c

index 7ebea7e99c4fd2b245708cf2247f6f57bfb96d96..ca3b4dc4c4e9eb6329b470caa27d803eb6fcdefa 100644 (file)
@@ -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;
index 068459af4c37ab569373f5919fe1b31df2e63cfa..8b241854c83b97d579c6bc6b87de3e77c4218a27 100644 (file)
@@ -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);
index b8b7afa9c27ba23581f30c0f490b43f4ee233bce..7e0c068ff3e56f2634dac1625a1af91351209b89 100644 (file)
@@ -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;
index ad609fbdfa35b633fdb325a36f6b00b99a202345..9826bf42acc789b9f6cf517d2d2b28e1d253f0bd 100644 (file)
@@ -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);