Vulkan-Docs/checkLinks.py

364 lines
15 KiB
Python
Raw Normal View History

2016-02-16 09:53:44 +00:00
#!/usr/bin/python3
#
# Copyright (c) 2015-2019 The Khronos Group Inc.
2016-02-16 09:53:44 +00:00
#
Change log for April 22, 2016 Vulkan 1.0.11 spec update: * Bump API patch number and header version number to 11 for this update. Github Issues: * Clarify the WSI extension language by switching from the fuzzier "ownership" language to more-consistent "acquire" language (public issue 117). * Clarify that memory barriers apply to all commands in the dependency chains in the flink:vkGetRenderAreaGranularity command and the <<synchronization-execution-and-memory-dependencies,Execution And Memory Dependencies>> section (public issue 132). * Clarify that a queue family is a set of queues in the <<fundamentals-execmodel,Execution Model>> section (public issue 166). * Removed requirement from valid usage language that VkPresentInfoKHR::waitSemaphoreCount must be greater than 0 (public issue 171). * Fix broken internal links, describe structures consistently, use consistent style for SPIR-V codewords, and tag normative terms that were missing asciidoc tags (public issue 183 and ancillary markup/normative language fixes). * Fix typos for slink:VkPhysicalDeviceLimits member names in slink:VkImageCreateInfo validity language (public issue 184). Internal Issues: * Document that the requested patch version number specified as part of slink:VkApplicationInfo::pname:apiVersion is ignored when creating an instance (internal issue 176). * Clarify handling of extension structs in the <<fundamentals-validusageValid Usage>> section (internal issue 254). * Update required slink:VkImageFormatProperties::pname:maxMipLevels to be limited to the maximum allowed mipmap pyramid size corresponding to the actual maximum supported size for the format (internal issue 256). * Modify the <<features-extentperimagetype,Allowed Extent Values Based On Image Type>> section so the allowed maximum extent is the maximum image dimension supported for each dimension of the type of texture being queried (internal issue 257). * Clarify in the <<spirvenv-module-validation,Validation Rules within a Module>> section that at least one of the code:LocalSize execution mode or code:WorkgroupSize decoration is required for each compute shader entry point in a shader module (internal issue 279). * Add validity rules for formats in flink:vkCmdClearColorImage and flink:vkCmdClearDepthStencilImage (internal issue 283). * Clarify that slink:VkImageFormatProperties::pname:maxResourceSize is an upper bound, and that it may not be possible to create an image anywhere near that size (internal issue 284). Other Commits: * Fix various minor markup errors reported by validation scripts. * Change copyright from Khronos Free Use License to Apache 2.0 license on relevant script/XML/header files. This does not affect the specification source copyright.
2016-04-21 08:08:38 +00:00
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
2016-02-16 09:53:44 +00:00
#
Change log for April 22, 2016 Vulkan 1.0.11 spec update: * Bump API patch number and header version number to 11 for this update. Github Issues: * Clarify the WSI extension language by switching from the fuzzier "ownership" language to more-consistent "acquire" language (public issue 117). * Clarify that memory barriers apply to all commands in the dependency chains in the flink:vkGetRenderAreaGranularity command and the <<synchronization-execution-and-memory-dependencies,Execution And Memory Dependencies>> section (public issue 132). * Clarify that a queue family is a set of queues in the <<fundamentals-execmodel,Execution Model>> section (public issue 166). * Removed requirement from valid usage language that VkPresentInfoKHR::waitSemaphoreCount must be greater than 0 (public issue 171). * Fix broken internal links, describe structures consistently, use consistent style for SPIR-V codewords, and tag normative terms that were missing asciidoc tags (public issue 183 and ancillary markup/normative language fixes). * Fix typos for slink:VkPhysicalDeviceLimits member names in slink:VkImageCreateInfo validity language (public issue 184). Internal Issues: * Document that the requested patch version number specified as part of slink:VkApplicationInfo::pname:apiVersion is ignored when creating an instance (internal issue 176). * Clarify handling of extension structs in the <<fundamentals-validusageValid Usage>> section (internal issue 254). * Update required slink:VkImageFormatProperties::pname:maxMipLevels to be limited to the maximum allowed mipmap pyramid size corresponding to the actual maximum supported size for the format (internal issue 256). * Modify the <<features-extentperimagetype,Allowed Extent Values Based On Image Type>> section so the allowed maximum extent is the maximum image dimension supported for each dimension of the type of texture being queried (internal issue 257). * Clarify in the <<spirvenv-module-validation,Validation Rules within a Module>> section that at least one of the code:LocalSize execution mode or code:WorkgroupSize decoration is required for each compute shader entry point in a shader module (internal issue 279). * Add validity rules for formats in flink:vkCmdClearColorImage and flink:vkCmdClearDepthStencilImage (internal issue 283). * Clarify that slink:VkImageFormatProperties::pname:maxResourceSize is an upper bound, and that it may not be possible to create an image anywhere near that size (internal issue 284). Other Commits: * Fix various minor markup errors reported by validation scripts. * Change copyright from Khronos Free Use License to Apache 2.0 license on relevant script/XML/header files. This does not affect the specification source copyright.
2016-04-21 08:08:38 +00:00
# http://www.apache.org/licenses/LICENSE-2.0
2016-02-16 09:53:44 +00:00
#
Change log for April 22, 2016 Vulkan 1.0.11 spec update: * Bump API patch number and header version number to 11 for this update. Github Issues: * Clarify the WSI extension language by switching from the fuzzier "ownership" language to more-consistent "acquire" language (public issue 117). * Clarify that memory barriers apply to all commands in the dependency chains in the flink:vkGetRenderAreaGranularity command and the <<synchronization-execution-and-memory-dependencies,Execution And Memory Dependencies>> section (public issue 132). * Clarify that a queue family is a set of queues in the <<fundamentals-execmodel,Execution Model>> section (public issue 166). * Removed requirement from valid usage language that VkPresentInfoKHR::waitSemaphoreCount must be greater than 0 (public issue 171). * Fix broken internal links, describe structures consistently, use consistent style for SPIR-V codewords, and tag normative terms that were missing asciidoc tags (public issue 183 and ancillary markup/normative language fixes). * Fix typos for slink:VkPhysicalDeviceLimits member names in slink:VkImageCreateInfo validity language (public issue 184). Internal Issues: * Document that the requested patch version number specified as part of slink:VkApplicationInfo::pname:apiVersion is ignored when creating an instance (internal issue 176). * Clarify handling of extension structs in the <<fundamentals-validusageValid Usage>> section (internal issue 254). * Update required slink:VkImageFormatProperties::pname:maxMipLevels to be limited to the maximum allowed mipmap pyramid size corresponding to the actual maximum supported size for the format (internal issue 256). * Modify the <<features-extentperimagetype,Allowed Extent Values Based On Image Type>> section so the allowed maximum extent is the maximum image dimension supported for each dimension of the type of texture being queried (internal issue 257). * Clarify in the <<spirvenv-module-validation,Validation Rules within a Module>> section that at least one of the code:LocalSize execution mode or code:WorkgroupSize decoration is required for each compute shader entry point in a shader module (internal issue 279). * Add validity rules for formats in flink:vkCmdClearColorImage and flink:vkCmdClearDepthStencilImage (internal issue 283). * Clarify that slink:VkImageFormatProperties::pname:maxResourceSize is an upper bound, and that it may not be possible to create an image anywhere near that size (internal issue 284). Other Commits: * Fix various minor markup errors reported by validation scripts. * Change copyright from Khronos Free Use License to Apache 2.0 license on relevant script/XML/header files. This does not affect the specification source copyright.
2016-04-21 08:08:38 +00:00
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
2016-02-16 09:53:44 +00:00
# checkLinks.py - validate link/reference API constructs in files
#
Change log for November 12, 2018 Vulkan 1.1.92 spec update: * Update release number to 92. Public Issues: * Move and modify valid usage statements dealing with pname:aspectMask in flink:vkCmdClearColorImage, flink:vkCmdClearDepthStencilImage, and slink:VkClearAttachment, so they are in places where all necessary information is available (public issue 529). * Fix math markup in <<textures-texel-anisotropic-filtering, Texel Anisotropic Filtering>> (public pull request 840). * Fix misspellings (public pull request 845). Internal Issues: * Add installation instructions and a Makefile "`chunked`" target for chunked HTML generation (internal issue 1352). * Fix pipeline mesh diagram style; also fix a minor bug in the classic pipeline diagram where vertex/index buffers wrongly fed into the vertex shader (internal issue 1436). * Make asciidoctor ERROR output raise an error, and don't suppress executed command output from CI make invocation (internal issue 1454). * Minor typo fixes and clarifications for `VK_NV_raytracing`. * Cleanup extension-specific properties ** Remove duplicated documentation for pname:maxDiscardRectangles, pname:pointClippingBehavior, and pname:maxVertexAttribDivisor (they shouldn't be documented with the other members of slink:VkPhysicalDeviceLimits at all). ** Remove duplicate anchor for pname:maxVertexAttribDivisor ** Consistently document stext:VkPhysicalDevice<Extension>PropertiesKHR *** Always document pname:sType/pname:pNext (was inconsistent before) *** Always mention chaining to slink:VkPhysicalDeviceProperties2 (and not as slink:VkPhysicalDeviceProperties2KHR) *** Always include Valid Usage statements last * Update Makefile 'checklinks' target and associated scripts, and fix markup problems identified by checkLinks.py, so that we can rely on the checklinks script as part of Gitlab CI.
2018-11-12 12:40:40 +00:00
# Usage: checkLinks.py [options] files > logfile
2016-02-16 09:53:44 +00:00
#
Change log for November 12, 2018 Vulkan 1.1.92 spec update: * Update release number to 92. Public Issues: * Move and modify valid usage statements dealing with pname:aspectMask in flink:vkCmdClearColorImage, flink:vkCmdClearDepthStencilImage, and slink:VkClearAttachment, so they are in places where all necessary information is available (public issue 529). * Fix math markup in <<textures-texel-anisotropic-filtering, Texel Anisotropic Filtering>> (public pull request 840). * Fix misspellings (public pull request 845). Internal Issues: * Add installation instructions and a Makefile "`chunked`" target for chunked HTML generation (internal issue 1352). * Fix pipeline mesh diagram style; also fix a minor bug in the classic pipeline diagram where vertex/index buffers wrongly fed into the vertex shader (internal issue 1436). * Make asciidoctor ERROR output raise an error, and don't suppress executed command output from CI make invocation (internal issue 1454). * Minor typo fixes and clarifications for `VK_NV_raytracing`. * Cleanup extension-specific properties ** Remove duplicated documentation for pname:maxDiscardRectangles, pname:pointClippingBehavior, and pname:maxVertexAttribDivisor (they shouldn't be documented with the other members of slink:VkPhysicalDeviceLimits at all). ** Remove duplicate anchor for pname:maxVertexAttribDivisor ** Consistently document stext:VkPhysicalDevice<Extension>PropertiesKHR *** Always document pname:sType/pname:pNext (was inconsistent before) *** Always mention chaining to slink:VkPhysicalDeviceProperties2 (and not as slink:VkPhysicalDeviceProperties2KHR) *** Always include Valid Usage statements last * Update Makefile 'checklinks' target and associated scripts, and fix markup problems identified by checkLinks.py, so that we can rely on the checklinks script as part of Gitlab CI.
2018-11-12 12:40:40 +00:00
# Options:
# -follow attempt to follow include:: directives. This script isn't # an
# Asciidoctor processor, so only literal relative paths can # be followed.
# -info print some internal diagnostics.
# -paramcheck attempt to validate param: names against the surrounding
# context (the current structure/function being validated, for example).
# This generates many false positives, so is not enabled by default.
# -fatal unvalidatable links cause immediate error exit from the script.
# Otherwise, errors are accumulated and summarized at the end.
#
# Depends on vkapi.py, which is a Python representation of relevant parts
# of the Vulkan API. Only works when vkapi.py is generated for the full
# API, e.g. 'makeAllExts checklinks'; otherwise many false-flagged errors
# will occur.
2016-02-16 09:53:44 +00:00
import copy, os, pdb, re, string, sys
from vkapi import *
global curFile, curLine, sectionDepth
global errCount, warnCount, emittedPrefix, printInfo
curFile = '???'
curLine = -1
sectionDepth = 0
emittedPrefix = {}
printInfo = False
# Called before printing a warning or error. Only prints once prior
# to output for a given file.
def emitPrefix():
global curFile, curLine, emittedPrefix
if (curFile not in emittedPrefix.keys()):
emittedPrefix[curFile] = None
print('Checking file:', curFile)
print('-------------------------------')
def info(*args, **kwargs):
global curFile, curLine, printInfo
if (printInfo):
emitPrefix()
print('INFO: %s line %d:' % (curFile, curLine),
' '.join([str(arg) for arg in args]))
# Print a validation warning found in a file
def warning(*args, **kwargs):
global curFile, curLine, warnCount
warnCount = warnCount + 1
emitPrefix()
print('WARNING: %s line %d:' % (curFile, curLine),
' '.join([str(arg) for arg in args]))
# Print a validation error found in a file
def error(*args, **kwargs):
global curFile, curLine, errCount
errCount = errCount + 1
emitPrefix()
print('ERROR: %s line %d:' % (curFile, curLine),
' '.join([str(arg) for arg in args]))
# See if a tag value exists in the specified dictionary and
# suggest it as an alternative if so.
def checkTag(tag, value, dict, dictName, tagName):
if (value in dict.keys()):
warning(value, 'exists in the API but not as a',
tag + ': .', 'Try using the', tagName + ': tag.')
# Report an error due to an asciidoc tag which doesn't match
# a corresponding API entity.
Change log for November 12, 2018 Vulkan 1.1.92 spec update: * Update release number to 92. Public Issues: * Move and modify valid usage statements dealing with pname:aspectMask in flink:vkCmdClearColorImage, flink:vkCmdClearDepthStencilImage, and slink:VkClearAttachment, so they are in places where all necessary information is available (public issue 529). * Fix math markup in <<textures-texel-anisotropic-filtering, Texel Anisotropic Filtering>> (public pull request 840). * Fix misspellings (public pull request 845). Internal Issues: * Add installation instructions and a Makefile "`chunked`" target for chunked HTML generation (internal issue 1352). * Fix pipeline mesh diagram style; also fix a minor bug in the classic pipeline diagram where vertex/index buffers wrongly fed into the vertex shader (internal issue 1436). * Make asciidoctor ERROR output raise an error, and don't suppress executed command output from CI make invocation (internal issue 1454). * Minor typo fixes and clarifications for `VK_NV_raytracing`. * Cleanup extension-specific properties ** Remove duplicated documentation for pname:maxDiscardRectangles, pname:pointClippingBehavior, and pname:maxVertexAttribDivisor (they shouldn't be documented with the other members of slink:VkPhysicalDeviceLimits at all). ** Remove duplicate anchor for pname:maxVertexAttribDivisor ** Consistently document stext:VkPhysicalDevice<Extension>PropertiesKHR *** Always document pname:sType/pname:pNext (was inconsistent before) *** Always mention chaining to slink:VkPhysicalDeviceProperties2 (and not as slink:VkPhysicalDeviceProperties2KHR) *** Always include Valid Usage statements last * Update Makefile 'checklinks' target and associated scripts, and fix markup problems identified by checkLinks.py, so that we can rely on the checklinks script as part of Gitlab CI.
2018-11-12 12:40:40 +00:00
def foundError(errType, tag, value, fatal):
2016-02-16 09:53:44 +00:00
global curFile, curLine
error('no such', errType, tag + ':' + value)
# Try some heuristics to detect likely problems such as missing vk
# prefixes or the wrong tag.
# Look in all the dictionaries in vkapi.py to see if the tag
# is just wrong but the API entity actually exists.
Change log for November 12, 2018 Vulkan 1.1.92 spec update: * Update release number to 92. Public Issues: * Move and modify valid usage statements dealing with pname:aspectMask in flink:vkCmdClearColorImage, flink:vkCmdClearDepthStencilImage, and slink:VkClearAttachment, so they are in places where all necessary information is available (public issue 529). * Fix math markup in <<textures-texel-anisotropic-filtering, Texel Anisotropic Filtering>> (public pull request 840). * Fix misspellings (public pull request 845). Internal Issues: * Add installation instructions and a Makefile "`chunked`" target for chunked HTML generation (internal issue 1352). * Fix pipeline mesh diagram style; also fix a minor bug in the classic pipeline diagram where vertex/index buffers wrongly fed into the vertex shader (internal issue 1436). * Make asciidoctor ERROR output raise an error, and don't suppress executed command output from CI make invocation (internal issue 1454). * Minor typo fixes and clarifications for `VK_NV_raytracing`. * Cleanup extension-specific properties ** Remove duplicated documentation for pname:maxDiscardRectangles, pname:pointClippingBehavior, and pname:maxVertexAttribDivisor (they shouldn't be documented with the other members of slink:VkPhysicalDeviceLimits at all). ** Remove duplicate anchor for pname:maxVertexAttribDivisor ** Consistently document stext:VkPhysicalDevice<Extension>PropertiesKHR *** Always document pname:sType/pname:pNext (was inconsistent before) *** Always mention chaining to slink:VkPhysicalDeviceProperties2 (and not as slink:VkPhysicalDeviceProperties2KHR) *** Always include Valid Usage statements last * Update Makefile 'checklinks' target and associated scripts, and fix markup problems identified by checkLinks.py, so that we can rely on the checklinks script as part of Gitlab CI.
2018-11-12 12:40:40 +00:00
checkTag(tag, value, flags, 'flags', 'tlink/tname')
2016-02-16 09:53:44 +00:00
checkTag(tag, value, enums, 'enums', 'elink')
checkTag(tag, value, structs, 'structs', 'slink/sname')
checkTag(tag, value, handles, 'handles', 'slink/sname')
checkTag(tag, value, defines, 'defines', 'slink/sname')
2016-02-16 09:53:44 +00:00
checkTag(tag, value, consts, 'consts', 'ename')
checkTag(tag, value, protos, 'protos', 'flink/fname')
checkTag(tag, value, funcpointers, 'funcpointers', 'tlink/tname')
# Look for missing vk prefixes (quirky since it's case-dependent)
# NOT DONE YET
Change log for November 12, 2018 Vulkan 1.1.92 spec update: * Update release number to 92. Public Issues: * Move and modify valid usage statements dealing with pname:aspectMask in flink:vkCmdClearColorImage, flink:vkCmdClearDepthStencilImage, and slink:VkClearAttachment, so they are in places where all necessary information is available (public issue 529). * Fix math markup in <<textures-texel-anisotropic-filtering, Texel Anisotropic Filtering>> (public pull request 840). * Fix misspellings (public pull request 845). Internal Issues: * Add installation instructions and a Makefile "`chunked`" target for chunked HTML generation (internal issue 1352). * Fix pipeline mesh diagram style; also fix a minor bug in the classic pipeline diagram where vertex/index buffers wrongly fed into the vertex shader (internal issue 1436). * Make asciidoctor ERROR output raise an error, and don't suppress executed command output from CI make invocation (internal issue 1454). * Minor typo fixes and clarifications for `VK_NV_raytracing`. * Cleanup extension-specific properties ** Remove duplicated documentation for pname:maxDiscardRectangles, pname:pointClippingBehavior, and pname:maxVertexAttribDivisor (they shouldn't be documented with the other members of slink:VkPhysicalDeviceLimits at all). ** Remove duplicate anchor for pname:maxVertexAttribDivisor ** Consistently document stext:VkPhysicalDevice<Extension>PropertiesKHR *** Always document pname:sType/pname:pNext (was inconsistent before) *** Always mention chaining to slink:VkPhysicalDeviceProperties2 (and not as slink:VkPhysicalDeviceProperties2KHR) *** Always include Valid Usage statements last * Update Makefile 'checklinks' target and associated scripts, and fix markup problems identified by checkLinks.py, so that we can rely on the checklinks script as part of Gitlab CI.
2018-11-12 12:40:40 +00:00
if fatal:
print('ERROR: %s line %d:' % (curFile, curLine),
' '.join(['no such', errType, tag + ':' + value]), file=sys.stderr)
sys.exit(1)
2016-02-16 09:53:44 +00:00
# Look for param in the list of all parameters of the specified functions
# Returns True if found, False otherwise
def findParam(param, funclist):
for f in funclist:
if (param in protos[f]):
info('parameter:', param, 'found in function:', f)
return True
return False
# Initialize tracking state for checking links/includes
def initChecks():
global curFile, curLine, curFuncs, curStruct, accumFunc, sectionDepth
global errCount, warnCount
global incPat, linkPat, pathPat, sectionPat
# Matches asciidoc single-line section tags
sectionPat = re.compile('^(=+) ')
# Matches any asciidoc include:: directive
pathPat = re.compile('^include::([\w./_]+)\[\]')
# Matches asciidoc include:: directives used in spec/ref pages (and also
Change log for May 20, 2017 Vulkan 1.0.50 spec update: * Bump API patch number and header version number to 50 for this update. Github Issues: * Fix numerous minor issues with the VK_EXT_debug_report extension (public issues 478, 483, 486, 489, 490). Internal Issues: * Update flink:vkAllocateDescriptorSets to specify conditions under which to return ename:VK_ERROR_FRAGMENTED_POOL or ename:VK_ERROR_OUT_OF_POOL_MEMORY instead of out-of-host/out-of-device-memory, and improve the <<fundamentals-errorcodes, description of those errors (internal issue 654). * Add a NOTE documenting that flink:vkAcquireNextImageKHR can only signal a single semaphore, and how to deal with that when multiple physical devices in a logical device need to wait on it (internal issue 730). * Improve description of pname:pNext chains of slink:VkPhysicalDeviceImageFormatInfo2KHR and slink:VkImageFormatProperties2KHR (internal issue 814). * Clean up math markup issues in the <<textures, Image Operations>> chapter (internal issue 818). * Update validusage target to use more robust code for preprocessing, by making direct use of Asciidoctor's preprocessor. Added uniqueItems check to JSON vu schema and add clean_validusage target (internal issue 826). * Update style guide to prohibit writing non-self-contained (on a single bullet point) Valid Usage statements, and modify offending Valid Usage statements in the Specification to match, to assist with automatic extraction for the validation layers (internal issue 828). * Add ename:VK_VALIDATION_CHECK_SHADERS_EXT to elink:VkValidationCheckEXT of the `VK_EXT_validation_flags` extension, to selectively disable shader validation. * Remove duplicate valid usage statement for slink:VkImageMemoryBarrier. * Modify reflow.py script to place VUID tag anchors standalone on a line following their corresponding bullet point, and reflow the spec text accordingly (this had been pending since the initial tag deployment). New Extensions: * `VK_AMD_texture_gather_bias_lod`
2017-05-21 00:00:50 +00:00
# others such as validity). This is specific to the layout of the api/
# includes and allows any path precding 'api/' followed by the category
# (protos, structs, enums, etc.) followed by the name of the proto,
# struct, etc. file.
incPat = re.compile('^.*api/(\w+)/(\w+)\.txt')
2016-02-16 09:53:44 +00:00
# Lists of current /protos/ (functions) and /structs/ includes. There
# can be several protos contiguously for different forms of a command
curFuncs = []
curStruct = None
# Tag if we should accumulate funcs or start a new list. Any intervening
# pname: tags or struct includes will restart the list.
accumFunc = False
# Matches all link names in the current spec/man pages. Assumes these
# macro names are not trailing subsets of other macros. Used to
# precede the regexp with [^A-Za-z], but this didn't catch macros
# at start of line.
linkPat = re.compile('([efpst](name|link)):(\w*)')
# Total error/warning counters
errCount = 0
warnCount = 0
# Validate asciidoc internal links in specified file.
# infile - filename to validate
# follow - if True, recursively follow include:: directives
Change log for November 12, 2018 Vulkan 1.1.92 spec update: * Update release number to 92. Public Issues: * Move and modify valid usage statements dealing with pname:aspectMask in flink:vkCmdClearColorImage, flink:vkCmdClearDepthStencilImage, and slink:VkClearAttachment, so they are in places where all necessary information is available (public issue 529). * Fix math markup in <<textures-texel-anisotropic-filtering, Texel Anisotropic Filtering>> (public pull request 840). * Fix misspellings (public pull request 845). Internal Issues: * Add installation instructions and a Makefile "`chunked`" target for chunked HTML generation (internal issue 1352). * Fix pipeline mesh diagram style; also fix a minor bug in the classic pipeline diagram where vertex/index buffers wrongly fed into the vertex shader (internal issue 1436). * Make asciidoctor ERROR output raise an error, and don't suppress executed command output from CI make invocation (internal issue 1454). * Minor typo fixes and clarifications for `VK_NV_raytracing`. * Cleanup extension-specific properties ** Remove duplicated documentation for pname:maxDiscardRectangles, pname:pointClippingBehavior, and pname:maxVertexAttribDivisor (they shouldn't be documented with the other members of slink:VkPhysicalDeviceLimits at all). ** Remove duplicate anchor for pname:maxVertexAttribDivisor ** Consistently document stext:VkPhysicalDevice<Extension>PropertiesKHR *** Always document pname:sType/pname:pNext (was inconsistent before) *** Always mention chaining to slink:VkPhysicalDeviceProperties2 (and not as slink:VkPhysicalDeviceProperties2KHR) *** Always include Valid Usage statements last * Update Makefile 'checklinks' target and associated scripts, and fix markup problems identified by checkLinks.py, so that we can rely on the checklinks script as part of Gitlab CI.
2018-11-12 12:40:40 +00:00
# paramCheck - if True, try to verify pname: refers to valid
# parameter/member names. This generates many false flags currently
2016-02-16 09:53:44 +00:00
# included - if True, function was called recursively
Change log for November 12, 2018 Vulkan 1.1.92 spec update: * Update release number to 92. Public Issues: * Move and modify valid usage statements dealing with pname:aspectMask in flink:vkCmdClearColorImage, flink:vkCmdClearDepthStencilImage, and slink:VkClearAttachment, so they are in places where all necessary information is available (public issue 529). * Fix math markup in <<textures-texel-anisotropic-filtering, Texel Anisotropic Filtering>> (public pull request 840). * Fix misspellings (public pull request 845). Internal Issues: * Add installation instructions and a Makefile "`chunked`" target for chunked HTML generation (internal issue 1352). * Fix pipeline mesh diagram style; also fix a minor bug in the classic pipeline diagram where vertex/index buffers wrongly fed into the vertex shader (internal issue 1436). * Make asciidoctor ERROR output raise an error, and don't suppress executed command output from CI make invocation (internal issue 1454). * Minor typo fixes and clarifications for `VK_NV_raytracing`. * Cleanup extension-specific properties ** Remove duplicated documentation for pname:maxDiscardRectangles, pname:pointClippingBehavior, and pname:maxVertexAttribDivisor (they shouldn't be documented with the other members of slink:VkPhysicalDeviceLimits at all). ** Remove duplicate anchor for pname:maxVertexAttribDivisor ** Consistently document stext:VkPhysicalDevice<Extension>PropertiesKHR *** Always document pname:sType/pname:pNext (was inconsistent before) *** Always mention chaining to slink:VkPhysicalDeviceProperties2 (and not as slink:VkPhysicalDeviceProperties2KHR) *** Always include Valid Usage statements last * Update Makefile 'checklinks' target and associated scripts, and fix markup problems identified by checkLinks.py, so that we can rely on the checklinks script as part of Gitlab CI.
2018-11-12 12:40:40 +00:00
# fatalExit - if True, validation errors cause an error exit immediately
2016-02-16 09:53:44 +00:00
# Links checked are:
# fname:vkBlah - Vulkan command name (generates internal link)
# flink:vkBlah - Vulkan command name
# sname:VkBlah - Vulkan struct name (generates internal link)
# slink:VkBlah - Vulkan struct name
Change log for November 12, 2018 Vulkan 1.1.92 spec update: * Update release number to 92. Public Issues: * Move and modify valid usage statements dealing with pname:aspectMask in flink:vkCmdClearColorImage, flink:vkCmdClearDepthStencilImage, and slink:VkClearAttachment, so they are in places where all necessary information is available (public issue 529). * Fix math markup in <<textures-texel-anisotropic-filtering, Texel Anisotropic Filtering>> (public pull request 840). * Fix misspellings (public pull request 845). Internal Issues: * Add installation instructions and a Makefile "`chunked`" target for chunked HTML generation (internal issue 1352). * Fix pipeline mesh diagram style; also fix a minor bug in the classic pipeline diagram where vertex/index buffers wrongly fed into the vertex shader (internal issue 1436). * Make asciidoctor ERROR output raise an error, and don't suppress executed command output from CI make invocation (internal issue 1454). * Minor typo fixes and clarifications for `VK_NV_raytracing`. * Cleanup extension-specific properties ** Remove duplicated documentation for pname:maxDiscardRectangles, pname:pointClippingBehavior, and pname:maxVertexAttribDivisor (they shouldn't be documented with the other members of slink:VkPhysicalDeviceLimits at all). ** Remove duplicate anchor for pname:maxVertexAttribDivisor ** Consistently document stext:VkPhysicalDevice<Extension>PropertiesKHR *** Always document pname:sType/pname:pNext (was inconsistent before) *** Always mention chaining to slink:VkPhysicalDeviceProperties2 (and not as slink:VkPhysicalDeviceProperties2KHR) *** Always include Valid Usage statements last * Update Makefile 'checklinks' target and associated scripts, and fix markup problems identified by checkLinks.py, so that we can rely on the checklinks script as part of Gitlab CI.
2018-11-12 12:40:40 +00:00
# elink:VkEnumName - Vulkan enumeration ('enum') type name (generates internal link)
2016-02-16 09:53:44 +00:00
# ename:VK_BLAH - Vulkan enumerant token name
# pname:name - parameter name to a command or a struct member
# tlink:name - Other Vulkan type name (generates internal link)
# tname:name - Other Vulkan type name
Change log for November 12, 2018 Vulkan 1.1.92 spec update: * Update release number to 92. Public Issues: * Move and modify valid usage statements dealing with pname:aspectMask in flink:vkCmdClearColorImage, flink:vkCmdClearDepthStencilImage, and slink:VkClearAttachment, so they are in places where all necessary information is available (public issue 529). * Fix math markup in <<textures-texel-anisotropic-filtering, Texel Anisotropic Filtering>> (public pull request 840). * Fix misspellings (public pull request 845). Internal Issues: * Add installation instructions and a Makefile "`chunked`" target for chunked HTML generation (internal issue 1352). * Fix pipeline mesh diagram style; also fix a minor bug in the classic pipeline diagram where vertex/index buffers wrongly fed into the vertex shader (internal issue 1436). * Make asciidoctor ERROR output raise an error, and don't suppress executed command output from CI make invocation (internal issue 1454). * Minor typo fixes and clarifications for `VK_NV_raytracing`. * Cleanup extension-specific properties ** Remove duplicated documentation for pname:maxDiscardRectangles, pname:pointClippingBehavior, and pname:maxVertexAttribDivisor (they shouldn't be documented with the other members of slink:VkPhysicalDeviceLimits at all). ** Remove duplicate anchor for pname:maxVertexAttribDivisor ** Consistently document stext:VkPhysicalDevice<Extension>PropertiesKHR *** Always document pname:sType/pname:pNext (was inconsistent before) *** Always mention chaining to slink:VkPhysicalDeviceProperties2 (and not as slink:VkPhysicalDeviceProperties2KHR) *** Always include Valid Usage statements last * Update Makefile 'checklinks' target and associated scripts, and fix markup problems identified by checkLinks.py, so that we can rely on the checklinks script as part of Gitlab CI.
2018-11-12 12:40:40 +00:00
def checkLinks(infile, follow = False, paramCheck = True, included = False, fatalExit = False):
2016-02-16 09:53:44 +00:00
global curFile, curLine, curFuncs, curStruct, accumFunc, sectionDepth
global errCount, warnCount
global incPat, linkPat, pathPat, sectionPat
# Global state which gets saved and restored by this function
oldCurFile = curFile
oldCurLine = curLine
curFile = infile
curLine = 0
# N.b. dirname() returns an empty string for a path with no directories,
# unlike the shell dirname(1).
if (not os.path.exists(curFile)):
error('No such file', curFile, '- skipping check')
# Restore global state before exiting the function
curFile = oldCurFile
curLine = oldCurLine
return
inPath = os.path.dirname(curFile)
Change log for November 25, 2016 Vulkan 1.0.35 spec update: * Bump API patch number and header version number to 35 for this update. Github Issues: * Document in the <<memory-device-hostaccess,Host Access>> section that mapping and unmapping does not invalidate or flush the mapped memory (public issues 27, 126). * Redefine the entire <<synchronization>> chapter in terms of consistent and well defined terminology, that's called out at the start of the chapter. This terminology is applied equally to all synchronization types, including subpass dependencies, submissions, and much of the implicit ordering stuff dotted around the spec. Key terms are laid out in the <<synchronization-dependencies,Execution and Memory Dependencies>> section at the top of the rewritten chapter (public issues 128, 131, 132, 217, 299, 300, 302, 306, 322, 346, 347, 371, 407). * Specify order of submission for batches in the <<vkQueueSubmit,vkQueueSubmit>> and <<vkQueueBindSparse,vkQueueBindSparse>> commands (public issue 371). * Add valid usage statements to each of the WSI extension sections indicating that the WSI-specific structure parameters must be valid, and remove automatically generated valid usage statements now covered by the manual sections (public issue 383). * Clarify render pass compatibility for flink:vkCmdExecuteCommands (public issue 390). Internal Issues: * Update +vk.xml+ to make previously explicit valid usage statements for <<vkDebugReportMessageEXT,vkDebugReportMessageEXT>> implicit instead (internal issue 553). * Add valid usage statement for slink:VkCreateImageInfo preventing creation of 1D sparse images (internal issue 573). * Fix Python scripts to always read/write files in utf-8 encoding, and a logic error in reflib.py which could cause a fatal error for malstructured asciidoc (internal issues 578, 586).
2016-11-26 10:33:44 +00:00
fp = open(curFile, 'r', encoding='utf-8')
2016-02-16 09:53:44 +00:00
for line in fp:
curLine = curLine + 1
# Track changes up and down section headers, and forget
# the current functions/structure when popping up a level
match = sectionPat.search(line)
if (match):
Change log for May 20, 2017 Vulkan 1.0.50 spec update: * Bump API patch number and header version number to 50 for this update. Github Issues: * Fix numerous minor issues with the VK_EXT_debug_report extension (public issues 478, 483, 486, 489, 490). Internal Issues: * Update flink:vkAllocateDescriptorSets to specify conditions under which to return ename:VK_ERROR_FRAGMENTED_POOL or ename:VK_ERROR_OUT_OF_POOL_MEMORY instead of out-of-host/out-of-device-memory, and improve the <<fundamentals-errorcodes, description of those errors (internal issue 654). * Add a NOTE documenting that flink:vkAcquireNextImageKHR can only signal a single semaphore, and how to deal with that when multiple physical devices in a logical device need to wait on it (internal issue 730). * Improve description of pname:pNext chains of slink:VkPhysicalDeviceImageFormatInfo2KHR and slink:VkImageFormatProperties2KHR (internal issue 814). * Clean up math markup issues in the <<textures, Image Operations>> chapter (internal issue 818). * Update validusage target to use more robust code for preprocessing, by making direct use of Asciidoctor's preprocessor. Added uniqueItems check to JSON vu schema and add clean_validusage target (internal issue 826). * Update style guide to prohibit writing non-self-contained (on a single bullet point) Valid Usage statements, and modify offending Valid Usage statements in the Specification to match, to assist with automatic extraction for the validation layers (internal issue 828). * Add ename:VK_VALIDATION_CHECK_SHADERS_EXT to elink:VkValidationCheckEXT of the `VK_EXT_validation_flags` extension, to selectively disable shader validation. * Remove duplicate valid usage statement for slink:VkImageMemoryBarrier. * Modify reflow.py script to place VUID tag anchors standalone on a line following their corresponding bullet point, and reflow the spec text accordingly (this had been pending since the initial tag deployment). New Extensions: * `VK_AMD_texture_gather_bias_lod`
2017-05-21 00:00:50 +00:00
info('Match sectionPat for line:', line)
2016-02-16 09:53:44 +00:00
depth = len(match.group(1))
if (depth < sectionDepth):
info('Resetting current function/structure for section:', line)
curFuncs = []
curStruct = None
sectionDepth = depth
match = pathPat.search(line)
if (match):
incpath = match.group(1)
Change log for May 20, 2017 Vulkan 1.0.50 spec update: * Bump API patch number and header version number to 50 for this update. Github Issues: * Fix numerous minor issues with the VK_EXT_debug_report extension (public issues 478, 483, 486, 489, 490). Internal Issues: * Update flink:vkAllocateDescriptorSets to specify conditions under which to return ename:VK_ERROR_FRAGMENTED_POOL or ename:VK_ERROR_OUT_OF_POOL_MEMORY instead of out-of-host/out-of-device-memory, and improve the <<fundamentals-errorcodes, description of those errors (internal issue 654). * Add a NOTE documenting that flink:vkAcquireNextImageKHR can only signal a single semaphore, and how to deal with that when multiple physical devices in a logical device need to wait on it (internal issue 730). * Improve description of pname:pNext chains of slink:VkPhysicalDeviceImageFormatInfo2KHR and slink:VkImageFormatProperties2KHR (internal issue 814). * Clean up math markup issues in the <<textures, Image Operations>> chapter (internal issue 818). * Update validusage target to use more robust code for preprocessing, by making direct use of Asciidoctor's preprocessor. Added uniqueItems check to JSON vu schema and add clean_validusage target (internal issue 826). * Update style guide to prohibit writing non-self-contained (on a single bullet point) Valid Usage statements, and modify offending Valid Usage statements in the Specification to match, to assist with automatic extraction for the validation layers (internal issue 828). * Add ename:VK_VALIDATION_CHECK_SHADERS_EXT to elink:VkValidationCheckEXT of the `VK_EXT_validation_flags` extension, to selectively disable shader validation. * Remove duplicate valid usage statement for slink:VkImageMemoryBarrier. * Modify reflow.py script to place VUID tag anchors standalone on a line following their corresponding bullet point, and reflow the spec text accordingly (this had been pending since the initial tag deployment). New Extensions: * `VK_AMD_texture_gather_bias_lod`
2017-05-21 00:00:50 +00:00
info('Match pathPat for line:', line)
info(' incpath =', incpath)
2016-02-16 09:53:44 +00:00
# An include:: directive. First check if it looks like a
# function or struct include file, and modify the corresponding
# current function or struct state accordingly.
match = incPat.search(incpath)
if (match):
Change log for May 20, 2017 Vulkan 1.0.50 spec update: * Bump API patch number and header version number to 50 for this update. Github Issues: * Fix numerous minor issues with the VK_EXT_debug_report extension (public issues 478, 483, 486, 489, 490). Internal Issues: * Update flink:vkAllocateDescriptorSets to specify conditions under which to return ename:VK_ERROR_FRAGMENTED_POOL or ename:VK_ERROR_OUT_OF_POOL_MEMORY instead of out-of-host/out-of-device-memory, and improve the <<fundamentals-errorcodes, description of those errors (internal issue 654). * Add a NOTE documenting that flink:vkAcquireNextImageKHR can only signal a single semaphore, and how to deal with that when multiple physical devices in a logical device need to wait on it (internal issue 730). * Improve description of pname:pNext chains of slink:VkPhysicalDeviceImageFormatInfo2KHR and slink:VkImageFormatProperties2KHR (internal issue 814). * Clean up math markup issues in the <<textures, Image Operations>> chapter (internal issue 818). * Update validusage target to use more robust code for preprocessing, by making direct use of Asciidoctor's preprocessor. Added uniqueItems check to JSON vu schema and add clean_validusage target (internal issue 826). * Update style guide to prohibit writing non-self-contained (on a single bullet point) Valid Usage statements, and modify offending Valid Usage statements in the Specification to match, to assist with automatic extraction for the validation layers (internal issue 828). * Add ename:VK_VALIDATION_CHECK_SHADERS_EXT to elink:VkValidationCheckEXT of the `VK_EXT_validation_flags` extension, to selectively disable shader validation. * Remove duplicate valid usage statement for slink:VkImageMemoryBarrier. * Modify reflow.py script to place VUID tag anchors standalone on a line following their corresponding bullet point, and reflow the spec text accordingly (this had been pending since the initial tag deployment). New Extensions: * `VK_AMD_texture_gather_bias_lod`
2017-05-21 00:00:50 +00:00
info('Match incPat for line:', line)
2016-02-16 09:53:44 +00:00
# For prototypes, if it is preceded by
# another include:: directive with no intervening link: tags,
# add to the current function list. Otherwise start a new list.
# There is only one current structure.
category = match.group(1)
tag = match.group(2)
# @ Validate tag!
# @ Arguably, any intervening text should shift to accumFuncs = False,
# e.g. only back-to-back includes separated by blank lines would be
# accumulated.
if (category == 'protos'):
if (tag in protos.keys()):
if (accumFunc):
curFuncs.append(tag)
else:
curFuncs = [ tag ]
# Restart accumulating functions
accumFunc = True
info('curFuncs =', curFuncs, 'accumFunc =', accumFunc)
else:
error('include of nonexistent function', tag)
elif (category == 'structs'):
if (tag in structs.keys()):
curStruct = tag
# Any /structs/ include means to stop accumulating /protos/
accumFunc = False
info('curStruct =', curStruct)
else:
error('include of nonexistent struct', tag)
if (follow):
# Actually process the included file now, recursively
newpath = os.path.normpath(os.path.join(inPath, incpath))
info(curFile, ': including file:', newpath)
Change log for November 12, 2018 Vulkan 1.1.92 spec update: * Update release number to 92. Public Issues: * Move and modify valid usage statements dealing with pname:aspectMask in flink:vkCmdClearColorImage, flink:vkCmdClearDepthStencilImage, and slink:VkClearAttachment, so they are in places where all necessary information is available (public issue 529). * Fix math markup in <<textures-texel-anisotropic-filtering, Texel Anisotropic Filtering>> (public pull request 840). * Fix misspellings (public pull request 845). Internal Issues: * Add installation instructions and a Makefile "`chunked`" target for chunked HTML generation (internal issue 1352). * Fix pipeline mesh diagram style; also fix a minor bug in the classic pipeline diagram where vertex/index buffers wrongly fed into the vertex shader (internal issue 1436). * Make asciidoctor ERROR output raise an error, and don't suppress executed command output from CI make invocation (internal issue 1454). * Minor typo fixes and clarifications for `VK_NV_raytracing`. * Cleanup extension-specific properties ** Remove duplicated documentation for pname:maxDiscardRectangles, pname:pointClippingBehavior, and pname:maxVertexAttribDivisor (they shouldn't be documented with the other members of slink:VkPhysicalDeviceLimits at all). ** Remove duplicate anchor for pname:maxVertexAttribDivisor ** Consistently document stext:VkPhysicalDevice<Extension>PropertiesKHR *** Always document pname:sType/pname:pNext (was inconsistent before) *** Always mention chaining to slink:VkPhysicalDeviceProperties2 (and not as slink:VkPhysicalDeviceProperties2KHR) *** Always include Valid Usage statements last * Update Makefile 'checklinks' target and associated scripts, and fix markup problems identified by checkLinks.py, so that we can rely on the checklinks script as part of Gitlab CI.
2018-11-12 12:40:40 +00:00
checkLinks(newpath, follow, paramCheck, included = True, fatalExit = fatalExit)
2016-02-16 09:53:44 +00:00
matches = linkPat.findall(line)
for match in matches:
# Start actual validation work. Depending on what the
# asciidoc tag name is, look up the value in the corresponding
# dictionary.
tag = match[0]
value = match[2]
if (tag == 'fname' or tag == 'flink'):
if (value not in protos.keys()):
Change log for November 12, 2018 Vulkan 1.1.92 spec update: * Update release number to 92. Public Issues: * Move and modify valid usage statements dealing with pname:aspectMask in flink:vkCmdClearColorImage, flink:vkCmdClearDepthStencilImage, and slink:VkClearAttachment, so they are in places where all necessary information is available (public issue 529). * Fix math markup in <<textures-texel-anisotropic-filtering, Texel Anisotropic Filtering>> (public pull request 840). * Fix misspellings (public pull request 845). Internal Issues: * Add installation instructions and a Makefile "`chunked`" target for chunked HTML generation (internal issue 1352). * Fix pipeline mesh diagram style; also fix a minor bug in the classic pipeline diagram where vertex/index buffers wrongly fed into the vertex shader (internal issue 1436). * Make asciidoctor ERROR output raise an error, and don't suppress executed command output from CI make invocation (internal issue 1454). * Minor typo fixes and clarifications for `VK_NV_raytracing`. * Cleanup extension-specific properties ** Remove duplicated documentation for pname:maxDiscardRectangles, pname:pointClippingBehavior, and pname:maxVertexAttribDivisor (they shouldn't be documented with the other members of slink:VkPhysicalDeviceLimits at all). ** Remove duplicate anchor for pname:maxVertexAttribDivisor ** Consistently document stext:VkPhysicalDevice<Extension>PropertiesKHR *** Always document pname:sType/pname:pNext (was inconsistent before) *** Always mention chaining to slink:VkPhysicalDeviceProperties2 (and not as slink:VkPhysicalDeviceProperties2KHR) *** Always include Valid Usage statements last * Update Makefile 'checklinks' target and associated scripts, and fix markup problems identified by checkLinks.py, so that we can rely on the checklinks script as part of Gitlab CI.
2018-11-12 12:40:40 +00:00
foundError('function', tag, value, False)
2016-02-16 09:53:44 +00:00
elif (tag == 'sname' or tag == 'slink'):
if (value not in structs.keys() and
value not in handles.keys()):
Change log for November 12, 2018 Vulkan 1.1.92 spec update: * Update release number to 92. Public Issues: * Move and modify valid usage statements dealing with pname:aspectMask in flink:vkCmdClearColorImage, flink:vkCmdClearDepthStencilImage, and slink:VkClearAttachment, so they are in places where all necessary information is available (public issue 529). * Fix math markup in <<textures-texel-anisotropic-filtering, Texel Anisotropic Filtering>> (public pull request 840). * Fix misspellings (public pull request 845). Internal Issues: * Add installation instructions and a Makefile "`chunked`" target for chunked HTML generation (internal issue 1352). * Fix pipeline mesh diagram style; also fix a minor bug in the classic pipeline diagram where vertex/index buffers wrongly fed into the vertex shader (internal issue 1436). * Make asciidoctor ERROR output raise an error, and don't suppress executed command output from CI make invocation (internal issue 1454). * Minor typo fixes and clarifications for `VK_NV_raytracing`. * Cleanup extension-specific properties ** Remove duplicated documentation for pname:maxDiscardRectangles, pname:pointClippingBehavior, and pname:maxVertexAttribDivisor (they shouldn't be documented with the other members of slink:VkPhysicalDeviceLimits at all). ** Remove duplicate anchor for pname:maxVertexAttribDivisor ** Consistently document stext:VkPhysicalDevice<Extension>PropertiesKHR *** Always document pname:sType/pname:pNext (was inconsistent before) *** Always mention chaining to slink:VkPhysicalDeviceProperties2 (and not as slink:VkPhysicalDeviceProperties2KHR) *** Always include Valid Usage statements last * Update Makefile 'checklinks' target and associated scripts, and fix markup problems identified by checkLinks.py, so that we can rely on the checklinks script as part of Gitlab CI.
2018-11-12 12:40:40 +00:00
foundError('aggregate/scalar/handle/define type', tag, value, False)
2016-02-16 09:53:44 +00:00
elif (tag == 'ename'):
if (value not in consts.keys() and value not in defines.keys()):
Change log for November 12, 2018 Vulkan 1.1.92 spec update: * Update release number to 92. Public Issues: * Move and modify valid usage statements dealing with pname:aspectMask in flink:vkCmdClearColorImage, flink:vkCmdClearDepthStencilImage, and slink:VkClearAttachment, so they are in places where all necessary information is available (public issue 529). * Fix math markup in <<textures-texel-anisotropic-filtering, Texel Anisotropic Filtering>> (public pull request 840). * Fix misspellings (public pull request 845). Internal Issues: * Add installation instructions and a Makefile "`chunked`" target for chunked HTML generation (internal issue 1352). * Fix pipeline mesh diagram style; also fix a minor bug in the classic pipeline diagram where vertex/index buffers wrongly fed into the vertex shader (internal issue 1436). * Make asciidoctor ERROR output raise an error, and don't suppress executed command output from CI make invocation (internal issue 1454). * Minor typo fixes and clarifications for `VK_NV_raytracing`. * Cleanup extension-specific properties ** Remove duplicated documentation for pname:maxDiscardRectangles, pname:pointClippingBehavior, and pname:maxVertexAttribDivisor (they shouldn't be documented with the other members of slink:VkPhysicalDeviceLimits at all). ** Remove duplicate anchor for pname:maxVertexAttribDivisor ** Consistently document stext:VkPhysicalDevice<Extension>PropertiesKHR *** Always document pname:sType/pname:pNext (was inconsistent before) *** Always mention chaining to slink:VkPhysicalDeviceProperties2 (and not as slink:VkPhysicalDeviceProperties2KHR) *** Always include Valid Usage statements last * Update Makefile 'checklinks' target and associated scripts, and fix markup problems identified by checkLinks.py, so that we can rely on the checklinks script as part of Gitlab CI.
2018-11-12 12:40:40 +00:00
foundError('enumerant/constant', tag, value, False)
2016-02-16 09:53:44 +00:00
elif (tag == 'elink'):
if (value not in enums.keys() and value not in flags.keys()):
Change log for November 12, 2018 Vulkan 1.1.92 spec update: * Update release number to 92. Public Issues: * Move and modify valid usage statements dealing with pname:aspectMask in flink:vkCmdClearColorImage, flink:vkCmdClearDepthStencilImage, and slink:VkClearAttachment, so they are in places where all necessary information is available (public issue 529). * Fix math markup in <<textures-texel-anisotropic-filtering, Texel Anisotropic Filtering>> (public pull request 840). * Fix misspellings (public pull request 845). Internal Issues: * Add installation instructions and a Makefile "`chunked`" target for chunked HTML generation (internal issue 1352). * Fix pipeline mesh diagram style; also fix a minor bug in the classic pipeline diagram where vertex/index buffers wrongly fed into the vertex shader (internal issue 1436). * Make asciidoctor ERROR output raise an error, and don't suppress executed command output from CI make invocation (internal issue 1454). * Minor typo fixes and clarifications for `VK_NV_raytracing`. * Cleanup extension-specific properties ** Remove duplicated documentation for pname:maxDiscardRectangles, pname:pointClippingBehavior, and pname:maxVertexAttribDivisor (they shouldn't be documented with the other members of slink:VkPhysicalDeviceLimits at all). ** Remove duplicate anchor for pname:maxVertexAttribDivisor ** Consistently document stext:VkPhysicalDevice<Extension>PropertiesKHR *** Always document pname:sType/pname:pNext (was inconsistent before) *** Always mention chaining to slink:VkPhysicalDeviceProperties2 (and not as slink:VkPhysicalDeviceProperties2KHR) *** Always include Valid Usage statements last * Update Makefile 'checklinks' target and associated scripts, and fix markup problems identified by checkLinks.py, so that we can rely on the checklinks script as part of Gitlab CI.
2018-11-12 12:40:40 +00:00
foundError('enum/bitflag type', tag, value, fatalExit)
# tname and tlink are the same except if the errors are treated as fatal
# They can be recombined once both are error-clean
elif (tag == 'tname'):
if (value not in funcpointers.keys() and value not in flags.keys()):
foundError('function pointer/other type', tag, value, fatalExit)
elif (tag == 'tlink'):
if (value not in funcpointers.keys() and value not in flags.keys()):
foundError('function pointer/other type', tag, value, False)
2016-02-16 09:53:44 +00:00
elif (tag == 'pname'):
# Any pname: tag means to stop accumulating /protos/
accumFunc = False
# See if this parameter is in the current proto(s) and struct
foundParam = False
if (curStruct and value in structs[curStruct]):
info('parameter', value, 'found in struct', curStruct)
elif (curFuncs and findParam(value, curFuncs)):
True
else:
Change log for November 12, 2018 Vulkan 1.1.92 spec update: * Update release number to 92. Public Issues: * Move and modify valid usage statements dealing with pname:aspectMask in flink:vkCmdClearColorImage, flink:vkCmdClearDepthStencilImage, and slink:VkClearAttachment, so they are in places where all necessary information is available (public issue 529). * Fix math markup in <<textures-texel-anisotropic-filtering, Texel Anisotropic Filtering>> (public pull request 840). * Fix misspellings (public pull request 845). Internal Issues: * Add installation instructions and a Makefile "`chunked`" target for chunked HTML generation (internal issue 1352). * Fix pipeline mesh diagram style; also fix a minor bug in the classic pipeline diagram where vertex/index buffers wrongly fed into the vertex shader (internal issue 1436). * Make asciidoctor ERROR output raise an error, and don't suppress executed command output from CI make invocation (internal issue 1454). * Minor typo fixes and clarifications for `VK_NV_raytracing`. * Cleanup extension-specific properties ** Remove duplicated documentation for pname:maxDiscardRectangles, pname:pointClippingBehavior, and pname:maxVertexAttribDivisor (they shouldn't be documented with the other members of slink:VkPhysicalDeviceLimits at all). ** Remove duplicate anchor for pname:maxVertexAttribDivisor ** Consistently document stext:VkPhysicalDevice<Extension>PropertiesKHR *** Always document pname:sType/pname:pNext (was inconsistent before) *** Always mention chaining to slink:VkPhysicalDeviceProperties2 (and not as slink:VkPhysicalDeviceProperties2KHR) *** Always include Valid Usage statements last * Update Makefile 'checklinks' target and associated scripts, and fix markup problems identified by checkLinks.py, so that we can rely on the checklinks script as part of Gitlab CI.
2018-11-12 12:40:40 +00:00
if paramCheck:
warning('parameter', value, 'not found. curStruct =',
curStruct, 'curFuncs =', curFuncs)
2016-02-16 09:53:44 +00:00
else:
# This is a logic error
error('unknown tag', tag + ':' + value)
fp.close()
if (errCount > 0 or warnCount > 0):
if (not included):
print('Errors found:', errCount, 'Warnings found:', warnCount)
print('')
if (included):
info('----- returning from:', infile, 'to parent file', '-----')
# Don't generate any output for files without errors
# else:
# print(curFile + ': No errors found')
# Restore global state before exiting the function
curFile = oldCurFile
curLine = oldCurLine
if __name__ == '__main__':
follow = False
Change log for November 12, 2018 Vulkan 1.1.92 spec update: * Update release number to 92. Public Issues: * Move and modify valid usage statements dealing with pname:aspectMask in flink:vkCmdClearColorImage, flink:vkCmdClearDepthStencilImage, and slink:VkClearAttachment, so they are in places where all necessary information is available (public issue 529). * Fix math markup in <<textures-texel-anisotropic-filtering, Texel Anisotropic Filtering>> (public pull request 840). * Fix misspellings (public pull request 845). Internal Issues: * Add installation instructions and a Makefile "`chunked`" target for chunked HTML generation (internal issue 1352). * Fix pipeline mesh diagram style; also fix a minor bug in the classic pipeline diagram where vertex/index buffers wrongly fed into the vertex shader (internal issue 1436). * Make asciidoctor ERROR output raise an error, and don't suppress executed command output from CI make invocation (internal issue 1454). * Minor typo fixes and clarifications for `VK_NV_raytracing`. * Cleanup extension-specific properties ** Remove duplicated documentation for pname:maxDiscardRectangles, pname:pointClippingBehavior, and pname:maxVertexAttribDivisor (they shouldn't be documented with the other members of slink:VkPhysicalDeviceLimits at all). ** Remove duplicate anchor for pname:maxVertexAttribDivisor ** Consistently document stext:VkPhysicalDevice<Extension>PropertiesKHR *** Always document pname:sType/pname:pNext (was inconsistent before) *** Always mention chaining to slink:VkPhysicalDeviceProperties2 (and not as slink:VkPhysicalDeviceProperties2KHR) *** Always include Valid Usage statements last * Update Makefile 'checklinks' target and associated scripts, and fix markup problems identified by checkLinks.py, so that we can rely on the checklinks script as part of Gitlab CI.
2018-11-12 12:40:40 +00:00
paramCheck = False
included = False
fatalExit = False
totalErrCount = 0
totalWarnCount = 0
2016-02-16 09:53:44 +00:00
if (len(sys.argv) > 1):
for file in sys.argv[1:]:
if (file == '-follow'):
follow = True
elif (file == '-info'):
printInfo = True
Change log for November 12, 2018 Vulkan 1.1.92 spec update: * Update release number to 92. Public Issues: * Move and modify valid usage statements dealing with pname:aspectMask in flink:vkCmdClearColorImage, flink:vkCmdClearDepthStencilImage, and slink:VkClearAttachment, so they are in places where all necessary information is available (public issue 529). * Fix math markup in <<textures-texel-anisotropic-filtering, Texel Anisotropic Filtering>> (public pull request 840). * Fix misspellings (public pull request 845). Internal Issues: * Add installation instructions and a Makefile "`chunked`" target for chunked HTML generation (internal issue 1352). * Fix pipeline mesh diagram style; also fix a minor bug in the classic pipeline diagram where vertex/index buffers wrongly fed into the vertex shader (internal issue 1436). * Make asciidoctor ERROR output raise an error, and don't suppress executed command output from CI make invocation (internal issue 1454). * Minor typo fixes and clarifications for `VK_NV_raytracing`. * Cleanup extension-specific properties ** Remove duplicated documentation for pname:maxDiscardRectangles, pname:pointClippingBehavior, and pname:maxVertexAttribDivisor (they shouldn't be documented with the other members of slink:VkPhysicalDeviceLimits at all). ** Remove duplicate anchor for pname:maxVertexAttribDivisor ** Consistently document stext:VkPhysicalDevice<Extension>PropertiesKHR *** Always document pname:sType/pname:pNext (was inconsistent before) *** Always mention chaining to slink:VkPhysicalDeviceProperties2 (and not as slink:VkPhysicalDeviceProperties2KHR) *** Always include Valid Usage statements last * Update Makefile 'checklinks' target and associated scripts, and fix markup problems identified by checkLinks.py, so that we can rely on the checklinks script as part of Gitlab CI.
2018-11-12 12:40:40 +00:00
elif file == '-paramcheck':
paramCheck = True
elif (file == '-fatal'):
fatalExit = True
2016-02-16 09:53:44 +00:00
else:
initChecks()
Change log for November 12, 2018 Vulkan 1.1.92 spec update: * Update release number to 92. Public Issues: * Move and modify valid usage statements dealing with pname:aspectMask in flink:vkCmdClearColorImage, flink:vkCmdClearDepthStencilImage, and slink:VkClearAttachment, so they are in places where all necessary information is available (public issue 529). * Fix math markup in <<textures-texel-anisotropic-filtering, Texel Anisotropic Filtering>> (public pull request 840). * Fix misspellings (public pull request 845). Internal Issues: * Add installation instructions and a Makefile "`chunked`" target for chunked HTML generation (internal issue 1352). * Fix pipeline mesh diagram style; also fix a minor bug in the classic pipeline diagram where vertex/index buffers wrongly fed into the vertex shader (internal issue 1436). * Make asciidoctor ERROR output raise an error, and don't suppress executed command output from CI make invocation (internal issue 1454). * Minor typo fixes and clarifications for `VK_NV_raytracing`. * Cleanup extension-specific properties ** Remove duplicated documentation for pname:maxDiscardRectangles, pname:pointClippingBehavior, and pname:maxVertexAttribDivisor (they shouldn't be documented with the other members of slink:VkPhysicalDeviceLimits at all). ** Remove duplicate anchor for pname:maxVertexAttribDivisor ** Consistently document stext:VkPhysicalDevice<Extension>PropertiesKHR *** Always document pname:sType/pname:pNext (was inconsistent before) *** Always mention chaining to slink:VkPhysicalDeviceProperties2 (and not as slink:VkPhysicalDeviceProperties2KHR) *** Always include Valid Usage statements last * Update Makefile 'checklinks' target and associated scripts, and fix markup problems identified by checkLinks.py, so that we can rely on the checklinks script as part of Gitlab CI.
2018-11-12 12:40:40 +00:00
checkLinks(file,
follow,
paramCheck = paramCheck,
included = included,
fatalExit = fatalExit)
totalErrCount = totalErrCount + errCount
totalWarnCount = totalWarnCount + warnCount
2016-02-16 09:53:44 +00:00
else:
Change log for November 12, 2018 Vulkan 1.1.92 spec update: * Update release number to 92. Public Issues: * Move and modify valid usage statements dealing with pname:aspectMask in flink:vkCmdClearColorImage, flink:vkCmdClearDepthStencilImage, and slink:VkClearAttachment, so they are in places where all necessary information is available (public issue 529). * Fix math markup in <<textures-texel-anisotropic-filtering, Texel Anisotropic Filtering>> (public pull request 840). * Fix misspellings (public pull request 845). Internal Issues: * Add installation instructions and a Makefile "`chunked`" target for chunked HTML generation (internal issue 1352). * Fix pipeline mesh diagram style; also fix a minor bug in the classic pipeline diagram where vertex/index buffers wrongly fed into the vertex shader (internal issue 1436). * Make asciidoctor ERROR output raise an error, and don't suppress executed command output from CI make invocation (internal issue 1454). * Minor typo fixes and clarifications for `VK_NV_raytracing`. * Cleanup extension-specific properties ** Remove duplicated documentation for pname:maxDiscardRectangles, pname:pointClippingBehavior, and pname:maxVertexAttribDivisor (they shouldn't be documented with the other members of slink:VkPhysicalDeviceLimits at all). ** Remove duplicate anchor for pname:maxVertexAttribDivisor ** Consistently document stext:VkPhysicalDevice<Extension>PropertiesKHR *** Always document pname:sType/pname:pNext (was inconsistent before) *** Always mention chaining to slink:VkPhysicalDeviceProperties2 (and not as slink:VkPhysicalDeviceProperties2KHR) *** Always include Valid Usage statements last * Update Makefile 'checklinks' target and associated scripts, and fix markup problems identified by checkLinks.py, so that we can rely on the checklinks script as part of Gitlab CI.
2018-11-12 12:40:40 +00:00
print('Need arguments: [-follow] [-info] [-paramcheck] [-fatal] infile [infile...]', file=sys.stderr)
if (totalErrCount > 0 or totalWarnCount > 0):
if (not included):
print('TOTAL Errors found:', totalErrCount, 'Warnings found:',
totalWarnCount)
if totalErrCount > 0:
sys.exit(1)