Update Vulkan-Loader Patches
This commit is contained in:
		
							parent
							
								
									0de6e6cee7
								
							
						
					
					
						commit
						7d28936b71
					
				
					 4 changed files with 22 additions and 25 deletions
				
			
		| 
						 | 
				
			
			@ -1,4 +1,4 @@
 | 
			
		|||
From 3144d063916caf6271d5af2b5edb58b95b49ef3f Mon Sep 17 00:00:00 2001
 | 
			
		||||
From 4037e82a4a6e46bd1133755683ad62f32e5af76e Mon Sep 17 00:00:00 2001
 | 
			
		||||
From: Syoyo Fujita <syoyo@lighttransport.com>
 | 
			
		||||
Date: Thu, 28 May 2020 21:38:16 +0900
 | 
			
		||||
Subject: [PATCH 1/4] Fix build on MinGW cross compiling environment.
 | 
			
		||||
| 
						 | 
				
			
			@ -10,7 +10,7 @@ Subject: [PATCH 1/4] Fix build on MinGW cross compiling environment.
 | 
			
		|||
 3 files changed, 20 insertions(+), 1 deletion(-)
 | 
			
		||||
 | 
			
		||||
diff --git a/loader/CMakeLists.txt b/loader/CMakeLists.txt
 | 
			
		||||
index d56f948cf..4e6c14ff8 100644
 | 
			
		||||
index 4f54c3298..50cced309 100644
 | 
			
		||||
--- a/loader/CMakeLists.txt
 | 
			
		||||
+++ b/loader/CMakeLists.txt
 | 
			
		||||
@@ -160,7 +160,7 @@ if(WIN32)
 | 
			
		||||
| 
						 | 
				
			
			@ -32,7 +32,7 @@ index d56f948cf..4e6c14ff8 100644
 | 
			
		|||
 elseif(APPLE)
 | 
			
		||||
     # For MacOS, use the C code and force the compiler's tail-call optimization instead of using assembly code.
 | 
			
		||||
diff --git a/loader/loader.c b/loader/loader.c
 | 
			
		||||
index 7776ff5f4..dc26a9c4f 100644
 | 
			
		||||
index 6db4e9245..d76f7dbe7 100644
 | 
			
		||||
--- a/loader/loader.c
 | 
			
		||||
+++ b/loader/loader.c
 | 
			
		||||
@@ -83,6 +83,19 @@
 | 
			
		||||
| 
						 | 
				
			
			@ -56,7 +56,7 @@ index 7776ff5f4..dc26a9c4f 100644
 | 
			
		|||
 
 | 
			
		||||
 // This is a CMake generated file with #defines for any functions/includes
 | 
			
		||||
diff --git a/loader/loader.rc b/loader/loader.rc
 | 
			
		||||
index 18eb5e6c1..2a9988d00 100755
 | 
			
		||||
index a29c507de..6ed444bfe 100755
 | 
			
		||||
--- a/loader/loader.rc
 | 
			
		||||
+++ b/loader/loader.rc
 | 
			
		||||
@@ -43,7 +43,11 @@
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,4 +1,4 @@
 | 
			
		|||
From d3a86d11426c8d148a554f67654fb0a048d0c98d Mon Sep 17 00:00:00 2001
 | 
			
		||||
From f712c42a36bf39592abb2c7f8d2d891287f14c3f Mon Sep 17 00:00:00 2001
 | 
			
		||||
From: BtbN <btbn@btbn.de>
 | 
			
		||||
Date: Mon, 7 Sep 2020 20:07:39 +0200
 | 
			
		||||
Subject: [PATCH 2/4] Fixes for MinGW build
 | 
			
		||||
| 
						 | 
				
			
			@ -11,10 +11,10 @@ Adapted from https://github.com/msys2/MINGW-packages/blob/348f1d46d9d273a2cc928d
 | 
			
		|||
 3 files changed, 7 insertions(+), 3 deletions(-)
 | 
			
		||||
 | 
			
		||||
diff --git a/loader/CMakeLists.txt b/loader/CMakeLists.txt
 | 
			
		||||
index 4e6c14ff8..ca768223f 100644
 | 
			
		||||
index 50cced309..d35d37220 100644
 | 
			
		||||
--- a/loader/CMakeLists.txt
 | 
			
		||||
+++ b/loader/CMakeLists.txt
 | 
			
		||||
@@ -329,11 +329,11 @@ else()
 | 
			
		||||
@@ -326,11 +326,11 @@ else()
 | 
			
		||||
         )
 | 
			
		||||
 # cmake-format: on
 | 
			
		||||
     endif()
 | 
			
		||||
| 
						 | 
				
			
			@ -28,7 +28,7 @@ index 4e6c14ff8..ca768223f 100644
 | 
			
		|||
 # Generate pkg-config file.
 | 
			
		||||
 include(FindPkgConfig QUIET)
 | 
			
		||||
diff --git a/loader/loader.h b/loader/loader.h
 | 
			
		||||
index 2182f187c..d0570cb97 100644
 | 
			
		||||
index 6cc0f8388..fc26fcde6 100644
 | 
			
		||||
--- a/loader/loader.h
 | 
			
		||||
+++ b/loader/loader.h
 | 
			
		||||
@@ -38,7 +38,9 @@
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,4 +1,4 @@
 | 
			
		|||
From 9e735ac1e3d15cc75185c988e954979c83521881 Mon Sep 17 00:00:00 2001
 | 
			
		||||
From 9ed35d2d8395553d90e65867946c4df9c7bfaf63 Mon Sep 17 00:00:00 2001
 | 
			
		||||
From: BtbN <btbn@btbn.de>
 | 
			
		||||
Date: Mon, 7 Sep 2020 20:33:23 +0200
 | 
			
		||||
Subject: [PATCH 3/4] Define appropiate minimum Windows-Version
 | 
			
		||||
| 
						 | 
				
			
			@ -8,7 +8,7 @@ Subject: [PATCH 3/4] Define appropiate minimum Windows-Version
 | 
			
		|||
 1 file changed, 5 insertions(+)
 | 
			
		||||
 | 
			
		||||
diff --git a/loader/vk_loader_platform.h b/loader/vk_loader_platform.h
 | 
			
		||||
index 437b3c320..badcbc816 100644
 | 
			
		||||
index d9381c239..c1e47e4c3 100644
 | 
			
		||||
--- a/loader/vk_loader_platform.h
 | 
			
		||||
+++ b/loader/vk_loader_platform.h
 | 
			
		||||
@@ -24,6 +24,11 @@
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,4 +1,4 @@
 | 
			
		|||
From 6e1f9e7ce670b295bf5d24564b1ec0a179a0ee34 Mon Sep 17 00:00:00 2001
 | 
			
		||||
From b6b9abf90b6f71abf9d5405745748dd991099247 Mon Sep 17 00:00:00 2001
 | 
			
		||||
From: BtbN <btbn@btbn.de>
 | 
			
		||||
Date: Sun, 4 Apr 2021 23:29:53 +0200
 | 
			
		||||
Subject: [PATCH 4/4] Unlock building static loader on any OS
 | 
			
		||||
| 
						 | 
				
			
			@ -27,7 +27,7 @@ index bd01fa016..91e5652f3 100644
 | 
			
		|||
 if(BUILD_STATIC_LOADER)
 | 
			
		||||
     message(WARNING "The BUILD_STATIC_LOADER option has been set. Note that this will only work on MacOS and is not supported "
 | 
			
		||||
diff --git a/loader/CMakeLists.txt b/loader/CMakeLists.txt
 | 
			
		||||
index ca768223f..f37b18908 100644
 | 
			
		||||
index d35d37220..cf6c57b5e 100644
 | 
			
		||||
--- a/loader/CMakeLists.txt
 | 
			
		||||
+++ b/loader/CMakeLists.txt
 | 
			
		||||
@@ -224,6 +224,22 @@ if(WIN32)
 | 
			
		||||
| 
						 | 
				
			
			@ -62,7 +62,7 @@ index ca768223f..f37b18908 100644
 | 
			
		|||
 
 | 
			
		||||
     target_link_libraries(vulkan Vulkan::Headers)
 | 
			
		||||
 
 | 
			
		||||
@@ -260,17 +278,19 @@ else()
 | 
			
		||||
@@ -260,14 +278,16 @@ else()
 | 
			
		||||
         set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-typedef-redefinition")
 | 
			
		||||
     endif()
 | 
			
		||||
 
 | 
			
		||||
| 
						 | 
				
			
			@ -74,16 +74,13 @@ index ca768223f..f37b18908 100644
 | 
			
		|||
     endif()
 | 
			
		||||
     add_dependencies(vulkan loader_asm_gen_files)
 | 
			
		||||
+    if (NOT BUILD_STATIC_LOADER)
 | 
			
		||||
     set_target_properties(vulkan
 | 
			
		||||
                           PROPERTIES SOVERSION
 | 
			
		||||
                                      "1"
 | 
			
		||||
                                      VERSION
 | 
			
		||||
                                      "${VulkanHeaders_VERSION_MAJOR}.${VulkanHeaders_VERSION_MINOR}.${VulkanHeaders_VERSION_PATCH}")
 | 
			
		||||
     # set version based on VK_HEADER_VERSION used to generate the code
 | 
			
		||||
     include(generated/loader_generated_header_version.cmake)
 | 
			
		||||
+    endif()
 | 
			
		||||
     target_link_libraries(vulkan ${CMAKE_DL_LIBS} m)
 | 
			
		||||
     if (NOT ANDROID)
 | 
			
		||||
         target_link_libraries(vulkan pthread)
 | 
			
		||||
@@ -342,6 +362,7 @@ if(PKG_CONFIG_FOUND)
 | 
			
		||||
@@ -339,6 +359,7 @@ if(PKG_CONFIG_FOUND)
 | 
			
		||||
     foreach(LIB ${CMAKE_CXX_IMPLICIT_LINK_LIBRARIES} ${PLATFORM_LIBS})
 | 
			
		||||
         set(PRIVATE_LIBS "${PRIVATE_LIBS} -l${LIB}")
 | 
			
		||||
     endforeach()
 | 
			
		||||
| 
						 | 
				
			
			@ -92,10 +89,10 @@ index ca768223f..f37b18908 100644
 | 
			
		|||
         set(VULKAN_LIB_SUFFIX "-1")
 | 
			
		||||
     endif ()
 | 
			
		||||
diff --git a/loader/loader.c b/loader/loader.c
 | 
			
		||||
index dc26a9c4f..4bafed2ed 100644
 | 
			
		||||
index d76f7dbe7..73e93fff1 100644
 | 
			
		||||
--- a/loader/loader.c
 | 
			
		||||
+++ b/loader/loader.c
 | 
			
		||||
@@ -7914,7 +7914,7 @@ out:
 | 
			
		||||
@@ -7889,7 +7889,7 @@ out:
 | 
			
		||||
     return result;
 | 
			
		||||
 }
 | 
			
		||||
 
 | 
			
		||||
| 
						 | 
				
			
			@ -105,10 +102,10 @@ index dc26a9c4f..4bafed2ed 100644
 | 
			
		|||
     switch (reason) {
 | 
			
		||||
         case DLL_PROCESS_ATTACH:
 | 
			
		||||
diff --git a/loader/loader.h b/loader/loader.h
 | 
			
		||||
index d0570cb97..a3bfdc53a 100644
 | 
			
		||||
index fc26fcde6..43fa875e5 100644
 | 
			
		||||
--- a/loader/loader.h
 | 
			
		||||
+++ b/loader/loader.h
 | 
			
		||||
@@ -439,6 +439,9 @@ static inline void loader_init_dispatch(void *obj, const void *data) {
 | 
			
		||||
@@ -449,6 +449,9 @@ static inline void loader_init_dispatch(void *obj, const void *data) {
 | 
			
		||||
 // Global variables used across files
 | 
			
		||||
 extern struct loader_struct loader;
 | 
			
		||||
 extern THREAD_LOCAL_DECL struct loader_instance *tls_instance;
 | 
			
		||||
| 
						 | 
				
			
			@ -119,7 +116,7 @@ index d0570cb97..a3bfdc53a 100644
 | 
			
		|||
 extern loader_platform_thread_mutex loader_json_lock;
 | 
			
		||||
 extern loader_platform_thread_mutex loader_preload_icd_lock;
 | 
			
		||||
diff --git a/loader/vk_loader_platform.h b/loader/vk_loader_platform.h
 | 
			
		||||
index badcbc816..38900b913 100644
 | 
			
		||||
index c1e47e4c3..2cc1d2e7c 100644
 | 
			
		||||
--- a/loader/vk_loader_platform.h
 | 
			
		||||
+++ b/loader/vk_loader_platform.h
 | 
			
		||||
@@ -421,9 +421,25 @@ typedef HANDLE loader_platform_thread;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue