Commit cfb3fe53 authored by Erik Faye-Lund 's avatar Erik Faye-Lund

d3d12: remove unused flags from resource-state manager

These flags are never set, so let's simplify the logic a bit here.
parent 212b25b1
......@@ -101,13 +101,11 @@ D3D12_RESOURCE_STATES CCurrentResourceState::StateIfPromoted(D3D12_RESOURCE_STAT
{
D3D12_RESOURCE_STATES Result = D3D12_RESOURCE_STATE_COMMON;
if((Flags & SubresourceTransitionFlags_ForceExplicitState) != SubresourceTransitionFlags_ForceExplicitState && (
m_bSimultaneousAccess ||
!!(State & (
if (m_bSimultaneousAccess || !!(State & (
D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE |
D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE |
D3D12_RESOURCE_STATE_COPY_SOURCE |
D3D12_RESOURCE_STATE_COPY_DEST))))
D3D12_RESOURCE_STATE_COPY_DEST)))
{
auto CurState = GetLogicalSubresourceState(SubresourceIndex);
......@@ -207,12 +205,6 @@ void ResourceStateManager::ApplyResourceTransitionsPreamble()
return false;
}
// Not an exact match, but an exact match required, so do the transition.
if ((Flags & SubresourceTransitionFlags_StateMatchExact) != SubresourceTransitionFlags_None)
{
return true;
}
if (
CurrentState == D3D12_RESOURCE_STATE_COMMON ||
DestinationState == D3D12_RESOURCE_STATE_COMMON)
......@@ -377,8 +369,6 @@ void ResourceStateManager::ProcessTransitioningSubresourceExplicit(
bool MayDecay = false;
bool IsPromotion = false;
bool bQueueStateUpdate = (SubresourceDestinationInfo.Flags & SubresourceTransitionFlags_NotUsedInCommandListIfNoStateChange) == SubresourceTransitionFlags_None;
// If not promotable then StateIfPromoted will be D3D12_RESOURCE_STATE_COMMON
auto StateIfPromoted = CurrentState.StateIfPromoted(after, SubresourceIndex, Flags);
......@@ -394,7 +384,6 @@ void ResourceStateManager::ProcessTransitioningSubresourceExplicit(
MayDecay = CurrentState.SupportsSimultaneousAccess() && !IsD3D12WriteState(after, Flags);
IsPromotion = false;
bQueueStateUpdate = true;
}
}
else
......@@ -405,18 +394,14 @@ void ResourceStateManager::ProcessTransitioningSubresourceExplicit(
after = StateIfPromoted;
MayDecay = !IsD3D12WriteState(after, Flags);
IsPromotion = true;
bQueueStateUpdate = true;
}
}
if (bQueueStateUpdate)
{
CCurrentResourceState::LogicalState NewLogicalState{after, ExecutionId, IsPromotion, MayDecay};
AddCurrentStateUpdate(TransitionableResourceState,
CurrentState,
TransitionDesc.Transition.Subresource,
NewLogicalState);
}
CCurrentResourceState::LogicalState NewLogicalState{after, ExecutionId, IsPromotion, MayDecay};
AddCurrentStateUpdate(TransitionableResourceState,
CurrentState,
TransitionDesc.Transition.Subresource,
NewLogicalState);
}
//----------------------------------------------------------------------------------------------------------------------------------
......
......@@ -48,8 +48,7 @@ D3D12_RESOURCE_STATE_VIDEO_PROCESS_WRITE;
//---------------------------------------------------------------------------------------------------------------------------------
inline bool IsD3D12WriteState(UINT State, SubresourceTransitionFlags Flags)
{
return (State & RESOURCE_STATE_ALL_WRITE_BITS) != 0 ||
(Flags & SubresourceTransitionFlags_ForceExplicitState) != SubresourceTransitionFlags_None;
return (State & RESOURCE_STATE_ALL_WRITE_BITS) != 0;
}
inline bool SupportsSimultaneousAccess(const D3D12_RESOURCE_DESC &desc)
......
......@@ -5,9 +5,6 @@ typedef enum _SubresourceTransitionFlags
{
SubresourceTransitionFlags_None = 0,
SubresourceTransitionFlags_TransitionPreDraw = 1,
SubresourceTransitionFlags_StateMatchExact = 4,
SubresourceTransitionFlags_ForceExplicitState = 8,
SubresourceTransitionFlags_NotUsedInCommandListIfNoStateChange = 0x10,
} SubresourceTransitionFlags;
DEFINE_ENUM_FLAG_OPERATORS(SubresourceTransitionFlags);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment