summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanylo Piliaiev <danylo.piliaiev@globallogic.com>2019-03-15 20:50:45 +0200
committerJason Ekstrand <jason@jlekstrand.net>2019-03-15 20:24:05 +0000
commitd50f560efc5216112bccde3e1133b8f2d167aed7 (patch)
tree90a08514fa85240d21fda0cdf11968d0f8b53056
parentb67640464532678af85f7bcdcef181dd28152b2d (diff)
Pass NULL for states which don't exist in captured pipeline
Suggested by Jason. Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
-rw-r--r--run.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/run.c b/run.c
index 3ca8e89..05efeec 100644
--- a/run.c
+++ b/run.c
@@ -292,13 +292,25 @@ create_graphics_pipeline(VkDevice device, struct pipeline_info *info,
pipelineInfo.pStages = info->pShaderStagesInfo;
pipelineInfo.pVertexInputState = &info->vertexInputState;
pipelineInfo.pInputAssemblyState = &info->inputAssemblyState;
- pipelineInfo.pTessellationState = &info->tessellationState;
- pipelineInfo.pViewportState = &info->viewportState;
+ pipelineInfo.pTessellationState =
+ info->tessellationState.sType == VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO ?
+ &info->tessellationState : NULL;
+ pipelineInfo.pViewportState =
+ info->viewportState.sType == VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO ?
+ &info->viewportState : NULL;
pipelineInfo.pRasterizationState = &info->rasterizationState;
- pipelineInfo.pMultisampleState = &info->multisampleState;
- pipelineInfo.pDepthStencilState = &info->depthStencilState;
- pipelineInfo.pColorBlendState = &info->colorBlendState;
- pipelineInfo.pDynamicState = &info->dynamicState;
+ pipelineInfo.pMultisampleState =
+ info->multisampleState.sType == VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO ?
+ &info->multisampleState : NULL;
+ pipelineInfo.pDepthStencilState =
+ info->depthStencilState.sType == VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO ?
+ &info->depthStencilState : NULL;
+ pipelineInfo.pColorBlendState =
+ info->colorBlendState.sType == VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO ?
+ &info->colorBlendState : NULL;
+ pipelineInfo.pDynamicState =
+ info->dynamicState.sType == VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO ?
+ &info->dynamicState : NULL;
pipelineInfo.layout = layout;
pipelineInfo.renderPass = renderPass;