Mesa (main): crocus: support rebinding streamout target buffers

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jul 6 04:40:57 UTC 2021


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

Author: Dave Airlie <airlied at redhat.com>
Date:   Tue Jul  6 13:21:58 2021 +1000

crocus: support rebinding streamout target buffers

Reviewed-by: Zoltán Böszörményi <zboszor at pr.hu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11710>

---

 src/gallium/drivers/crocus/crocus_resource.c |  4 ----
 src/gallium/drivers/crocus/crocus_state.c    | 11 ++++++++++-
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/src/gallium/drivers/crocus/crocus_resource.c b/src/gallium/drivers/crocus/crocus_resource.c
index 5510f4f7153..8854573ef9c 100644
--- a/src/gallium/drivers/crocus/crocus_resource.c
+++ b/src/gallium/drivers/crocus/crocus_resource.c
@@ -1113,10 +1113,6 @@ crocus_invalidate_resource(struct pipe_context *ctx,
    if (res->bo->userptr)
       return;
 
-   // XXX: We should support this.
-   if (res->bind_history & PIPE_BIND_STREAM_OUTPUT)
-      return;
-
    struct crocus_bo *old_bo = res->bo;
    struct crocus_bo *new_bo =
       crocus_bo_alloc(screen->bufmgr, res->bo->name, resource->width0);
diff --git a/src/gallium/drivers/crocus/crocus_state.c b/src/gallium/drivers/crocus/crocus_state.c
index ef6b2bb9e14..e623ae62d4b 100644
--- a/src/gallium/drivers/crocus/crocus_state.c
+++ b/src/gallium/drivers/crocus/crocus_state.c
@@ -8289,7 +8289,16 @@ crocus_rebind_buffer(struct crocus_context *ice,
 
    if (res->bind_history & PIPE_BIND_STREAM_OUTPUT) {
       /* XXX: be careful about resetting vs appending... */
-      assert(false);
+      for (int i = 0; i < 4; i++) {
+         if (ice->state.so_target[i] &&
+             (ice->state.so_target[i]->buffer == &res->base.b)) {
+#if GFX_VER == 6
+            ice->state.stage_dirty |= CROCUS_STAGE_DIRTY_BINDINGS_GS;
+#else
+            ice->state.dirty |= CROCUS_DIRTY_GEN7_SO_BUFFERS;
+#endif
+         }
+      }
    }
 
    for (int s = MESA_SHADER_VERTEX; s < MESA_SHADER_STAGES; s++) {



More information about the mesa-commit mailing list