Mesa (main): gallium/u_threaded: do not apply start twice

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jul 1 12:15:56 UTC 2021


Module: Mesa
Branch: main
Commit: 669b6889e4b0ed4e3ca597dee8a1ab6834bac560
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=669b6889e4b0ed4e3ca597dee8a1ab6834bac560

Author: Erik Faye-Lund <erik.faye-lund at collabora.com>
Date:   Tue Jun 29 10:45:44 2021 +0200

gallium/u_threaded: do not apply start twice

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 at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11635>

---

 src/gallium/auxiliary/util/u_threaded_context.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/auxiliary/util/u_threaded_context.c b/src/gallium/auxiliary/util/u_threaded_context.c
index 5d28bbcf62b..847e7057859 100644
--- a/src/gallium/auxiliary/util/u_threaded_context.c
+++ b/src/gallium/auxiliary/util/u_threaded_context.c
@@ -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 {



More information about the mesa-commit mailing list