diff options
Diffstat (limited to 'src/gallium/drivers/nv50')
-rw-r--r-- | src/gallium/drivers/nv50/nv50_screen.c | 6 | ||||
-rw-r--r-- | src/gallium/drivers/nv50/nv50_state.c | 16 |
2 files changed, 17 insertions, 5 deletions
diff --git a/src/gallium/drivers/nv50/nv50_screen.c b/src/gallium/drivers/nv50/nv50_screen.c index b341ade695e..c96e028b2a2 100644 --- a/src/gallium/drivers/nv50/nv50_screen.c +++ b/src/gallium/drivers/nv50/nv50_screen.c @@ -151,9 +151,13 @@ nv50_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param) return 1; case PIPE_CAP_TGSI_CAN_COMPACT_VARYINGS: case PIPE_CAP_TGSI_CAN_COMPACT_CONSTANTS: - return 0; /* state trackers will know better */ case PIPE_CAP_USER_VERTEX_BUFFERS: + case PIPE_CAP_USER_INDEX_BUFFERS: + return 0; /* state trackers will know better */ + case PIPE_CAP_USER_CONSTANT_BUFFERS: return 1; + case PIPE_CAP_CONSTANT_BUFFER_OFFSET_ALIGNMENT: + return 256; case PIPE_CAP_VERTEX_BUFFER_OFFSET_4BYTE_ALIGNED_ONLY: case PIPE_CAP_VERTEX_BUFFER_STRIDE_4BYTE_ALIGNED_ONLY: case PIPE_CAP_VERTEX_ELEMENT_SRC_OFFSET_4BYTE_ALIGNED_ONLY: 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; } - |