Update for Vulkan-Docs 1.1.107

This commit is contained in:
Jon Leech
2019-04-16 05:57:09 -07:00
committed by Jon Leech
parent 08cbb5458f
commit 171949d26d
9 changed files with 1638 additions and 1541 deletions

View File

@@ -101,9 +101,8 @@ class ConventionsBase(ABC):
"""Return suffix of generated Asciidoctor files"""
raise NotImplementedError
@property
@abstractmethod
def api_name(self):
def api_name(self, spectype = None):
"""Return API name"""
raise NotImplementedError

View File

@@ -516,9 +516,10 @@ class OutputGenerator:
# Generator can be used without writing to a file.
if self.genOpts.filename is not None:
if sys.platform == 'win32':
if not os.path.exists(self.genOpts.directory):
directory = Path(self.genOpts.directory)
if not Path.exists(directory):
os.makedirs(directory)
self.outFile = io.open(self.genOpts.directory + '/' + self.genOpts.filename, 'w', encoding='utf-8')
self.outFile = (directory / self.genOpts.filename).open('w', encoding='utf-8')
else:
filename = self.genOpts.directory + '/' + self.genOpts.filename
self.outFile = io.open(filename, 'w', encoding='utf-8')

View File

@@ -14,20 +14,28 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import argparse, cProfile, pdb, string, sys, time
from reg import *
from generator import write
import argparse
import pdb
import re
import sys
import time
import xml.etree.ElementTree as etree
from cgenerator import CGeneratorOptions, COutputGenerator
from docgenerator import DocGeneratorOptions, DocOutputGenerator
from extensionmetadocgenerator import ExtensionMetaDocGeneratorOptions, ExtensionMetaDocOutputGenerator
from pygenerator import PyOutputGenerator
from validitygenerator import ValidityOutputGenerator
from extensionmetadocgenerator import (ExtensionMetaDocGeneratorOptions,
ExtensionMetaDocOutputGenerator)
from generator import write
from hostsyncgenerator import HostSynchronizationOutputGenerator
from pygenerator import PyOutputGenerator
from reg import Registry
from validitygenerator import ValidityOutputGenerator
from vkconventions import VulkanConventions
# Simple timer functions
startTime = None
def startTimer(timeit):
global startTime
if timeit:
@@ -42,7 +50,7 @@ def endTimer(timeit, msg):
# Turn a list of strings into a regexp string matching exactly those strings
def makeREstring(list, default = None):
if len(list) > 0 or default == None:
if len(list) > 0 or default is None:
return '^(' + '|'.join(list) + ')$'
else:
return default
@@ -79,8 +87,7 @@ def makeGenOpts(args):
# Descriptive names for various regexp patterns used to select
# versions and extensions
allFeatures = allExtensions = '.*'
noFeatures = noExtensions = None
allFeatures = allExtensions = r'.*'
# Turn lists of names/patterns into matching regular expressions
addExtensionsPat = makeREstring(extensions, None)
@@ -119,8 +126,6 @@ def makeGenOpts(args):
# Defaults for generating re-inclusion protection wrappers (or not)
protectFile = protect
protectFeature = protect
protectProto = protect
# An API style conventions object
conventions = VulkanConventions()
@@ -403,12 +408,10 @@ def makeGenOpts(args):
# extensions - list of additional extensions to include in generated
# interfaces
def genTarget(args):
global genOpts
# Create generator options with specified parameters
makeGenOpts(args)
if args.target in genOpts.keys():
if args.target in genOpts:
createGenerator = genOpts[args.target][0]
options = genOpts[args.target][1]
@@ -435,6 +438,7 @@ def genTarget(args):
write('No generator options for unknown target:',
args.target, file=sys.stderr)
# -feature name
# -extension name
# For both, "name" may be a single name, or a space-separated list

View File

@@ -183,6 +183,9 @@ class FeatureInfo(BaseInfo):
self.version = "0"
self.versionNumber = "0"
self.number = elem.get('number')
# If there's no 'number' attribute, use 0, so sorting works
if self.number is None:
self.number = 0
self.supported = elem.get('supported')
self.emit = False
@@ -655,7 +658,7 @@ class Registry:
self.gen.logMsg('diag', 'markRequired: command implicitly requires dependent type', type_elem.text)
self.markTypeRequired(type_elem.text, required)
else:
self.gen.logMsg('warn', 'command:', name, 'IS NOT DEFINED')
self.gen.logMsg('warn', 'command:', cmdname, 'IS NOT DEFINED')
# featurename - name of the feature
# feature - Element for <require> or <remove> tag
@@ -982,7 +985,7 @@ class Registry:
# being generated. Add extensions matching the pattern specified in
# regExtensions, then remove extensions matching the pattern
# specified in regRemoveExtensions
for (extName,ei) in sorted(self.extdict.items(),key = lambda x : x[1].number):
for (extName,ei) in sorted(self.extdict.items(),key = lambda x : x[1].number if x[1].number is not None else '0'):
extName = ei.name
include = False

File diff suppressed because it is too large Load Diff

View File

@@ -153,7 +153,7 @@ server.
<type category="define">// Vulkan 1.1 version number
#define <name>VK_API_VERSION_1_1</name> <type>VK_MAKE_VERSION</type>(1, 1, 0)// Patch version should always be set to 0</type>
<type category="define">// Version of this file
#define <name>VK_HEADER_VERSION</name> 106</type>
#define <name>VK_HEADER_VERSION</name> 107</type>
<type category="define">
#define <name>VK_DEFINE_HANDLE</name>(object) typedef struct object##_T* object;</type>
@@ -285,6 +285,7 @@ typedef void <name>CAMetalLayer</name>;
<type category="bitmask">typedef <type>VkFlags</type> <name>VkMetalSurfaceCreateFlagsEXT</name>;</type>
<type category="bitmask">typedef <type>VkFlags</type> <name>VkImagePipeSurfaceCreateFlagsFUCHSIA</name>;</type>
<type category="bitmask">typedef <type>VkFlags</type> <name>VkStreamDescriptorSurfaceCreateFlagsGGP</name>;</type>
<type category="bitmask">typedef <type>VkFlags</type> <name>VkHeadlessSurfaceCreateFlagsEXT</name>;</type>
<type requires="VkPeerMemoryFeatureFlagBits" category="bitmask">typedef <type>VkFlags</type> <name>VkPeerMemoryFeatureFlags</name>;</type>
<type category="bitmask" name="VkPeerMemoryFeatureFlagsKHR" alias="VkPeerMemoryFeatureFlags"/>
<type requires="VkMemoryAllocateFlagBits" category="bitmask">typedef <type>VkFlags</type> <name>VkMemoryAllocateFlags</name>;</type>
@@ -3859,6 +3860,11 @@ typedef void <name>CAMetalLayer</name>;
<member><type>void</type>* <name>pNext</name></member>
<member><type>VkBool32</type> <name>fullScreenExclusiveSupported</name></member>
</type>
<type category="struct" name="VkHeadlessSurfaceCreateInfoEXT">
<member values="VK_STRUCTURE_TYPE_HEADLESS_SURFACE_CREATE_INFO_EXT"><type>VkStructureType</type> <name>sType</name></member>
<member>const <type>void</type>* <name>pNext</name></member>
<member optional="true"><type>VkHeadlessSurfaceCreateFlagsEXT</type> <name>flags</name></member>
</type>
</types>
<comment>Vulkan enumerant (token) definitions</comment>
@@ -6330,26 +6336,6 @@ typedef void <name>CAMetalLayer</name>;
<param><type>VkExternalMemoryHandleTypeFlagsNV</type> <name>handleType</name></param>
<param><type>HANDLE</type>* <name>pHandle</name></param>
</command>
<command queues="graphics" renderpass="inside" cmdbufferlevel="primary,secondary" pipeline="graphics">
<proto><type>void</type> <name>vkCmdDrawIndirectCountAMD</name></proto>
<param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
<param><type>VkBuffer</type> <name>buffer</name></param>
<param><type>VkDeviceSize</type> <name>offset</name></param>
<param><type>VkBuffer</type> <name>countBuffer</name></param>
<param><type>VkDeviceSize</type> <name>countBufferOffset</name></param>
<param><type>uint32_t</type> <name>maxDrawCount</name></param>
<param><type>uint32_t</type> <name>stride</name></param>
</command>
<command queues="graphics" renderpass="inside" cmdbufferlevel="primary,secondary" pipeline="graphics">
<proto><type>void</type> <name>vkCmdDrawIndexedIndirectCountAMD</name></proto>
<param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
<param><type>VkBuffer</type> <name>buffer</name></param>
<param><type>VkDeviceSize</type> <name>offset</name></param>
<param><type>VkBuffer</type> <name>countBuffer</name></param>
<param><type>VkDeviceSize</type> <name>countBufferOffset</name></param>
<param><type>uint32_t</type> <name>maxDrawCount</name></param>
<param><type>uint32_t</type> <name>stride</name></param>
</command>
<command queues="graphics,compute" renderpass="inside" cmdbufferlevel="primary,secondary">
<proto><type>void</type> <name>vkCmdProcessCommandsNVX</name></proto>
<param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
@@ -7073,6 +7059,7 @@ typedef void <name>CAMetalLayer</name>;
<param><type>uint32_t</type> <name>maxDrawCount</name></param>
<param><type>uint32_t</type> <name>stride</name></param>
</command>
<command name="vkCmdDrawIndirectCountAMD" alias="vkCmdDrawIndirectCountKHR"/>
<command queues="graphics" renderpass="inside" cmdbufferlevel="primary,secondary" pipeline="graphics">
<proto><type>void</type> <name>vkCmdDrawIndexedIndirectCountKHR</name></proto>
<param externsync="true"><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
@@ -7083,6 +7070,7 @@ typedef void <name>CAMetalLayer</name>;
<param><type>uint32_t</type> <name>maxDrawCount</name></param>
<param><type>uint32_t</type> <name>stride</name></param>
</command>
<command name="vkCmdDrawIndexedIndirectCountAMD" alias="vkCmdDrawIndexedIndirectCountKHR"/>
<command queues="graphics,compute,transfer" renderpass="both" cmdbufferlevel="primary,secondary">
<proto><type>void</type> <name>vkCmdSetCheckpointNV</name></proto>
<param><type>VkCommandBuffer</type> <name>commandBuffer</name></param>
@@ -7342,7 +7330,13 @@ typedef void <name>CAMetalLayer</name>;
<param><type>VkDevice</type> <name>device</name></param>
<param><type>VkSwapchainKHR</type> <name>swapchain</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>vkCreateHeadlessSurfaceEXT</name></proto>
<param><type>VkInstance</type> <name>instance</name></param>
<param>const <type>VkHeadlessSurfaceCreateInfoEXT</type>* <name>pCreateInfo</name></param>
<param optional="true">const <type>VkAllocationCallbacks</type>* <name>pAllocator</name></param>
<param><type>VkSurfaceKHR</type>* <name>pSurface</name></param>
</command>
</commands>
<feature api="vulkan" name="VK_VERSION_1_0" number="1.0" comment="Vulkan core API interface definitions">
@@ -8315,9 +8309,9 @@ typedef void <name>CAMetalLayer</name>;
<enum value="&quot;VK_AMD_negative_viewport_height&quot;" name="VK_AMD_NEGATIVE_VIEWPORT_HEIGHT_EXTENSION_NAME"/>
</require>
</extension>
<extension name="VK_AMD_gpu_shader_half_float" number="37" type="device" author="AMD" contact="Dominik Witczak @dominikwitczakamd" supported="vulkan">
<extension name="VK_AMD_gpu_shader_half_float" number="37" type="device" author="AMD" contact="Dominik Witczak @dominikwitczakamd" supported="vulkan" deprecatedby="VK_KHR_shader_float16_int8">
<require>
<enum value="1" name="VK_AMD_GPU_SHADER_HALF_FLOAT_SPEC_VERSION"/>
<enum value="2" name="VK_AMD_GPU_SHADER_HALF_FLOAT_SPEC_VERSION"/>
<enum value="&quot;VK_AMD_gpu_shader_half_float&quot;" name="VK_AMD_GPU_SHADER_HALF_FLOAT_EXTENSION_NAME"/>
</require>
</extension>
@@ -9463,9 +9457,9 @@ typedef void <name>CAMetalLayer</name>;
<enum value="&quot;VK_KHR_storage_buffer_storage_class&quot;" name="VK_KHR_STORAGE_BUFFER_STORAGE_CLASS_EXTENSION_NAME"/>
</require>
</extension>
<extension name="VK_AMD_gpu_shader_int16" number="133" type="device" author="AMD" contact="Qun Lin @linqun" supported="vulkan">
<extension name="VK_AMD_gpu_shader_int16" number="133" type="device" author="AMD" contact="Qun Lin @linqun" supported="vulkan" deprecatedby="VK_KHR_shader_float16_int8">
<require>
<enum value="1" name="VK_AMD_GPU_SHADER_INT16_SPEC_VERSION"/>
<enum value="2" name="VK_AMD_GPU_SHADER_INT16_SPEC_VERSION"/>
<enum value="&quot;VK_AMD_gpu_shader_int16&quot;" name="VK_AMD_GPU_SHADER_INT16_EXTENSION_NAME"/>
</require>
</extension>
@@ -10717,7 +10711,7 @@ typedef void <name>CAMetalLayer</name>;
<command name="vkAcquireFullScreenExclusiveModeEXT"/>
<command name="vkReleaseFullScreenExclusiveModeEXT"/>
</require>
<require feature="VK_KHR_win32_surface">
<require extension="VK_KHR_win32_surface">
<enum offset="1" extends="VkStructureType" name="VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_WIN32_INFO_EXT"/>
<type name="VkSurfaceFullScreenExclusiveWin32InfoEXT"/>
</require>
@@ -10725,10 +10719,14 @@ typedef void <name>CAMetalLayer</name>;
<command name="vkGetDeviceGroupSurfacePresentModes2EXT"/>
</require>
</extension>
<extension name="VK_EXT_extension_257" number="257" author="EXT" contact="Jan-Harald Fredriksen @janharaldfredriksen-arm" supported="disabled">
<extension name="VK_EXT_headless_surface" number="257" type="instance" requires="VK_KHR_surface" author="EXT" contact="Ray Smith @raysmith-arm" supported="vulkan">
<require>
<enum value="0" name="VK_EXT_EXTENSION_257_SPEC_VERSION"/>
<enum value="&quot;VK_EXT_extension_257&quot;" name="VK_EXT_EXTENSION_257_EXTENSION_NAME"/>
<enum value="0" name="VK_EXT_HEADLESS_SURFACE_SPEC_VERSION"/>
<enum value="&quot;VK_EXT_headless_surface&quot;" name="VK_EXT_HEADLESS_SURFACE_EXTENSION_NAME"/>
<enum offset="0" extends="VkStructureType" name="VK_STRUCTURE_TYPE_HEADLESS_SURFACE_CREATE_INFO_EXT"/>
<type name="VkHeadlessSurfaceCreateFlagsEXT"/>
<type name="VkHeadlessSurfaceCreateInfoEXT"/>
<command name="vkCreateHeadlessSurfaceEXT"/>
</require>
</extension>
<extension name="VK_EXT_extension_258" number="258" author="EXT" contact="Jan-Harald Fredriksen @janharaldfredriksen-arm" supported="disabled">

View File

@@ -17,6 +17,8 @@
# Working-group-specific style conventions,
# used in generation.
import re
from conventions import ConventionsBase
@@ -66,6 +68,17 @@ class VulkanConventions(ConventionsBase):
"""Determine if member type and name match the next pointer chain member."""
return paramtype == 'void' and paramname == self.nextpointer_member_name
def generate_structure_type_from_name(self, structname):
"""Generate a structure type name, like VK_STRUCTURE_TYPE_CREATE_INSTANCE_INFO"""
structure_type_parts = []
# Tokenize into "words"
for elem in re.findall(r'(([A-Z][a-z]+)|([A-Z][A-Z]+))', structname):
if elem[0] == 'Vk':
structure_type_parts.append('VK_STRUCTURE_TYPE')
else:
structure_type_parts.append(elem[0].upper())
return '_'.join(structure_type_parts)
@property
def warning_comment(self):
"""Return warning comment to be placed in header of generated Asciidoctor files"""
@@ -76,10 +89,18 @@ class VulkanConventions(ConventionsBase):
"""Return suffix of generated Asciidoctor files"""
return '.txt'
@property
def api_name(self):
"""Return API name"""
return 'Vulkan'
def api_name(self, spectype = 'api'):
"""Return API or specification name for citations in ref pages.ref
pages should link to for
spectype is the spec this refpage is for: 'api' is the Vulkan API
Specification. Defaults to 'api'. If an unrecognized spectype is
given, returns None.
"""
if spectype == 'api' or spectype is None:
return 'Vulkan'
else:
return None
@property
def xml_supported_name_of_api(self):
@@ -158,8 +179,7 @@ class VulkanConventions(ConventionsBase):
"""
return tail
@property
def specURL(self):
def specURL(self, spectype = 'api'):
"""Return public registry URL which ref pages should link to for the
current all-extensions HTML specification, so xrefs in the
asciidoc source that aren't to ref pages can link into it