radeonsi: only add descriptors in presence of resident handles
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 18 May 2017 20:37:25 +0000 (22:37 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 14 Jun 2017 08:04:36 +0000 (10:04 +0200)
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@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/drivers/radeonsi/si_descriptors.c

index b5722b764207d5f9d86635e18768002819650eca..12b82a139dd2ae9e2802e81a181a09cf413c4e4d 100644 (file)
@@ -2374,6 +2374,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 *);