1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-31 14:52:11 +01:00

[dxvk] Unconditionally call updateDynamicState

And optimize that instead. The previous check would always succeed anyway
since we'd set unused dynamic states to dirty, which is necessary for us
to update that state once it's actually used by a pipeline.
This commit is contained in:
Philip Rebohle 2022-07-16 14:47:54 +02:00
parent dadc1bc8ff
commit 39dd25e972
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99

View File

@ -5162,15 +5162,15 @@ namespace dxvk {
void DxvkContext::updateDynamicState() {
if (m_flags.test(DxvkContextFlag::GpDirtyViewport)) {
if (unlikely(m_flags.test(DxvkContextFlag::GpDirtyViewport))) {
m_flags.clr(DxvkContextFlag::GpDirtyViewport);
m_cmd->cmdSetViewport(m_state.vp.viewportCount, m_state.vp.viewports.data());
m_cmd->cmdSetScissor(m_state.vp.viewportCount, m_state.vp.scissorRects.data());
}
if (m_flags.all(DxvkContextFlag::GpDirtyDepthStencilState,
DxvkContextFlag::GpDynamicDepthStencilState)) {
if (unlikely(m_flags.all(DxvkContextFlag::GpDirtyDepthStencilState,
DxvkContextFlag::GpDynamicDepthStencilState))) {
m_flags.clr(DxvkContextFlag::GpDirtyDepthStencilState);
// Make sure to not enable writes to aspects that cannot be
@ -5202,6 +5202,12 @@ namespace dxvk {
m_state.gp.state.rs.depthBiasEnable());
}
if (unlikely(m_flags.all(DxvkContextFlag::GpDirtyBlendConstants,
DxvkContextFlag::GpDynamicBlendConstants))) {
m_flags.clr(DxvkContextFlag::GpDirtyBlendConstants);
m_cmd->cmdSetBlendConstants(&m_state.dyn.blendConstants.r);
}
if (m_flags.all(DxvkContextFlag::GpDirtyRasterizerState,
DxvkContextFlag::GpDynamicRasterizerState)) {
m_flags.clr(DxvkContextFlag::GpDirtyRasterizerState);
@ -5211,12 +5217,6 @@ namespace dxvk {
m_state.dyn.frontFace);
}
if (m_flags.all(DxvkContextFlag::GpDirtyBlendConstants,
DxvkContextFlag::GpDynamicBlendConstants)) {
m_flags.clr(DxvkContextFlag::GpDirtyBlendConstants);
m_cmd->cmdSetBlendConstants(&m_state.dyn.blendConstants.r);
}
if (m_flags.all(DxvkContextFlag::GpDirtyStencilRef,
DxvkContextFlag::GpDynamicStencilRef)) {
m_flags.clr(DxvkContextFlag::GpDirtyStencilRef);
@ -5351,15 +5351,7 @@ namespace dxvk {
if (m_state.gp.flags.test(DxvkGraphicsPipelineFlag::HasTransformFeedback))
this->updateTransformFeedbackState();
if (m_flags.any(
DxvkContextFlag::GpDirtyViewport,
DxvkContextFlag::GpDirtyBlendConstants,
DxvkContextFlag::GpDirtyDepthBias,
DxvkContextFlag::GpDirtyDepthBounds,
DxvkContextFlag::GpDirtyDepthStencilState,
DxvkContextFlag::GpDirtyRasterizerState,
DxvkContextFlag::GpDirtyStencilRef))
this->updateDynamicState();
this->updateDynamicState();
if (m_flags.test(DxvkContextFlag::DirtyPushConstants))
this->updatePushConstants<VK_PIPELINE_BIND_POINT_GRAPHICS>();