Fix in BlockMetadata_Linear::CreateAllocationRequest for too large allocations

Ported from https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator/pull/396
This commit is contained in:
Adam Sawicki 2024-03-05 16:23:44 +01:00
parent 5b87b9a028
commit c29f274ea1

View File

@ -4034,6 +4034,10 @@ bool BlockMetadata_Linear::CreateAllocationRequest(
D3D12MA_ASSERT(allocSize > 0 && "Cannot allocate empty block!");
D3D12MA_ASSERT(pAllocationRequest != NULL);
D3D12MA_HEAVY_ASSERT(Validate());
if(allocSize > GetSize())
return false;
pAllocationRequest->size = allocSize;
return upperAddress ?
CreateAllocationRequest_UpperAddress(