Closed fendevel closed 1 year ago
I agree that vkGetDeviceImageMemoryRequirements
(and vkGetDeviceBufferMemoryRequirements
) should be enough to prevent the best practice warning here. The tricky part will be finding a good way to essentially tracking every call and saving the VkImageCreateInfo
to pair with the VkMemoryRequirements
values. Assuming we can hash it, but still have to worry about how many times an application might call vkGetDeviceImageMemoryRequirements
To be honest, I also question how useful of a best practice warning this really is for developers. I guess not sure how often people are just guessing the size
and memoryType
for memory allocations
Yeah it may end up being better to check the inputs for the memory binding function and emitting a warning based on that than to track which functions were called where + associated data. Looking for specific function calls probably really isn't that useful.
This will be fixed in the upcoming SDK release.
Describe the Issue
Validation layers report
UNASSIGNED-BestPractices-vkBindBufferMemory-requirements-not-retrieved
andUNASSIGNED-BestPractices-vkBindImageMemory-requirements-not-retrieved
if you bind device memory with memory requirements queried usingvkGetDeviceBufferMemoryRequirements
orvkGetDeviceImageMemoryRequirements
. These functions are provided by Vulkan 1.3 as alternatives tovkGetBufferMemoryRequirements
andvkGetImageMemoryRequirements
.Valid Usage ID
UNASSIGNED-BestPractices-vkBindImageMemory-requirements-not-retrieved(WARN / SPEC): msgNum: 1185611228 - Validation Warning: [ UNASSIGNED-BestPractices-vkBindImageMemory-requirements-not-retrieved ] Object 0: handle = 0x1ed20d4d200, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x46aafddc | vkBindImageMemory(): Binding memory to VkImage 0x1ed23c955c0[] but vkGetImageMemoryRequirements() has not been called on that image.