From 09531f27933bf04bffde9074acb302e026e8f181 Mon Sep 17 00:00:00 2001 From: Jon Leech Date: Fri, 15 May 2020 04:54:44 -0700 Subject: [PATCH] Update for Vulkan-Docs 1.2.141 --- include/vulkan/vulkan.hpp | 157 +++++++++++++++++++++++++++++++------------ include/vulkan/vulkan_core.h | 4 +- registry/genvk.py | 10 +-- registry/reg.py | 23 ++++--- registry/validusage.json | 18 +++-- registry/vk.xml | 24 ++++++- registry/vkconventions.py | 7 +- 7 files changed, 173 insertions(+), 70 deletions(-) diff --git a/include/vulkan/vulkan.hpp b/include/vulkan/vulkan.hpp index eb7f924..68c7cc0 100644 --- a/include/vulkan/vulkan.hpp +++ b/include/vulkan/vulkan.hpp @@ -69,10 +69,6 @@ # if defined(__linux__) || defined(__APPLE__) # include # endif - -# if defined(_WIN32) -# include -# endif #endif #if 201711 <= __cpp_impl_three_way_comparison @@ -83,7 +79,7 @@ #endif -static_assert( VK_HEADER_VERSION == 140 , "Wrong VK_HEADER_VERSION!" ); +static_assert( VK_HEADER_VERSION == 141 , "Wrong VK_HEADER_VERSION!" ); // 32-bit vulkan is not typesafe for handles, so don't allow copy constructors on this platform by default. // To enable this feature on 32-bit platforms please define VULKAN_HPP_TYPESAFE_CONVERSION @@ -247,16 +243,52 @@ namespace VULKAN_HPP_NAMESPACE , m_ptr(list.begin()) {} - template - ArrayProxy(Container const& container) VULKAN_HPP_NOEXCEPT - : m_count(static_cast(container.size())) - , m_ptr(container.data()) + template + ArrayProxy(std::array const & data) VULKAN_HPP_NOEXCEPT + : m_count(N) + , m_ptr(data.data()) + {} + + template ::value, int>::type = 0> + ArrayProxy(std::array::type, N> const & data) VULKAN_HPP_NOEXCEPT + : m_count(N) + , m_ptr(data.data()) + {} + + template + ArrayProxy(std::array & data) VULKAN_HPP_NOEXCEPT + : m_count(N) + , m_ptr(data.data()) + {} + + template ::value, int>::type = 0> + ArrayProxy(std::array::type, N> & data) VULKAN_HPP_NOEXCEPT + : m_count(N) + , m_ptr(data.data()) + {} + + template ::type>> + ArrayProxy(std::vector const & data) VULKAN_HPP_NOEXCEPT + : m_count(static_cast(data.size())) + , m_ptr(data.data()) + {} + + template ::type>, typename B = T, typename std::enable_if::value, int>::type = 0> + ArrayProxy(std::vector::type, Allocator> const& data) VULKAN_HPP_NOEXCEPT + : m_count(static_cast(data.size())) + , m_ptr(data.data()) {} - template - ArrayProxy(Container & container) VULKAN_HPP_NOEXCEPT - : m_count(static_cast(container.size())) - , m_ptr(container.data()) + template ::type>> + ArrayProxy(std::vector & data) VULKAN_HPP_NOEXCEPT + : m_count(static_cast(data.size())) + , m_ptr(data.data()) + {} + + template ::type>, typename B = T, typename std::enable_if::value, int>::type = 0> + ArrayProxy(std::vector::type, Allocator> & data) VULKAN_HPP_NOEXCEPT + : m_count(static_cast(data.size())) + , m_ptr(data.data()) {} const T * begin() const VULKAN_HPP_NOEXCEPT @@ -4593,6 +4625,7 @@ namespace VULKAN_HPP_NAMESPACE eGoogleSwiftshader = VK_DRIVER_ID_GOOGLE_SWIFTSHADER, eGgpProprietary = VK_DRIVER_ID_GGP_PROPRIETARY, eBroadcomProprietary = VK_DRIVER_ID_BROADCOM_PROPRIETARY, + eMesaLlvmpipe = VK_DRIVER_ID_MESA_LLVMPIPE, eIntelOpenSourceMesa = VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESA_KHR }; using DriverIdKHR = DriverId; @@ -4613,6 +4646,7 @@ namespace VULKAN_HPP_NAMESPACE case DriverId::eGoogleSwiftshader : return "GoogleSwiftshader"; case DriverId::eGgpProprietary : return "GgpProprietary"; case DriverId::eBroadcomProprietary : return "BroadcomProprietary"; + case DriverId::eMesaLlvmpipe : return "MesaLlvmpipe"; default: return "invalid"; } } @@ -8875,7 +8909,8 @@ namespace VULKAN_HPP_NAMESPACE eVIV = VK_VENDOR_ID_VIV, eVSI = VK_VENDOR_ID_VSI, eKazan = VK_VENDOR_ID_KAZAN, - eCodeplay = VK_VENDOR_ID_CODEPLAY + eCodeplay = VK_VENDOR_ID_CODEPLAY, + eMESA = VK_VENDOR_ID_MESA }; VULKAN_HPP_INLINE std::string to_string( VendorId value ) @@ -8886,6 +8921,7 @@ namespace VULKAN_HPP_NAMESPACE case VendorId::eVSI : return "VSI"; case VendorId::eKazan : return "Kazan"; case VendorId::eCodeplay : return "Codeplay"; + case VendorId::eMESA : return "MESA"; default: return "invalid"; } } @@ -13422,6 +13458,11 @@ namespace VULKAN_HPP_NAMESPACE { return value; } + + operator T&& () && VULKAN_HPP_NOEXCEPT + { + return std::move( value ); + } #endif }; @@ -83683,26 +83724,52 @@ namespace VULKAN_HPP_NAMESPACE template <> struct isStructureChainValid{ enum { value = true }; }; #if VULKAN_HPP_ENABLE_DYNAMIC_LOADER_TOOL +# if defined( _WIN32 ) + namespace detail + { + extern "C" __declspec( dllimport ) void * __stdcall LoadLibraryA( char const * lpLibFileName ); + extern "C" __declspec( dllimport ) int __stdcall FreeLibrary( void * hLibModule ); + extern "C" __declspec( dllimport ) void * __stdcall GetProcAddress( void * hModule, char const * lpProcName ); + } // namespace detail +# endif + class DynamicLoader { public: -#ifdef VULKAN_HPP_NO_EXCEPTIONS - DynamicLoader() VULKAN_HPP_NOEXCEPT : m_success( false ) -#else - DynamicLoader() : m_success( false ) -#endif +# ifdef VULKAN_HPP_NO_EXCEPTIONS + DynamicLoader( std::string const & vulkanLibraryName = {} ) VULKAN_HPP_NOEXCEPT : m_success( false ) +# else + DynamicLoader( std::string const & vulkanLibraryName = {} ) : m_success( false ) +# endif { -#if defined(__linux__) - m_library = dlopen( "libvulkan.so", RTLD_NOW | RTLD_LOCAL ); -#elif defined(__APPLE__) - m_library = dlopen( "libvulkan.dylib", RTLD_NOW | RTLD_LOCAL ); -#elif defined(_WIN32) - m_library = LoadLibrary( TEXT( "vulkan-1.dll" ) ); -#else - VULKAN_HPP_ASSERT( false && "unsupported platform" ); -#endif + if ( !vulkanLibraryName.empty() ) + { +# if defined( __linux__ ) || defined( __APPLE__ ) + m_library = dlopen( vulkanLibraryName.c_str(), RTLD_NOW | RTLD_LOCAL ); +# elif defined( _WIN32 ) + m_library = detail::LoadLibraryA( vulkanLibraryName.c_str() ); +# else +# error unsupported platform +# endif + } + else + { +# if defined( __linux__ ) + m_library = dlopen( "libvulkan.so", RTLD_NOW | RTLD_LOCAL ); + if ( m_library == nullptr ) + { + m_library = dlopen( "libvulkan.so.1", RTLD_NOW | RTLD_LOCAL ); + } +# elif defined( __APPLE__ ) + m_library = dlopen( "libvulkan.dylib", RTLD_NOW | RTLD_LOCAL ); +# elif defined( _WIN32 ) + m_library = detail::LoadLibraryA( "vulkan-1.dll" ); +# else +# error unsupported platform +# endif + } - m_success = m_library != 0; + m_success = (m_library != nullptr); #ifndef VULKAN_HPP_NO_EXCEPTIONS if ( !m_success ) { @@ -83734,35 +83801,37 @@ namespace VULKAN_HPP_NAMESPACE { if ( m_library ) { -#if defined(__linux__) || defined(__APPLE__) +# if defined( __linux__ ) || defined( __APPLE__ ) dlclose( m_library ); -#elif defined(_WIN32) - FreeLibrary( m_library ); -#endif +# elif defined( _WIN32 ) + detail::FreeLibrary( m_library ); +# else +# error unsupported platform +# endif } } template T getProcAddress( const char* function ) const VULKAN_HPP_NOEXCEPT { -#if defined(__linux__) || defined(__APPLE__) +# if defined( __linux__ ) || defined( __APPLE__ ) return (T)dlsym( m_library, function ); -#elif defined(_WIN32) - return (T)GetProcAddress( m_library, function ); -#endif +# elif defined( _WIN32 ) + return (T)detail::GetProcAddress( m_library, function ); +# else +# error unsupported platform +# endif } bool success() const VULKAN_HPP_NOEXCEPT { return m_success; } private: bool m_success; -#if defined(__linux__) || defined(__APPLE__) - void *m_library; -#elif defined(_WIN32) - HMODULE m_library; -#else -#error unsupported platform -#endif +# if defined( __linux__ ) || defined( __APPLE__ ) || defined( _WIN32 ) + void * m_library; +# else +# error unsupported platform +# endif }; #endif diff --git a/include/vulkan/vulkan_core.h b/include/vulkan/vulkan_core.h index efd589f..db2e556 100644 --- a/include/vulkan/vulkan_core.h +++ b/include/vulkan/vulkan_core.h @@ -44,7 +44,7 @@ extern "C" { #define VK_VERSION_MINOR(version) (((uint32_t)(version) >> 12) & 0x3ff) #define VK_VERSION_PATCH(version) ((uint32_t)(version) & 0xfff) // Version of this file -#define VK_HEADER_VERSION 140 +#define VK_HEADER_VERSION 141 // Complete version of this file #define VK_HEADER_VERSION_COMPLETE VK_MAKE_VERSION(1, 2, VK_HEADER_VERSION) @@ -1431,6 +1431,7 @@ typedef enum VkVendorId { VK_VENDOR_ID_VSI = 0x10002, VK_VENDOR_ID_KAZAN = 0x10003, VK_VENDOR_ID_CODEPLAY = 0x10004, + VK_VENDOR_ID_MESA = 0x10005, VK_VENDOR_ID_MAX_ENUM = 0x7FFFFFFF } VkVendorId; typedef VkFlags VkInstanceCreateFlags; @@ -4885,6 +4886,7 @@ typedef enum VkDriverId { VK_DRIVER_ID_GOOGLE_SWIFTSHADER = 10, VK_DRIVER_ID_GGP_PROPRIETARY = 11, VK_DRIVER_ID_BROADCOM_PROPRIETARY = 12, + VK_DRIVER_ID_MESA_LLVMPIPE = 13, VK_DRIVER_ID_AMD_PROPRIETARY_KHR = VK_DRIVER_ID_AMD_PROPRIETARY, VK_DRIVER_ID_AMD_OPEN_SOURCE_KHR = VK_DRIVER_ID_AMD_OPEN_SOURCE, VK_DRIVER_ID_MESA_RADV_KHR = VK_DRIVER_ID_MESA_RADV, diff --git a/registry/genvk.py b/registry/genvk.py index 490fcdd..c7ef75d 100755 --- a/registry/genvk.py +++ b/registry/genvk.py @@ -166,12 +166,13 @@ def makeGenOpts(args): expandEnumerants = False) ] - # API names to validate man/api spec includes & links - genOpts['vkapi.py'] = [ + # Python representation of API information, used by scripts that + # don't need to load the full XML. + genOpts['api.py'] = [ PyOutputGenerator, DocGeneratorOptions( conventions = conventions, - filename = 'vkapi.py', + filename = 'api.py', directory = directory, apiname = 'vulkan', profile = None, @@ -180,7 +181,8 @@ def makeGenOpts(args): defaultExtensions = None, addExtensions = addExtensionsPat, removeExtensions = removeExtensionsPat, - emitExtensions = emitExtensionsPat) + emitExtensions = emitExtensionsPat, + reparentEnums = False) ] # API validity files for spec diff --git a/registry/reg.py b/registry/reg.py index 9c5cbc0..d0bd065 100755 --- a/registry/reg.py +++ b/registry/reg.py @@ -23,6 +23,16 @@ from collections import defaultdict, namedtuple from generator import OutputGenerator, GeneratorOptions, write +def apiNameMatch(str, supported): + """Return whether a required api name matches a pattern specified for an + XML 'api' attribute or 'supported' attribute. + + - str - api name such as 'vulkan' or 'openxr' + - supported - comma-separated list of XML API names""" + + return (str is not None and str in supported.split(',')) + + def matchAPIProfile(api, profile, elem): """Return whether an API and profile being generated matches an element's profile @@ -1154,7 +1164,7 @@ class Registry: for key in self.apidict: fi = self.apidict[key] api = fi.elem.get('api') - if api == self.genOpts.apiname: + if apiNameMatch(self.genOpts.apiname, api): apiMatch = True if regVersions.match(fi.name): # Matches API & version #s being generated. Mark for @@ -1191,13 +1201,10 @@ class Registry: extName = ei.name include = False - # Include extension if defaultExtensions is not None and if the - # 'supported' attribute matches defaultExtensions. The regexp in - # 'supported' must exactly match defaultExtensions, so bracket - # it with ^(pat)$. - pat = '^(' + ei.elem.get('supported') + ')$' - if (self.genOpts.defaultExtensions - and re.match(pat, self.genOpts.defaultExtensions)): + # Include extension if defaultExtensions is not None and is + # exactly matched by the 'supported' attribute. + if apiNameMatch(self.genOpts.defaultExtensions, + ei.elem.get('supported')): self.gen.logMsg('diag', 'Including extension', extName, "(defaultExtensions matches the 'supported' attribute)") include = True diff --git a/registry/validusage.json b/registry/validusage.json index 65e7565..ba31c97 100644 --- a/registry/validusage.json +++ b/registry/validusage.json @@ -1,9 +1,9 @@ { "version info": { "schema version": 2, - "api version": "1.2.140", - "comment": "from git branch: github-master commit: a79b923ed376c42e99ecdb9d2ad69a56fb850ddc", - "date": "2020-05-04 09:48:50Z" + "api version": "1.2.141", + "comment": "from git branch: github-master commit: 8bd1271c25ec56248494389b0cc2b6741cb28164", + "date": "2020-05-15 09:13:21Z" }, "validation": { "vkGetInstanceProcAddr": { @@ -7933,8 +7933,12 @@ "vkGetRayTracingShaderGroupHandlesKHR": { "(VK_NV_ray_tracing,VK_KHR_ray_tracing)": [ { + "vuid": "VUID-vkGetRayTracingShaderGroupHandlesKHR-firstGroup-04050", + "text": " firstGroup must be less than the number of shader groups in pipeline" + }, + { "vuid": "VUID-vkGetRayTracingShaderGroupHandlesKHR-firstGroup-02419", - "text": " The sum of firstGroup and groupCount must be less than the number of shader groups in pipeline" + "text": " The sum of firstGroup and groupCount must be less than or equal to the number of shader groups in pipeline" }, { "vuid": "VUID-vkGetRayTracingShaderGroupHandlesKHR-dataSize-02420", @@ -7971,8 +7975,12 @@ "vkGetRayTracingCaptureReplayShaderGroupHandlesKHR": { "(VK_NV_ray_tracing,VK_KHR_ray_tracing)+(VK_KHR_ray_tracing)": [ { + "vuid": "VUID-vkGetRayTracingCaptureReplayShaderGroupHandlesKHR-firstGroup-04051", + "text": " firstGroup must be less than the number of shader groups in pipeline" + }, + { "vuid": "VUID-vkGetRayTracingCaptureReplayShaderGroupHandlesKHR-firstGroup-03483", - "text": " The sum of firstGroup and groupCount must be less than the number of shader groups in pipeline" + "text": " The sum of firstGroup and groupCount must be less than or equal to the number of shader groups in pipeline" }, { "vuid": "VUID-vkGetRayTracingCaptureReplayShaderGroupHandlesKHR-dataSize-03484", diff --git a/registry/vk.xml b/registry/vk.xml index 954f691..cbc430a 100644 --- a/registry/vk.xml +++ b/registry/vk.xml @@ -157,7 +157,7 @@ server. // Vulkan 1.2 version number #define VK_API_VERSION_1_2 VK_MAKE_VERSION(1, 2, 0)// Patch version should always be set to 0 // Version of this file -#define VK_HEADER_VERSION 140 +#define VK_HEADER_VERSION 141 // Complete version of this file #define VK_HEADER_VERSION_COMPLETE VK_MAKE_VERSION(1, 2, VK_HEADER_VERSION) @@ -5970,7 +5970,8 @@ typedef void CAMetalLayer; - + + Driver IDs are now represented as enums instead of the old @@ -5988,6 +5989,7 @@ typedef void CAMetalLayer; + @@ -13391,5 +13393,23 @@ typedef void CAMetalLayer; + + + + + + + + + + + + + + + + + + diff --git a/registry/vkconventions.py b/registry/vkconventions.py index eebc792..f69dfc1 100644 --- a/registry/vkconventions.py +++ b/registry/vkconventions.py @@ -131,11 +131,6 @@ class VulkanConventions(ConventionsBase): 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_' @@ -195,7 +190,7 @@ class VulkanConventions(ConventionsBase): @property def extra_refpage_headers(self): """Return any extra text to add to refpage headers.""" - return 'include::../config/attribs.txt[]' + return 'include::{config}/attribs.txt[]' @property def extension_index_prefixes(self): -- 2.7.4