As clearly stated in the specification:
Any parameter that is a structure containing a void*
pNext
member must have a value of pNext
that is either NULL
, or points to a valid structure that is defined by an enabled extension.
It's for extensions.
If the first member of every structure is sType, couldn't extensions just define their own structure types when they need different/extra parameters?
That wouldn't be extensible.
There is only one sType
field. So how could two extensions extend the same API with new values? Similarly, how could an old extension work alongside new versions of Vulkan that itself uses a different data structure identified by sType
.
With pNext
, you don't have that problem. Each extension data structure will not only have its own internal sType
field, but it will no doubt also have its own pNext
field. So multiple extensions can extend the same data structures.
sType
doesn't need this, because it will only be changed in higher versions of Vulkan.