demos/cube: Provide a non-null VertexInputStateCreateInfo
In the spec for VkGraphicsPipelineCreateInfo, some structs are explicitly
listed as being able to be NULL if they are not used.
VertexInputStateCreateInfo is not one of them.
diff --git a/demos/cube.c b/demos/cube.c
index d2c20d0..ea53f49 100644
--- a/demos/cube.c
+++ b/demos/cube.c
@@ -1539,6 +1539,7 @@
{
VkGraphicsPipelineCreateInfo pipeline;
VkPipelineCacheCreateInfo pipelineCache;
+ VkPipelineVertexInputStateCreateInfo vi;
VkPipelineInputAssemblyStateCreateInfo ia;
VkPipelineRasterStateCreateInfo rs;
VkPipelineColorBlendStateCreateInfo cb;
@@ -1558,6 +1559,9 @@
pipeline.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO;
pipeline.layout = demo->pipeline_layout;
+ memset(&vi, 0, sizeof(vi));
+ vi.sType = VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO;
+
memset(&ia, 0, sizeof(ia));
ia.sType = VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO;
ia.topology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST;
@@ -1623,7 +1627,7 @@
err = vkCreatePipelineCache(demo->device, &pipelineCache, &demo->pipelineCache);
assert(!err);
- pipeline.pVertexInputState = NULL;
+ pipeline.pVertexInputState = &vi;
pipeline.pInputAssemblyState = &ia;
pipeline.pRasterState = &rs;
pipeline.pColorBlendState = &cb;