Commit 428c6458 by Alexis Hetu Committed by Alexis Hétu

Do not attempt to initialize dynamic state vars with pipeline state

Pipeline variables, like scissor, viewport and blend constants, may not be provided by the pipeline state if they are set to use the dynamic state instead. In that case, the related initialization structures may be null and should not be used. Bug b/118619338 Change-Id: Ieb5ff066b06ecfe444c6d26e43c70fd18d2f9c31 Tests: dEQP-VK.image.texel_view_compatible.graphic.extended.* Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/29053Tested-by: 's avatarAlexis Hétu <sugoi@google.com> Presubmit-Ready: Alexis Hétu <sugoi@google.com> Reviewed-by: 's avatarBen Clayton <bclayton@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
parent 911b85f8
...@@ -313,8 +313,15 @@ GraphicsPipeline::GraphicsPipeline(const VkGraphicsPipelineCreateInfo* pCreateIn ...@@ -313,8 +313,15 @@ GraphicsPipeline::GraphicsPipeline(const VkGraphicsPipelineCreateInfo* pCreateIn
UNIMPLEMENTED("pCreateInfo->pViewportState settings"); UNIMPLEMENTED("pCreateInfo->pViewportState settings");
} }
scissor = viewportState->pScissors[0]; if(!hasDynamicState(VK_DYNAMIC_STATE_SCISSOR))
viewport = viewportState->pViewports[0]; {
scissor = viewportState->pScissors[0];
}
if(!hasDynamicState(VK_DYNAMIC_STATE_VIEWPORT))
{
viewport = viewportState->pViewports[0];
}
} }
const VkPipelineRasterizationStateCreateInfo* rasterizationState = pCreateInfo->pRasterizationState; const VkPipelineRasterizationStateCreateInfo* rasterizationState = pCreateInfo->pRasterizationState;
...@@ -393,10 +400,13 @@ GraphicsPipeline::GraphicsPipeline(const VkGraphicsPipelineCreateInfo* pCreateIn ...@@ -393,10 +400,13 @@ GraphicsPipeline::GraphicsPipeline(const VkGraphicsPipelineCreateInfo* pCreateIn
UNIMPLEMENTED("colorBlendState"); UNIMPLEMENTED("colorBlendState");
} }
blendConstants.r = colorBlendState->blendConstants[0]; if(!hasDynamicState(VK_DYNAMIC_STATE_BLEND_CONSTANTS))
blendConstants.g = colorBlendState->blendConstants[1]; {
blendConstants.b = colorBlendState->blendConstants[2]; blendConstants.r = colorBlendState->blendConstants[0];
blendConstants.a = colorBlendState->blendConstants[3]; blendConstants.g = colorBlendState->blendConstants[1];
blendConstants.b = colorBlendState->blendConstants[2];
blendConstants.a = colorBlendState->blendConstants[3];
}
if(colorBlendState->attachmentCount == 1) if(colorBlendState->attachmentCount == 1)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment