mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-04-29 18:55:42 -04:00
Vulkan/StreamBuffer: Fix allocations getting stuck
This commit is contained in:
parent
5e07b23cfb
commit
f044818a7c
@ -275,7 +275,16 @@ void StreamBuffer::UpdateGPUPosition()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (start != end)
|
if (start != end)
|
||||||
|
{
|
||||||
m_tracked_fences.erase(start, end);
|
m_tracked_fences.erase(start, end);
|
||||||
|
if (m_current_offset == m_current_gpu_position)
|
||||||
|
{
|
||||||
|
// GPU is all caught up now.
|
||||||
|
m_current_offset = 0;
|
||||||
|
m_current_gpu_position = 0;
|
||||||
|
m_current_space = m_size;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool StreamBuffer::WaitForClearSpace(u32 num_bytes)
|
bool StreamBuffer::WaitForClearSpace(u32 num_bytes)
|
||||||
@ -321,7 +330,7 @@ bool StreamBuffer::WaitForClearSpace(u32 num_bytes)
|
|||||||
if (gpu_position > num_bytes)
|
if (gpu_position > num_bytes)
|
||||||
{
|
{
|
||||||
new_offset = 0;
|
new_offset = 0;
|
||||||
new_space = gpu_position;
|
new_space = gpu_position - 1;
|
||||||
new_gpu_position = gpu_position;
|
new_gpu_position = gpu_position;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -336,7 +345,7 @@ bool StreamBuffer::WaitForClearSpace(u32 num_bytes)
|
|||||||
{
|
{
|
||||||
// Leave the offset as-is, but update the GPU position.
|
// Leave the offset as-is, but update the GPU position.
|
||||||
new_offset = m_current_offset;
|
new_offset = m_current_offset;
|
||||||
new_space = gpu_position - m_current_offset;
|
new_space = available_space_inbetween - 1;
|
||||||
new_gpu_position = gpu_position;
|
new_gpu_position = gpu_position;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user