summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Gmeiner <[email protected]>2019-09-13 08:24:33 +0200
committerMarge Bot <[email protected]>2020-03-25 20:49:32 +0000
commit061b262a0c2482e10286c4ecc96a81b47546100a (patch)
tree05fa61988f4cc3e0212c7795d6bbd794abcdcb81
parent0ed053f03d936d301091dd68e96ced8dbedc83b2 (diff)
freedreno: ssbo: keep track if a buffer gets written
Signed-off-by: Christian Gmeiner <[email protected]> Reviewed-by: Rob Clark <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/1963>
-rw-r--r--src/gallium/drivers/freedreno/freedreno_context.h1
-rw-r--r--src/gallium/drivers/freedreno/freedreno_state.c2
2 files changed, 3 insertions, 0 deletions
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;