- /* 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->constbuf_uploader) {
- cb.buffer = NULL;
- cb.user_buffer = NULL;
- u_upload_data(st->constbuf_uploader, 0, paramBytes,
- st->ctx->Const.UniformBufferOffsetAlignment,
- params->ParameterValues, &cb.buffer_offset, &cb.buffer);
- u_upload_unmap(st->constbuf_uploader);
- } else {
- cb.buffer = NULL;
- cb.user_buffer = params->ParameterValues;
- cb.buffer_offset = 0;
- }