Browse Source

radv: skip draws with instance_count == 0

Loosely based on RadeonSI.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
tags/19.0-branchpoint
Samuel Pitoiset 6 years ago
parent
commit
b8c4f523b4
1 changed files with 13 additions and 0 deletions
  1. 13
    0
      src/amd/vulkan/radv_cmd_buffer.c

+ 13
- 0
src/amd/vulkan/radv_cmd_buffer.c View File

@@ -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.
*/

Loading…
Cancel
Save