Do not shrink buffer's size on submit

This commit is contained in:
Anton Kovalev 2024-08-27 23:33:24 +02:00
parent 595b845df0
commit 3d46a5d492
1 changed files with 4 additions and 2 deletions

View File

@ -573,8 +573,10 @@ void Liverpool::CopyCmdBuffers(std::span<const u32>& dcb, std::span<const u32>&
auto& queue = mapped_queues[GfxQueueId]; auto& queue = mapped_queues[GfxQueueId];
// This is fine because resize doesn't reallocate the buffer on shrink // This is fine because resize doesn't reallocate the buffer on shrink
queue.dcb_buffer.resize(queue.dcb_buffer_offset + dcb.size()); queue.dcb_buffer.resize(
queue.ccb_buffer.resize(queue.ccb_buffer_offset + dcb.size()); std::max(queue.dcb_buffer.size(), queue.dcb_buffer_offset + dcb.size()));
queue.ccb_buffer.resize(
std::max(queue.ccb_buffer.size(), queue.ccb_buffer_offset + dcb.size()));
u32 prev_dcb_buffer_offset = queue.dcb_buffer_offset; u32 prev_dcb_buffer_offset = queue.dcb_buffer_offset;
u32 prev_ccb_buffer_offset = queue.ccb_buffer_offset; u32 prev_ccb_buffer_offset = queue.ccb_buffer_offset;