From 2d0e3d79210ac808096fbff7571bff7fc639b364 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Wed, 5 Mar 2025 14:34:01 +0100 Subject: [PATCH] [dxvk] Highlight multisampled render passes when debugging --- src/dxvk/dxvk_context.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/dxvk/dxvk_context.cpp b/src/dxvk/dxvk_context.cpp index ffcdda82f..aff2635c9 100644 --- a/src/dxvk/dxvk_context.cpp +++ b/src/dxvk/dxvk_context.cpp @@ -3008,6 +3008,8 @@ namespace dxvk { void DxvkContext::beginRenderPassDebugRegion() { + VkSampleCountFlagBits sampleCount = VK_SAMPLE_COUNT_1_BIT; + bool hasColorAttachments = false; bool hasDepthAttachment = m_state.om.renderTargets.depth.view != nullptr; @@ -3033,6 +3035,7 @@ namespace dxvk { label << (hasColorAttachments ? ", " : "") << i << ": " << (imageName ? imageName : "unknown"); hasColorAttachments = true; + sampleCount = m_state.om.renderTargets.color[i].view->image()->info().sampleCount; } } @@ -3042,14 +3045,21 @@ namespace dxvk { const char* imageName = m_state.om.renderTargets.depth.view->image()->info().debugName; label << "DS:" << (imageName ? imageName : "unknown"); + + sampleCount = m_state.om.renderTargets.depth.view->image()->info().sampleCount; } if (!hasColorAttachments && !hasDepthAttachment) label << "No attachments"; + if (sampleCount > VK_SAMPLE_COUNT_1_BIT) + label << ", " << uint32_t(sampleCount) << "x MSAA"; + label << ")"; - pushDebugRegion(vk::makeLabel(0xf0e6dc, label.str().c_str()), + uint32_t color = sampleCount > VK_SAMPLE_COUNT_1_BIT ? 0xf0dcf0 : 0xf0e6dc; + + pushDebugRegion(vk::makeLabel(color, label.str().c_str()), util::DxvkDebugLabelType::InternalRenderPass); }