From d864d7ab9b1c00855720b7817553f78ceb37aa79 Mon Sep 17 00:00:00 2001 From: Dario Date: Sun, 21 Jul 2024 19:04:22 -0300 Subject: [PATCH] D3D12: Fix bogus warning for sample positions. --- src/d3d12/rt64_d3d12.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/d3d12/rt64_d3d12.cpp b/src/d3d12/rt64_d3d12.cpp index 86195ef..e0a27bf 100644 --- a/src/d3d12/rt64_d3d12.cpp +++ b/src/d3d12/rt64_d3d12.cpp @@ -1343,7 +1343,10 @@ namespace RT64 { void D3D12CommandList::end() { assert(open); - + + // It's required to reset the sample positions before the command list ends. + resetSamplePositions(); + d3d->Close(); open = false; targetFramebuffer = nullptr; @@ -1352,7 +1355,6 @@ namespace RT64 { activeGraphicsPipelineLayout = nullptr; activeGraphicsPipeline = nullptr; activeTopology = D3D_PRIMITIVE_TOPOLOGY_UNDEFINED; - activeSamplePositions = false; descriptorHeapsSet = false; } @@ -1413,12 +1415,11 @@ namespace RT64 { if (msaaDepthTarget && interfaceTexture->desc.multisampling.sampleLocationsEnabled) { setSamplePositions(interfaceTexture); d3d->ResourceBarrier(1, &resourceBarrier); + resetSamplePositionsRequired = true; } else { barrierVector.emplace_back(resourceBarrier); } - - resetSamplePositionsRequired = resetSamplePositionsRequired || msaaDepthTarget; } if (resetSamplePositionsRequired) {