Add attribute to mark pNext pointers with the Vulkan struct they extend#347
Add attribute to mark pNext pointers with the Vulkan struct they extend#347adam-sawicki-a merged 2 commits intoGPUOpen-LibrariesAndSDKs:masterfrom Rob2309:extends-marker
Conversation
|
How is it going to be used? Can you please show an example of how it is used and why it is needed? |
I would take the With the attribute introduced above, a code generator could automatically generate a typesafe wrapper for This could probably be somehow extracted from the documentation comment, but I think parsing a custom attribute is cleaner and simpler. |
|
OK, thank you for the explanation. I accepted and merged your change without any modifications. I hope it will be useful. |
This PR adds an attribute
VMA_EXTENDS_VK_STRUCTsimilar toVMA_LEN_IF_NOT_NULLthat allows detecting programatically which Vulkan structure will be extended with a givenpNextargument.For example:
with this attribute, generators can detect and enforce that
pNextpoints to a structure that is allowed to be present in thepNextchain ofVkBindBufferMemoryInfoKHR.