1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-04-01 09:25:24 +02: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; renderingInheritance.stencilAttachmentFormat = depthStencilFormat;
} }
// On drivers that don't natively support secondary command buffers, only // On drivers that don't natively support secondary command buffers, only use
// use them to enable MSAA resolve attachments. Also ignore color-only // them to enable MSAA resolve attachments. Also ignore render passes with only
// render passes here since we almost certainly need the output anyway. // 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 bool useSecondaryCmdBuffer = !m_device->perfHints().preferPrimaryCmdBufs
&& renderingInheritance.rasterizationSamples > VK_SAMPLE_COUNT_1_BIT; && renderingInheritance.rasterizationSamples > VK_SAMPLE_COUNT_1_BIT;
if (m_device->perfHints().preferRenderPassOps) { if (m_device->perfHints().preferRenderPassOps) {
useSecondaryCmdBuffer = renderingInheritance.rasterizationSamples > VK_SAMPLE_COUNT_1_BIT useSecondaryCmdBuffer = renderingInheritance.rasterizationSamples > VK_SAMPLE_COUNT_1_BIT;
|| (!m_device->perfHints().preferPrimaryCmdBufs && depthStencilAspects);
if (!m_device->perfHints().preferPrimaryCmdBufs)
useSecondaryCmdBuffer |= depthStencilAspects || colorInfoCount > 1u;
} }
if (useSecondaryCmdBuffer) { if (useSecondaryCmdBuffer) {