From 020009f7ccdffa84c6e1649c4e915954f5fd7cc0 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sat, 19 Dec 2015 17:15:02 +0100 Subject: u_upload_mgr: pass alignment to u_upload_alloc manually MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The fixed alignment of u_upload_mgr will go away. This is the first step. The motivation is that one u_upload_mgr can have multiple users, each allocating from the same buffer, but requiring a different alignment. Reviewed-by: Nicolai Hähnle --- src/mesa/state_tracker/st_cb_bitmap.c | 2 +- src/mesa/state_tracker/st_cb_clear.c | 2 +- src/mesa/state_tracker/st_cb_drawpixels.c | 2 +- src/mesa/state_tracker/st_cb_drawtex.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_cb_bitmap.c b/src/mesa/state_tracker/st_cb_bitmap.c index a4a48a616fd..14e8354d480 100644 --- a/src/mesa/state_tracker/st_cb_bitmap.c +++ b/src/mesa/state_tracker/st_cb_bitmap.c @@ -204,7 +204,7 @@ setup_bitmap_vertex_data(struct st_context *st, bool normalized, tBot = (GLfloat) height; } - u_upload_alloc(st->uploader, 0, 4 * sizeof(vertices[0]), + u_upload_alloc(st->uploader, 0, 4 * sizeof(vertices[0]), 4, vbuf_offset, vbuf, (void **) &vertices); if (!*vbuf) { return; diff --git a/src/mesa/state_tracker/st_cb_clear.c b/src/mesa/state_tracker/st_cb_clear.c index 18efd14a57c..e09f5ec6a0b 100644 --- a/src/mesa/state_tracker/st_cb_clear.c +++ b/src/mesa/state_tracker/st_cb_clear.c @@ -184,7 +184,7 @@ draw_quad(struct st_context *st, vb.stride = 8 * sizeof(float); - u_upload_alloc(st->uploader, 0, 4 * sizeof(vertices[0]), + u_upload_alloc(st->uploader, 0, 4 * sizeof(vertices[0]), 4, &vb.buffer_offset, &vb.buffer, (void **) &vertices); if (!vb.buffer) { diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index a125d1f149e..86e8a55e25e 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@ -457,7 +457,7 @@ draw_quad(struct gl_context *ctx, GLfloat x0, GLfloat y0, GLfloat z, struct pipe_resource *buf = NULL; unsigned offset; - u_upload_alloc(st->uploader, 0, 4 * sizeof(verts[0]), &offset, + u_upload_alloc(st->uploader, 0, 4 * sizeof(verts[0]), 4, &offset, &buf, (void **) &verts); if (!buf) { return; diff --git a/src/mesa/state_tracker/st_cb_drawtex.c b/src/mesa/state_tracker/st_cb_drawtex.c index 2634b09d777..b3e4b5bb70c 100644 --- a/src/mesa/state_tracker/st_cb_drawtex.c +++ b/src/mesa/state_tracker/st_cb_drawtex.c @@ -150,7 +150,7 @@ st_DrawTex(struct gl_context *ctx, GLfloat x, GLfloat y, GLfloat z, GLuint attr; u_upload_alloc(st->uploader, 0, - numAttribs * 4 * 4 * sizeof(GLfloat), + numAttribs * 4 * 4 * sizeof(GLfloat), 4, &offset, &vbuffer, (void **) &vbuf); if (!vbuffer) { return; -- cgit v1.2.3