VulkanRenderer: Fix unitybuild causing #define issue because of Windows.h
This commit is contained in:
parent
f034e71ba4
commit
d717335bca
|
|
@ -14,10 +14,8 @@
|
|||
#include <Nazara/VulkanRenderer/Wrapper/CommandPool.hpp>
|
||||
#include <vulkan/vulkan_core.h>
|
||||
|
||||
namespace Nz
|
||||
namespace Nz::Vk
|
||||
{
|
||||
namespace Vk
|
||||
{
|
||||
class CommandBuffer
|
||||
{
|
||||
friend CommandPool;
|
||||
|
|
@ -25,7 +23,7 @@ namespace Nz
|
|||
public:
|
||||
inline CommandBuffer();
|
||||
CommandBuffer(const CommandBuffer&) = delete;
|
||||
inline CommandBuffer(CommandBuffer&& commandBuffer);
|
||||
inline CommandBuffer(CommandBuffer&& commandBuffer) noexcept;
|
||||
~CommandBuffer() = default;
|
||||
|
||||
inline bool Begin(const VkCommandBufferBeginInfo& info);
|
||||
|
|
@ -127,7 +125,6 @@ namespace Nz
|
|||
|
||||
operator VkCommandBuffer() const { return Get(); }
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#include <Nazara/VulkanRenderer/Wrapper/CommandBuffer.inl>
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ namespace Nz
|
|||
{
|
||||
}
|
||||
|
||||
inline CommandBuffer::CommandBuffer(CommandBuffer&& commandBuffer) :
|
||||
inline CommandBuffer::CommandBuffer(CommandBuffer&& commandBuffer) noexcept :
|
||||
m_pool(commandBuffer.m_pool),
|
||||
m_handle(commandBuffer.m_handle),
|
||||
m_lastErrorCode(commandBuffer.m_lastErrorCode)
|
||||
|
|
|
|||
|
|
@ -7,10 +7,8 @@
|
|||
#include <cassert>
|
||||
#include <Nazara/VulkanRenderer/Debug.hpp>
|
||||
|
||||
namespace Nz
|
||||
namespace Nz::Vk
|
||||
{
|
||||
namespace Vk
|
||||
{
|
||||
inline DescriptorSet::DescriptorSet() :
|
||||
m_pool(nullptr),
|
||||
m_handle(VK_NULL_HANDLE)
|
||||
|
|
@ -159,7 +157,6 @@ namespace Nz
|
|||
{
|
||||
return m_handle;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#include <Nazara/VulkanRenderer/DebugOff.hpp>
|
||||
|
|
|
|||
|
|
@ -21,17 +21,24 @@
|
|||
#endif
|
||||
|
||||
#ifdef VK_USE_PLATFORM_WAYLAND_KHR
|
||||
#include <wayland-client.h>
|
||||
#include <vulkan/vulkan_wayland.h>
|
||||
#endif
|
||||
|
||||
#ifdef VK_USE_PLATFORM_WIN32_KHR
|
||||
#include <windows.h>
|
||||
typedef struct HINSTANCE__* HINSTANCE;
|
||||
typedef struct HWND__* HWND;
|
||||
typedef struct HMONITOR__* HMONITOR;
|
||||
typedef void* HANDLE;
|
||||
typedef /*_Null_terminated_*/ const wchar_t* LPCWSTR;
|
||||
typedef unsigned long DWORD;
|
||||
typedef struct _SECURITY_ATTRIBUTES SECURITY_ATTRIBUTES;
|
||||
#include <vulkan/vulkan_win32.h>
|
||||
#endif
|
||||
|
||||
#ifdef VK_USE_PLATFORM_XCB_KHR
|
||||
#include <xcb/xcb.h>
|
||||
struct xcb_connection_t;
|
||||
typedef uint32_t xcb_window_t;
|
||||
typedef uint32_t xcb_visualid_t;
|
||||
#include <vulkan/vulkan_xcb.h>
|
||||
#endif
|
||||
|
||||
|
|
@ -48,10 +55,8 @@ typedef unsigned long VisualID;
|
|||
#include <vulkan/vulkan_xlib.h>
|
||||
#endif
|
||||
|
||||
namespace Nz
|
||||
namespace Nz::Vk
|
||||
{
|
||||
namespace Vk
|
||||
{
|
||||
class NAZARA_VULKANRENDERER_API Instance
|
||||
{
|
||||
public:
|
||||
|
|
@ -113,7 +118,6 @@ namespace Nz
|
|||
RenderAPIValidationLevel m_validationLevel;
|
||||
UInt32 m_apiVersion;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#include <Nazara/VulkanRenderer/Wrapper/Instance.inl>
|
||||
|
|
|
|||
|
|
@ -7,10 +7,8 @@
|
|||
#include <cassert>
|
||||
#include <Nazara/VulkanRenderer/Debug.hpp>
|
||||
|
||||
namespace Nz
|
||||
namespace Nz::Vk
|
||||
{
|
||||
namespace Vk
|
||||
{
|
||||
inline bool Instance::Create(RenderAPIValidationLevel validationLevel, const std::string& appName, UInt32 appVersion, const std::string& engineName, UInt32 engineVersion, UInt32 apiVersion, const std::vector<const char*>& layers, const std::vector<const char*>& extensions, const VkAllocationCallbacks* allocator)
|
||||
{
|
||||
VkApplicationInfo appInfo =
|
||||
|
|
@ -144,7 +142,6 @@ namespace Nz
|
|||
|
||||
return properties;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#include <Nazara/VulkanRenderer/DebugOff.hpp>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,3 @@ extern "C"
|
|||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(NAZARA_PLATFORM_WINDOWS)
|
||||
#include <Nazara/Core/AntiWindows.hpp>
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -625,7 +625,3 @@ namespace Nz
|
|||
Vk::Instance Vulkan::s_instance;
|
||||
ParameterList Vulkan::s_initializationParameters;
|
||||
}
|
||||
|
||||
#if defined(NAZARA_PLATFORM_WINDOWS)
|
||||
#include <Nazara/Core/AntiWindows.hpp>
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -143,6 +143,7 @@ namespace Nz
|
|||
}
|
||||
}
|
||||
|
||||
// vma includes vulkan.h which includes system headers
|
||||
#if defined(NAZARA_PLATFORM_WINDOWS)
|
||||
#include <Nazara/Core/AntiWindows.hpp>
|
||||
#elif defined(NAZARA_PLATFORM_LINUX)
|
||||
|
|
|
|||
|
|
@ -18,6 +18,3 @@ namespace Nz
|
|||
m_owner.Release(*this);
|
||||
}
|
||||
}
|
||||
#if defined(NAZARA_PLATFORM_WINDOWS)
|
||||
#include <Nazara/Core/AntiWindows.hpp>
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -290,7 +290,3 @@ namespace Nz
|
|||
m_commandBuffer.ImageBarrier(ToVulkan(srcStageMask), ToVulkan(dstStageMask), VkDependencyFlags(0), ToVulkan(srcAccessMask), ToVulkan(dstAccessMask), ToVulkan(oldLayout), ToVulkan(newLayout), vkTexture.GetImage(), vkTexture.GetSubresourceRange());
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(NAZARA_PLATFORM_WINDOWS)
|
||||
#include <Nazara/Core/AntiWindows.hpp>
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -76,7 +76,3 @@ namespace Nz
|
|||
TryToShrink();
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(NAZARA_PLATFORM_WINDOWS)
|
||||
#include <Nazara/Core/AntiWindows.hpp>
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -54,7 +54,3 @@ namespace Nz
|
|||
m_pipeline.SetDebugName(name);
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(NAZARA_PLATFORM_WINDOWS)
|
||||
#include <Nazara/Core/AntiWindows.hpp>
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -140,7 +140,3 @@ namespace Nz
|
|||
return formatProperties.optimalTilingFeatures & flags; //< Assume optimal tiling
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(NAZARA_PLATFORM_WINDOWS)
|
||||
#include <Nazara/Core/AntiWindows.hpp>
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -12,7 +12,3 @@ namespace Nz
|
|||
GetFramebuffer().SetDebugName(name);
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(NAZARA_PLATFORM_WINDOWS)
|
||||
#include <Nazara/Core/AntiWindows.hpp>
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -91,7 +91,3 @@ namespace Nz
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(NAZARA_PLATFORM_WINDOWS)
|
||||
#include <Nazara/Core/AntiWindows.hpp>
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -139,7 +139,3 @@ namespace Nz
|
|||
return m_renderPass.SetDebugName(name);
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(NAZARA_PLATFORM_WINDOWS)
|
||||
#include <Nazara/Core/AntiWindows.hpp>
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -328,7 +328,3 @@ namespace Nz
|
|||
m_pipelineCreateInfo.stateData->colorBlendState = BuildColorBlendInfo(m_pipelineInfo, m_pipelineCreateInfo.colorBlendAttachmentState);
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(NAZARA_PLATFORM_WINDOWS)
|
||||
#include <Nazara/Core/AntiWindows.hpp>
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -159,7 +159,3 @@ namespace Nz
|
|||
TryToShrink();
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(NAZARA_PLATFORM_WINDOWS)
|
||||
#include <Nazara/Core/AntiWindows.hpp>
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -64,7 +64,3 @@ namespace Nz
|
|||
return m_deviceInfos;
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(NAZARA_PLATFORM_WINDOWS)
|
||||
#include <Nazara/Core/AntiWindows.hpp>
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -147,7 +147,3 @@ namespace Nz
|
|||
m_owner.Release(*this);
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(NAZARA_PLATFORM_WINDOWS)
|
||||
#include <Nazara/Core/AntiWindows.hpp>
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -147,7 +147,3 @@ namespace Nz
|
|||
m_shaderModule.SetDebugName(name);
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(NAZARA_PLATFORM_WINDOWS)
|
||||
#include <Nazara/Core/AntiWindows.hpp>
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -15,6 +15,11 @@
|
|||
#include <array>
|
||||
#include <stdexcept>
|
||||
|
||||
#ifdef VK_USE_PLATFORM_WIN32_KHR
|
||||
#include <Windows.h>
|
||||
#include <vulkan/vulkan_win32.h>
|
||||
#endif
|
||||
|
||||
#ifdef VK_USE_PLATFORM_METAL_EXT
|
||||
#include <objc/runtime.h>
|
||||
#include <vulkan/vulkan_metal.h>
|
||||
|
|
|
|||
|
|
@ -501,6 +501,7 @@ namespace Nz
|
|||
}
|
||||
}
|
||||
|
||||
// vma includes vulkan.h which includes system headers
|
||||
#if defined(NAZARA_PLATFORM_WINDOWS)
|
||||
#include <Nazara/Core/AntiWindows.hpp>
|
||||
#elif defined(NAZARA_PLATFORM_LINUX)
|
||||
|
|
|
|||
|
|
@ -42,7 +42,3 @@ namespace Nz
|
|||
throw std::runtime_error("failed to instantiate Vulkan framebuffer: " + TranslateVulkanError(m_framebuffer.GetLastErrorCode()));
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(NAZARA_PLATFORM_WINDOWS)
|
||||
#include <Nazara/Core/AntiWindows.hpp>
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -40,7 +40,3 @@ namespace Nz
|
|||
return m_sampler.SetDebugName(name);
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(NAZARA_PLATFORM_WINDOWS)
|
||||
#include <Nazara/Core/AntiWindows.hpp>
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -103,7 +103,3 @@ namespace Nz
|
|||
m_nextAllocationIndex = 0;
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(NAZARA_PLATFORM_WINDOWS)
|
||||
#include <Nazara/Core/AntiWindows.hpp>
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -8,7 +8,3 @@
|
|||
namespace Nz
|
||||
{
|
||||
}
|
||||
|
||||
#if defined(NAZARA_PLATFORM_WINDOWS)
|
||||
#include <Nazara/Core/AntiWindows.hpp>
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -51,7 +51,3 @@ namespace Nz
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(NAZARA_PLATFORM_WINDOWS)
|
||||
#include <Nazara/Core/AntiWindows.hpp>
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -49,7 +49,3 @@ namespace Nz
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(NAZARA_PLATFORM_WINDOWS)
|
||||
#include <Nazara/Core/AntiWindows.hpp>
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -300,6 +300,7 @@ namespace Nz
|
|||
}
|
||||
}
|
||||
|
||||
// vma includes vulkan.h which includes system headers
|
||||
#if defined(NAZARA_PLATFORM_WINDOWS)
|
||||
#include <Nazara/Core/AntiWindows.hpp>
|
||||
#elif defined(NAZARA_PLATFORM_LINUX)
|
||||
|
|
|
|||
|
|
@ -12,10 +12,8 @@
|
|||
#include <sstream>
|
||||
#include <Nazara/VulkanRenderer/Debug.hpp>
|
||||
|
||||
namespace Nz
|
||||
namespace Nz::Vk
|
||||
{
|
||||
namespace Vk
|
||||
{
|
||||
namespace
|
||||
{
|
||||
VKAPI_ATTR VkBool32 VKAPI_CALL DebugMessengerCallback(
|
||||
|
|
@ -334,9 +332,4 @@ namespace Nz
|
|||
|
||||
#include <Nazara/VulkanRenderer/Wrapper/InstanceFunctions.hpp>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(NAZARA_PLATFORM_WINDOWS)
|
||||
#include <Nazara/Core/AntiWindows.hpp>
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in New Issue