From: Christian Gmeiner Date: Fri, 13 Sep 2019 06:24:33 +0000 (+0200) Subject: freedreno: ssbo: keep track if a buffer gets written X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=061b262a0c2482e10286c4ecc96a81b47546100a;p=mesa.git freedreno: ssbo: keep track if a buffer gets written Signed-off-by: Christian Gmeiner Reviewed-by: Rob Clark Part-of: --- 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;