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

Samuel Pitoiset samuel.pitoiset at gmail.com
Tue May 30 20:36:25 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 | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/gallium/drivers/radeonsi/si_descriptors.c b/src/gallium/drivers/radeonsi/si_descriptors.c
index 769ce778cf..e40f1230c4 100644
--- a/src/gallium/drivers/radeonsi/si_descriptors.c
+++ b/src/gallium/drivers/radeonsi/si_descriptors.c
@@ -2383,6 +2383,12 @@ void si_all_resident_buffers_begin_new_cs(struct si_context *sctx)
 				   sizeof(struct si_texture_handle *);
 	num_resident_img_handles = sctx->resident_img_handles.size /
 				   sizeof(struct si_image_handle *);
+
+	/* Skip adding the bindless descriptors when no handles are resident.
+	 */
+	if (!num_resident_tex_handles && !num_resident_img_handles)
+		return;
+
 	num_bindless_descriptors = sctx->bindless_descriptors.size /
 				   sizeof(struct r600_resource *);
 
-- 
2.13.0



More information about the mesa-dev mailing list