[Mesa-dev] [PATCH v3 58/63] radeonsi: only decompress resident textures/images when used

Samuel Pitoiset samuel.pitoiset at gmail.com
Fri Jun 9 13:35:56 UTC 2017


When the current bound shaders don't use any bindless textures
or images, it's useless to decompress the resident resources.

v3: - rebased and updated check for compute

Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Reviewed-by: Marek Olšák <marek.olsak at amd.com> (v2)
---
 src/gallium/drivers/radeonsi/si_blit.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_blit.c b/src/gallium/drivers/radeonsi/si_blit.c
index 8b77242759..70259b80c8 100644
--- a/src/gallium/drivers/radeonsi/si_blit.c
+++ b/src/gallium/drivers/radeonsi/si_blit.c
@@ -798,8 +798,14 @@ static void si_decompress_textures(struct si_context *sctx, unsigned shader_mask
 		}
 	}
 
-	si_decompress_resident_textures(sctx);
-	si_decompress_resident_images(sctx);
+	if (si_graphics_uses_bindless_samplers(sctx) ||
+	    ((shader_mask & (1 << PIPE_SHADER_COMPUTE) &&
+	     si_compute_uses_bindless_samplers(sctx))))
+		si_decompress_resident_textures(sctx);
+	if (si_graphics_uses_bindless_images(sctx) ||
+	    ((shader_mask & (1 << PIPE_SHADER_COMPUTE) &&
+	     si_compute_uses_bindless_images(sctx))))
+		si_decompress_resident_images(sctx);
 
 	si_check_render_feedback(sctx);
 }
-- 
2.13.1



More information about the mesa-dev mailing list