mirror of https://github.com/PCSX2/pcsx2.git
GS: Support compiling without OpenGL renderer
This commit is contained in:
parent
3488aa54be
commit
d387a1f4dc
|
@ -10,9 +10,17 @@ add_library(imgui
|
||||||
imgui/imstb_rectpack.h
|
imgui/imstb_rectpack.h
|
||||||
imgui/imstb_textedit.h
|
imgui/imstb_textedit.h
|
||||||
imgui/imstb_truetype.h
|
imgui/imstb_truetype.h
|
||||||
|
)
|
||||||
|
|
||||||
|
target_include_directories(imgui PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/imgui" "${CMAKE_CURRENT_SOURCE_DIR}/include")
|
||||||
|
|
||||||
|
if(USE_OPENGL)
|
||||||
|
target_sources(imgui PRIVATE
|
||||||
include/imgui_impl_opengl3.h
|
include/imgui_impl_opengl3.h
|
||||||
src/imgui_impl_opengl3.cpp
|
src/imgui_impl_opengl3.cpp
|
||||||
)
|
)
|
||||||
|
target_link_libraries(imgui glad)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
target_sources(imgui PRIVATE
|
target_sources(imgui PRIVATE
|
||||||
|
@ -20,7 +28,3 @@ if(WIN32)
|
||||||
src/imgui_impl_dx11.cpp
|
src/imgui_impl_dx11.cpp
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_include_directories(imgui PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/imgui" "${CMAKE_CURRENT_SOURCE_DIR}/include")
|
|
||||||
target_link_libraries(imgui glad)
|
|
||||||
|
|
||||||
|
|
|
@ -38,6 +38,7 @@ option(USE_VTUNE "Plug VTUNE to profile GS JIT.")
|
||||||
# Graphical option
|
# Graphical option
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
option(BUILD_REPLAY_LOADERS "Build GS replayer to ease testing (developer option)")
|
option(BUILD_REPLAY_LOADERS "Build GS replayer to ease testing (developer option)")
|
||||||
|
option(USE_OPENGL "Enable OpenGL GS renderer" ON)
|
||||||
option(USE_VULKAN "Enable Vulkan GS renderer" ON)
|
option(USE_VULKAN "Enable Vulkan GS renderer" ON)
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
|
@ -206,6 +207,10 @@ if(USE_VTUNE)
|
||||||
list(APPEND PCSX2_DEFS ENABLE_VTUNE)
|
list(APPEND PCSX2_DEFS ENABLE_VTUNE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(USE_OPENGL)
|
||||||
|
list(APPEND PCSX2_DEFS ENABLE_OPENGL)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(USE_VULKAN)
|
if(USE_VULKAN)
|
||||||
list(APPEND PCSX2_DEFS ENABLE_VULKAN)
|
list(APPEND PCSX2_DEFS ENABLE_VULKAN)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -29,8 +29,10 @@ else()
|
||||||
|
|
||||||
# Using find_package OpenGL without either setting your opengl preference to GLVND or LEGACY
|
# Using find_package OpenGL without either setting your opengl preference to GLVND or LEGACY
|
||||||
# is deprecated as of cmake 3.11.
|
# is deprecated as of cmake 3.11.
|
||||||
|
if(USE_OPENGL)
|
||||||
set(OpenGL_GL_PREFERENCE GLVND)
|
set(OpenGL_GL_PREFERENCE GLVND)
|
||||||
find_package(OpenGL REQUIRED)
|
find_package(OpenGL REQUIRED)
|
||||||
|
endif()
|
||||||
find_package(PNG REQUIRED)
|
find_package(PNG REQUIRED)
|
||||||
find_package(Vtune)
|
find_package(Vtune)
|
||||||
|
|
||||||
|
@ -115,7 +117,9 @@ else()
|
||||||
include(CheckLib)
|
include(CheckLib)
|
||||||
|
|
||||||
if(UNIX AND NOT APPLE)
|
if(UNIX AND NOT APPLE)
|
||||||
|
if(USE_OPENGL)
|
||||||
check_lib(EGL EGL EGL/egl.h)
|
check_lib(EGL EGL EGL/egl.h)
|
||||||
|
endif()
|
||||||
if(X11_API)
|
if(X11_API)
|
||||||
check_lib(X11_XCB X11-xcb X11/Xlib-xcb.h)
|
check_lib(X11_XCB X11-xcb X11/Xlib-xcb.h)
|
||||||
check_lib(XCB xcb xcb/xcb.h)
|
check_lib(XCB xcb xcb/xcb.h)
|
||||||
|
@ -259,10 +263,13 @@ else()
|
||||||
set(BIN2CPPDEP ${CMAKE_SOURCE_DIR}/linux_various/hex2h.pl)
|
set(BIN2CPPDEP ${CMAKE_SOURCE_DIR}/linux_various/hex2h.pl)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_subdirectory(3rdparty/glad EXCLUDE_FROM_ALL)
|
|
||||||
add_subdirectory(3rdparty/simpleini EXCLUDE_FROM_ALL)
|
add_subdirectory(3rdparty/simpleini EXCLUDE_FROM_ALL)
|
||||||
add_subdirectory(3rdparty/imgui EXCLUDE_FROM_ALL)
|
add_subdirectory(3rdparty/imgui EXCLUDE_FROM_ALL)
|
||||||
|
|
||||||
|
if(USE_OPENGL)
|
||||||
|
add_subdirectory(3rdparty/glad EXCLUDE_FROM_ALL)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(USE_VULKAN)
|
if(USE_VULKAN)
|
||||||
add_subdirectory(3rdparty/glslang EXCLUDE_FROM_ALL)
|
add_subdirectory(3rdparty/glslang EXCLUDE_FROM_ALL)
|
||||||
add_subdirectory(3rdparty/vulkan-headers EXCLUDE_FROM_ALL)
|
add_subdirectory(3rdparty/vulkan-headers EXCLUDE_FROM_ALL)
|
||||||
|
|
|
@ -18,10 +18,6 @@ target_sources(common PRIVATE
|
||||||
Exceptions.cpp
|
Exceptions.cpp
|
||||||
FastFormatString.cpp
|
FastFormatString.cpp
|
||||||
FastJmp.cpp
|
FastJmp.cpp
|
||||||
GL/Context.cpp
|
|
||||||
GL/Program.cpp
|
|
||||||
GL/ShaderCache.cpp
|
|
||||||
GL/StreamBuffer.cpp
|
|
||||||
FileSystem.cpp
|
FileSystem.cpp
|
||||||
IniInterface.cpp
|
IniInterface.cpp
|
||||||
Mutex.cpp
|
Mutex.cpp
|
||||||
|
@ -78,10 +74,6 @@ target_sources(common PRIVATE
|
||||||
FastJmp.h
|
FastJmp.h
|
||||||
FileSystem.h
|
FileSystem.h
|
||||||
General.h
|
General.h
|
||||||
GL/Context.h
|
|
||||||
GL/Program.h
|
|
||||||
GL/ShaderCache.h
|
|
||||||
GL/StreamBuffer.h
|
|
||||||
HashCombine.h
|
HashCombine.h
|
||||||
MemcpyFast.h
|
MemcpyFast.h
|
||||||
MemsetFast.inl
|
MemsetFast.inl
|
||||||
|
@ -134,6 +126,22 @@ target_sources(common PRIVATE
|
||||||
emitter/x86types.h
|
emitter/x86types.h
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(USE_OPENGL)
|
||||||
|
target_sources(common PRIVATE
|
||||||
|
GL/Context.cpp
|
||||||
|
GL/Program.cpp
|
||||||
|
GL/ShaderCache.cpp
|
||||||
|
GL/StreamBuffer.cpp
|
||||||
|
)
|
||||||
|
target_sources(common PRIVATE
|
||||||
|
GL/Context.h
|
||||||
|
GL/Program.h
|
||||||
|
GL/ShaderCache.h
|
||||||
|
GL/StreamBuffer.h
|
||||||
|
)
|
||||||
|
target_link_libraries(common PUBLIC glad)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(USE_VULKAN)
|
if(USE_VULKAN)
|
||||||
target_link_libraries(common PUBLIC
|
target_link_libraries(common PUBLIC
|
||||||
Vulkan-Headers glslang
|
Vulkan-Headers glslang
|
||||||
|
@ -176,11 +184,17 @@ if(WIN32)
|
||||||
D3D11/ShaderCache.h
|
D3D11/ShaderCache.h
|
||||||
D3D11/ShaderCompiler.cpp
|
D3D11/ShaderCompiler.cpp
|
||||||
D3D11/ShaderCompiler.h
|
D3D11/ShaderCompiler.h
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(USE_OPENGL)
|
||||||
|
if(WIN32)
|
||||||
|
target_sources(common PRIVATE
|
||||||
GL/ContextWGL.cpp
|
GL/ContextWGL.cpp
|
||||||
GL/ContextWGL.h
|
GL/ContextWGL.h
|
||||||
)
|
)
|
||||||
target_link_libraries(common PUBLIC pthreads4w Winmm.lib opengl32.lib)
|
target_link_libraries(common PUBLIC opengl32.lib)
|
||||||
elseif(APPLE)
|
elseif(APPLE)
|
||||||
target_sources(common PRIVATE
|
target_sources(common PRIVATE
|
||||||
GL/ContextAGL.mm
|
GL/ContextAGL.mm
|
||||||
GL/ContextAGL.h
|
GL/ContextAGL.h
|
||||||
|
@ -188,7 +202,7 @@ elseif(APPLE)
|
||||||
set_source_files_properties(GL/ContextAGL.mm PROPERTIES SKIP_PRECOMPILE_HEADERS ON)
|
set_source_files_properties(GL/ContextAGL.mm PROPERTIES SKIP_PRECOMPILE_HEADERS ON)
|
||||||
target_compile_options(common PRIVATE -fobjc-arc)
|
target_compile_options(common PRIVATE -fobjc-arc)
|
||||||
target_link_options(common PRIVATE -fobjc-link-runtime)
|
target_link_options(common PRIVATE -fobjc-link-runtime)
|
||||||
else()
|
else()
|
||||||
if(X11_API OR WAYLAND_API)
|
if(X11_API OR WAYLAND_API)
|
||||||
target_sources(common PRIVATE
|
target_sources(common PRIVATE
|
||||||
GL/ContextEGL.cpp
|
GL/ContextEGL.cpp
|
||||||
|
@ -202,7 +216,6 @@ else()
|
||||||
GL/ContextEGLX11.cpp
|
GL/ContextEGLX11.cpp
|
||||||
GL/ContextEGLX11.h
|
GL/ContextEGLX11.h
|
||||||
)
|
)
|
||||||
target_compile_definitions(common PUBLIC "VULKAN_USE_X11=1")
|
|
||||||
if(TARGET PkgConfig::XRANDR)
|
if(TARGET PkgConfig::XRANDR)
|
||||||
target_link_libraries(common PRIVATE PkgConfig::XRANDR)
|
target_link_libraries(common PRIVATE PkgConfig::XRANDR)
|
||||||
target_compile_definitions(common PRIVATE "HAS_XRANDR=1")
|
target_compile_definitions(common PRIVATE "HAS_XRANDR=1")
|
||||||
|
@ -215,8 +228,23 @@ else()
|
||||||
GL/ContextEGLWayland.h
|
GL/ContextEGLWayland.h
|
||||||
)
|
)
|
||||||
target_link_libraries(common PRIVATE ${WAYLAND_EGL_LIBRARIES})
|
target_link_libraries(common PRIVATE ${WAYLAND_EGL_LIBRARIES})
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(USE_VULKAN)
|
||||||
|
if(APPLE)
|
||||||
|
# Needed for Metal surface creation.
|
||||||
|
target_compile_options(common PRIVATE -fobjc-arc)
|
||||||
|
target_link_options(common PRIVATE -fobjc-link-runtime)
|
||||||
|
elseif(NOT WIN32)
|
||||||
|
if(X11_API)
|
||||||
|
target_compile_definitions(common PUBLIC "VULKAN_USE_X11=1")
|
||||||
|
endif()
|
||||||
|
if(WAYLAND_API)
|
||||||
target_compile_definitions(common PUBLIC "VULKAN_USE_WAYLAND=1")
|
target_compile_definitions(common PUBLIC "VULKAN_USE_WAYLAND=1")
|
||||||
endif()
|
endif()
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (USE_GCC AND CMAKE_INTERPROCEDURAL_OPTIMIZATION)
|
if (USE_GCC AND CMAKE_INTERPROCEDURAL_OPTIMIZATION)
|
||||||
|
@ -224,7 +252,7 @@ if (USE_GCC AND CMAKE_INTERPROCEDURAL_OPTIMIZATION)
|
||||||
set_source_files_properties(FastJmp.cpp PROPERTIES COMPILE_FLAGS -fno-lto)
|
set_source_files_properties(FastJmp.cpp PROPERTIES COMPILE_FLAGS -fno-lto)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_link_libraries(common PRIVATE ${LIBC_LIBRARIES} PUBLIC wxWidgets::all glad)
|
target_link_libraries(common PRIVATE ${LIBC_LIBRARIES} PUBLIC wxWidgets::all)
|
||||||
target_compile_features(common PUBLIC cxx_std_17)
|
target_compile_features(common PUBLIC cxx_std_17)
|
||||||
target_include_directories(common PUBLIC ../3rdparty/include ../)
|
target_include_directories(common PUBLIC ../3rdparty/include ../)
|
||||||
target_compile_definitions(common PUBLIC "${PCSX2_DEFS}")
|
target_compile_definitions(common PUBLIC "${PCSX2_DEFS}")
|
||||||
|
|
|
@ -43,10 +43,18 @@ static constexpr RendererInfo s_renderer_info[] = {
|
||||||
QT_TRANSLATE_NOOP("GraphicsSettingsWidget", "Direct3D 11"),
|
QT_TRANSLATE_NOOP("GraphicsSettingsWidget", "Direct3D 11"),
|
||||||
GSRendererType::DX11,
|
GSRendererType::DX11,
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef ENABLE_OPENGL
|
||||||
QT_TRANSLATE_NOOP("GraphicsSettingsWidget", "OpenGL"),
|
QT_TRANSLATE_NOOP("GraphicsSettingsWidget", "OpenGL"),
|
||||||
GSRendererType::OGL,
|
GSRendererType::OGL,
|
||||||
|
#endif
|
||||||
|
#ifdef ENABLE_VULKAN
|
||||||
QT_TRANSLATE_NOOP("GraphicsSettingsWidget", "Vulkan"),
|
QT_TRANSLATE_NOOP("GraphicsSettingsWidget", "Vulkan"),
|
||||||
GSRendererType::VK,
|
GSRendererType::VK,
|
||||||
|
#endif
|
||||||
|
#ifdef __APPLE__
|
||||||
|
QT_TRANSLATE_NOOP("GraphicsSettingsWidget", "Metal"),
|
||||||
|
GSRendererType::Metal,
|
||||||
|
#endif
|
||||||
QT_TRANSLATE_NOOP("GraphicsSettingsWidget", "Software"),
|
QT_TRANSLATE_NOOP("GraphicsSettingsWidget", "Software"),
|
||||||
GSRendererType::SW,
|
GSRendererType::SW,
|
||||||
QT_TRANSLATE_NOOP("GraphicsSettingsWidget", "Null"),
|
QT_TRANSLATE_NOOP("GraphicsSettingsWidget", "Null"),
|
||||||
|
|
|
@ -50,7 +50,7 @@
|
||||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||||
<PrecompiledHeaderFile>PrecompiledHeader.h</PrecompiledHeaderFile>
|
<PrecompiledHeaderFile>PrecompiledHeader.h</PrecompiledHeaderFile>
|
||||||
<EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
|
<EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
|
||||||
<PreprocessorDefinitions>WIN32_LEAN_AND_MEAN;LZMA_API_STATIC;BUILD_DX=1;SPU2X_PORTAUDIO;DIRECTINPUT_VERSION=0x0800;PCSX2_CORE;DISABLE_RECORDING;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>WIN32_LEAN_AND_MEAN;LZMA_API_STATIC;BUILD_DX=1;ENABLE_OPENGL;ENABLE_VULKAN;DIRECTINPUT_VERSION=0x0800;PCSX2_CORE;DISABLE_RECORDING;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<PreprocessorDefinitions Condition="$(Configuration.Contains(Debug))">PCSX2_DEBUG;PCSX2_DEVBUILD;_SECURE_SCL_=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions Condition="$(Configuration.Contains(Debug))">PCSX2_DEBUG;PCSX2_DEVBUILD;_SECURE_SCL_=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<PreprocessorDefinitions Condition="$(Configuration.Contains(Devel))">PCSX2_DEVEL;PCSX2_DEVBUILD;NDEBUG;_SECURE_SCL_=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions Condition="$(Configuration.Contains(Devel))">PCSX2_DEVEL;PCSX2_DEVBUILD;NDEBUG;_SECURE_SCL_=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<PreprocessorDefinitions Condition="$(Configuration.Contains(Release))">NDEBUG;_SECURE_SCL_=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions Condition="$(Configuration.Contains(Release))">NDEBUG;_SECURE_SCL_=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
|
|
@ -699,10 +699,6 @@ set(pcsx2GSSources
|
||||||
GS/Renderers/SW/GSSetupPrimCodeGenerator.all.cpp
|
GS/Renderers/SW/GSSetupPrimCodeGenerator.all.cpp
|
||||||
GS/Renderers/SW/GSTextureCacheSW.cpp
|
GS/Renderers/SW/GSTextureCacheSW.cpp
|
||||||
GS/Renderers/SW/GSTextureSW.cpp
|
GS/Renderers/SW/GSTextureSW.cpp
|
||||||
GS/Renderers/OpenGL/GLLoader.cpp
|
|
||||||
GS/Renderers/OpenGL/GLState.cpp
|
|
||||||
GS/Renderers/OpenGL/GSDeviceOGL.cpp
|
|
||||||
GS/Renderers/OpenGL/GSTextureOGL.cpp
|
|
||||||
GS/Window/GSSetting.cpp
|
GS/Window/GSSetting.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -767,15 +763,27 @@ set(pcsx2GSHeaders
|
||||||
GS/Renderers/SW/GSTextureCacheSW.h
|
GS/Renderers/SW/GSTextureCacheSW.h
|
||||||
GS/Renderers/SW/GSTextureSW.h
|
GS/Renderers/SW/GSTextureSW.h
|
||||||
GS/Renderers/SW/GSVertexSW.h
|
GS/Renderers/SW/GSVertexSW.h
|
||||||
|
GS/Window/GSCaptureDlg.h
|
||||||
|
GS/Window/GSDialog.h
|
||||||
|
GS/Window/GSSetting.h
|
||||||
|
)
|
||||||
|
|
||||||
|
if(USE_OPENGL)
|
||||||
|
list(APPEND pcsx2GSSources
|
||||||
|
GS/Renderers/OpenGL/GLLoader.cpp
|
||||||
|
GS/Renderers/OpenGL/GLState.cpp
|
||||||
|
GS/Renderers/OpenGL/GSDeviceOGL.cpp
|
||||||
|
GS/Renderers/OpenGL/GSTextureOGL.cpp
|
||||||
|
)
|
||||||
|
list(APPEND pcsx2GSHeaders
|
||||||
GS/Renderers/OpenGL/GLLoader.h
|
GS/Renderers/OpenGL/GLLoader.h
|
||||||
GS/Renderers/OpenGL/GLState.h
|
GS/Renderers/OpenGL/GLState.h
|
||||||
GS/Renderers/OpenGL/GSDeviceOGL.h
|
GS/Renderers/OpenGL/GSDeviceOGL.h
|
||||||
GS/Renderers/OpenGL/GSTextureOGL.h
|
GS/Renderers/OpenGL/GSTextureOGL.h
|
||||||
GS/Renderers/OpenGL/GSUniformBufferOGL.h
|
GS/Renderers/OpenGL/GSUniformBufferOGL.h
|
||||||
GS/Window/GSCaptureDlg.h
|
|
||||||
GS/Window/GSDialog.h
|
|
||||||
GS/Window/GSSetting.h
|
|
||||||
)
|
)
|
||||||
|
target_link_libraries(PCSX2_FLAGS INTERFACE glad)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(USE_VULKAN)
|
if(USE_VULKAN)
|
||||||
list(APPEND pcsx2GSSources
|
list(APPEND pcsx2GSSources
|
||||||
|
@ -984,15 +992,22 @@ set(pcsx2DebugToolsHeaders
|
||||||
# Frontend sources
|
# Frontend sources
|
||||||
set(pcsx2FrontendSources
|
set(pcsx2FrontendSources
|
||||||
Frontend/ImGuiManager.cpp
|
Frontend/ImGuiManager.cpp
|
||||||
Frontend/OpenGLHostDisplay.cpp
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# Frontend headers
|
# Frontend headers
|
||||||
set(pcsx2FrontendHeaders
|
set(pcsx2FrontendHeaders
|
||||||
Frontend/ImGuiManager.h
|
Frontend/ImGuiManager.h
|
||||||
Frontend/OpenGLHostDisplay.h
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(USE_OPENGL)
|
||||||
|
list(APPEND pcsx2FrontendSources
|
||||||
|
Frontend/OpenGLHostDisplay.cpp
|
||||||
|
)
|
||||||
|
list(APPEND pcsx2FrontendHeaders
|
||||||
|
Frontend/OpenGLHostDisplay.h
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(USE_VULKAN)
|
if(USE_VULKAN)
|
||||||
list(APPEND pcsx2FrontendSources
|
list(APPEND pcsx2FrontendSources
|
||||||
Frontend/VulkanHostDisplay.cpp
|
Frontend/VulkanHostDisplay.cpp
|
||||||
|
@ -1579,7 +1594,6 @@ endif()
|
||||||
|
|
||||||
target_link_libraries(PCSX2_FLAGS INTERFACE
|
target_link_libraries(PCSX2_FLAGS INTERFACE
|
||||||
common
|
common
|
||||||
glad
|
|
||||||
imgui
|
imgui
|
||||||
fmt::fmt
|
fmt::fmt
|
||||||
ryml
|
ryml
|
||||||
|
|
|
@ -25,8 +25,6 @@
|
||||||
#include "Renderers/SW/GSRendererSW.h"
|
#include "Renderers/SW/GSRendererSW.h"
|
||||||
#include "Renderers/Null/GSRendererNull.h"
|
#include "Renderers/Null/GSRendererNull.h"
|
||||||
#include "Renderers/Null/GSDeviceNull.h"
|
#include "Renderers/Null/GSDeviceNull.h"
|
||||||
#include "Renderers/OpenGL/GSDeviceOGL.h"
|
|
||||||
#include "Renderers/Metal/GSMetalCPPAccessible.h"
|
|
||||||
#include "Renderers/HW/GSRendererNew.h"
|
#include "Renderers/HW/GSRendererNew.h"
|
||||||
#include "Renderers/HW/GSTextureReplacements.h"
|
#include "Renderers/HW/GSTextureReplacements.h"
|
||||||
#include "GSLzma.h"
|
#include "GSLzma.h"
|
||||||
|
@ -45,6 +43,14 @@
|
||||||
#include "pcsx2/Frontend/InputManager.h"
|
#include "pcsx2/Frontend/InputManager.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef ENABLE_OPENGL
|
||||||
|
#include "Renderers/OpenGL/GSDeviceOGL.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __APPLE__
|
||||||
|
#include "Renderers/Metal/GSMetalCPPAccessible.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef ENABLE_VULKAN
|
#ifdef ENABLE_VULKAN
|
||||||
#include "Renderers/Vulkan/GSDeviceVK.h"
|
#include "Renderers/Vulkan/GSDeviceVK.h"
|
||||||
#endif
|
#endif
|
||||||
|
@ -157,27 +163,44 @@ void GSclose()
|
||||||
|
|
||||||
static HostDisplay::RenderAPI GetAPIForRenderer(GSRendererType renderer)
|
static HostDisplay::RenderAPI GetAPIForRenderer(GSRendererType renderer)
|
||||||
{
|
{
|
||||||
|
#if defined(_WIN32)
|
||||||
|
// On Windows, we use DX11 for software, since it's always available.
|
||||||
|
constexpr HostDisplay::RenderAPI default_api = HostDisplay::RenderAPI::D3D11;
|
||||||
|
#elif defined(__APPLE__)
|
||||||
|
// For Macs, default to Metal.
|
||||||
|
constexpr HostDisplay::RenderAPI default_api = HostDisplay::RenderAPI::Metal;
|
||||||
|
#else
|
||||||
|
// For Linux, default to OpenGL (because of hardware compatibility), if we
|
||||||
|
// have it, otherwise Vulkan (if we have it).
|
||||||
|
#if defined(ENABLE_OPENGL)
|
||||||
|
constexpr HostDisplay::RenderAPI default_api = HostDisplay::RenderAPI::OpenGL;
|
||||||
|
#elif defined(ENABLE_VULKAN)
|
||||||
|
constexpr HostDisplay::RenderAPI default_api = HostDisplay::RenderAPI::Vulkan;
|
||||||
|
#else
|
||||||
|
constexpr HostDisplay::RenderAPI default_api = HostDisplay::RenderAPI::None;
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
switch (renderer)
|
switch (renderer)
|
||||||
{
|
{
|
||||||
case GSRendererType::OGL:
|
case GSRendererType::OGL:
|
||||||
#ifndef _WIN32
|
|
||||||
default:
|
|
||||||
#endif
|
|
||||||
return HostDisplay::RenderAPI::OpenGL;
|
return HostDisplay::RenderAPI::OpenGL;
|
||||||
|
|
||||||
case GSRendererType::VK:
|
case GSRendererType::VK:
|
||||||
return HostDisplay::RenderAPI::Vulkan;
|
return HostDisplay::RenderAPI::Vulkan;
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
case GSRendererType::DX11:
|
||||||
|
return HostDisplay::RenderAPI::D3D11;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
case GSRendererType::Metal:
|
case GSRendererType::Metal:
|
||||||
return HostDisplay::RenderAPI::Metal;
|
return HostDisplay::RenderAPI::Metal;
|
||||||
#endif
|
#endif
|
||||||
#ifdef _WIN32
|
|
||||||
case GSRendererType::DX11:
|
|
||||||
case GSRendererType::SW:
|
|
||||||
default:
|
default:
|
||||||
return HostDisplay::RenderAPI::D3D11;
|
return default_api;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -200,10 +223,12 @@ static bool DoGSOpen(GSRendererType renderer, u8* basemem)
|
||||||
g_gs_device = std::unique_ptr<GSDevice>(MakeGSDeviceMTL());
|
g_gs_device = std::unique_ptr<GSDevice>(MakeGSDeviceMTL());
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef ENABLE_OPENGL
|
||||||
case HostDisplay::RenderAPI::OpenGL:
|
case HostDisplay::RenderAPI::OpenGL:
|
||||||
case HostDisplay::RenderAPI::OpenGLES:
|
case HostDisplay::RenderAPI::OpenGLES:
|
||||||
g_gs_device = std::make_unique<GSDeviceOGL>();
|
g_gs_device = std::make_unique<GSDeviceOGL>();
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef ENABLE_VULKAN
|
#ifdef ENABLE_VULKAN
|
||||||
case HostDisplay::RenderAPI::Vulkan:
|
case HostDisplay::RenderAPI::Vulkan:
|
||||||
|
@ -1200,7 +1225,9 @@ void GSApp::Init()
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
m_gs_renderers.push_back(GSSetting(static_cast<u32>(GSRendererType::Metal), "Metal", ""));
|
m_gs_renderers.push_back(GSSetting(static_cast<u32>(GSRendererType::Metal), "Metal", ""));
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef ENABLE_OPENGL
|
||||||
m_gs_renderers.push_back(GSSetting(static_cast<u32>(GSRendererType::OGL), "OpenGL", ""));
|
m_gs_renderers.push_back(GSSetting(static_cast<u32>(GSRendererType::OGL), "OpenGL", ""));
|
||||||
|
#endif
|
||||||
#ifdef ENABLE_VULKAN
|
#ifdef ENABLE_VULKAN
|
||||||
m_gs_renderers.push_back(GSSetting(static_cast<u32>(GSRendererType::VK), "Vulkan", ""));
|
m_gs_renderers.push_back(GSSetting(static_cast<u32>(GSRendererType::VK), "Vulkan", ""));
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -190,14 +190,30 @@ CRCHackLevel GSUtil::GetRecommendedCRCHackLevel(GSRendererType type)
|
||||||
|
|
||||||
GSRendererType GSUtil::GetPreferredRenderer()
|
GSRendererType GSUtil::GetPreferredRenderer()
|
||||||
{
|
{
|
||||||
#ifdef __APPLE__
|
#if defined(__APPLE__)
|
||||||
|
// Mac: Prefer Metal hardware.
|
||||||
return GSRendererType::Metal;
|
return GSRendererType::Metal;
|
||||||
#endif
|
#elif defined(_WIN32)
|
||||||
#ifdef _WIN32
|
#if defined(ENABLE_OPENGL)
|
||||||
|
// Windows: Prefer GL if available.
|
||||||
if (D3D::ShouldPreferD3D())
|
if (D3D::ShouldPreferD3D())
|
||||||
return GSRendererType::DX11;
|
return GSRendererType::DX11;
|
||||||
#endif
|
else
|
||||||
return GSRendererType::OGL;
|
return GSRendererType::OGL;
|
||||||
|
#else
|
||||||
|
// DX11 is always available, otherwise.
|
||||||
|
return GSRendererType::DX11;
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
// Linux: Prefer GL/Vulkan, whatever is available.
|
||||||
|
#if defined(ENABLE_OPENGL)
|
||||||
|
return GSRendererType::OGL;
|
||||||
|
#elif defined(ENABLE_VULKAN)
|
||||||
|
return GSRendererType::Vulkan;
|
||||||
|
#else
|
||||||
|
return GSRendererType::SW;
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
|
|
@ -124,7 +124,9 @@ std::string HostDisplay::GetFullscreenModeString(u32 width, u32 height, float re
|
||||||
return StringUtil::StdStringFromFormat("%u x %u @ %f hz", width, height, refresh_rate);
|
return StringUtil::StdStringFromFormat("%u x %u @ %f hz", width, height, refresh_rate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef ENABLE_OPENGL
|
||||||
#include "Frontend/OpenGLHostDisplay.h"
|
#include "Frontend/OpenGLHostDisplay.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef ENABLE_VULKAN
|
#ifdef ENABLE_VULKAN
|
||||||
#include "Frontend/VulkanHostDisplay.h"
|
#include "Frontend/VulkanHostDisplay.h"
|
||||||
|
@ -148,9 +150,11 @@ std::unique_ptr<HostDisplay> HostDisplay::CreateDisplayForAPI(RenderAPI api)
|
||||||
return std::unique_ptr<HostDisplay>(MakeMetalHostDisplay());
|
return std::unique_ptr<HostDisplay>(MakeMetalHostDisplay());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef ENABLE_OPENGL
|
||||||
case RenderAPI::OpenGL:
|
case RenderAPI::OpenGL:
|
||||||
case RenderAPI::OpenGLES:
|
case RenderAPI::OpenGLES:
|
||||||
return std::make_unique<OpenGLHostDisplay>();
|
return std::make_unique<OpenGLHostDisplay>();
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef ENABLE_VULKAN
|
#ifdef ENABLE_VULKAN
|
||||||
case RenderAPI::Vulkan:
|
case RenderAPI::Vulkan:
|
||||||
|
|
|
@ -27,10 +27,6 @@
|
||||||
|
|
||||||
#include "common/Assertions.h"
|
#include "common/Assertions.h"
|
||||||
#include "Frontend/ImGuiManager.h"
|
#include "Frontend/ImGuiManager.h"
|
||||||
#include "Frontend/OpenGLHostDisplay.h"
|
|
||||||
#ifdef _WIN32
|
|
||||||
#include "Frontend/D3D11HostDisplay.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "gui/App.h"
|
#include "gui/App.h"
|
||||||
#include "gui/AppHost.h"
|
#include "gui/AppHost.h"
|
||||||
|
|
|
@ -48,7 +48,7 @@
|
||||||
<ForcedIncludeFiles>PrecompiledHeader.h;%(ForcedIncludeFiles)</ForcedIncludeFiles>
|
<ForcedIncludeFiles>PrecompiledHeader.h;%(ForcedIncludeFiles)</ForcedIncludeFiles>
|
||||||
<EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
|
<EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
|
||||||
<AdditionalOptions>/Zc:externConstexpr %(AdditionalOptions)</AdditionalOptions>
|
<AdditionalOptions>/Zc:externConstexpr %(AdditionalOptions)</AdditionalOptions>
|
||||||
<PreprocessorDefinitions>WIN32_LEAN_AND_MEAN;LZMA_API_STATIC;BUILD_DX=1;ENABLE_VULKAN;SPU2X_CUBEB;DIRECTINPUT_VERSION=0x0800;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>WIN32_LEAN_AND_MEAN;LZMA_API_STATIC;BUILD_DX=1;ENABLE_OPENGL;ENABLE_VULKAN;SPU2X_CUBEB;DIRECTINPUT_VERSION=0x0800;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<PreprocessorDefinitions Condition="$(Configuration.Contains(Debug))">PCSX2_DEBUG;PCSX2_DEVBUILD;_SECURE_SCL_=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions Condition="$(Configuration.Contains(Debug))">PCSX2_DEBUG;PCSX2_DEVBUILD;_SECURE_SCL_=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<PreprocessorDefinitions Condition="$(Configuration.Contains(Devel))">PCSX2_DEVEL;PCSX2_DEVBUILD;NDEBUG;_SECURE_SCL_=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions Condition="$(Configuration.Contains(Devel))">PCSX2_DEVEL;PCSX2_DEVBUILD;NDEBUG;_SECURE_SCL_=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<PreprocessorDefinitions Condition="$(Configuration.Contains(Release))">NDEBUG;_SECURE_SCL_=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions Condition="$(Configuration.Contains(Release))">NDEBUG;_SECURE_SCL_=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
|
|
@ -52,7 +52,7 @@
|
||||||
<ForcedIncludeFiles>PrecompiledHeader.h;%(ForcedIncludeFiles)</ForcedIncludeFiles>
|
<ForcedIncludeFiles>PrecompiledHeader.h;%(ForcedIncludeFiles)</ForcedIncludeFiles>
|
||||||
<EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
|
<EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
|
||||||
<AdditionalOptions>/Zc:externConstexpr %(AdditionalOptions)</AdditionalOptions>
|
<AdditionalOptions>/Zc:externConstexpr %(AdditionalOptions)</AdditionalOptions>
|
||||||
<PreprocessorDefinitions>WIN32_LEAN_AND_MEAN;LZMA_API_STATIC;BUILD_DX=1;ENABLE_VULKAN;SPU2X_CUBEB;SDL_BUILD;PCSX2_CORE;DISABLE_RECORDING;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>WIN32_LEAN_AND_MEAN;LZMA_API_STATIC;BUILD_DX=1;ENABLE_OPENGL;ENABLE_VULKAN;SPU2X_CUBEB;SDL_BUILD;PCSX2_CORE;DISABLE_RECORDING;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<PreprocessorDefinitions Condition="$(Configuration.Contains(Debug))">PCSX2_DEBUG;PCSX2_DEVBUILD;_SECURE_SCL_=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions Condition="$(Configuration.Contains(Debug))">PCSX2_DEBUG;PCSX2_DEVBUILD;_SECURE_SCL_=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<PreprocessorDefinitions Condition="$(Configuration.Contains(Devel))">PCSX2_DEVEL;PCSX2_DEVBUILD;NDEBUG;_SECURE_SCL_=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions Condition="$(Configuration.Contains(Devel))">PCSX2_DEVEL;PCSX2_DEVBUILD;NDEBUG;_SECURE_SCL_=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<PreprocessorDefinitions Condition="$(Configuration.Contains(Release))">NDEBUG;_SECURE_SCL_=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions Condition="$(Configuration.Contains(Release))">NDEBUG;_SECURE_SCL_=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
|
Loading…
Reference in New Issue