Fix incorrect resetting of buffers if created with new-barrier functions

This commit is contained in:
baldurk committed 2026-07-01 11:00:06 +01:00
1 parent 39ecdedcc1
commit 30daa3833a
1 file changed
+5 -2
+5 -2
View File
@@ -3766,7 +3766,7 @@ void AddStateResetBarrier(D3D12ResourceLayout srcState, D3D12ResourceLayout dstS
ID3D12Resource *res, UINT subresource, BarrierSet &barriers)
{
if((srcState.IsStates() || srcState.ToLayout() == D3D12_BARRIER_LAYOUT_UNDEFINED) &&
dstState.IsStates())
(dstState.IsStates() || dstState.ToLayout() == D3D12_BARRIER_LAYOUT_UNDEFINED))
{
D3D12_RESOURCE_BARRIER b;
b.Type = D3D12_RESOURCE_BARRIER_TYPE_TRANSITION;
@@ -3779,7 +3779,10 @@ void AddStateResetBarrier(D3D12ResourceLayout srcState, D3D12ResourceLayout dstS
if(srcState.ToLayout() == D3D12_BARRIER_LAYOUT_UNDEFINED)
b.Transition.StateBefore = D3D12_RESOURCE_STATE_COMMON;
// could now be identical after silently promoting the before state.
if(dstState.ToLayout() == D3D12_BARRIER_LAYOUT_UNDEFINED)
b.Transition.StateAfter = D3D12_RESOURCE_STATE_COMMON;
// could now be identical after silently promoting the before/after state.
if(b.Transition.StateBefore != b.Transition.StateAfter)
barriers.barriers.push_back(b);
}