freedreno: ssbo: keep track if a buffer gets written
authorChristian Gmeiner <christian.gmeiner@gmail.com>
Fri, 13 Sep 2019 06:24:33 +0000 (08:24 +0200)
committerMarge Bot <eric+marge@anholt.net>
Wed, 25 Mar 2020 20:49:32 +0000 (20:49 +0000)
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/1963>

src/gallium/drivers/freedreno/freedreno_context.h
src/gallium/drivers/freedreno/freedreno_state.c

index f92790c0ecf4353f526c51454fee7935184f29a7..30deddd21b3ed7ab231cff0e2f11b19e264647d7 100644 (file)
@@ -66,6 +66,7 @@ struct fd_constbuf_stateobj {
 struct fd_shaderbuf_stateobj {
        struct pipe_shader_buffer sb[PIPE_MAX_SHADER_BUFFERS];
        uint32_t enabled_mask;
+       uint32_t writable_mask;
 };
 
 struct fd_shaderimg_stateobj {
index dd42ef4c6e979e22c1d7399f2c224653c666ccec..a748bfec82cd53a2e83a091c7d8947299673ac2b 100644 (file)
@@ -129,6 +129,8 @@ fd_set_shader_buffers(struct pipe_context *pctx,
        const unsigned modified_bits = u_bit_consecutive(start, count);
 
        so->enabled_mask &= ~modified_bits;
+       so->writable_mask &= ~modified_bits;
+       so->writable_mask |= writable_bitmask << start;
 
        for (unsigned i = 0; i < count; i++) {
                unsigned n = i + start;