1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-03-28 02:19:26 +01:00

[dxvk] Adjust secondary command buffer logic in tiler mode

Enables usage for render passes with multiple color attachments but
no depth. This way we can mask out unused attachments.
This commit is contained in:
Philip Rebohle 2025-03-23 01:19:18 +01:00
parent a6af6e0a5f
commit a0e6ca3cc0

View File

@ -5824,15 +5824,18 @@ namespace dxvk {
renderingInheritance.stencilAttachmentFormat = depthStencilFormat;
}
// On drivers that don't natively support secondary command buffers, only
// use them to enable MSAA resolve attachments. Also ignore color-only
// render passes here since we almost certainly need the output anyway.
// On drivers that don't natively support secondary command buffers, only use
// them to enable MSAA resolve attachments. Also ignore render passes with only
// one color attachment here since those tend to only have a small number of
// draws and we are almost certainly going to use the output anyway.
bool useSecondaryCmdBuffer = !m_device->perfHints().preferPrimaryCmdBufs
&& renderingInheritance.rasterizationSamples > VK_SAMPLE_COUNT_1_BIT;
if (m_device->perfHints().preferRenderPassOps) {
useSecondaryCmdBuffer = renderingInheritance.rasterizationSamples > VK_SAMPLE_COUNT_1_BIT
|| (!m_device->perfHints().preferPrimaryCmdBufs && depthStencilAspects);
useSecondaryCmdBuffer = renderingInheritance.rasterizationSamples > VK_SAMPLE_COUNT_1_BIT;
if (!m_device->perfHints().preferPrimaryCmdBufs)
useSecondaryCmdBuffer |= depthStencilAspects || colorInfoCount > 1u;
}
if (useSecondaryCmdBuffer) {