venus: check dynamic state for raster enablement
We should not scrub raster dedicated states when dynamic state includes VK_DYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE. Test: - dEQP-VK.pipeline.extended_dynamic_state.*_raster - dEQP-VK.api.pipeline.pipeline_invalid_pointers_unused_structs.graphics Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Ryan Neph <ryanneph@google.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17582>
This commit is contained in:
parent
e14022c052
commit
4eaa780944
|
@ -277,8 +277,8 @@ vn_fix_graphics_pipeline_create_info(
|
|||
bool any_fix = false;
|
||||
|
||||
VkShaderStageFlags stages = 0;
|
||||
for (uint32_t i = 0; i < info->stageCount; ++i) {
|
||||
stages |= info->pStages[i].stage;
|
||||
for (uint32_t j = 0; j < info->stageCount; j++) {
|
||||
stages |= info->pStages[j].stage;
|
||||
}
|
||||
|
||||
/* Fix pTessellationState?
|
||||
|
@ -291,13 +291,25 @@ vn_fix_graphics_pipeline_create_info(
|
|||
any_fix = true;
|
||||
}
|
||||
|
||||
bool ignore_raster_dedicated_states =
|
||||
!info->pRasterizationState ||
|
||||
info->pRasterizationState->rasterizerDiscardEnable == VK_TRUE;
|
||||
if (ignore_raster_dedicated_states && info->pDynamicState) {
|
||||
for (uint32_t j = 0; j < info->pDynamicState->dynamicStateCount;
|
||||
j++) {
|
||||
if (info->pDynamicState->pDynamicStates[j] ==
|
||||
VK_DYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE) {
|
||||
ignore_raster_dedicated_states = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* FIXME: Conditions for ignoring pDepthStencilState and
|
||||
* pColorBlendState miss some cases that depend on the render pass. Make
|
||||
* them agree with the VUIDs.
|
||||
*
|
||||
* TODO: Update conditions for VK_EXT_extended_dynamic_state2.
|
||||
*/
|
||||
if (info->pRasterizationState->rasterizerDiscardEnable == VK_TRUE &&
|
||||
if (ignore_raster_dedicated_states &&
|
||||
(info->pViewportState || info->pMultisampleState ||
|
||||
info->pDepthStencilState || info->pColorBlendState)) {
|
||||
fix.ignore_raster_dedicated_states = true;
|
||||
|
|
Loading…
Reference in New Issue