Compare commits

...

2 Commits

Author SHA1 Message Date
bjorn 1cda2d59a7 gpu: increase max number of memory blocks to 1024;
We are allocating buffers in smaller chunks now (4MB), and only 256 of
those would limit GPU memory usage to 1GB (in reality the cap is much
higher since static buffers and textures are still suballocated, and any
allocation bigger than 4MB will use its own block).  Still, in some
degenerate cases with huge amounts of temporary buffer memory, we are
hitting this limit earlier than we'd like.
2024-03-08 12:03:55 -08:00
bjorn f93fb0c0c7 Set buffer tick properly when destroying pass;
This was causing one of the pass's buffers to be unrecyclable.
2024-03-08 11:56:23 -08:00
2 changed files with 5 additions and 2 deletions

View File

@ -184,7 +184,7 @@ static struct {
VkDebugUtilsMessengerEXT messenger;
gpu_allocator allocators[GPU_MEMORY_COUNT];
uint8_t allocatorLookup[GPU_MEMORY_COUNT];
gpu_memory memory[256];
gpu_memory memory[1024];
uint32_t streamCount;
uint32_t tick[2];
gpu_tick ticks[2];

View File

@ -5242,7 +5242,10 @@ void lovrPassDestroy(void* ref) {
gpu_tally_destroy(pass->tally.gpu);
lovrRelease(pass->tally.tempBuffer, lovrBufferDestroy);
}
if (pass->buffers.current) freeBlock(&state.bufferAllocators[GPU_BUFFER_STREAM], pass->buffers.current);
if (pass->buffers.current) {
pass->buffers.current->tick = state.tick;
freeBlock(&state.bufferAllocators[GPU_BUFFER_STREAM], pass->buffers.current);
}
os_vm_free(pass->allocator.memory, pass->allocator.limit);
free(pass);
}