summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Leech <devrel@oddhack.org>2017-10-12 15:35:10 -0700
committerGitHub <noreply@github.com>2017-10-12 15:35:10 -0700
commit3d1582e9ef17a5b94ad4737b4de937599cf40000 (patch)
treeb00fc4ad9cfc899e3bdc39c799a3f894e39fdc7c
parent9da85cc6ebb24a69e4f80fad0f80bc44c5571f75 (diff)
parent10720dd0b5dcfdc737474899d8142e89f17aaf62 (diff)
downloadvulkan-spec-3d1582e9ef17a5b94ad4737b4de937599cf40000.zip
vulkan-spec-3d1582e9ef17a5b94ad4737b4de937599cf40000.tar.xz
Merge pull request #560 from krOoze/fix_flags_pointer_autovalidity
Fix autovalidity for output Flags pointers
-rw-r--r--src/spec/validitygenerator.py32
-rw-r--r--src/spec/vk.xml4
2 files changed, 23 insertions, 13 deletions
diff --git a/src/spec/validitygenerator.py b/src/spec/validitygenerator.py
index 355ad98..aefdb08 100644
--- a/src/spec/validitygenerator.py
+++ b/src/spec/validitygenerator.py
@@ -444,16 +444,17 @@ class ValidityOutputGenerator(OutputGenerator):
if asciidoc != '':
asciidoc += '\n'
- # Add additional line for non-optional bitmasks
- if self.getTypeCategory(paramtype.text) == 'bitmask':
- if param.attrib.get('optional') is None:
- asciidoc += self.makeAnchor(blockname, paramname.text, 'requiredbitmask')
- if self.paramIsArray(param):
- asciidoc += 'Each element of '
- asciidoc += 'pname:'
- asciidoc += paramname.text
- asciidoc += ' must: not be `0`'
- asciidoc += '\n'
+ # Add additional line for non-optional bitmasks
+ if self.getTypeCategory(paramtype.text) == 'bitmask':
+ isMandatory = param.attrib.get('optional') is None #TODO does not really handle if someone tries something like optional="true,false"
+ if isMandatory:
+ asciidoc += self.makeAnchor(blockname, paramname.text, 'requiredbitmask')
+ if self.paramIsArray(param):
+ asciidoc += 'Each element of '
+ asciidoc += 'pname:'
+ asciidoc += paramname.text
+ asciidoc += ' must: not be `0`'
+ asciidoc += '\n'
return asciidoc
@@ -514,7 +515,16 @@ class ValidityOutputGenerator(OutputGenerator):
asciidoc += '\n'
else:
if self.paramIsArray(param):
- asciidoc += self.makeAsciiDocLineForParameter(blockname, param, params, 'combinations of ' + self.makeEnumerationName(bitsname) + ' value')
+ #
+ if param.text is not None and 'const' in param.text:
+ asciidoc += self.makeAsciiDocLineForParameter(blockname, param, params, 'combinations of ' + self.makeEnumerationName(bitsname) + ' value')
+ else:
+ asciidoc += self.makeAsciiDocLineForParameter(blockname, param, params, self.makeEnumerationName(paramtype.text) + ' value')
+ elif self.paramIsPointer(param):
+ if param.text is not None and 'const' in param.text:
+ asciidoc += self.makeAsciiDocLineForParameter(blockname, param, params, 'combination of ' + self.makeEnumerationName(bitsname) + ' values')
+ else:
+ asciidoc += self.makeAsciiDocLineForParameter(blockname, param, params, self.makeEnumerationName(paramtype.text) + ' value')
else:
asciidoc += self.makeAsciiDocLineForParameter(blockname, param, params, 'combination of ' + self.makeEnumerationName(bitsname) + ' values')
elif typecategory == 'handle':
diff --git a/src/spec/vk.xml b/src/spec/vk.xml
index 958e8d2..4776e6f 100644
--- a/src/spec/vk.xml
+++ b/src/spec/vk.xml
@@ -5151,7 +5151,7 @@ private version is maintained in the 1.0 branch of the member gitlab server.
<param><type>uint32_t</type> <name>heapIndex</name></param>
<param><type>uint32_t</type> <name>localDeviceIndex</name></param>
<param><type>uint32_t</type> <name>remoteDeviceIndex</name></param>
- <param><type>VkPeerMemoryFeatureFlagsKHX</type>* <name>pPeerMemoryFeatures</name></param>
+ <param optional="false,true"><type>VkPeerMemoryFeatureFlagsKHX</type>* <name>pPeerMemoryFeatures</name></param>
</command>
<command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY">
<proto><type>VkResult</type> <name>vkBindBufferMemory2KHR</name></proto>
@@ -5179,7 +5179,7 @@ private version is maintained in the 1.0 branch of the member gitlab server.
<proto><type>VkResult</type> <name>vkGetDeviceGroupSurfacePresentModesKHX</name></proto>
<param><type>VkDevice</type> <name>device</name></param>
<param externsync="true"><type>VkSurfaceKHR</type> <name>surface</name></param>
- <param><type>VkDeviceGroupPresentModeFlagsKHX</type>* <name>pModes</name></param>
+ <param optional="false,true"><type>VkDeviceGroupPresentModeFlagsKHX</type>* <name>pModes</name></param>
</command>
<command successcodes="VK_SUCCESS,VK_TIMEOUT,VK_NOT_READY,VK_SUBOPTIMAL_KHR" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY,VK_ERROR_OUT_OF_DEVICE_MEMORY,VK_ERROR_DEVICE_LOST,VK_ERROR_OUT_OF_DATE_KHR,VK_ERROR_SURFACE_LOST_KHR">
<proto><type>VkResult</type> <name>vkAcquireNextImage2KHX</name></proto>