fix vk_<platform> files to compile (commented out GetHandleForSurface)

This commit is contained in:
baldurk
2015-12-10 01:30:33 +01:00
parent 998743aafc
commit 103c285c44
8 changed files with 37 additions and 23 deletions
+2
View File
@@ -4,6 +4,8 @@ COMMIT=`git rev-parse HEAD`
MACROS=-DLINUX \
-DRENDERDOC_PLATFORM=linux \
-DRENDERDOC_EXPORTS \
-DVK_USE_PLATFORM_XCB_KHR \
-DVK_USE_PLATFORM_XLIB_KHR \
-DGIT_COMMIT_HASH="\"$(COMMIT)\""
CFLAGS=-c -Wall -Werror -Wno-unused -Wno-unknown-pragmas -fPIC $(MACROS) -I../../ -I../../3rdparty/ -I$(VK_SDK_PATH)/include/vulkan
CPPFLAGS=-std=c++11 -g -Wno-reorder -fvisibility=hidden -fvisibility-inlines-hidden
@@ -139,7 +139,7 @@
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>RENDERDOC_EXPORTS;RENDERDOC_PLATFORM=win32;WIN64;WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>RENDERDOC_EXPORTS;RENDERDOC_PLATFORM=win32;VK_USE_PLATFORM_WIN32_KHR;WIN64;WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)renderdoc\;$(SolutionDir)renderdoc\3rdparty\</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<TreatWarningAsError>true</TreatWarningAsError>
@@ -156,7 +156,7 @@
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>RENDERDOC_EXPORTS;RENDERDOC_PLATFORM=win32;WIN64;WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>RENDERDOC_EXPORTS;RENDERDOC_PLATFORM=win32;VK_USE_PLATFORM_WIN32_KHR;WIN64;WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)renderdoc\;$(SolutionDir)renderdoc\3rdparty\</AdditionalIncludeDirectories>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
@@ -176,7 +176,7 @@
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>RENDERDOC_EXPORTS;RENDERDOC_PLATFORM=win32;WIN64;WIN32;RELEASE;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>RENDERDOC_EXPORTS;RENDERDOC_PLATFORM=win32;VK_USE_PLATFORM_WIN32_KHR;WIN64;WIN32;RELEASE;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)renderdoc\;$(SolutionDir)renderdoc\3rdparty\</AdditionalIncludeDirectories>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
@@ -198,7 +198,7 @@
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>RENDERDOC_EXPORTS;RENDERDOC_PLATFORM=win32;USE_BREAKPAD;WIN64;WIN32;RELEASE;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>RENDERDOC_EXPORTS;RENDERDOC_PLATFORM=win32;VK_USE_PLATFORM_WIN32_KHR;USE_BREAKPAD;WIN64;WIN32;RELEASE;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)renderdoc\;$(SolutionDir)renderdoc\3rdparty\</AdditionalIncludeDirectories>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-5
View File
@@ -38,11 +38,6 @@
#include "core/core.h"
// this needs to be above the include of vulkan.h
#if defined(__linux__)
#include <xcb/xcb.h>
#endif
#include <vulkan/vulkan.h>
#include <vulkan/vk_lunarg_debug_marker.h>
#include <vulkan/vk_lunarg_debug_report.h>
+1
View File
@@ -223,6 +223,7 @@ private:
// return the pre-selected device and queue
VkDevice GetDev() { RDCASSERT(m_Device != VK_NULL_HANDLE); return m_Device; }
VkQueue GetQ() { RDCASSERT(m_Device != VK_NULL_HANDLE); return m_Queue; }
VkInstance GetInstance() { RDCASSERT(m_Instance != VK_NULL_HANDLE); return m_Instance; }
VkCommandBuffer GetNextCmd();
void SubmitCmds();
void FlushQ();
@@ -73,6 +73,18 @@ void InitInstanceReplayTables(VkInstance instance)
InstanceGPA(DbgCreateMsgCallback)
InstanceGPA(DbgDestroyMsgCallback)
#ifdef VK_USE_PLATFORM_WIN32_KHR
InstanceGPA(CreateWin32SurfaceKHR)
#endif
#ifdef VK_USE_PLATFORM_XCB_KHR
InstanceGPA(CreateXcbSurfaceKHR)
#endif
#ifdef VK_USE_PLATFORM_XLIB_KHR
InstanceGPA(CreateXlibSurfaceKHR)
#endif
#undef InstanceGPA
}
+6 -8
View File
@@ -46,15 +46,12 @@ void VulkanReplay::OutputWindow::SetWindowHandle(void *wn)
screen = iter.data;
}
void VulkanReplay::OutputWindow::InitSurfaceDescription(VkSurfaceDescriptionWindowKHR &surfDesc)
void VulkanReplay::OutputWindow::InitSurfaceDescription(WrappedVulkan *driver)
{
static VkPlatformHandleXcbKHR handle;
handle.connection = connection;
handle.root = screen->root;
VkInstance inst = driver->GetInstance();
surfDesc.pPlatformHandle = &handle;
surfDesc.pPlatformWindow = &wnd;
surfDesc.platform = VK_PLATFORM_X11_KHR;
VkResult vkr = ObjDisp(inst)->vkCreateXcbSurfaceKHR(Unwrap(inst), connection, &wnd, NULL, &surface);
RDCASSERT(vkr == VK_SUCCESS);
}
void VulkanReplay::GetOutputWindowDimensions(uint64_t id, int32_t &w, int32_t &h)
@@ -83,6 +80,7 @@ bool VulkanReplay::IsOutputWindowVisible(uint64_t id)
return true;
}
/*
RENDERDOC_WindowHandle WrappedVulkan::GetHandleForSurface(const VkSurfaceDescriptionKHR* surf)
{
RDCASSERT(surf);
@@ -113,7 +111,7 @@ RENDERDOC_WindowHandle WrappedVulkan::GetHandleForSurface(const VkSurfaceDescrip
RDCERR("Unsupported platform %u", (uint32_t)winDesc->platform);
return NULL;
}
}*/
void *LoadVulkanLibrary()
{
+1 -1
View File
@@ -179,7 +179,7 @@ class VulkanReplay : public IReplayDriver
void Destroy(WrappedVulkan *driver, VkDevice device);
// implemented in vk_replay_platform.cpp
void CreateSurface();
void CreateSurface(WrappedVulkan *driver);
void SetWindowHandle(void *wn);
WINDOW_HANDLE_DECL
+11 -5
View File
@@ -32,13 +32,17 @@ void VulkanReplay::OutputWindow::SetWindowHandle(void *wn)
wnd = (HWND)wn;
}
void VulkanReplay::OutputWindow::InitSurfaceDescription(VkSurfaceDescriptionWindowKHR &surfDesc)
void VulkanReplay::OutputWindow::CreateSurface(WrappedVulkan *driver)
{
VkInstance inst = driver->GetInstance();
HINSTANCE hinst;
GetModuleHandleExA(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS|GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,
(const char *)&dllLocator, (HMODULE *)&surfDesc.pPlatformHandle);
surfDesc.pPlatformWindow = wnd;
surfDesc.platform = VK_PLATFORM_WIN32_KHR;
(const char *)&dllLocator, (HMODULE *)&hinst);
VkResult vkr = ObjDisp(inst)->CreateWin32SurfaceKHR(Unwrap(inst), hinst, wnd, NULL, &surface);
RDCASSERT(vkr == VK_SUCCESS);
}
void VulkanReplay::GetOutputWindowDimensions(uint64_t id, int32_t &w, int32_t &h)
@@ -62,6 +66,7 @@ bool VulkanReplay::IsOutputWindowVisible(uint64_t id)
return (IsWindowVisible(m_OutputWindows[id].wnd) == TRUE);
}
/*
RENDERDOC_WindowHandle WrappedVulkan::GetHandleForSurface(const VkSurfaceDescriptionKHR* surf)
{
RDCASSERT(surf);
@@ -71,6 +76,7 @@ RENDERDOC_WindowHandle WrappedVulkan::GetHandleForSurface(const VkSurfaceDescrip
return winDesc->pPlatformWindow;
}
*/
void *LoadVulkanLibrary()
{