mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-12-27 06:21:02 +00:00
gpu-open/vma: Optimize CheckAllocation method
- Avoids doing useless work. The scanning algorithm is painfully slow on hardware with alignment requirement > 1 - Upto 50ms saved for ~600 allocations when many small allocations exist
This commit is contained in:
parent
6f4dbf4fcd
commit
5a049d41fd
8
3rdparty/GPUOpen/include/vk_mem_alloc.h
vendored
8
3rdparty/GPUOpen/include/vk_mem_alloc.h
vendored
@ -8848,7 +8848,7 @@ bool VmaBlockMetadata_Generic::CheckAllocation(
|
||||
|
||||
// Check previous suballocations for BufferImageGranularity conflicts.
|
||||
// Make bigger alignment if necessary.
|
||||
if(bufferImageGranularity > 1)
|
||||
if(bufferImageGranularity > 1 && bufferImageGranularity != allocAlignment)
|
||||
{
|
||||
bool bufferImageGranularityConflict = false;
|
||||
VmaSuballocationList::const_iterator prevSuballocItem = suballocItem;
|
||||
@ -8932,7 +8932,7 @@ bool VmaBlockMetadata_Generic::CheckAllocation(
|
||||
|
||||
// Check next suballocations for BufferImageGranularity conflicts.
|
||||
// If conflict exists, we must mark more allocations lost or fail.
|
||||
if(bufferImageGranularity > 1)
|
||||
if(bufferImageGranularity > 1 && (allocSize % bufferImageGranularity || *pOffset % bufferImageGranularity))
|
||||
{
|
||||
VmaSuballocationList::const_iterator nextSuballocItem = lastSuballocItem;
|
||||
++nextSuballocItem;
|
||||
@ -8991,7 +8991,7 @@ bool VmaBlockMetadata_Generic::CheckAllocation(
|
||||
|
||||
// Check previous suballocations for BufferImageGranularity conflicts.
|
||||
// Make bigger alignment if necessary.
|
||||
if(bufferImageGranularity > 1)
|
||||
if(bufferImageGranularity > 1 && bufferImageGranularity != allocAlignment)
|
||||
{
|
||||
bool bufferImageGranularityConflict = false;
|
||||
VmaSuballocationList::const_iterator prevSuballocItem = suballocItem;
|
||||
@ -9031,7 +9031,7 @@ bool VmaBlockMetadata_Generic::CheckAllocation(
|
||||
|
||||
// Check next suballocations for BufferImageGranularity conflicts.
|
||||
// If conflict exists, allocation cannot be made here.
|
||||
if(bufferImageGranularity > 1)
|
||||
if(bufferImageGranularity > 1 && (allocSize % bufferImageGranularity || *pOffset % bufferImageGranularity))
|
||||
{
|
||||
VmaSuballocationList::const_iterator nextSuballocItem = suballocItem;
|
||||
++nextSuballocItem;
|
||||
|
Loading…
Reference in New Issue
Block a user