diff options
| author | Rémi Verschelde <rverschelde@gmail.com> | 2019-11-06 15:30:21 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-02-11 12:05:31 +0100 |
| commit | bb9b9b03c4915f21fe7c6e4339436aab6f0af7ea (patch) | |
| tree | 767db65d09874a8b1ba84c7844f25c76d5a58eaa /thirdparty/vulkan/loader/vk_loader_platform.h | |
| parent | 7f430b03a70e70ba9f63c192beb2f31dd884f907 (diff) | |
| parent | 7bf72ed14e4758bea20543e08d904200a5f2328f (diff) | |
| download | redot-engine-bb9b9b03c4915f21fe7c6e4339436aab6f0af7ea.tar.gz | |
Merge pull request #33385 from bruvzg/loader_1_1_127
Update Vulkan loader to 1.1.127
Diffstat (limited to 'thirdparty/vulkan/loader/vk_loader_platform.h')
| -rw-r--r-- | thirdparty/vulkan/loader/vk_loader_platform.h | 39 |
1 files changed, 35 insertions, 4 deletions
diff --git a/thirdparty/vulkan/loader/vk_loader_platform.h b/thirdparty/vulkan/loader/vk_loader_platform.h index e405c21088..2ffda55367 100644 --- a/thirdparty/vulkan/loader/vk_loader_platform.h +++ b/thirdparty/vulkan/loader/vk_loader_platform.h @@ -207,7 +207,12 @@ static inline void loader_platform_thread_cond_broadcast(loader_platform_thread_ static inline const char *LoaderPnpDriverRegistry() { BOOL is_wow; IsWow64Process(GetCurrentProcess(), &is_wow); - return is_wow ? (API_NAME "DriverNameWow") : (API_NAME "DriverName"); + return is_wow ? "VulkanDriverNameWow" : "VulkanDriverName"; +} +static inline const wchar_t *LoaderPnpDriverRegistryWide() { + BOOL is_wow; + IsWow64Process(GetCurrentProcess(), &is_wow); + return is_wow ? L"VulkanDriverNameWow" : L"VulkanDriverName"; } // Get the key for the plug 'n play explicit layer registry @@ -215,15 +220,25 @@ static inline const char *LoaderPnpDriverRegistry() { static inline const char *LoaderPnpELayerRegistry() { BOOL is_wow; IsWow64Process(GetCurrentProcess(), &is_wow); - return is_wow ? (API_NAME "ExplicitLayersWow") : (API_NAME "ExplicitLayers"); + return is_wow ? "VulkanExplicitLayersWow" : "VulkanExplicitLayers"; +} +static inline const wchar_t *LoaderPnpELayerRegistryWide() { + BOOL is_wow; + IsWow64Process(GetCurrentProcess(), &is_wow); + return is_wow ? L"VulkanExplicitLayersWow" : L"VulkanExplicitLayers"; } + // Get the key for the plug 'n play implicit layer registry // The string returned by this function should NOT be freed - static inline const char *LoaderPnpILayerRegistry() { BOOL is_wow; IsWow64Process(GetCurrentProcess(), &is_wow); - return is_wow ? (API_NAME "ImplicitLayersWow") : (API_NAME "ImplicitLayers"); + return is_wow ? "VulkanImplicitLayersWow" : "VulkanImplicitLayers"; +} +static inline const wchar_t *LoaderPnpILayerRegistryWide() { + BOOL is_wow; + IsWow64Process(GetCurrentProcess(), &is_wow); + return is_wow ? L"VulkanImplicitLayersWow" : L"VulkanImplicitLayers"; } #endif @@ -319,7 +334,23 @@ static char *loader_platform_get_proc_address_error(const char *name) { // Threads: typedef HANDLE loader_platform_thread; + +// __declspec(thread) is not supported by MinGW compiler (ignored with warning or +// cause erorr depending on compiler switches) +// +// __thread should be used instead +// +// __MINGW32__ defined for both 32 and 64 bit MinGW compilers, so it is enough to +// detect any (32 or 64) flawor of MinGW compiler. +// +// @note __GNUC__ could be used as a more generic way to detect _any_ +// GCC[-compitible] compiler on Windows, but this fix was tested +// only with MinGW, so keep it explicit at the moment. +#if defined(__MINGW32__) +#define THREAD_LOCAL_DECL __thread +#else #define THREAD_LOCAL_DECL __declspec(thread) +#endif // The once init functionality is not used when building a DLL on Windows. This is because there is no way to clean up the // resources allocated by anything allocated by once init. This isn't a problem for static libraries, but it is for dynamic |
