diff options
Diffstat (limited to 'src/mesa/state_tracker/st_atom_constbuf.c')
-rw-r--r-- | src/mesa/state_tracker/st_atom_constbuf.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/mesa/state_tracker/st_atom_constbuf.c b/src/mesa/state_tracker/st_atom_constbuf.c index d02e51cb9a..2df6fef210 100644 --- a/src/mesa/state_tracker/st_atom_constbuf.c +++ b/src/mesa/state_tracker/st_atom_constbuf.c @@ -85,14 +85,10 @@ void st_upload_constants( struct st_context *st, } /* load Mesa constants into the constant buffer */ - if (cbuf->buffer) { - void *map = pipe_buffer_map(pipe->screen, cbuf->buffer, - PIPE_BUFFER_USAGE_CPU_WRITE); - memcpy(map, params->ParameterValues, paramBytes); - pipe_buffer_unmap(pipe->screen, cbuf->buffer); - } - - cbuf->size = paramBytes; + if (cbuf->buffer) + pipe_buffer_write(pipe->screen, cbuf->buffer, + 0, paramBytes, + params->ParameterValues); st->pipe->set_constant_buffer(st->pipe, id, 0, cbuf); } |