Skip to content

buffer: do not call unmap in reset#88

Merged
Mrkol merged 2 commits into
AlexandrShcherbakov:mainfrom
kzubatov:main
May 13, 2026
Merged

buffer: do not call unmap in reset#88
Mrkol merged 2 commits into
AlexandrShcherbakov:mainfrom
kzubatov:main

Conversation

@kzubatov

Copy link
Copy Markdown
Contributor

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)

@github-actions

Copy link
Copy Markdown

А я всегда говорил, нормально делай — нормально будет! 👍

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
@github-actions

Copy link
Copy Markdown

А я всегда говорил, нормально делай — нормально будет! 👍

@Mrkol Mrkol merged commit c118de6 into AlexandrShcherbakov:main May 13, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants