summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Leech <devrel@oddhack.org>2017-10-12 15:39:47 -0700
committerGitHub <noreply@github.com>2017-10-12 15:39:47 -0700
commit61bb590a50b179d16f6dd9009f934afcf3854eab (patch)
tree5df5ac34f41644427573f738b3224acb42214c29
parent74432fcf82c9e17afd4a93b0cd9467d6ed02455d (diff)
parent582a6518874b281961a952267a9bf3c16a7f57e2 (diff)
downloadvulkan-spec-61bb590a50b179d16f6dd9009f934afcf3854eab.zip
vulkan-spec-61bb590a50b179d16f6dd9009f934afcf3854eab.tar.xz
Merge pull request #566 from krOoze/fixnclarify_altlen
Fix and clarify altlen
-rw-r--r--doc/specs/vulkan/registry.txt8
-rw-r--r--src/spec/registry.rnc5
-rw-r--r--src/spec/vk.xml2
3 files changed, 14 insertions, 1 deletions
diff --git a/doc/specs/vulkan/registry.txt b/doc/specs/vulkan/registry.txt
index 156548a..0154f2e 100644
--- a/doc/specs/vulkan/registry.txt
+++ b/doc/specs/vulkan/registry.txt
@@ -436,6 +436,10 @@ member.
contains a `latexmath:` equation, this attribute should
be specified with an equivalent equation using only C builtin operators,
C math library function names, and variables as allowed for attr:len.
+ It must be a valid C99 expression whose result is equal to attr:len for
+ all possible inputs.
+ It is a comma separated list that has size equal to only the `latexmath`
+ item count in attr:len list.
This attribute is intended to support consumers of the XML who need to
generate validation code from the allowed length.
* attr:externsync - denotes that the member should be externally
@@ -814,6 +818,10 @@ members.
contains a `latexmath:` equation, this attribute should
be specified with an equivalent equation using only C builtin operators,
C math library function names, and variables as allowed for attr:len.
+ It must be a valid C99 expression whose result is equal to attr:len for
+ all possible inputs.
+ It is a comma separated list that has size equal to only the `latexmath`
+ item count in attr:len list.
This attribute is intended to support consumers of the XML who need to
generate validation code from the allowed length.
* attr:optional - a value of `"true"` or `"false"` determines whether this
diff --git a/src/spec/registry.rnc b/src/spec/registry.rnc
index e8b87ba..924bf3e 100644
--- a/src/spec/registry.rnc
+++ b/src/spec/registry.rnc
@@ -110,6 +110,8 @@ Types = element types {
# member of that struct, 'null-terminated' for a string, '1' to indicate it's
# just a pointer (used for nested pointers), or a latex equation (prefixed with
# 'latexmath:')
+# altlen - if len has latexmath equations, this contains equivalent C99
+# expressions separated by commas.
# externsync - denotes that the member should be externally synchronized
# when accessed by Vulkan
# optional - whether this value can be omitted by providing NULL (for
@@ -264,6 +266,8 @@ Commands = element commands {
# member of that struct, 'null-terminated' for a string, '1' to indicate it's
# just a pointer (used for nested pointers), or a latex equation (prefixed with
# 'latexmath:')
+# altlen - if len has latexmath equations, this contains equivalent C99
+# expressions separated by commas.
# externsync - denotes that the member should be externally synchronized
# when accessed by Vulkan
# optional - whether this value can be omitted by providing NULL (for
@@ -295,6 +299,7 @@ Command = element command {
} ,
element param {
attribute len { text } ? ,
+ attribute altlen { text } ? ,
attribute externsync { text } ? ,
attribute optional { text } ? ,
attribute noautovalidity { text } ? ,
diff --git a/src/spec/vk.xml b/src/spec/vk.xml
index 4776e6f..da6816d 100644
--- a/src/spec/vk.xml
+++ b/src/spec/vk.xml
@@ -977,7 +977,7 @@ private version is maintained in the 1.0 branch of the member gitlab server.
<member><type>VkSampleCountFlagBits</type> <name>rasterizationSamples</name><comment>Number of samples used for rasterization</comment></member>
<member><type>VkBool32</type> <name>sampleShadingEnable</name><comment>optional (GL45)</comment></member>
<member><type>float</type> <name>minSampleShading</name><comment>optional (GL45)</comment></member>
- <member optional="true" len="latexmath:[\lceil{\mathit{rasterizationSamples} \over 32}\rceil]" altlen="ceil(rasterizationSamples / 32)">const <type>VkSampleMask</type>* <name>pSampleMask</name><comment>Array of sampleMask words</comment></member>
+ <member optional="true" len="latexmath:[\lceil{\mathit{rasterizationSamples} \over 32}\rceil]" altlen="(rasterizationSamples + 31) / 32">const <type>VkSampleMask</type>* <name>pSampleMask</name><comment>Array of sampleMask words</comment></member>
<member><type>VkBool32</type> <name>alphaToCoverageEnable</name></member>
<member><type>VkBool32</type> <name>alphaToOneEnable</name></member>
</type>