Mesa (main): crocus: fix crash on index buffer rebinding.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Jul 5 01:57:16 UTC 2021


Module: Mesa
Branch: main
Commit: 32b8d473064cf410dcc9f1138d1d346573a28e27
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=32b8d473064cf410dcc9f1138d1d346573a28e27

Author: Dave Airlie <airlied at redhat.com>
Date:   Mon Jul  5 11:43:52 2021 +1000

crocus: fix crash on index buffer rebinding.

This was crashing in plasmashell.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11704>

---

 src/gallium/drivers/crocus/crocus_state.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/crocus/crocus_state.c b/src/gallium/drivers/crocus/crocus_state.c
index de5e60ed751..df858c849a6 100644
--- a/src/gallium/drivers/crocus/crocus_state.c
+++ b/src/gallium/drivers/crocus/crocus_state.c
@@ -8273,7 +8273,8 @@ crocus_rebind_buffer(struct crocus_context *ice,
       }
    }
 
-   if (res->bind_history & PIPE_BIND_INDEX_BUFFER) {
+   if ((res->bind_history & PIPE_BIND_INDEX_BUFFER) &&
+       ice->state.index_buffer.res) {
       if (res->bo == crocus_resource_bo(ice->state.index_buffer.res))
          pipe_resource_reference(&ice->state.index_buffer.res, NULL);
    }



More information about the mesa-commit mailing list