Set buffer tick properly when destroying pass;

This was causing one of the pass's buffers to be unrecyclable.
This commit is contained in:
bjorn 2024-03-08 11:56:23 -08:00
parent 4719dbdd10
commit f93fb0c0c7
1 changed files with 4 additions and 1 deletions

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);
}