From 582a6518874b281961a952267a9bf3c16a7f57e2 Mon Sep 17 00:00:00 2001 From: Petr Kraus Date: Thu, 21 Sep 2017 17:25:24 +0200 Subject: [PATCH] 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` --- doc/specs/vulkan/registry.txt | 8 ++++++++ src/spec/registry.rnc | 5 +++++ src/spec/vk.xml | 2 +- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/doc/specs/vulkan/registry.txt b/doc/specs/vulkan/registry.txt index 156548a4..0154f2e7 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 e8b87ba9..924bf3e2 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 7ed72c5f..c30c8310 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. VkSampleCountFlagBits rasterizationSamplesNumber of samples used for rasterization VkBool32 sampleShadingEnableoptional (GL45) float minSampleShadingoptional (GL45) - const VkSampleMask* pSampleMaskArray of sampleMask words + const VkSampleMask* pSampleMaskArray of sampleMask words VkBool32 alphaToCoverageEnable VkBool32 alphaToOneEnable