mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-25 21:03:51 +00:00
fix(rendering): wait all frame fences before freeing shared descriptor sets
deferAfterFrameFence only waits for one frame slot's fence, but shared resources (material descriptor sets, vertex/index buffers) are bound by both in-flight frames' command buffers. On AMD RADV this caused vkFreeDescriptorSets errors and eventual SIGSEGV. Add deferAfterAllFrameFences: queues to every frame slot with a shared counter so cleanup runs exactly once, after the last slot is fenced. Use it for WMO, terrain, water, and character model shared resources. Per-frame bone sets keep using deferAfterFrameFence (already correct). Also fix character renderer vertex format: R8G8B8A8_UINT -> _SINT to match shader's ivec4 input (RADV validation rejects the mismatch).
This commit is contained in:
parent
def821055b
commit
3ac8c4d95f
6 changed files with 31 additions and 10 deletions
|
|
@ -1061,8 +1061,8 @@ void TerrainRenderer::destroyChunkGPU(TerrainChunkGPU& chunk) {
|
|||
chunk.materialSet = VK_NULL_HANDLE;
|
||||
chunk.ownedAlphaTextures.clear();
|
||||
|
||||
vkCtx->deferAfterFrameFence([device, allocator, vertexBuffer, vertexAlloc, indexBuffer, indexAlloc,
|
||||
paramsUBO, paramsAlloc, pool, materialSet, alphaTextures]() {
|
||||
vkCtx->deferAfterAllFrameFences([device, allocator, vertexBuffer, vertexAlloc, indexBuffer, indexAlloc,
|
||||
paramsUBO, paramsAlloc, pool, materialSet, alphaTextures]() {
|
||||
if (vertexBuffer) {
|
||||
AllocatedBuffer ab{}; ab.buffer = vertexBuffer; ab.allocation = vertexAlloc;
|
||||
destroyBuffer(allocator, ab);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue