VulkanPushPool - more efficient replacement for 3x VulkanPushBuffer#17122
Merged
VulkanPushPool - more efficient replacement for 3x VulkanPushBuffer#17122
Conversation
a505b0b to
6d3a25e
Compare
GPU/Vulkan/DrawEngineVulkan.cpp
Outdated
Comment on lines
+355
to
+357
| stats_.pushUBOSpaceUsed = 0; // (int)pushUBO->GetOffset(); | ||
| stats_.pushVertexSpaceUsed = 0; // (int)frame->pushVertex->GetOffset(); | ||
| stats_.pushIndexSpaceUsed = 0; // (int)frame->pushIndex->GetOffset(); |
Collaborator
There was a problem hiding this comment.
I think these stats are still TODO? Or should we remove?
-[Unknown]
Owner
Author
There was a problem hiding this comment.
First one is wildly inaccurate since we have a lot of other stuff in that buffer. I'll fix up the other ones.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This new
VulkanPushPoolis similar to 3xVulkanPushBuffer, except that unused buffers are shared among the (up to) 3 frame contexts - any frame can grab them if they're free and haven't been used in the last couple frames.The result is that excessive allocations from spikes can be more efficiently re-used. When using texture packs with very large textures, VRAM consumption is cut by more than a third.
Anyway, the result will be good VRAM savings, effectively leading to less out-of-memory conditions. Though the effect is really mostly there when using large texture replacements.
The shrinking heuristics can be tweaked further, but it's doing a better job than the old code already. It's very non-aggressive to avoid excessive re-allocation, while shaving off really huge spikes over time.
Also changes the old VulkanPushBuffer to have the same allocation interface as the new one.