From: Jason Ekstrand Date: Fri, 16 Oct 2015 00:15:25 +0000 (-0700) Subject: demos/cube: Provide a non-null VertexInputStateCreateInfo X-Git-Tag: upstream/1.1.92~4637 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=515b7aed05ca136bdc86be7e4f3c6aab7e60dff8;p=platform%2Fupstream%2FVulkan-Tools.git 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 @@ static void demo_prepare_pipeline(struct demo *demo) { VkGraphicsPipelineCreateInfo pipeline; VkPipelineCacheCreateInfo pipelineCache; + VkPipelineVertexInputStateCreateInfo vi; VkPipelineInputAssemblyStateCreateInfo ia; VkPipelineRasterStateCreateInfo rs; VkPipelineColorBlendStateCreateInfo cb; @@ -1558,6 +1559,9 @@ static void demo_prepare_pipeline(struct demo *demo) 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 @@ static void demo_prepare_pipeline(struct demo *demo) err = vkCreatePipelineCache(demo->device, &pipelineCache, &demo->pipelineCache); assert(!err); - pipeline.pVertexInputState = NULL; + pipeline.pVertexInputState = &vi; pipeline.pInputAssemblyState = &ia; pipeline.pRasterState = &rs; pipeline.pColorBlendState = &cb;