From 0b7d48cbad86eaac21fce3793da41b46db8be3b4 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Tue, 24 Apr 2012 22:53:05 +0200 Subject: gallium: add void *user_buffer to pipe_constant_buffer This reduces CPU overhead when updating constants. --- src/gallium/drivers/radeonsi/r600_state_common.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/gallium/drivers/radeonsi') diff --git a/src/gallium/drivers/radeonsi/r600_state_common.c b/src/gallium/drivers/radeonsi/r600_state_common.c index 05a201ce3bc..63c07420915 100644 --- a/src/gallium/drivers/radeonsi/r600_state_common.c +++ b/src/gallium/drivers/radeonsi/r600_state_common.c @@ -439,6 +439,12 @@ void r600_set_constant_buffer(struct pipe_context *ctx, uint shader, uint index, return; } + if (cb->user_buffer) { + rbuffer = pipe_user_buffer_create(ctx->screen, cb->user_buffer, + cb->buffer_size, + PIPE_BIND_CONSTANT_BUFFER); + } + r600_inval_shader_cache(rctx); r600_upload_const_buffer(rctx, &rbuffer, &offset); -- cgit v1.2.3