mirror of
https://gitee.com/openharmony/third_party_vulkan-loader
synced 2024-11-27 09:21:56 +00:00
wsi: Various fixes and Windows build issues
This commit is contained in:
parent
16edfa668c
commit
6be1a0d17d
4
CMakeLists.txt
Normal file → Executable file
4
CMakeLists.txt
Normal file → Executable file
@ -5,12 +5,14 @@ cmake_minimum_required(VERSION 2.8.11)
|
|||||||
project (VULKAN)
|
project (VULKAN)
|
||||||
# set (CMAKE_VERBOSE_MAKEFILE 1)
|
# set (CMAKE_VERBOSE_MAKEFILE 1)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# The MAJOR number of the version we're building, used in naming
|
# The MAJOR number of the version we're building, used in naming
|
||||||
# vulkan-<major>.dll (and other files).
|
# vulkan-<major>.dll (and other files).
|
||||||
set(MAJOR "0")
|
set(MAJOR "0")
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
add_definitions(-DVK_USE_PLATFORM_WIN32_KHR)
|
add_definitions(-DVK_USE_PLATFORM_WIN32_KHR -DWIN32_LEAN_AND_MEAN)
|
||||||
else()
|
else()
|
||||||
add_definitions(-DVK_USE_PLATFORM_XCB_KHR)
|
add_definitions(-DVK_USE_PLATFORM_XCB_KHR)
|
||||||
endif()
|
endif()
|
||||||
|
@ -31,7 +31,6 @@
|
|||||||
|
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
// WinSock2.h must be included *BEFORE* windows.h
|
// WinSock2.h must be included *BEFORE* windows.h
|
||||||
#define WIN32_LEAN_AND_MEAN
|
|
||||||
#include <WinSock2.h>
|
#include <WinSock2.h>
|
||||||
#endif // _WIN32
|
#endif // _WIN32
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ from source_line_info import sourcelineinfo
|
|||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
|
|
||||||
def proto_is_global(proto):
|
def proto_is_global(proto):
|
||||||
if proto.params[0].ty == "VkInstance" or proto.params[0].ty == "VkPhysicalDevice" or proto.name == "CreateInstance" or proto.name == "EnumerateInstanceLayerProperties" or proto.name == "EnumerateInstanceExtensionProperties" or proto.name == "EnumerateDeviceLayerProperties" or proto.name == "EnumerateDeviceExtensionProperties" or proto.name == "CreateXcbSurfaceKHR" or proto.name == "vkGetPhysicalDeviceXcbPresentationSupportKHR":
|
if proto.params[0].ty == "VkInstance" or proto.params[0].ty == "VkPhysicalDevice" or proto.name == "CreateInstance" or proto.name == "EnumerateInstanceLayerProperties" or proto.name == "EnumerateInstanceExtensionProperties" or proto.name == "EnumerateDeviceLayerProperties" or proto.name == "EnumerateDeviceExtensionProperties" or proto.name == "CreateXcbSurfaceKHR" or proto.name == "vkGetPhysicalDeviceXcbPresentationSupportKHR" or proto.name == "CreateWin32SurfaceKHR" or proto.name == "vkGetPhysicalDeviceWin32PresentationSupportKHR":
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
@ -1170,13 +1170,22 @@ class APIDumpSubcommand(Subcommand):
|
|||||||
|
|
||||||
def generate_body(self):
|
def generate_body(self):
|
||||||
self.layer_name = "APIDump"
|
self.layer_name = "APIDump"
|
||||||
instance_extensions=[('wsi_enabled',
|
if sys.platform == 'win32':
|
||||||
['vkGetPhysicalDeviceSurfaceSupportKHR',
|
instance_extensions=[('wsi_enabled',
|
||||||
'vkGetPhysicalDeviceSurfaceCapabilitiesKHR',
|
['vkGetPhysicalDeviceSurfaceSupportKHR',
|
||||||
'vkGetPhysicalDeviceSurfaceFormatsKHR',
|
'vkGetPhysicalDeviceSurfaceCapabilitiesKHR',
|
||||||
'vkGetPhysicalDeviceSurfacePresentModesKHR',
|
'vkGetPhysicalDeviceSurfaceFormatsKHR',
|
||||||
'vkCreateXcbSurfaceKHR',
|
'vkGetPhysicalDeviceSurfacePresentModesKHR',
|
||||||
'vkGetPhysicalDeviceXcbPresentationSupportKHR'])]
|
'vkCreateWin32SurfaceKHR',
|
||||||
|
'vkGetPhysicalDeviceWin32PresentationSupportKHR'])]
|
||||||
|
else:
|
||||||
|
instance_extensions=[('wsi_enabled',
|
||||||
|
['vkGetPhysicalDeviceSurfaceSupportKHR',
|
||||||
|
'vkGetPhysicalDeviceSurfaceCapabilitiesKHR',
|
||||||
|
'vkGetPhysicalDeviceSurfaceFormatsKHR',
|
||||||
|
'vkGetPhysicalDeviceSurfacePresentModesKHR',
|
||||||
|
'vkCreateXcbSurfaceKHR',
|
||||||
|
'vkGetPhysicalDeviceXcbPresentationSupportKHR'])]
|
||||||
extensions=[('wsi_enabled',
|
extensions=[('wsi_enabled',
|
||||||
['vkCreateSwapchainKHR',
|
['vkCreateSwapchainKHR',
|
||||||
'vkDestroySwapchainKHR', 'vkGetSwapchainImagesKHR',
|
'vkDestroySwapchainKHR', 'vkGetSwapchainImagesKHR',
|
||||||
@ -1601,7 +1610,7 @@ class ObjectTrackerSubcommand(Subcommand):
|
|||||||
'}' % (qual, decl, proto.c_call()))
|
'}' % (qual, decl, proto.c_call()))
|
||||||
return "".join(funcs)
|
return "".join(funcs)
|
||||||
# Temporarily prevent DestroySurface call from being generated until WSI layer support is fleshed out
|
# Temporarily prevent DestroySurface call from being generated until WSI layer support is fleshed out
|
||||||
elif 'DestroyInstance' in proto.name or 'DestroyDevice' in proto.name or 'SurfaceKHR' in proto.name:
|
elif 'DestroyInstance' in proto.name or 'DestroyDevice' in proto.name: # LUGMAL or 'SurfaceKHR' in proto.name:
|
||||||
return ""
|
return ""
|
||||||
else:
|
else:
|
||||||
if 'Create' in proto.name or 'Alloc' in proto.name:
|
if 'Create' in proto.name or 'Alloc' in proto.name:
|
||||||
@ -1713,14 +1722,24 @@ class ObjectTrackerSubcommand(Subcommand):
|
|||||||
['vkCreateSwapchainKHR',
|
['vkCreateSwapchainKHR',
|
||||||
'vkDestroySwapchainKHR', 'vkGetSwapchainImagesKHR',
|
'vkDestroySwapchainKHR', 'vkGetSwapchainImagesKHR',
|
||||||
'vkAcquireNextImageKHR', 'vkQueuePresentKHR'])]
|
'vkAcquireNextImageKHR', 'vkQueuePresentKHR'])]
|
||||||
instance_extensions=[('msg_callback_get_proc_addr', []),
|
if sys.platform == 'win32':
|
||||||
('wsi_enabled',
|
instance_extensions=[('msg_callback_get_proc_addr', []),
|
||||||
['vkGetPhysicalDeviceSurfaceSupportKHR',
|
('wsi_enabled',
|
||||||
'vkGetPhysicalDeviceSurfaceCapabilitiesKHR',
|
['vkGetPhysicalDeviceSurfaceSupportKHR',
|
||||||
'vkGetPhysicalDeviceSurfaceFormatsKHR',
|
'vkGetPhysicalDeviceSurfaceCapabilitiesKHR',
|
||||||
'vkGetPhysicalDeviceSurfacePresentModesKHR',
|
'vkGetPhysicalDeviceSurfaceFormatsKHR',
|
||||||
'vkCreateXcbSurfaceKHR',
|
'vkGetPhysicalDeviceSurfacePresentModesKHR',
|
||||||
'vkGetPhysicalDeviceXcbPresentationSupportKHR'])]
|
'vkCreateWin32SurfaceKHR',
|
||||||
|
'vkGetPhysicalDeviceWin32PresentationSupportKHR'])]
|
||||||
|
else:
|
||||||
|
instance_extensions=[('msg_callback_get_proc_addr', []),
|
||||||
|
('wsi_enabled',
|
||||||
|
['vkGetPhysicalDeviceSurfaceSupportKHR',
|
||||||
|
'vkGetPhysicalDeviceSurfaceCapabilitiesKHR',
|
||||||
|
'vkGetPhysicalDeviceSurfaceFormatsKHR',
|
||||||
|
'vkGetPhysicalDeviceSurfacePresentModesKHR',
|
||||||
|
'vkCreateXcbSurfaceKHR',
|
||||||
|
'vkGetPhysicalDeviceXcbPresentationSupportKHR'])]
|
||||||
body = [self.generate_maps(),
|
body = [self.generate_maps(),
|
||||||
self.generate_procs(),
|
self.generate_procs(),
|
||||||
self.generate_destroy_instance(),
|
self.generate_destroy_instance(),
|
||||||
|
Loading…
Reference in New Issue
Block a user