- /* We always need to get a new buffer, to keep the drivers simple and
- * avoid gratuitous rendering synchronization.
- * Let's use a user buffer to avoid an unnecessary copy.
- */
- if (!st->has_user_constbuf) {
- cb.buffer = NULL;
- cb.user_buffer = NULL;
- u_upload_data(st->pipe->const_uploader, 0, paramBytes,
- st->ctx->Const.UniformBufferOffsetAlignment,
- params->ParameterValues, &cb.buffer_offset, &cb.buffer);
- u_upload_unmap(st->pipe->const_uploader);
- } else {
- cb.buffer = NULL;
- cb.user_buffer = params->ParameterValues;
- cb.buffer_offset = 0;
- }