summaryrefslogtreecommitdiff
path: root/thirdparty/vulkan/loader/vk_loader_platform.h
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2020-03-09 09:29:14 +0100
committerRémi Verschelde <rverschelde@gmail.com>2020-03-09 09:36:37 +0100
commit214bc9e5a1f3300b97aed407fb62d902c53ae0e6 (patch)
treea171a5d88e1df69a643f3f631417c4b33d4a1fc5 /thirdparty/vulkan/loader/vk_loader_platform.h
parent7579a792bed9881a6afd73c058dfd57441fb5c7a (diff)
Update Vulkan loader and headers to sdk-1.2.131.2
(Headers are actually sdk-1.2.131.1, they did not get a re-release.) Also synced VMA 2.3.0 again, fixing unwanted clang-formatting of thirdparty code.
Diffstat (limited to 'thirdparty/vulkan/loader/vk_loader_platform.h')
-rw-r--r--thirdparty/vulkan/loader/vk_loader_platform.h47
1 files changed, 3 insertions, 44 deletions
diff --git a/thirdparty/vulkan/loader/vk_loader_platform.h b/thirdparty/vulkan/loader/vk_loader_platform.h
index 2ffda55367..7824e35d6b 100644
--- a/thirdparty/vulkan/loader/vk_loader_platform.h
+++ b/thirdparty/vulkan/loader/vk_loader_platform.h
@@ -279,31 +279,6 @@ static inline char *loader_platform_dirname(char *path) {
return path;
}
-// WIN32 runtime doesn't have basename().
-// Microsoft also doesn't have basename(). Paths are different on Windows, and
-// so this is just a temporary solution in order to get us compiling, so that we
-// can test some scenarios, and develop the correct solution for Windows.
-// TODO: Develop a better, permanent solution for Windows, to replace this
-// temporary code:
-static char *loader_platform_basename(char *pathname) {
- char *current, *next;
-
- // TODO/TBD: Do we need to deal with the Windows's ":" character?
-
- for (current = pathname; *current != '\0'; current = next) {
- next = strchr(current, DIRECTORY_SYMBOL);
- if (next == NULL) {
- // No more DIRECTORY_SYMBOL's so return p:
- return current;
- } else {
- // Point one character past the DIRECTORY_SYMBOL:
- next++;
- }
- }
- // We shouldn't get to here, but this makes the compiler happy:
- return current;
-}
-
// Dynamic Loading:
typedef HMODULE loader_platform_dl_handle;
static loader_platform_dl_handle loader_platform_open_library(const char *lib_path) {
@@ -336,15 +311,15 @@ static char *loader_platform_get_proc_address_error(const char *name) {
typedef HANDLE loader_platform_thread;
// __declspec(thread) is not supported by MinGW compiler (ignored with warning or
-// cause erorr depending on compiler switches)
+// cause error 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.
+// detect any (32 or 64) flavor 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
+// GCC[-compatible] 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
@@ -355,25 +330,9 @@ typedef HANDLE loader_platform_thread;
// 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
// ones. When building a DLL, we use DllMain() instead to allow properly cleaning up resources.
-#if defined(LOADER_DYNAMIC_LIB)
#define LOADER_PLATFORM_THREAD_ONCE_DECLARATION(var)
#define LOADER_PLATFORM_THREAD_ONCE_DEFINITION(var)
#define LOADER_PLATFORM_THREAD_ONCE(ctl, func)
-#else
-#define LOADER_PLATFORM_THREAD_ONCE_DECLARATION(var) INIT_ONCE var = INIT_ONCE_STATIC_INIT;
-#define LOADER_PLATFORM_THREAD_ONCE_DEFINITION(var) INIT_ONCE var;
-#define LOADER_PLATFORM_THREAD_ONCE(ctl, func) loader_platform_thread_once_fn(ctl, func)
-static BOOL CALLBACK InitFuncWrapper(PINIT_ONCE InitOnce, PVOID Parameter, PVOID *Context) {
- void (*func)(void) = (void (*)(void))Parameter;
- func();
- return TRUE;
-}
-static void loader_platform_thread_once_fn(void *ctl, void (*func)(void)) {
- assert(func != NULL);
- assert(ctl != NULL);
- InitOnceExecuteOnce((PINIT_ONCE)ctl, InitFuncWrapper, (void *)func, NULL);
-}
-#endif
// Thread IDs:
typedef DWORD loader_platform_thread_id;