diff --git a/doc/specs/vulkan/chapters/descriptorsets.txt b/doc/specs/vulkan/chapters/descriptorsets.txt
index 6e40b263..1e60aa44 100644
--- a/doc/specs/vulkan/chapters/descriptorsets.txt
+++ b/doc/specs/vulkan/chapters/descriptorsets.txt
@@ -2373,6 +2373,15 @@ include::../api/protos/vkUpdateDescriptorSetWithTemplateKHR.txt[]
of slink:VkDescriptorImageInfo, slink:VkDescriptorBufferInfo, or
slink:VkBufferView used to write the descriptors.
+.Valid Usage
+****
+ * pname:pData must: be a pointer to a memory that contains one or more
+ valid instances of slink:VkDescriptorImageInfo,
+ slink:VkDescriptorBufferInfo, or slink:VkBufferView in a layout defined
+ by pname:descriptorUpdateTemplate when it was created with
+ flink:vkCreateDescriptorUpdateTemplateKHR
+****
+
include::../validity/protos/vkUpdateDescriptorSetWithTemplateKHR.txt[]
.API example
@@ -2699,6 +2708,11 @@ include::../api/protos/vkCmdPushDescriptorSetWithTemplateKHR.txt[]
The pipelineBindPoint specified during the creation of the descriptor
update template must: be supported by the pname:commandBuffer's parent
sname:VkCommandPool's queue family
+ * pname:pData must: be a pointer to a memory that contains one or more
+ valid instances of slink:VkDescriptorImageInfo,
+ slink:VkDescriptorBufferInfo, or slink:VkBufferView in a layout defined
+ by pname:descriptorUpdateTemplate when it was created with
+ flink:vkCreateDescriptorUpdateTemplateKHR
****
include::../validity/protos/vkCmdPushDescriptorSetWithTemplateKHR.txt[]
diff --git a/src/spec/validitygenerator.py b/src/spec/validitygenerator.py
index cfae2857..355ad982 100644
--- a/src/spec/validitygenerator.py
+++ b/src/spec/validitygenerator.py
@@ -406,22 +406,28 @@ class ValidityOutputGenerator(OutputGenerator):
elif self.paramIsPointer(param):
# Handle pointers - which are really special case arrays (i.e. they don't have a length)
+ #TODO should do something here if someone ever uses some intricate comma-separated `optional`
pointercount = paramtype.tail.count('*')
- # Could be multi-level pointers (e.g. ppData - pointer to a pointer). Handle that.
- for i in range(0, pointercount):
- asciidoc += 'a pointer to '
-
+ # Treat void* as an int
if paramtype.text == 'void':
- # If there's only one pointer, it's optional, and it doesn't point at anything in particular - we don't need any language.
- if pointercount == 1 and param.attrib.get('optional') is not None:
+ pointercount -= 1
+
+ # Could be multi-level pointers (e.g. ppData - pointer to a pointer). Handle that.
+ asciidoc += 'a '
+ for i in range(0, pointercount):
+ asciidoc += 'pointer to a '
+
+ # Handle void* and pointers to it
+ if paramtype.text == 'void':
+ # If there is only void*, it is just optional int - we don't need any language.
+ if pointercount == 0 and param.attrib.get('optional') is not None:
return '' # early return
else:
- # Pointer to nothing in particular - delete the " to " portion
- asciidoc = asciidoc[:-4]
- else:
- # Add an article for English semantic win
- asciidoc += 'a '
+ if param.attrib.get('optional').split(',')[pointercount] is not None:
+ # The last void* is just optional int (e.g. to be filled by the impl.)
+ typetext = 'pointer value'
+
# If a value is "const" that means it won't get modified, so it must be valid going into the function.
if param.text is not None and paramtype.text != 'void':
diff --git a/src/spec/vk.xml b/src/spec/vk.xml
index 7ed72c5f..958e8d2b 100644
--- a/src/spec/vk.xml
+++ b/src/spec/vk.xml
@@ -1527,7 +1527,7 @@ private version is maintained in the 1.0 branch of the member gitlab server.
VkStructureType sType
const void* pNext
VkViSurfaceCreateFlagsNN flags
- void* window
+ void* window
VkStructureType sType
@@ -2317,13 +2317,13 @@ private version is maintained in the 1.0 branch of the member gitlab server.
VkStructureType sType
const void* pNext
VkIOSSurfaceCreateFlagsMVK flags
- const void* pView
+ const void* pView
VkStructureType sType
const void* pNext
VkMacOSSurfaceCreateFlagsMVK flags
- const void* pView
+ const void* pView
float xcoeff
@@ -3796,7 +3796,7 @@ private version is maintained in the 1.0 branch of the member gitlab server.
VkDeviceSize offset
VkDeviceSize size
VkMemoryMapFlags flags
- void** ppData
+ void** ppData
void vkUnmapMemory
@@ -5222,7 +5222,7 @@ private version is maintained in the 1.0 branch of the member gitlab server.
VkDevice device
VkDescriptorSet descriptorSet
VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate
- const void* pData
+ const void* pData
void vkCmdPushDescriptorSetWithTemplateKHR
@@ -5230,7 +5230,7 @@ private version is maintained in the 1.0 branch of the member gitlab server.
VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate
VkPipelineLayout layout
uint32_t set
- const void* pData
+ const void* pData
void vkSetHdrMetadataEXT