Commit 511f6521 by Rémi Verschelde

SCons: Streamline Vulkan buildsystem + fixups

- Renamed option to `builtin_vulkan`, since that's the name of the library and if we were to add new components, we'd likely use that same option. - Merge `vulkan_loader/SCsub` in `vulkan/SCsub`. - Accordingly, don't use built-in Vulkan headers when not building against the built-in loader library. - Drop Vulkan registry which we don't appear to need currently. - Style and permission fixes.
parent 32408247
......@@ -155,7 +155,7 @@ opts.Add(BoolVariable('builtin_pcre2_with_jit', "Use JIT compiler for the built-
opts.Add(BoolVariable('builtin_recast', "Use the built-in Recast library", True))
opts.Add(BoolVariable('builtin_rvo2', "Use the built-in RVO2 library", True))
opts.Add(BoolVariable('builtin_squish', "Use the built-in squish library", True))
opts.Add(BoolVariable('builtin_vulkan_loader', "Use the built-in Vulkan loader library", True))
opts.Add(BoolVariable('builtin_vulkan', "Use the built-in Vulkan loader library and headers", True))
opts.Add(BoolVariable('builtin_xatlas', "Use the built-in xatlas library", True))
opts.Add(BoolVariable('builtin_zlib', "Use the built-in zlib library", True))
opts.Add(BoolVariable('builtin_zstd', "Use the built-in Zstd library", True))
......
......@@ -22,9 +22,6 @@ SConscript('alsamidi/SCsub')
SConscript('coremidi/SCsub')
SConscript('winmidi/SCsub')
if env["builtin_vulkan_loader"] and not (env["platform"]=="osx" and env['use_static_mvk']):
SConscript('vulkan_loader/SCsub')
# Graphics drivers
if (env["platform"] != "server"):
# SConscript('gles3/SCsub')
......
......@@ -2,7 +2,60 @@
Import('env')
env.add_source_files(env.drivers_sources,"*.cpp")
env.add_source_files(env.drivers_sources, "*.cpp")
if env['builtin_vulkan']:
# Use bundled Vulkan headers
thirdparty_dir = "#thirdparty/vulkan"
env.Prepend(CPPPATH=[thirdparty_dir + "/include", thirdparty_dir + "/loader"])
#SConscript("shaders/SCsub")
# Build Vulkan loader library
env_thirdparty = env.Clone()
env_thirdparty.disable_warnings()
loader_sources = [
"asm_offset.c",
"cJSON.c",
"debug_utils.c",
"dev_ext_trampoline.c",
"loader.c",
"murmurhash.c",
"phys_dev_ext.c",
"trampoline.c",
"unknown_ext_chain.c",
"wsi.c",
"extension_manual.c",
]
if env['platform'] == "windows":
loader_sources.append("dirent_on_windows.c")
env_thirdparty.AppendUnique(CPPDEFINES=[
'VK_USE_PLATFORM_WIN32_KHR',
'VULKAN_NON_CMAKE_BUILD',
'WIN32_LEAN_AND_MEAN',
'API_NAME=\\"%s\\"' % 'Vulkan'
])
if not env.msvc: # Windows 7+, missing in mingw headers
env_thirdparty.AppendUnique(CPPDEFINES=[
"CM_GETIDLIST_FILTER_CLASS=0x00000200",
"CM_GETIDLIST_FILTER_PRESENT=0x00000100"
])
elif env['platform'] == "osx":
env_thirdparty.AppendUnique(CPPDEFINES=[
'VK_USE_PLATFORM_MACOS_MVK',
'VULKAN_NON_CMAKE_BUILD',
'SYSCONFDIR=\\"%s\\"' % '/etc',
'FALLBACK_DATA_DIRS=\\"%s\\"' % '/usr/local/share:/usr/share',
'FALLBACK_CONFIG_DIRS=\\"%s\\"' % '/etc/xdg'
])
elif env['platform'] == "x11":
env_thirdparty.AppendUnique(CPPDEFINES=[
'VK_USE_PLATFORM_XLIB_KHR',
'VULKAN_NON_CMAKE_BUILD',
'SYSCONFDIR=\\"%s\\"' % '/etc',
'FALLBACK_DATA_DIRS=\\"%s\\"' % '/usr/local/share:/usr/share',
'FALLBACK_CONFIG_DIRS=\\"%s\\"' % '/etc/xdg'
])
loader_sources = [thirdparty_dir + "/loader/" + file for file in loader_sources]
env_thirdparty.add_source_files(env.drivers_sources, loader_sources)
#!/usr/bin/env python
Import('env')
env_vlk_ldr = env.Clone()
loader_dir = "#thirdparty/vulkan/loader/"
loader_sources = [
"asm_offset.c",
"dev_ext_trampoline.c",
"phys_dev_ext.c",
"cJSON.c",
"loader.c",
"trampoline.c",
"unknown_ext_chain.c",
"wsi.c",
"debug_utils.c",
"extension_manual.c",
"murmurhash.c"
]
if (env_vlk_ldr["platform"]=="windows"):
loader_sources.append("dirent_on_windows.c")
env_vlk_ldr.AppendUnique(CPPDEFINES = [
'VK_USE_PLATFORM_WIN32_KHR',
'VULKAN_NON_CMAKE_BUILD',
'WIN32_LEAN_AND_MEAN',
'API_NAME=\\"%s\\"' % 'Vulkan'
])
if not env.msvc: #windows 7+, missing in mingw headers
env_vlk_ldr.AppendUnique(CPPDEFINES = [
"CM_GETIDLIST_FILTER_CLASS=0x00000200",
"CM_GETIDLIST_FILTER_PRESENT=0x00000100"
])
elif (env_vlk_ldr["platform"]=="osx"):
env_vlk_ldr.AppendUnique(CPPDEFINES = [
'VK_USE_PLATFORM_MACOS_MVK',
'VULKAN_NON_CMAKE_BUILD',
'SYSCONFDIR=\\"%s\\"' % '/etc',
'FALLBACK_DATA_DIRS=\\"%s\\"' % '/usr/local/share:/usr/share',
'FALLBACK_CONFIG_DIRS=\\"%s\\"' % '/etc/xdg'
])
elif (env_vlk_ldr["platform"]=="x11"):
env_vlk_ldr.AppendUnique(CPPDEFINES = [
'VK_USE_PLATFORM_XLIB_KHR',
'VULKAN_NON_CMAKE_BUILD',
'SYSCONFDIR=\\"%s\\"' % '/etc',
'FALLBACK_DATA_DIRS=\\"%s\\"' % '/usr/local/share:/usr/share',
'FALLBACK_CONFIG_DIRS=\\"%s\\"' % '/etc/xdg'
])
loader_sources = [loader_dir + file for file in loader_sources]
env_thirdparty = env_vlk_ldr.Clone()
env_thirdparty.add_source_files(env.drivers_sources, loader_sources)
env.Prepend(CPPPATH=[loader_dir])
......@@ -154,16 +154,15 @@ def configure(env):
env.Append(LINKFLAGS=['-framework', 'Cocoa', '-framework', 'Carbon', '-framework', 'AudioUnit', '-framework', 'CoreAudio', '-framework', 'CoreMIDI', '-framework', 'IOKit', '-framework', 'ForceFeedback', '-framework', 'CoreVideo', '-framework', 'AVFoundation', '-framework', 'CoreMedia'])
env.Append(LIBS=['pthread', 'z'])
env.Prepend(CPPPATH=['#thirdparty/vulkan/include/', "#thirdparty/vulkan/registry/"])
env.Append(CPPDEFINES=['VULKAN_ENABLED'])
#env.Append(CPPDEFINES=['GLES_ENABLED', 'OPENGL_ENABLED'])
env.Append(LINKFLAGS=['-framework', 'Metal', '-framework', 'QuartzCore', '-framework', 'IOSurface'])
if (env['use_static_mvk']):
env.Append(LINKFLAGS=['-framework', 'MoltenVK'])
elif not env["builtin_vulkan_loader"]:
env['builtin_vulkan'] = False
elif not env['builtin_vulkan']:
env.Append(LIBS=['vulkan'])
#env.Append(CPPDEFINES=['GLES_ENABLED', 'OPENGL_ENABLED'])
env.Append(CCFLAGS=['-mmacosx-version-min=10.11'])
env.Append(LINKFLAGS=['-mmacosx-version-min=10.11'])
......@@ -224,9 +224,8 @@ def configure_msvc(env, manual_msvc_config):
'shell32', 'advapi32', 'dinput8', 'dxguid', 'imm32', 'bcrypt', 'Avrt',
'dwmapi']
env.Prepend(CPPPATH=['#thirdparty/vulkan/include/', "#thirdparty/vulkan/registry/"])
env.AppendUnique(CPPDEFINES = ['VULKAN_ENABLED'])
if not env["builtin_vulkan_loader"]:
env.AppendUnique(CPPDEFINES=['VULKAN_ENABLED'])
if not env['builtin_vulkan']:
LIBS += ['vulkan']
else:
LIBS += ['cfgmgr32']
......@@ -361,13 +360,12 @@ def configure_mingw(env):
env.Append(CPPDEFINES=[('WINVER', env['target_win_version']), ('_WIN32_WINNT', env['target_win_version'])])
env.Append(LIBS=['mingw32', 'dsound', 'ole32', 'd3d9', 'winmm', 'gdi32', 'iphlpapi', 'shlwapi', 'wsock32', 'ws2_32', 'kernel32', 'oleaut32', 'dinput8', 'dxguid', 'ksuser', 'imm32', 'bcrypt', 'avrt', 'uuid', 'dwmapi'])
env.Prepend(CPPPATH=['#thirdparty/vulkan/include/', "#thirdparty/vulkan/registry/"])
env.Append(CPPDEFINES=['VULKAN_ENABLED'])
if not env["builtin_vulkan_loader"]:
if not env['builtin_vulkan']:
env.Append(LIBS=['vulkan'])
else:
env.Append(LIBS=['cfgmgr32'])
## TODO !!! Reenable when OpenGLES Rendering Device is implemented !!!
#env.Append(CPPDEFINES=['OPENGL_ENABLED'])
env.Append(LIBS=['opengl32'])
......
......@@ -320,10 +320,9 @@ def configure(env):
env.Prepend(CPPPATH=['#platform/x11'])
env.Append(CPPDEFINES=['X11_ENABLED', 'UNIX_ENABLED'])
env.Prepend(CPPPATH=['#thirdparty/vulkan/include/', "#thirdparty/vulkan/registry/"])
env.Append(CPPDEFINES=['VULKAN_ENABLED'])
if not env["builtin_vulkan_loader"]:
env.Append(LIBS=['vulkan'])
if not env['builtin_vulkan']:
env.ParseConfig('pkg-config vulkan --cflags --libs')
#env.Append(CPPDEFINES=['OPENGL_ENABLED'])
env.Append(LIBS=['GL'])
......
# Third party libraries
Please keep categories (`##` level) listed alphabetically and matching their
respective folder names. Use two empty lines to separate categories for
readability.
Subcategories (`###` level) where needed are separated by a single empty line.
## assimp
......@@ -139,6 +144,7 @@ the GLES version Godot targets.
Important: File `glslang/glslang/Include/Common.h` has
Godot-made change marked with `// -- GODOT --` comments.
## jpeg-compressor
- Upstream: https://github.com/richgel999/jpeg-compressor
......@@ -259,25 +265,6 @@ changes to ensure they build for Javascript/HTML5. Those
changes are marked with `// -- GODOT --` comments.
## Vulkan Ecosystem Components (Vulkan ICD loader and headers)
- Upstream: https://github.com/KhronosGroup/Vulkan-Loader
- Version: 1.1.113
- License: Apache 2.0
## wslay
- Upstream: https://github.com/tatsuhiro-t/wslay
- Version: 1.1.0
- License: MIT
File extracted from upstream release tarball:
- All `*.c` and `*.h` in `lib/` and `lib/includes/`
- `wslay.h` has a small Godot addition to fix MSVC build.
See `thirdparty/wslay/msvcfix.diff`
## mbedtls
- Upstream: https://tls.mbed.org/
......@@ -528,6 +515,26 @@ They can be reapplied using the patches included in the `vhacd`
folder.
## vulkan
- Upstream: https://github.com/KhronosGroup/Vulkan-Loader
- Version: 1.1.113
- License: Apache 2.0
Unless there is a specific reason to package a more recent version, please stick
to Vulkan SDK releases (prefixed by `sdk-`) for all components.
NOTE: Use `scripts/update_deps.py --ref <version>` in the Loader git repository
to retrieve the `Vulkan-Headers` repository matching the loader version.
Files extracted from upstream source:
- `Vulkan-Headers/include/` as `include/`
- All `.c` and `.h` files in `loader/` and `loader/generated/`, put in a common
`loader/` folder
- `LICENSE.txt`
## wslay
- Upstream: https://github.com/tatsuhiro-t/wslay
......
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
#!/usr/bin/python3 -i
#
# Copyright (c) 2015-2017, 2019 The Khronos Group Inc.
# Copyright (c) 2015-2017, 2019 Valve Corporation
# Copyright (c) 2015-2017, 2019 LunarG, Inc.
#
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# 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.
#
# Author: Mark Lobodzinski <mark@lunarg.com>
import os,re,sys,string
import xml.etree.ElementTree as etree
from generator import *
from collections import namedtuple
# Copyright text prefixing all headers (list of strings).
prefixStrings = [
'/*',
'** Copyright (c) 2015-2017, 2019 The Khronos Group Inc.',
'** Copyright (c) 2015-2017, 2019 Valve Corporation',
'** Copyright (c) 2015-2017, 2019 LunarG, Inc.',
'** Copyright (c) 2015-2017, 2019 Google Inc.',
'**',
'** 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',
'**',
'** http://www.apache.org/licenses/LICENSE-2.0',
'**',
'** 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.',
'*/',
''
]
platform_dict = {
'android' : 'VK_USE_PLATFORM_ANDROID_KHR',
'fuchsia' : 'VK_USE_PLATFORM_FUCHSIA',
'ggp': 'VK_USE_PLATFORM_GGP',
'ios' : 'VK_USE_PLATFORM_IOS_MVK',
'macos' : 'VK_USE_PLATFORM_MACOS_MVK',
'metal' : 'VK_USE_PLATFORM_METAL_EXT',
'vi' : 'VK_USE_PLATFORM_VI_NN',
'wayland' : 'VK_USE_PLATFORM_WAYLAND_KHR',
'win32' : 'VK_USE_PLATFORM_WIN32_KHR',
'xcb' : 'VK_USE_PLATFORM_XCB_KHR',
'xlib' : 'VK_USE_PLATFORM_XLIB_KHR',
'xlib_xrandr' : 'VK_USE_PLATFORM_XLIB_XRANDR_EXT',
}
#
# Return appropriate feature protect string from 'platform' tag on feature
def GetFeatureProtect(interface):
"""Get platform protection string"""
platform = interface.get('platform')
protect = None
if platform is not None:
protect = platform_dict[platform]
return protect
#!/usr/bin/python3 -i
#
# Copyright (c) 2013-2019 The Khronos Group Inc.
#
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# 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.
# Base class for working-group-specific style conventions,
# used in generation.
from abc import ABCMeta, abstractmethod
ABC = ABCMeta('ABC', (object,), {})
class ConventionsBase(ABC):
"""WG-specific conventions."""
@abstractmethod
def formatExtension(self, name):
"""Mark up a name as an extension for the spec."""
raise NotImplementedError
@property
@abstractmethod
def null(self):
"""Preferred spelling of NULL."""
raise NotImplementedError
def makeProseList(self, elements, connective='and'):
"""Make a (comma-separated) list for use in prose.
Adds a connective (by default, 'and')
before the last element if there are more than 1.
Override with a different method or different call to
_implMakeProseList if you want to add a comma for two elements,
or not use a serial comma.
"""
return self._implMakeProseList(elements, connective)
@property
def struct_macro(self):
"""Get the appropriate format macro for a structure.
May override.
"""
return 'sname:'
def makeStructName(self, name):
"""Prepend the appropriate format macro for a structure to a structure type name.
Uses struct_macro, so just override that if you want to change behavior.
"""
return self.struct_macro + name
@property
def external_macro(self):
"""Get the appropriate format macro for an external type like uint32_t.
May override.
"""
return 'basetype:'
def makeExternalTypeName(self, name):
"""Prepend the appropriate format macro for an external type like uint32_t to a type name.
Uses external_macro, so just override that if you want to change behavior.
"""
return self.external_macro + name
def _implMakeProseList(self, elements, connective, comma_for_two_elts=False, serial_comma=True):
"""Internal-use implementation to make a (comma-separated) list for use in prose.
Adds a connective (by default, 'and')
before the last element if there are more than 1,
and only includes commas if there are more than 2
(if comma_for_two_elts is False).
Don't edit these defaults, override self.makeProseList().
"""
assert(serial_comma) # didn't implement what we didn't need
my_elts = list(elements)
if len(my_elts) > 1:
my_elts[-1] = '{} {}'.format(connective, my_elts[-1])
if not comma_for_two_elts and len(my_elts) <= 2:
return ' '.join(my_elts)
return ', '.join(my_elts)
@property
@abstractmethod
def file_suffix(self):
"""Return suffix of generated Asciidoctor files"""
raise NotImplementedError
@abstractmethod
def api_name(self, spectype = None):
"""Return API name"""
raise NotImplementedError
@property
@abstractmethod
def api_prefix(self):
"""Return API token prefix"""
raise NotImplementedError
@property
@abstractmethod
def api_version_prefix(self):
"""Return API core version token prefix"""
raise NotImplementedError
@property
@abstractmethod
def KHR_prefix(self):
"""Return extension name prefix for KHR extensions"""
raise NotImplementedError
@property
@abstractmethod
def EXT_prefix(self):
"""Return extension name prefix for EXT extensions"""
raise NotImplementedError
#!/bin/bash
python loader_genvk.py -registry vk.xml -scripts . vk_layer_dispatch_table.h
python loader_genvk.py -registry vk.xml -scripts . vk_dispatch_table_helper.h
python loader_genvk.py -registry vk.xml -scripts . vk_object_types.h
python loader_genvk.py -registry vk.xml -scripts . vk_loader_extensions.h
python loader_genvk.py -registry vk.xml -scripts . vk_loader_extensions.c
mv ./*.c ../loader/
mv ./*.h ../loader/
{
"repos" : [
{
"name" : "Vulkan-Headers",
"url" : "https://github.com/KhronosGroup/Vulkan-Headers.git",
"sub_dir" : "Vulkan-Headers",
"build_dir" : "Vulkan-Headers/build",
"install_dir" : "Vulkan-Headers/build/install",
"commit" : "v1.1.113"
}
],
"install_names" : {
"Vulkan-Headers" : "VULKAN_HEADERS_INSTALL_DIR"
}
}
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
#!/usr/bin/python3 -i
#
# Copyright (c) 2013-2019 The Khronos Group Inc.
#
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# 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.
# Working-group-specific style conventions,
# used in generation.
import re
from conventions import ConventionsBase
class VulkanConventions(ConventionsBase):
def formatExtension(self, name):
"""Mark up a name as an extension for the spec."""
return '`<<{}>>`'.format(name)
@property
def null(self):
"""Preferred spelling of NULL."""
return '`NULL`'
@property
def constFlagBits(self):
"""Returns True if static const flag bits should be generated, False if an enumerated type should be generated."""
return False
@property
def struct_macro(self):
return 'sname:'
@property
def external_macro(self):
return 'code:'
@property
def structtype_member_name(self):
"""Return name of the structure type member"""
return 'sType'
@property
def nextpointer_member_name(self):
"""Return name of the structure pointer chain member"""
return 'pNext'
@property
def valid_pointer_prefix(self):
"""Return prefix to pointers which must themselves be valid"""
return 'valid'
def is_structure_type_member(self, paramtype, paramname):
"""Determine if member type and name match the structure type member."""
return paramtype == 'VkStructureType' and paramname == self.structtype_member_name
def is_nextpointer_member(self, paramtype, paramname):
"""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"""
return '// WARNING: DO NOT MODIFY! This file is automatically generated from the vk.xml registry'
@property
def file_suffix(self):
"""Return suffix of generated Asciidoctor files"""
return '.txt'
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):
"""Return the supported= attribute used in API XML"""
return 'vulkan'
@property
def api_prefix(self):
"""Return API token prefix"""
return 'VK_'
@property
def api_version_prefix(self):
"""Return API core version token prefix"""
return 'VK_VERSION_'
@property
def KHR_prefix(self):
"""Return extension name prefix for KHR extensions"""
return 'VK_KHR_'
@property
def EXT_prefix(self):
"""Return extension name prefix for EXT extensions"""
return 'VK_EXT_'
@property
def write_contacts(self):
"""Return whether contact list should be written to extension appendices"""
return True
@property
def write_refpage_include(self):
"""Return whether refpage include should be written to extension appendices"""
return True
def writeFeature(self, featureExtraProtect, filename):
"""Returns True if OutputGenerator.endFeature should write this feature.
Used in COutputGenerator
"""
return True
def requires_error_validation(self, return_type):
"""Returns True if the return_type element is an API result code
requiring error validation.
"""
return False
@property
def required_errors(self):
"""Return a list of required error codes for validation."""
return []
def is_externsync_command(self, protoname):
"""Returns True if the protoname element is an API command requiring
external synchronization
"""
return protoname is not None and 'vkCmd' in protoname
def is_api_name(self, name):
"""Returns True if name is in the reserved API namespace.
For Vulkan, these are names with a case-insensitive 'vk' prefix, or
a 'PFN_vk' function pointer type prefix.
"""
return name[0:2].lower() == 'vk' or name[0:6] == 'PFN_vk'
def is_voidpointer_alias(self, tag, text, tail):
"""Return True if the declaration components (tag,text,tail) of an
element represents a void * type
"""
return tag == 'type' and text == 'void' and tail.startswith('*')
def make_voidpointer_alias(self, tail):
"""Reformat a void * declaration to include the API alias macro.
Vulkan doesn't have an API alias macro, so do nothing.
"""
return tail
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
instead. N.b. this may need to change on a per-refpage basis if
there are multiple documents involved.
"""
return 'https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html'
@property
def xml_api_name(self):
"""Return the name used in the default API XML registry for the default API"""
return 'vulkan'
@property
def registry_path(self):
"""Return relpath to the default API XML registry in this project."""
return 'xml/vk.xml'
@property
def specification_path(self):
"""Return relpath to the Asciidoctor specification sources in this project."""
return '../appendices/meta'
@property
def extra_refpage_headers(self):
"""Return any extra text to add to refpage headers."""
return 'include::../config/attribs.txt[]'
@property
def extension_index_prefixes(self):
"""Return a list of extension prefixes used to group extension refpages."""
return ['VK_KHR', 'VK_EXT', 'VK']
@property
def unified_flag_refpages(self):
"""Returns True if Flags/FlagBits refpages are unified, False if
they're separate.
"""
return False
@property
def spec_reflow_path(self):
"""Return the relative path to the spec source folder to reflow"""
return '.'
@property
def spec_no_reflow_dirs(self):
"""Return a set of directories not to automatically descend into
when reflowing spec text
"""
return ('scripts', 'style')
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment