[Mesa-dev] [PATCH v2] radv: skip draws with instance_count == 0
Bas Nieuwenhuizen
basni at chromium.org
Wed Jan 9 12:39:36 UTC 2019
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
On Wed, Jan 9, 2019 at 10:03 AM Samuel Pitoiset
<samuel.pitoiset at gmail.com> wrote:
>
> Loosely based on RadeonSI.
>
> v2: - do not check for indexed draws
>
> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
> ---
> src/amd/vulkan/radv_cmd_buffer.c | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c
> index d1b8b3dee6a..7bde5e68089 100644
> --- a/src/amd/vulkan/radv_cmd_buffer.c
> +++ b/src/amd/vulkan/radv_cmd_buffer.c
> @@ -3696,6 +3696,19 @@ radv_draw(struct radv_cmd_buffer *cmd_buffer,
> radeon_check_space(cmd_buffer->device->ws,
> cmd_buffer->cs, 4096);
>
> + if (likely(!info->indirect)) {
> + /* SI-CI treat instance_count==0 as instance_count==1. There is
> + * no workaround for indirect draws, but we can at least skip
> + * direct draws.
> + */
> + if (unlikely(!info->instance_count))
> + return;
> +
> + /* Handle count == 0. */
> + if (unlikely(!info->count && !info->strmout_buffer))
> + return;
> + }
> +
> /* Use optimal packet order based on whether we need to sync the
> * pipeline.
> */
> --
> 2.20.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list