[2/4] gallium/u_threaded: always unmap const_uploader

Submitted by Marek Olšák on Feb. 7, 2019, 1:21 a.m.

Details

Message ID 20190207012201.15832-3-maraeo@gmail.com
State New
Headers show
Series "RadeonSI: Upload constants to VRAM via SDMA" ( rev: 3 2 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Marek Olšák Feb. 7, 2019, 1:21 a.m.
From: Marek Olšák <marek.olsak@amd.com>

radeonsi will require this. It's a no-op for drivers supporting persistent
mappings.
---
 src/gallium/auxiliary/util/u_threaded_context.c | 1 +
 1 file changed, 1 insertion(+)

Patch hide | download patch | download mbox

diff --git a/src/gallium/auxiliary/util/u_threaded_context.c b/src/gallium/auxiliary/util/u_threaded_context.c
index 8e3bceae18d..66ee58bb588 100644
--- a/src/gallium/auxiliary/util/u_threaded_context.c
+++ b/src/gallium/auxiliary/util/u_threaded_context.c
@@ -669,20 +669,21 @@  tc_set_constant_buffer(struct pipe_context *_pipe,
    struct pipe_resource *buffer = NULL;
    unsigned offset;
 
    /* This must be done before adding set_constant_buffer, because it could
     * generate e.g. transfer_unmap and flush partially-uninitialized
     * set_constant_buffer to the driver if it was done afterwards.
     */
    if (cb && cb->user_buffer) {
       u_upload_data(tc->base.const_uploader, 0, cb->buffer_size, 64,
                     cb->user_buffer, &offset, &buffer);
+      u_upload_unmap(tc->base.const_uploader);
    }
 
    struct tc_constant_buffer *p =
       tc_add_struct_typed_call(tc, TC_CALL_set_constant_buffer,
                                tc_constant_buffer);
    p->shader = shader;
    p->index = index;
 
    if (cb) {
       if (cb->user_buffer) {