[Mesa-dev] [PATCH 2/4] gallium/u_threaded: always unmap const_uploader

Marek Olšák maraeo at gmail.com
Thu Feb 7 01:21:59 UTC 2019


From: Marek Olšák <marek.olsak at 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(+)

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) {
-- 
2.17.1



More information about the mesa-dev mailing list