From 09857dcaa997c7f51cd56c8fdb330774a1be779d Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Tue, 1 Aug 2023 18:07:47 +0200 Subject: [PATCH] [dxvk] Dirty multisample state if sample mask export changes. This affects Alpha-to-Coverage. --- src/dxvk/dxvk_context.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/dxvk/dxvk_context.cpp b/src/dxvk/dxvk_context.cpp index 31e15e28..9c9ca14a 100644 --- a/src/dxvk/dxvk_context.cpp +++ b/src/dxvk/dxvk_context.cpp @@ -4961,6 +4961,7 @@ namespace dxvk { DxvkGraphicsPipelineFlags oldFlags = m_state.gp.flags; DxvkGraphicsPipelineFlags newFlags = newPipeline->flags(); + DxvkGraphicsPipelineFlags diffFlags = oldFlags ^ newFlags; DxvkGraphicsPipelineFlags hazardMask( DxvkGraphicsPipelineFlag::HasTransformFeedback, @@ -4968,7 +4969,7 @@ namespace dxvk { m_state.gp.flags = newFlags; - if (((oldFlags ^ newFlags) & hazardMask) != 0) { + if ((diffFlags & hazardMask) != 0) { // Force-update vertex/index buffers for hazard checks m_flags.set(DxvkContextFlag::GpDirtyIndexBuffer, DxvkContextFlag::GpDirtyVertexBuffers, @@ -4981,6 +4982,9 @@ namespace dxvk { this->spillRenderPass(true); } + if (diffFlags.test(DxvkGraphicsPipelineFlag::HasSampleMaskExport)) + m_flags.set(DxvkContextFlag::GpDirtyMultisampleState); + m_descriptorState.dirtyStages(VK_SHADER_STAGE_ALL_GRAPHICS); if (newPipeline->getBindings()->layout().getPushConstantRange().size)