diff options
author | Marek Olšák <[email protected]> | 2012-04-24 20:16:50 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2012-04-30 01:09:57 +0200 |
commit | 7a0545972694e6afc6c5ac60db563defa79c20d9 (patch) | |
tree | 3152ec74a8bb4a2dbd1a25a5ed6f7911faad1525 /src/mesa/state_tracker/st_context.c | |
parent | 507337864fa80caf9f26602324d2c28dd0a75d61 (diff) |
st/mesa: make user constant buffers optional
Diffstat (limited to 'src/mesa/state_tracker/st_context.c')
-rw-r--r-- | src/mesa/state_tracker/st_context.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c index d50c6be6c4d..a804e77af8b 100644 --- a/src/mesa/state_tracker/st_context.c +++ b/src/mesa/state_tracker/st_context.c @@ -163,6 +163,14 @@ st_create_context_priv( struct gl_context *ctx, struct pipe_context *pipe ) PIPE_BIND_INDEX_BUFFER); } + if (!screen->get_param(screen, PIPE_CAP_USER_CONSTANT_BUFFERS)) { + unsigned alignment = + screen->get_param(screen, PIPE_CAP_CONSTANT_BUFFER_OFFSET_ALIGNMENT); + + st->constbuf_uploader = u_upload_create(pipe, 128 * 1024, alignment, + PIPE_BIND_CONSTANT_BUFFER); + } + st->cso_context = cso_create_context(pipe); st_init_vbuf(st); @@ -273,6 +281,9 @@ static void st_destroy_context_priv( struct st_context *st ) if (st->indexbuf_uploader) { u_upload_destroy(st->indexbuf_uploader); } + if (st->constbuf_uploader) { + u_upload_destroy(st->constbuf_uploader); + } free( st ); } |