D3D12: Don't add fence tracking entries without buffer offset changes
This commit is contained in:
parent
31bc0cf2c3
commit
2f7870b046
|
@ -293,7 +293,7 @@ void D3DStreamBuffer::UpdateGPUProgress()
|
||||||
m_queued_fences.pop();
|
m_queued_fences.pop();
|
||||||
|
|
||||||
// Has fence gone past this point?
|
// Has fence gone past this point?
|
||||||
if (fence_value > tracking_information.fence_value)
|
if (fence_value >= tracking_information.fence_value)
|
||||||
{
|
{
|
||||||
m_buffer_gpu_completion_offset = tracking_information.buffer_offset;
|
m_buffer_gpu_completion_offset = tracking_information.buffer_offset;
|
||||||
}
|
}
|
||||||
|
@ -307,7 +307,18 @@ void D3DStreamBuffer::UpdateGPUProgress()
|
||||||
|
|
||||||
void D3DStreamBuffer::QueueFenceCallback(void* owning_object, UINT64 fence_value)
|
void D3DStreamBuffer::QueueFenceCallback(void* owning_object, UINT64 fence_value)
|
||||||
{
|
{
|
||||||
reinterpret_cast<D3DStreamBuffer*>(owning_object)->QueueFence(fence_value);
|
D3DStreamBuffer* owning_stream_buffer = reinterpret_cast<D3DStreamBuffer*>(owning_object);
|
||||||
|
if (owning_stream_buffer->HasBufferOffsetChangedSinceLastFence())
|
||||||
|
owning_stream_buffer->QueueFence(fence_value);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool D3DStreamBuffer::HasBufferOffsetChangedSinceLastFence() const
|
||||||
|
{
|
||||||
|
if (m_queued_fences.empty())
|
||||||
|
return true;
|
||||||
|
|
||||||
|
// Don't add a new fence tracking entry when our offset hasn't changed.
|
||||||
|
return (m_queued_fences.back().buffer_offset != m_buffer_offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
void D3DStreamBuffer::QueueFence(UINT64 fence_value)
|
void D3DStreamBuffer::QueueFence(UINT64 fence_value)
|
||||||
|
|
|
@ -39,6 +39,8 @@ private:
|
||||||
bool AttemptToFindExistingFenceToStallOn(size_t allocation_size);
|
bool AttemptToFindExistingFenceToStallOn(size_t allocation_size);
|
||||||
|
|
||||||
void UpdateGPUProgress();
|
void UpdateGPUProgress();
|
||||||
|
|
||||||
|
bool HasBufferOffsetChangedSinceLastFence() const;
|
||||||
void QueueFence(UINT64 fence_value);
|
void QueueFence(UINT64 fence_value);
|
||||||
|
|
||||||
struct FenceTrackingInformation
|
struct FenceTrackingInformation
|
||||||
|
|
Loading…
Reference in New Issue