gallium/radeon: handle other map buffer flags from the threaded context
authorMarek Olšák <marek.olsak@amd.com>
Sun, 12 Mar 2017 13:17:25 +0000 (14:17 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 15 May 2017 11:01:33 +0000 (13:01 +0200)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
src/gallium/drivers/radeon/r600_buffer_common.c

index 4132858b1fc959d3385229dd903f2a09d87b44a0..5d984ea80666d06fc8b241e043bcb54b463d8e01 100644 (file)
@@ -354,7 +354,8 @@ static void *r600_buffer_transfer_map(struct pipe_context *ctx,
 
        /* See if the buffer range being mapped has never been initialized,
         * in which case it can be mapped unsynchronized. */
-       if (!(usage & PIPE_TRANSFER_UNSYNCHRONIZED) &&
+       if (!(usage & (PIPE_TRANSFER_UNSYNCHRONIZED |
+                      TC_TRANSFER_MAP_IGNORE_VALID_RANGE)) &&
            usage & PIPE_TRANSFER_WRITE &&
            !rbuffer->is_shared &&
            !util_ranges_intersect(&rbuffer->valid_buffer_range, box->x, box->x + box->width)) {
@@ -368,7 +369,8 @@ static void *r600_buffer_transfer_map(struct pipe_context *ctx,
        }
 
        if (usage & PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE &&
-           !(usage & PIPE_TRANSFER_UNSYNCHRONIZED)) {
+           !(usage & (PIPE_TRANSFER_UNSYNCHRONIZED |
+                      TC_TRANSFER_MAP_NO_INVALIDATE))) {
                assert(usage & PIPE_TRANSFER_WRITE);
 
                if (r600_invalidate_buffer(rctx, rbuffer)) {