Mesa (master): radeonsi: add BOs after need_cs_space

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Apr 25 00:59:25 UTC 2019


Module: Mesa
Branch: master
Commit: 36cfe5fd62237bc49a0bea0c2aeeaf9e89b6f11c
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=36cfe5fd62237bc49a0bea0c2aeeaf9e89b6f11c

Author: Marek Olšák <marek.olsak at amd.com>
Date:   Wed Apr 24 17:33:53 2019 -0400

radeonsi: add BOs after need_cs_space

need_cs_space may clear the buffer list.

Fixes: 951d60f8cdc88 "radeonsi: delay adding BOs at the beginning of IBs until the first draw"

Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>

---

 src/gallium/drivers/radeonsi/si_compute.c    | 6 +++---
 src/gallium/drivers/radeonsi/si_state_draw.c | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_compute.c b/src/gallium/drivers/radeonsi/si_compute.c
index 2f444a3a1b8..541d7e6f118 100644
--- a/src/gallium/drivers/radeonsi/si_compute.c
+++ b/src/gallium/drivers/radeonsi/si_compute.c
@@ -885,9 +885,6 @@ static void si_launch_grid(
 		si_decompress_textures(sctx, 1 << PIPE_SHADER_COMPUTE);
 	}
 
-	if (sctx->bo_list_add_all_compute_resources)
-		si_compute_resources_add_all_to_bo_list(sctx);
-
 	/* Add buffer sizes for memory checking in need_cs_space. */
 	si_context_add_resource_size(sctx, &program->shader.bo->b.b);
 	/* TODO: add the scratch buffer */
@@ -905,6 +902,9 @@ static void si_launch_grid(
 
 	si_need_gfx_cs_space(sctx);
 
+	if (sctx->bo_list_add_all_compute_resources)
+		si_compute_resources_add_all_to_bo_list(sctx);
+
 	if (!sctx->cs_shader_state.initialized)
 		si_initialize_compute(sctx);
 
diff --git a/src/gallium/drivers/radeonsi/si_state_draw.c b/src/gallium/drivers/radeonsi/si_state_draw.c
index c220eaf24f8..80e1bc4b475 100644
--- a/src/gallium/drivers/radeonsi/si_state_draw.c
+++ b/src/gallium/drivers/radeonsi/si_state_draw.c
@@ -1311,9 +1311,6 @@ static void si_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info *i
 
 	si_decompress_textures(sctx, u_bit_consecutive(0, SI_NUM_GRAPHICS_SHADERS));
 
-	if (sctx->bo_list_add_all_gfx_resources)
-		si_gfx_resources_add_all_to_bo_list(sctx);
-
 	/* Set the rasterization primitive type.
 	 *
 	 * This must be done after si_decompress_textures, which can call
@@ -1455,6 +1452,9 @@ static void si_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info *i
 
 	si_need_gfx_cs_space(sctx);
 
+	if (sctx->bo_list_add_all_gfx_resources)
+		si_gfx_resources_add_all_to_bo_list(sctx);
+
 	/* Since we've called si_context_add_resource_size for vertex buffers,
 	 * this must be called after si_need_cs_space, because we must let
 	 * need_cs_space flush before we add buffers to the buffer list.




More information about the mesa-commit mailing list