diff options
author | Marek Olšák <[email protected]> | 2012-05-11 16:38:13 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2012-05-11 16:38:13 +0200 |
commit | bb4c5d72d7c7cb1d9e7016e2c07c36875f30011a (patch) | |
tree | 153444ff535900f82ae63b5af8ccd09fb2f063af /src/gallium/drivers/nv50/nv50_state.c | |
parent | 96956dc5076fc03b9290368ca90e3f3b870ee613 (diff) | |
parent | 8dd3e341b337ca2d22bcc0e7548a78a6c36ca77d (diff) |
Merge branch 'gallium-userbuf'
Conflicts:
src/gallium/docs/source/screen.rst
src/gallium/drivers/nv50/nv50_state.c
src/gallium/include/pipe/p_defines.h
src/mesa/state_tracker/st_draw.c
Diffstat (limited to 'src/gallium/drivers/nv50/nv50_state.c')
-rw-r--r-- | src/gallium/drivers/nv50/nv50_state.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/gallium/drivers/nv50/nv50_state.c b/src/gallium/drivers/nv50/nv50_state.c index 5e32b2717fd..7f840e2b42e 100644 --- a/src/gallium/drivers/nv50/nv50_state.c +++ b/src/gallium/drivers/nv50/nv50_state.c @@ -747,9 +747,16 @@ nv50_gp_state_bind(struct pipe_context *pipe, void *hwcso) static void nv50_set_constant_buffer(struct pipe_context *pipe, uint shader, uint index, - struct pipe_resource *res) + struct pipe_constant_buffer *cb) { struct nv50_context *nv50 = nv50_context(pipe); + struct pipe_resource *res = cb ? cb->buffer : NULL; + + if (cb && cb->user_buffer) { + res = nouveau_user_buffer_create(pipe->screen, cb->user_buffer, + cb->buffer_size, + PIPE_BIND_CONSTANT_BUFFER); + } pipe_resource_reference(&nv50->constbuf[shader][index], res); @@ -762,6 +769,10 @@ nv50_set_constant_buffer(struct pipe_context *pipe, uint shader, uint index, nouveau_bufctx_reset(nv50->bufctx_3d, NV50_BIND_CB(shader, index)); nv50->dirty |= NV50_NEW_CONSTBUF; + + if (cb && cb->user_buffer) { + pipe_resource_reference(&res, NULL); + } } /* ============================================================================= @@ -1055,7 +1066,4 @@ nv50_init_state_functions(struct nv50_context *nv50) pipe->create_stream_output_target = nv50_so_target_create; pipe->stream_output_target_destroy = nv50_so_target_destroy; pipe->set_stream_output_targets = nv50_set_stream_output_targets; - - pipe->redefine_user_buffer = u_default_redefine_user_buffer; } - |