Add new tests for advanced data uploading #474
Merged
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.
Closes #433
What do you think? The new tests don't show any validation layer warnigns or errors on my system.
I still need to find a way to link the code in the doxygen documentation, but that's for another pr.
I still have some questions:
In
TestDataUploadingWithStagingBuffer
, I explicitely check if the memory did not end up in mappable memory withTEST(!(memPropFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT));
. Does this make sense like this? Because if this is not true, it would be a bug in vma, right? (The same argument is forTEST(memPropFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT);
inTestDataUploadingWithMappedMemory
).Besides
vmaFlushAllocation
, should we maybe also mention in a comment that the user needs to callvmaInvalidateAllocation
if reading from gpu -> cpu is the desired use case?In theory, we could abstract
TestAdvancedDataUploading
into a function (as I did with the lambda in the ticket here) so we have less duplicate code. The functionsTestDataUploadingWithMappedMemory
andTestDataUploadingWithStagingBuffer
would then call that function with the flags required. While this leads to less code, I am not sure if it would be easier for beginners to understand.Also, I think it would be worth mentioning in the docs that both
vmaFlushAllocation
andvmaInvalidateAllocation
check internally if the memory isVK_MEMORY_PROPERTY_HOST_COHERENT_BIT
, meaning we don't need to check for manually this when calling these functionsDo we need some additional tests if the data uploading was successful?
Johannes