Skip to content
Permalink
Browse files
Merge pull request #9190 from iwubcode/enable_vulkan_windows_solution
VideoCommon: enable vulkan in windows solution, update CMake vulkan option to match opengl
  • Loading branch information
leoetlino committed Oct 24, 2020
2 parents 285b926 + 02c3242 commit 1719e63
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 10 deletions.
@@ -115,8 +115,8 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/Binaries)
if (WIN32)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/Binary)

if (CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
string(APPEND CMAKE_RUNTIME_OUTPUT_DIRECTORY /ARM64)
if (CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
string(APPEND CMAKE_RUNTIME_OUTPUT_DIRECTORY /ARM64)
endif()

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
@@ -557,7 +557,12 @@ add_subdirectory(Externals/imgui)
add_subdirectory(Externals/glslang)

if(ENABLE_VULKAN)
add_definitions(-DUSE_VULKAN)
add_definitions(-DHAS_VULKAN)
endif()

if(NOT WIN32 OR (NOT (CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")))
# OpenGL is available on all platforms except windows-arm64
add_definitions(-DHAS_OPENGL)
endif()

find_package(pugixml)
@@ -22,11 +22,6 @@
#include "Core/ConfigManager.h"
#include "Core/Core.h"

// OpenGL is not available on Windows-on-ARM64
#if !defined(_WIN32) || !defined(_M_ARM64)
#define HAS_OPENGL 1
#endif

// TODO: ugly
#ifdef _WIN32
#include "VideoBackends/D3D/VideoBackend.h"
@@ -37,7 +32,9 @@
#include "VideoBackends/OGL/VideoBackend.h"
#include "VideoBackends/Software/VideoBackend.h"
#endif
#ifdef HAS_VULKAN
#include "VideoBackends/Vulkan/VideoBackend.h"
#endif

#include "VideoCommon/AsyncRequests.h"
#include "VideoCommon/BPStructs.h"
@@ -225,7 +222,7 @@ const std::vector<std::unique_ptr<VideoBackendBase>>& VideoBackendBase::GetAvail
backends.push_back(std::make_unique<DX11::VideoBackend>());
backends.push_back(std::make_unique<DX12::VideoBackend>());
#endif
#ifdef USE_VULKAN
#ifdef HAS_VULKAN
backends.push_back(std::make_unique<Vulkan::VideoBackend>());
#endif
#ifdef HAS_OPENGL
@@ -15,6 +15,16 @@
<Import Project="$(VSPropsDir)PCHUse.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<ItemDefinitionGroup Condition="'$(Platform)'=='x64'">
<ClCompile>
<PreprocessorDefinitions>HAS_OPENGL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup>
<ClCompile>
<PreprocessorDefinitions>HAS_VULKAN;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="AbstractFramebuffer.cpp" />
<ClCompile Include="AbstractStagingTexture.cpp" />
@@ -191,4 +201,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>

0 comments on commit 1719e63

Please sign in to comment.