buffer: do not call unmap in reset#88
Merged
Merged
Conversation
|
А я всегда говорил, нормально делай — нормально будет! 👍 |
if VMA_ALLOCATION_CREATE_MAPPED_BIT is set, the buffer is always mapped and unmap should not be called in reset, see https://gpuopen-librariesandsdks.github.io/VulkanMemoryAllocator/html/group__group__alloc.html#ggad9889c10c798b040d59c92f257cae597a11da372cc3a82931c5e5d6146cd9dd1f:~:text=It%20is%20also%20safe,to%20VMA%5FALLOCATION%5FCREATE%5FMAPPED%5FBIT%20flag If map is called explicitly, instead of creating the buffer using VMA_ALLOCATION_CREATE_MAPPED_BIT, unmap must also be called explicitly Removed map/unmap calls in helper functions, since buffers are created with VMA_ALLOCATION_CREATE_MAPPED_BIT
|
А я всегда говорил, нормально делай — нормально будет! 👍 |
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.
The reverted commit was wrong, because it makes VMA_ALLOCATION_CREATE_MAPPED_BIT useless.
Instead, do not call map/unmap if VMA_ALLOCATION_CREATE_MAPPED_BIT is used.
You must explicitly call the unmap if the buffer is mapped without the VMA_ALLOCATION_CREATE_MAPPED_BIT flag (since you have already called map yourself)