Add unity build support
This commit is contained in:
@@ -13,3 +13,7 @@ extern "C"
|
||||
return renderer.release();
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(NAZARA_PLATFORM_WINDOWS)
|
||||
#include <Nazara/Core/AntiWindows.hpp>
|
||||
#endif
|
||||
|
||||
@@ -18,14 +18,14 @@ namespace Nz
|
||||
{
|
||||
namespace
|
||||
{
|
||||
struct AvailableLayer
|
||||
struct AvailableVulkanLayer
|
||||
{
|
||||
VkLayerProperties layerProperties;
|
||||
std::unordered_map<std::string, std::size_t> extensionByName;
|
||||
std::vector<VkExtensionProperties> extensionList;
|
||||
};
|
||||
|
||||
void EnumerateLayers(std::vector<AvailableLayer>& availableLayers, std::unordered_map<std::string, std::size_t>& layerByName)
|
||||
void EnumerateVulkanLayers(std::vector<AvailableVulkanLayer>& availableLayers, std::unordered_map<std::string, std::size_t>& layerByName)
|
||||
{
|
||||
std::vector<VkLayerProperties> layerList;
|
||||
if (Vk::Loader::EnumerateInstanceLayerProperties(&layerList))
|
||||
@@ -175,9 +175,9 @@ namespace Nz
|
||||
|
||||
std::vector<const char*> enabledLayers;
|
||||
|
||||
std::vector<AvailableLayer> availableLayers;
|
||||
std::vector<AvailableVulkanLayer> availableLayers;
|
||||
std::unordered_map<std::string, std::size_t> availableLayerByName;
|
||||
EnumerateLayers(availableLayers, availableLayerByName);
|
||||
EnumerateVulkanLayers(availableLayers, availableLayerByName);
|
||||
|
||||
if (!parameters.GetBooleanParameter("VkInstanceInfo_OverrideEnabledLayers", &bParam) || !bParam)
|
||||
{
|
||||
@@ -627,3 +627,7 @@ namespace Nz
|
||||
Vk::Instance Vulkan::s_instance;
|
||||
ParameterList Vulkan::s_initializationParameters;
|
||||
}
|
||||
|
||||
#if defined(NAZARA_PLATFORM_WINDOWS)
|
||||
#include <Nazara/Core/AntiWindows.hpp>
|
||||
#endif
|
||||
|
||||
@@ -136,3 +136,9 @@ namespace Nz
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(NAZARA_PLATFORM_WINDOWS)
|
||||
#include <Nazara/Core/AntiWindows.hpp>
|
||||
#elif defined(NAZARA_PLATFORM_LINUX)
|
||||
#include <Nazara/Core/AntiX11.hpp>
|
||||
#endif
|
||||
|
||||
@@ -13,3 +13,6 @@ namespace Nz
|
||||
m_owner.Release(*this);
|
||||
}
|
||||
}
|
||||
#if defined(NAZARA_PLATFORM_WINDOWS)
|
||||
#include <Nazara/Core/AntiWindows.hpp>
|
||||
#endif
|
||||
|
||||
@@ -262,3 +262,7 @@ namespace Nz
|
||||
m_commandBuffer.ImageBarrier(ToVulkan(srcStageMask), ToVulkan(dstStageMask), VkDependencyFlags(0), ToVulkan(srcAccessMask), ToVulkan(dstAccessMask), ToVulkan(oldLayout), ToVulkan(newLayout), vkTexture.GetImage(), aspectFlags);
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(NAZARA_PLATFORM_WINDOWS)
|
||||
#include <Nazara/Core/AntiWindows.hpp>
|
||||
#endif
|
||||
|
||||
@@ -71,3 +71,7 @@ namespace Nz
|
||||
TryToShrink();
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(NAZARA_PLATFORM_WINDOWS)
|
||||
#include <Nazara/Core/AntiWindows.hpp>
|
||||
#endif
|
||||
|
||||
@@ -124,3 +124,7 @@ namespace Nz
|
||||
return formatProperties.optimalTilingFeatures & flags; //< Assume optimal tiling
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(NAZARA_PLATFORM_WINDOWS)
|
||||
#include <Nazara/Core/AntiWindows.hpp>
|
||||
#endif
|
||||
|
||||
@@ -8,3 +8,7 @@
|
||||
namespace Nz
|
||||
{
|
||||
}
|
||||
|
||||
#if defined(NAZARA_PLATFORM_WINDOWS)
|
||||
#include <Nazara/Core/AntiWindows.hpp>
|
||||
#endif
|
||||
|
||||
@@ -91,3 +91,7 @@ namespace Nz
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(NAZARA_PLATFORM_WINDOWS)
|
||||
#include <Nazara/Core/AntiWindows.hpp>
|
||||
#endif
|
||||
|
||||
@@ -134,3 +134,7 @@ namespace Nz
|
||||
OnRenderPassRelease(this);
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(NAZARA_PLATFORM_WINDOWS)
|
||||
#include <Nazara/Core/AntiWindows.hpp>
|
||||
#endif
|
||||
|
||||
@@ -320,3 +320,7 @@ namespace Nz
|
||||
m_pipelineCreateInfo.stateData->colorBlendState = BuildColorBlendInfo(m_pipelineInfo, m_pipelineCreateInfo.colorBlendAttachmentState);
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(NAZARA_PLATFORM_WINDOWS)
|
||||
#include <Nazara/Core/AntiWindows.hpp>
|
||||
#endif
|
||||
|
||||
@@ -154,3 +154,7 @@ namespace Nz
|
||||
TryToShrink();
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(NAZARA_PLATFORM_WINDOWS)
|
||||
#include <Nazara/Core/AntiWindows.hpp>
|
||||
#endif
|
||||
|
||||
@@ -615,3 +615,7 @@ namespace Nz
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(NAZARA_PLATFORM_WINDOWS)
|
||||
#include <Nazara/Core/AntiWindows.hpp>
|
||||
#endif
|
||||
|
||||
@@ -75,3 +75,7 @@ namespace Nz
|
||||
return m_deviceInfos;
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(NAZARA_PLATFORM_WINDOWS)
|
||||
#include <Nazara/Core/AntiWindows.hpp>
|
||||
#endif
|
||||
|
||||
@@ -73,3 +73,7 @@ namespace Nz
|
||||
m_owner.Release(*this);
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(NAZARA_PLATFORM_WINDOWS)
|
||||
#include <Nazara/Core/AntiWindows.hpp>
|
||||
#endif
|
||||
|
||||
@@ -146,3 +146,7 @@ namespace Nz
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(NAZARA_PLATFORM_WINDOWS)
|
||||
#include <Nazara/Core/AntiWindows.hpp>
|
||||
#endif
|
||||
|
||||
@@ -77,3 +77,7 @@ namespace Nz
|
||||
m_surface.Destroy();
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(NAZARA_PLATFORM_WINDOWS)
|
||||
#include <Nazara/Core/AntiWindows.hpp>
|
||||
#endif
|
||||
|
||||
@@ -418,3 +418,9 @@ namespace Nz
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(NAZARA_PLATFORM_WINDOWS)
|
||||
#include <Nazara/Core/AntiWindows.hpp>
|
||||
#elif defined(NAZARA_PLATFORM_LINUX)
|
||||
#include <Nazara/Core/AntiX11.hpp>
|
||||
#endif
|
||||
|
||||
@@ -42,3 +42,7 @@ 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
|
||||
|
||||
@@ -33,3 +33,7 @@ namespace Nz
|
||||
throw std::runtime_error("Failed to create sampler: " + TranslateVulkanError(m_sampler.GetLastErrorCode()));
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(NAZARA_PLATFORM_WINDOWS)
|
||||
#include <Nazara/Core/AntiWindows.hpp>
|
||||
#endif
|
||||
|
||||
@@ -103,3 +103,7 @@ namespace Nz
|
||||
m_nextAllocationIndex = 0;
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(NAZARA_PLATFORM_WINDOWS)
|
||||
#include <Nazara/Core/AntiWindows.hpp>
|
||||
#endif
|
||||
|
||||
@@ -8,3 +8,7 @@
|
||||
namespace Nz
|
||||
{
|
||||
}
|
||||
|
||||
#if defined(NAZARA_PLATFORM_WINDOWS)
|
||||
#include <Nazara/Core/AntiWindows.hpp>
|
||||
#endif
|
||||
|
||||
@@ -51,3 +51,7 @@ namespace Nz
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(NAZARA_PLATFORM_WINDOWS)
|
||||
#include <Nazara/Core/AntiWindows.hpp>
|
||||
#endif
|
||||
|
||||
@@ -49,3 +49,7 @@ namespace Nz
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(NAZARA_PLATFORM_WINDOWS)
|
||||
#include <Nazara/Core/AntiWindows.hpp>
|
||||
#endif
|
||||
|
||||
@@ -293,3 +293,9 @@ namespace Nz
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(NAZARA_PLATFORM_WINDOWS)
|
||||
#include <Nazara/Core/AntiWindows.hpp>
|
||||
#elif defined(NAZARA_PLATFORM_LINUX)
|
||||
#include <Nazara/Core/AntiX11.hpp>
|
||||
#endif
|
||||
|
||||
@@ -253,3 +253,7 @@ namespace Nz
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(NAZARA_PLATFORM_WINDOWS)
|
||||
#include <Nazara/Core/AntiWindows.hpp>
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user