EDIT: Docs and minor bug fixed

This commit is contained in:
2025-10-29 22:51:28 +09:00
parent 97177dade3
commit 0226c0b5b3
26 changed files with 348 additions and 17 deletions

View File

@@ -307,3 +307,21 @@ VkAccelerationStructureKHR RayTracingManager::buildTLASFromDrawContext(const Dra
return _tlas.handle;
}
void RayTracingManager::removeBLASForBuffer(VkBuffer vertexBuffer)
{
if (!vertexBuffer) return;
VkDevice dv = _device->device();
auto it = _blasByVB.find(vertexBuffer);
if (it == _blasByVB.end()) return;
if (it->second.handle)
{
_vkDestroyAccelerationStructureKHR(dv, it->second.handle, nullptr);
}
if (it->second.storage.buffer)
{
_resources->destroy_buffer(it->second.storage);
}
_blasByVB.erase(it);
}