Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid usage of VmaAllocation #116

Open
Eearslya opened this issue Jul 24, 2024 · 2 comments
Open

Invalid usage of VmaAllocation #116

Eearslya opened this issue Jul 24, 2024 · 2 comments

Comments

@Eearslya
Copy link

Starting in chapter 3, Mesh Buffers, the guide introduces users to VMA. Buffers are created for vertices and indices, as well as host-visible staging buffers.

The guide instructs users to use staging.allocation->GetMappedData() to acquire a pointer to write to the staging buffer. However, this is not valid usage. VmaAllocation is an opaque type in VMA, and all of its members and functions are only visible to the single translation unit that defines VMA_IMPLEMENTATION. This works in vkguide's case because all of the code is within vk_engine.cpp, but it's probably not something we want to be teaching new users in a tutorial scenario.

All of the mentions of GetMappedData() should probably be replaced with the public API function vmaMapMemory().

@scgehin
Copy link

scgehin commented Aug 15, 2024

While we are at it, it would be best to access the mapped data from staging.info.pMappedData. Since the allocations are created with VMA_ALLOCATION_CREATE_MAPPED_BIT, calling the mapping/unmapping functions just adds extra work (though it's not an error).

@XavierCS-dev
Copy link

Thanks, switched to using allocation.pMappedData. This didn't fix my issues but at least it compiles now lol.

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

No branches or pull requests

3 participants