gallium/u_threaded: do not apply start twice
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Tue, 29 Jun 2021 08:45:44 +0000 (10:45 +0200)
committerMarge Bot <eric+marge@anholt.net>
Thu, 1 Jul 2021 11:57:49 +0000 (11:57 +0000)
We already apply start when setting the bits in writable_buffer, so
shifting the bits up by start just makes us apply the offset twice.

Caught by Coverity.

Fixes: 988d0917208 ("gallium/u_threaded: clear valid buffer range only if it's not bound for write")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11635>

src/gallium/auxiliary/util/u_threaded_context.c

index 5d28bbc..847e705 100644 (file)
@@ -1467,7 +1467,7 @@ tc_set_shader_images(struct pipe_context *_pipe,
    }
 
    tc->image_buffers_writeable_mask[shader] &= ~BITFIELD_RANGE(start, count);
-   tc->image_buffers_writeable_mask[shader] |= writable_buffers << start;
+   tc->image_buffers_writeable_mask[shader] |= writable_buffers;
 }
 
 struct tc_shader_buffers {