VulkanSceneGraph
VulkanSceneGraph copied to clipboard
Re-compiling always allocates minimumBufferSize (16MB) for new buffers
Additional calls to BindIndex/VertexBuffers
are not re-using the memory blocks from the previous frame/compilation, causing the minimal size to be allocated for each of them (16MB as defined in MemoryBufferPools.h).
After investigation we localized the issue to a MemoryBufferPools
being created each compilation in Viewer::compile
(new CompileTraversal
->new Context
->new CopyAndReleaseBuffer
->new MemoryBufferPools
). A rudimentary workaround which solves the issue is:
- Making
deviceResourceMap
a member field or static. - Adding
if (!deviceResources.compile)
before creating a newCompileTraversal
Here's a minimal example demonstrating the issue (and checking the frame commands in RenderDoc). vsgdraw.zip
Would like some feedback on this issue and whether this is a design flaw of VSG, as creating new models on the fly and recompiling should not add a minimum of 16MB.