wsi: Various fixes and Windows build issues

This commit is contained in:
Mark Lobodzinski 2015-11-26 10:59:58 -07:00 committed by Jon Ashburn
parent 16edfa668c
commit 6be1a0d17d
3 changed files with 39 additions and 19 deletions

4
CMakeLists.txt Normal file → Executable file
View 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()

View File

@ -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

View File

@ -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(),