diff options
author | Marek Olšák <[email protected]> | 2012-04-13 19:27:45 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2012-04-18 16:19:39 +0200 |
commit | b69dad1683f092e3ce9d0f3f8fb1bdf96bdff0c7 (patch) | |
tree | 03939ebc7c336edaa250d027a05515a0751751a1 /src | |
parent | 0a43fd4c01395c2bdfef7b087e884aa4c657ba9a (diff) |
st/mesa: use u_upload_mgr to upload vertices for glDrawPixels
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/state_tracker/st_cb_drawpixels.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index 18d0e53d406..5229ccee688 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@ -66,6 +66,7 @@ #include "util/u_inlines.h" #include "util/u_math.h" #include "util/u_tile.h" +#include "util/u_upload_mgr.h" #include "cso_cache/cso_context.h" @@ -619,16 +620,16 @@ draw_quad(struct gl_context *ctx, GLfloat x0, GLfloat y0, GLfloat z, } { - struct pipe_resource *buf; + struct pipe_resource *buf = NULL; + unsigned offset; - /* allocate/load buffer object with vertex data */ - buf = pipe_buffer_create(pipe->screen, - PIPE_BIND_VERTEX_BUFFER, - PIPE_USAGE_STATIC, - sizeof(verts)); - pipe_buffer_write(st->pipe, buf, 0, sizeof(verts), verts); + u_upload_data(st->uploader, 0, sizeof(verts), verts, &offset, &buf); + if (!buf) { + return; + } - util_draw_vertex_buffer(pipe, st->cso_context, buf, 0, + u_upload_unmap(st->uploader); + util_draw_vertex_buffer(pipe, st->cso_context, buf, offset, PIPE_PRIM_QUADS, 4, /* verts */ 3); /* attribs/vert */ |