Module: Mesa
Branch: staging/23.0
Commit: aeb5a36003693c61f797f751bd4e701298c0059c
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=aeb5a36003693c61f797f751bd4e701298c0059c

Author: Rob Clark <[email protected]>
Date:   Tue Jan  3 14:23:28 2023 -0800

freedreno: Fix tracking of enabled SSBOs

Clearing all of the modified bits an relying on OR'ing the needed bits
back in the loop below doesn't quite work out, Because of early continue
if the SSBO has not changed.

Fixes: 0ed053f03d9 ("freedreno: simplify fd_set_shader_buffers(..)")
Signed-off-by: Rob Clark <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20575>
(cherry picked from commit e41d19a7119f2ad92d1765842e066cb84b90014b)

---

 .pick_status.json                               | 2 +-
 src/gallium/drivers/freedreno/freedreno_state.c | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 8113bf47a7d..90ba6c802e8 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -706,7 +706,7 @@
         "description": "freedreno: Fix tracking of enabled SSBOs",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": "0ed053f03d936d301091dd68e96ced8dbedc83b2"
     },
diff --git a/src/gallium/drivers/freedreno/freedreno_state.c 
b/src/gallium/drivers/freedreno/freedreno_state.c
index 65215e2fcf1..03d23004b9e 100644
--- a/src/gallium/drivers/freedreno/freedreno_state.c
+++ b/src/gallium/drivers/freedreno/freedreno_state.c
@@ -164,7 +164,6 @@ fd_set_shader_buffers(struct pipe_context *pctx, enum 
pipe_shader_type shader,
    struct fd_shaderbuf_stateobj *so = &ctx->shaderbuf[shader];
    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;
 
@@ -194,6 +193,8 @@ fd_set_shader_buffers(struct pipe_context *pctx, enum 
pipe_shader_type shader,
          }
       } else {
          pipe_resource_reference(&buf->buffer, NULL);
+
+         so->enabled_mask &= ~BIT(n);
       }
    }
 

Reply via email to