diff options
author | Mark Lobodzinski <mark@lunarg.com> | 2015-11-26 10:59:58 -0700 |
---|---|---|
committer | Jon Ashburn <jon@lunarg.com> | 2015-12-01 10:26:05 -0700 |
commit | 6f92feb2a1e8dded4a79b00d64ab36490b197581 (patch) | |
tree | 3a715ddba4202b96a18e78850ae1de19b5bc4418 | |
parent | 1ead357a510623a84f190aef2902df2ca4bd42c4 (diff) |
wsi: Various fixes and Windows build issues
-rwxr-xr-x[-rw-r--r--] | CMakeLists.txt | 4 | ||||
-rw-r--r-- | layers/object_track.h | 12 | ||||
-rw-r--r-- | layers/swapchain.cpp | 1 | ||||
-rw-r--r-- | loader/vk_loader_platform.h | 1 | ||||
-rwxr-xr-x | vk-layer-generate.py | 53 | ||||
-rw-r--r-- | vktrace/src/vktrace_common/vktrace_platform.h | 1 | ||||
-rw-r--r-- | vktrace/src/vktrace_layer/vktrace_lib_trace.cpp | 4 |
7 files changed, 53 insertions, 23 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index b3234f28..9510e31d 100644..100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,12 +5,14 @@ cmake_minimum_required(VERSION 2.8.11) project (VULKAN) # set (CMAKE_VERBOSE_MAKEFILE 1) + + # The MAJOR number of the version we're building, used in naming # vulkan-<major>.dll (and other files). set(MAJOR "0") if(WIN32) - add_definitions(-DVK_USE_PLATFORM_WIN32_KHR) + add_definitions(-DVK_USE_PLATFORM_WIN32_KHR -DWIN32_LEAN_AND_MEAN) else() add_definitions(-DVK_USE_PLATFORM_XCB_KHR) endif() diff --git a/layers/object_track.h b/layers/object_track.h index ad9a44a7..43089178 100644 --- a/layers/object_track.h +++ b/layers/object_track.h @@ -407,7 +407,7 @@ initObjectTracker( { option_str = getLayerOption("ObjectTrackerLogFilename"); log_output = getLayerLogOutput(option_str, "ObjectTracker"); - layer_create_msg_callback(my_data->report_data, report_flags, log_callback, (void *) log_output, &my_data->logging_callback); + layer_create_msg_callback(my_data->report_data, report_flags, log_callback, (void *) log_output, &(my_data->logging_callback)); } if (!objLockInitialized) @@ -562,6 +562,16 @@ static void create_physical_device(VkInstance dispatchable_object, VkPhysicalDev numTotalObjs++; } +static void create_surface_khr(VkInstance instance, VkSurfaceKHR surface, VkDbgObjectType objType) +{ + // TODO: Add tracking of surface objects +} + +static void destroy_surface_khr(VkInstance instance, VkSurfaceKHR surface) +{ + // TODO: Add tracking of surface objects +} + static void alloc_command_buffer(VkDevice device, VkCommandPool commandPool, VkCommandBuffer vkObj, VkDbgObjectType objType) { log_msg(mdd(device), VK_DBG_REPORT_INFO_BIT, objType, reinterpret_cast<uint64_t>(vkObj), 0, OBJTRACK_NONE, "OBJTRACK", diff --git a/layers/swapchain.cpp b/layers/swapchain.cpp index 0bc80f19..9348f7f7 100644 --- a/layers/swapchain.cpp +++ b/layers/swapchain.cpp @@ -26,6 +26,7 @@ #include <stdio.h> #include <string.h> +#include <vk_loader_platform.h> #include "swapchain.h" #include "vk_layer_extension_utils.h" diff --git a/loader/vk_loader_platform.h b/loader/vk_loader_platform.h index 45fe4290..257fdf2f 100644 --- a/loader/vk_loader_platform.h +++ b/loader/vk_loader_platform.h @@ -31,7 +31,6 @@ #if defined(_WIN32) // WinSock2.h must be included *BEFORE* windows.h -#define WIN32_LEAN_AND_MEAN #include <WinSock2.h> #endif // _WIN32 diff --git a/vk-layer-generate.py b/vk-layer-generate.py index 0827704c..f38712a2 100755 --- a/vk-layer-generate.py +++ b/vk-layer-generate.py @@ -39,7 +39,7 @@ from source_line_info import sourcelineinfo from collections import defaultdict 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 else: return False @@ -1170,13 +1170,22 @@ class APIDumpSubcommand(Subcommand): def generate_body(self): self.layer_name = "APIDump" - instance_extensions=[('wsi_enabled', - ['vkGetPhysicalDeviceSurfaceSupportKHR', - 'vkGetPhysicalDeviceSurfaceCapabilitiesKHR', - 'vkGetPhysicalDeviceSurfaceFormatsKHR', - 'vkGetPhysicalDeviceSurfacePresentModesKHR', - 'vkCreateXcbSurfaceKHR', - 'vkGetPhysicalDeviceXcbPresentationSupportKHR'])] + if sys.platform == 'win32':
+ instance_extensions=[('wsi_enabled',
+ ['vkGetPhysicalDeviceSurfaceSupportKHR',
+ 'vkGetPhysicalDeviceSurfaceCapabilitiesKHR',
+ 'vkGetPhysicalDeviceSurfaceFormatsKHR',
+ 'vkGetPhysicalDeviceSurfacePresentModesKHR',
+ 'vkCreateWin32SurfaceKHR',
+ 'vkGetPhysicalDeviceWin32PresentationSupportKHR'])]
+ else:
+ instance_extensions=[('wsi_enabled',
+ ['vkGetPhysicalDeviceSurfaceSupportKHR',
+ 'vkGetPhysicalDeviceSurfaceCapabilitiesKHR',
+ 'vkGetPhysicalDeviceSurfaceFormatsKHR',
+ 'vkGetPhysicalDeviceSurfacePresentModesKHR',
+ 'vkCreateXcbSurfaceKHR',
+ 'vkGetPhysicalDeviceXcbPresentationSupportKHR'])] extensions=[('wsi_enabled', ['vkCreateSwapchainKHR', 'vkDestroySwapchainKHR', 'vkGetSwapchainImagesKHR', @@ -1601,7 +1610,7 @@ class ObjectTrackerSubcommand(Subcommand): '}' % (qual, decl, proto.c_call())) return "".join(funcs) # 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 "" else: if 'Create' in proto.name or 'Alloc' in proto.name: @@ -1713,14 +1722,24 @@ class ObjectTrackerSubcommand(Subcommand): ['vkCreateSwapchainKHR', 'vkDestroySwapchainKHR', 'vkGetSwapchainImagesKHR', 'vkAcquireNextImageKHR', 'vkQueuePresentKHR'])] - instance_extensions=[('msg_callback_get_proc_addr', []), - ('wsi_enabled', - ['vkGetPhysicalDeviceSurfaceSupportKHR', - 'vkGetPhysicalDeviceSurfaceCapabilitiesKHR', - 'vkGetPhysicalDeviceSurfaceFormatsKHR', - 'vkGetPhysicalDeviceSurfacePresentModesKHR', - 'vkCreateXcbSurfaceKHR', - 'vkGetPhysicalDeviceXcbPresentationSupportKHR'])] + if sys.platform == 'win32':
+ instance_extensions=[('msg_callback_get_proc_addr', []),
+ ('wsi_enabled',
+ ['vkGetPhysicalDeviceSurfaceSupportKHR',
+ 'vkGetPhysicalDeviceSurfaceCapabilitiesKHR',
+ 'vkGetPhysicalDeviceSurfaceFormatsKHR',
+ 'vkGetPhysicalDeviceSurfacePresentModesKHR',
+ 'vkCreateWin32SurfaceKHR',
+ 'vkGetPhysicalDeviceWin32PresentationSupportKHR'])]
+ else:
+ instance_extensions=[('msg_callback_get_proc_addr', []),
+ ('wsi_enabled',
+ ['vkGetPhysicalDeviceSurfaceSupportKHR',
+ 'vkGetPhysicalDeviceSurfaceCapabilitiesKHR',
+ 'vkGetPhysicalDeviceSurfaceFormatsKHR',
+ 'vkGetPhysicalDeviceSurfacePresentModesKHR',
+ 'vkCreateXcbSurfaceKHR',
+ 'vkGetPhysicalDeviceXcbPresentationSupportKHR'])] body = [self.generate_maps(), self.generate_procs(), self.generate_destroy_instance(), diff --git a/vktrace/src/vktrace_common/vktrace_platform.h b/vktrace/src/vktrace_common/vktrace_platform.h index 5a41a079..60e05cda 100644 --- a/vktrace/src/vktrace_common/vktrace_platform.h +++ b/vktrace/src/vktrace_common/vktrace_platform.h @@ -57,7 +57,6 @@ typedef pthread_mutex_t VKTRACE_CRITICAL_SECTION; #elif defined(WIN32) #define _CRT_RAND_S -#define WIN32_LEAN_AND_MEAN // The following line is needed to use the C++ std::min() or std::max(): #define NOMINMAX #include <Windows.h> diff --git a/vktrace/src/vktrace_layer/vktrace_lib_trace.cpp b/vktrace/src/vktrace_layer/vktrace_lib_trace.cpp index b970ad3d..99d3c56b 100644 --- a/vktrace/src/vktrace_layer/vktrace_lib_trace.cpp +++ b/vktrace/src/vktrace_layer/vktrace_lib_trace.cpp @@ -1185,7 +1185,7 @@ VKTRACER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL __HOOKED_vkCreateWin32SurfaceKHR( packet_vkCreateWin32SurfaceKHR* pPacket = NULL; // don't bother with copying the actual win32 hinstance, hwnd into the trace packet, vkreplay has to use it's own anyway CREATE_TRACE_PACKET(vkCreateWin32SurfaceKHR, sizeof(VkSurfaceKHR) + sizeof(VkAllocationCallbacks)); - result = mid(instance)->instTable.CreateWin32SurfaceKHR(instance, connection, window, pAllocator, pSurface); + result = mid(instance)->instTable.CreateWin32SurfaceKHR(instance, hinstance, hwnd, pAllocator, pSurface); pPacket = interpret_body_as_vkCreateWin32SurfaceKHR(pHeader); pPacket->instance = instance; pPacket->hinstance = hinstance; @@ -1207,7 +1207,7 @@ VKTRACER_EXPORT VKAPI_ATTR VkBool32 VKAPI_CALL __HOOKED_vkGetPhysicalDeviceWin32 VkBool32 result; packet_vkGetPhysicalDeviceWin32PresentationSupportKHR* pPacket = NULL; CREATE_TRACE_PACKET(vkGetPhysicalDeviceWin32PresentationSupportKHR, 0); - result = mid(physicalDevice)->instTable.GetPhysicalDeviceWin32PresentationSupportKHR(physicalDevice, queueFamilyIndexn); + result = mid(physicalDevice)->instTable.GetPhysicalDeviceWin32PresentationSupportKHR(physicalDevice, queueFamilyIndex); pPacket = interpret_body_as_vkGetPhysicalDeviceWin32PresentationSupportKHR(pHeader); pPacket->physicalDevice = physicalDevice; pPacket->queueFamilyIndex = queueFamilyIndex; |