Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
fLindahl committed Nov 9, 2024
2 parents 67d0445 + 1ecb25d commit 61b0b70
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions code/foundation/memory/rangeallocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ RangeAllocator::InsertNode(uint size, uint offset)
newNode.offset = offset;
newNode.binNext = headNodeIndex;
newNode.binPrev = RangeAllocatorNode::END;
newNode.resident = false;

this->freeStorage += size;

Expand Down
11 changes: 7 additions & 4 deletions code/render/coregraphics/vk/vkgraphicsdevice.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2240,6 +2240,7 @@ UploadInternal(const CoreGraphics::BufferId buffer, const uint offset, const voi
void
FreeUploads(const Util::Array<Memory::RangeAllocation>& allocations)
{
Threading::CriticalScope _0(&UploadLock);
for (const auto& alloc : allocations)
{
state.uploadAllocator.Dealloc(alloc);
Expand Down Expand Up @@ -2363,12 +2364,14 @@ NewFrame()
{
state.queries[state.currentBufferedFrameIndex].queryFreeCount[i] = 0;
}

for (const auto& alloc : state.uploadAllocationsToFree[state.currentBufferedFrameIndex])
{
state.uploadAllocator.Dealloc(alloc);
Threading::CriticalScope _0(&UploadLock);
for (const auto& alloc : state.uploadAllocationsToFree[state.currentBufferedFrameIndex])
{
state.uploadAllocator.Dealloc(alloc);
}
state.uploadAllocationsToFree[state.currentBufferedFrameIndex].Clear();
}
state.uploadAllocationsToFree[state.currentBufferedFrameIndex].Clear();

// update constant buffer offsets
Vulkan::GraphicsDeviceState::ConstantsRingBuffer& nextCboRing = state.constantBufferRings[state.currentBufferedFrameIndex];
Expand Down

0 comments on commit 61b0b70

Please sign in to comment.