[Mesa-dev] [RFC PATCH 54/65] radeonsi: only add descriptors in presence of resident handles

Samuel Pitoiset samuel.pitoiset at gmail.com
Fri May 19 16:52:59 UTC 2017


This won't help much except for applications that use a ton
of resident handles. Though, this will reduce the winsys
overhead a little bit.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
---
 src/gallium/drivers/radeonsi/si_descriptors.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/gallium/drivers/radeonsi/si_descriptors.c b/src/gallium/drivers/radeonsi/si_descriptors.c
index 12f7ead619..44a4b16712 100644
--- a/src/gallium/drivers/radeonsi/si_descriptors.c
+++ b/src/gallium/drivers/radeonsi/si_descriptors.c
@@ -2531,6 +2531,11 @@ void si_all_resident_buffers_begin_new_cs(struct si_context *sctx)
 {
 	unsigned i;
 
+	/* Skip adding the resident descriptors when no handles are resident.
+	 */
+	if (!sctx->num_resident_tex_handles && !sctx->num_resident_img_handles)
+		return;
+
 	/* Add all resident descriptors. */
 	for (i = 0; i < sctx->num_resident_descriptors; i++) {
 		struct r600_resource *desc = sctx->resident_descriptors[i];
-- 
2.13.0



More information about the mesa-dev mailing list