radv: implement dynamic depth bias enable

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10340>
This commit is contained in:
Samuel Pitoiset
2021-03-15 18:29:44 +01:00
committed by Marge Bot
parent 44e7bcf942
commit f2933e9872
5 changed files with 50 additions and 5 deletions

View File

@@ -1387,7 +1387,8 @@ radv_pipeline_needed_dynamic_state(const VkGraphicsPipelineCreateInfo *pCreateIn
if (pCreateInfo->pRasterizationState->rasterizerDiscardEnable)
return RADV_DYNAMIC_PRIMITIVE_TOPOLOGY | RADV_DYNAMIC_VERTEX_INPUT_BINDING_STRIDE;
if (!pCreateInfo->pRasterizationState->depthBiasEnable)
if (!pCreateInfo->pRasterizationState->depthBiasEnable &&
!radv_is_state_dynamic(pCreateInfo, VK_DYNAMIC_STATE_DEPTH_BIAS_ENABLE_EXT))
states &= ~RADV_DYNAMIC_DEPTH_BIAS;
if (!pCreateInfo->pDepthStencilState ||
@@ -1730,6 +1731,10 @@ radv_pipeline_init_dynamic_state(struct radv_pipeline *pipeline,
dynamic->fragment_shading_rate.combiner_ops[i] = shading_rate->combinerOps[i];
}
if (states & RADV_DYNAMIC_DEPTH_BIAS_ENABLE) {
dynamic->depth_bias_enable = pCreateInfo->pRasterizationState->depthBiasEnable;
}
pipeline->dynamic_state.mask = states;
}