[Mesa-dev] [PATCH v4 58/63] radeonsi: only decompress resident textures/images when used
Samuel Pitoiset
samuel.pitoiset at gmail.com
Mon Jun 12 12:36:23 UTC 2017
When the current bound shaders don't use any bindless textures
or images, it's useless to decompress the resident resources.
v4: - inline si_*_uses_bindless_*()
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..917319bf7d 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 (sctx->uses_bindless_samplers ||
+ ((shader_mask & (1 << PIPE_SHADER_COMPUTE) &&
+ sctx->cs_shader_state.program->uses_bindless_samplers)))
+ si_decompress_resident_textures(sctx);
+ if (sctx->uses_bindless_images ||
+ ((shader_mask & (1 << PIPE_SHADER_COMPUTE) &&
+ sctx->cs_shader_state.program->uses_bindless_images)))
+ si_decompress_resident_images(sctx);
si_check_render_feedback(sctx);
}
--
2.13.1
More information about the mesa-dev
mailing list