Skip to content

Commit

Permalink
[dxvk] Dirty multisample state if sample mask export changes.
Browse files Browse the repository at this point in the history
This affects Alpha-to-Coverage.
  • Loading branch information
doitsujin committed Aug 1, 2023
1 parent d66f838 commit 09857dc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/dxvk/dxvk_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4961,14 +4961,15 @@ namespace dxvk {

DxvkGraphicsPipelineFlags oldFlags = m_state.gp.flags;
DxvkGraphicsPipelineFlags newFlags = newPipeline->flags();
DxvkGraphicsPipelineFlags diffFlags = oldFlags ^ newFlags;

DxvkGraphicsPipelineFlags hazardMask(
DxvkGraphicsPipelineFlag::HasTransformFeedback,
DxvkGraphicsPipelineFlag::HasStorageDescriptors);

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,
Expand All @@ -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)
Expand Down

0 comments on commit 09857dc

Please sign in to comment.