From 061b262a0c2482e10286c4ecc96a81b47546100a Mon Sep 17 00:00:00 2001 From: Christian Gmeiner Date: Fri, 13 Sep 2019 08:24:33 +0200 Subject: [PATCH] freedreno: ssbo: keep track if a buffer gets written Signed-off-by: Christian Gmeiner Reviewed-by: Rob Clark Part-of: --- src/gallium/drivers/freedreno/freedreno_context.h | 1 + src/gallium/drivers/freedreno/freedreno_state.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/gallium/drivers/freedreno/freedreno_context.h b/src/gallium/drivers/freedreno/freedreno_context.h index f92790c0ecf..30deddd21b3 100644 --- a/src/gallium/drivers/freedreno/freedreno_context.h +++ b/src/gallium/drivers/freedreno/freedreno_context.h @@ -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 { diff --git a/src/gallium/drivers/freedreno/freedreno_state.c b/src/gallium/drivers/freedreno/freedreno_state.c index dd42ef4c6e9..a748bfec82c 100644 --- a/src/gallium/drivers/freedreno/freedreno_state.c +++ b/src/gallium/drivers/freedreno/freedreno_state.c @@ -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; -- 2.30.2