Fix code style
This commit is contained in:
@@ -144,23 +144,17 @@ void GPUContextDX12::SetResourceState(ResourceOwnerDX12* resource, D3D12_RESOURC
|
||||
auto& state = resource->State;
|
||||
if (subresourceIndex == D3D12_RESOURCE_BARRIER_ALL_SUBRESOURCES && !state.AreAllSubresourcesSame())
|
||||
{
|
||||
// Slow path. Want to transition the entire resource (with multiple subresources). But they aren't in the same state.
|
||||
|
||||
// Slow path because we have to transition the entire resource with multiple subresources that aren't in the same state
|
||||
const uint32 subresourceCount = resource->GetSubresourcesCount();
|
||||
for (uint32 i = 0; i < subresourceCount; i++)
|
||||
{
|
||||
const D3D12_RESOURCE_STATES before = state.GetSubresourceState(i);
|
||||
|
||||
// We're not using IsTransitionNeeded() because we do want to transition even if 'after' is a subset of 'before'
|
||||
// This is so that we can ensure all subresources are in the same state, simplifying future barriers
|
||||
if (before != after)
|
||||
{
|
||||
AddTransitionBarrier(resource, before, after, i);
|
||||
state.SetSubresourceState(i, after);
|
||||
}
|
||||
}
|
||||
|
||||
// The entire resource should now be in the after state on this command list
|
||||
ASSERT(state.CheckResourceState(after));
|
||||
state.SetResourceState(after);
|
||||
}
|
||||
|
||||
@@ -172,12 +172,8 @@ public:
|
||||
{
|
||||
if (sampleCount <= 8)
|
||||
{
|
||||
// 0 has better quality (a more even distribution)
|
||||
// Higher quality levels might be useful for non box filtered AA or when using weighted samples.
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Not supported.
|
||||
return 0xffffffff;
|
||||
}
|
||||
|
||||
@@ -187,7 +183,7 @@ public:
|
||||
#endif
|
||||
|
||||
private:
|
||||
|
||||
|
||||
#if PLATFORM_XBOX_SCARLETT
|
||||
void updateFrameEvents();
|
||||
#endif
|
||||
|
||||
@@ -33,14 +33,11 @@ public:
|
||||
/// Returns true if resource state transition is needed in order to use resource in given state.
|
||||
/// </summary>
|
||||
/// <param name="currentState">The current resource state.</param>
|
||||
/// <param name="targeState">the destination resource state.</param>
|
||||
/// <param name="targetState">the destination resource state.</param>
|
||||
/// <returns>True if need to perform a transition, otherwise false.</returns>
|
||||
static bool IsTransitionNeeded(D3D12_RESOURCE_STATES currentState, D3D12_RESOURCE_STATES targeState)
|
||||
static bool IsTransitionNeeded(D3D12_RESOURCE_STATES currentState, D3D12_RESOURCE_STATES targetState)
|
||||
{
|
||||
// If 'targeState' is a subset of 'before', then there's no need for a transition
|
||||
// Note: COMMON is an oddball state that doesn't follow the RESOURE_STATE pattern of
|
||||
// having exactly one bit set so we need to special case these
|
||||
return currentState != targeState && ((currentState | targeState) != currentState || targeState == D3D12_RESOURCE_STATE_COMMON);
|
||||
return currentState != targetState && ((currentState | targetState) != currentState || targetState == D3D12_RESOURCE_STATE_COMMON);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user