radv: skip draw calls with 0-sized index buffers
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 31 Jul 2019 07:39:18 +0000 (09:39 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 31 Jul 2019 10:14:29 +0000 (12:14 +0200)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_cmd_buffer.c

index a833fc4221b8afcb404e326885f8bd5aae8118ed..bd5d30ad7a28f63fb0ca8b280caf2bbe5dabb6d9 100644 (file)
@@ -4323,6 +4323,12 @@ radv_emit_draw_packets(struct radv_cmd_buffer *cmd_buffer,
                        int index_size = radv_get_vgt_index_size(state->index_type);
                        uint64_t index_va;
 
+                       /* Skip draw calls with 0-sized index buffers. They
+                        * cause a hang on some chips, like Navi10-14.
+                        */
+                       if (!cmd_buffer->state.max_index_count)
+                               return;
+
                        index_va = state->index_va;
                        index_va += info->first_index * index_size;