From b461744c52c60bb855d6119e9adc5f93b75480d5 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Tue, 10 Nov 2015 11:31:31 -0800 Subject: [PATCH] anv/gen7: Properly handle VS with VertexID but no vertices --- src/vulkan/gen7_pipeline.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/vulkan/gen7_pipeline.c b/src/vulkan/gen7_pipeline.c index 3622071ead2..269d9d46ac5 100644 --- a/src/vulkan/gen7_pipeline.c +++ b/src/vulkan/gen7_pipeline.c @@ -39,10 +39,11 @@ gen7_emit_vertex_input(struct anv_pipeline *pipeline, const uint32_t num_dwords = 1 + element_count * 2; uint32_t *p; - if (info->attributeCount > 0) { - p = anv_batch_emitn(&pipeline->batch, num_dwords, - GEN7_3DSTATE_VERTEX_ELEMENTS); - } + if (info->attributeCount == 0 && !sgvs) + return; + + p = anv_batch_emitn(&pipeline->batch, num_dwords, + GEN7_3DSTATE_VERTEX_ELEMENTS); for (uint32_t i = 0; i < info->attributeCount; i++) { const VkVertexInputAttributeDescription *desc = -- 2.30.2