summaryrefslogtreecommitdiffstats
path: root/src/vulkan/gen7_pipeline.c
diff options
context:
space:
mode:
authorChad Versace <[email protected]>2015-08-28 08:07:15 -0700
committerChad Versace <[email protected]>2015-08-28 08:07:15 -0700
commit84cfc08c1059f6190b0ada811003abe93c624e39 (patch)
tree321ece005288fefcc8e16e628e97bf5cacb79ea1 /src/vulkan/gen7_pipeline.c
parent053d32d2a5906057519e12ffd8bc946bee2f5c60 (diff)
vk/pipeline: Fix crash when the pipeline has no attributes
If there are no attributes, don't emit 3DSTATE_VERTEX_ELEMENTS. That packet does not allow 0 attributes.
Diffstat (limited to 'src/vulkan/gen7_pipeline.c')
-rw-r--r--src/vulkan/gen7_pipeline.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/vulkan/gen7_pipeline.c b/src/vulkan/gen7_pipeline.c
index a5c7a201690..0ed4727c37f 100644
--- a/src/vulkan/gen7_pipeline.c
+++ b/src/vulkan/gen7_pipeline.c
@@ -39,8 +39,10 @@ gen7_emit_vertex_input(struct anv_pipeline *pipeline,
const uint32_t num_dwords = 1 + element_count * 2;
uint32_t *p;
- p = anv_batch_emitn(&pipeline->batch, num_dwords,
- GEN7_3DSTATE_VERTEX_ELEMENTS);
+ if (info->attributeCount > 0) {
+ p = anv_batch_emitn(&pipeline->batch, num_dwords,
+ GEN7_3DSTATE_VERTEX_ELEMENTS);
+ }
for (uint32_t i = 0; i < info->attributeCount; i++) {
const VkVertexInputAttributeDescription *desc =