summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Kraus <petr_kraus@email.cz>2017-09-21 17:25:24 +0200
committerPetr Kraus <petr_kraus@email.cz>2017-10-13 00:36:41 +0200
commit582a6518874b281961a952267a9bf3c16a7f57e2 (patch)
tree64afa58736ae5b95869bf908d7c2dfc7988200e8
parentd2d907e4f3730bc4290b518faf0604492b302693 (diff)
downloadvulkan-spec-582a6518874b281961a952267a9bf3c16a7f57e2.zip
vulkan-spec-582a6518874b281961a952267a9bf3c16a7f57e2.tar.xz
Fix and clarify altlen
1) Fix `pSampleMask `s `altlen` to have C99 semantics equivalent to len 2) Fix `registry.rnc` to also have altlen for `param`s 3) Document `altlen` in `registry.rnc` comments 4) Clarify `altlen` in schema doc that beside C syntax it also follows C semantics 5) Clarify `altlen` in schema doc in case there ever is `latexmath` in comma separated `len`
-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 7ed72c5..c30c831 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>