summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2012-04-24 22:53:05 +0200
committerMarek Olšák <[email protected]>2012-04-30 01:18:48 +0200
commit0b7d48cbad86eaac21fce3793da41b46db8be3b4 (patch)
tree437f5cfeb3a77278d29e384b47dfaef9b96faa75 /src/mesa/state_tracker
parent01bf5569c44389c1127bbb9e873c8a234ac92ff7 (diff)
gallium: add void *user_buffer to pipe_constant_buffer
This reduces CPU overhead when updating constants.
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r--src/mesa/state_tracker/st_atom_constbuf.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/mesa/state_tracker/st_atom_constbuf.c b/src/mesa/state_tracker/st_atom_constbuf.c
index eb98161dbd0..c9018b3bd77 100644
--- a/src/mesa/state_tracker/st_atom_constbuf.c
+++ b/src/mesa/state_tracker/st_atom_constbuf.c
@@ -56,8 +56,6 @@ void st_upload_constants( struct st_context *st,
struct gl_program_parameter_list *params,
unsigned shader_type)
{
- struct pipe_context *pipe = st->pipe;
-
assert(shader_type == PIPE_SHADER_VERTEX ||
shader_type == PIPE_SHADER_FRAGMENT ||
shader_type == PIPE_SHADER_GEOMETRY);
@@ -80,13 +78,12 @@ void st_upload_constants( struct st_context *st,
*/
if (st->constbuf_uploader) {
cb.buffer = NULL;
+ cb.user_buffer = NULL;
u_upload_data(st->constbuf_uploader, 0, paramBytes,
params->ParameterValues, &cb.buffer_offset, &cb.buffer);
} else {
- cb.buffer = pipe_user_buffer_create(pipe->screen,
- params->ParameterValues,
- paramBytes,
- PIPE_BIND_CONSTANT_BUFFER);
+ cb.buffer = NULL;
+ cb.user_buffer = params->ParameterValues;
cb.buffer_offset = 0;
}
cb.buffer_size = paramBytes;