mirror of
https://github.com/PabloMK7/citra.git
synced 2025-09-10 12:50:04 +00:00
build: Add flags to toggle specific renderer backends. (#7375)
This commit is contained in:
parent
77fce3cf82
commit
82294425e3
18 changed files with 443 additions and 211 deletions
|
@ -19,10 +19,6 @@ add_library(citra-android SHARED
|
|||
default_ini.h
|
||||
emu_window/emu_window.cpp
|
||||
emu_window/emu_window.h
|
||||
emu_window/emu_window_gl.cpp
|
||||
emu_window/emu_window_gl.h
|
||||
emu_window/emu_window_vk.cpp
|
||||
emu_window/emu_window_vk.h
|
||||
game_info.cpp
|
||||
game_settings.cpp
|
||||
game_settings.h
|
||||
|
@ -35,10 +31,23 @@ add_library(citra-android SHARED
|
|||
)
|
||||
|
||||
target_link_libraries(citra-android PRIVATE audio_core citra_common citra_core input_common network)
|
||||
target_link_libraries(citra-android PRIVATE android camera2ndk EGL glad inih jnigraphics log mediandk yuv)
|
||||
target_link_libraries(citra-android PRIVATE android camera2ndk inih jnigraphics log mediandk yuv)
|
||||
|
||||
if ("arm64" IN_LIST ARCHITECTURE)
|
||||
target_link_libraries(citra-android PRIVATE adrenotools)
|
||||
if (ENABLE_OPENGL)
|
||||
target_sources(citra-android PRIVATE
|
||||
emu_window/emu_window_gl.cpp
|
||||
emu_window/emu_window_gl.h
|
||||
)
|
||||
target_link_libraries(citra-android PRIVATE EGL glad)
|
||||
endif()
|
||||
if (ENABLE_VULKAN)
|
||||
target_sources(citra-android PRIVATE
|
||||
emu_window/emu_window_vk.cpp
|
||||
emu_window/emu_window_vk.h
|
||||
)
|
||||
if ("arm64" IN_LIST ARCHITECTURE)
|
||||
target_link_libraries(citra-android PRIVATE adrenotools)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(CPACK_PACKAGE_EXECUTABLES ${CPACK_PACKAGE_EXECUTABLES} citra-android)
|
||||
|
|
|
@ -45,8 +45,12 @@
|
|||
#include "jni/camera/ndk_camera.h"
|
||||
#include "jni/camera/still_image_camera.h"
|
||||
#include "jni/config.h"
|
||||
#ifdef ENABLE_OPENGL
|
||||
#include "jni/emu_window/emu_window_gl.h"
|
||||
#endif
|
||||
#ifdef ENABLE_VULKAN
|
||||
#include "jni/emu_window/emu_window_vk.h"
|
||||
#endif
|
||||
#include "jni/game_settings.h"
|
||||
#include "jni/id_cache.h"
|
||||
#include "jni/input_manager.h"
|
||||
|
@ -55,7 +59,7 @@
|
|||
#include "video_core/gpu.h"
|
||||
#include "video_core/renderer_base.h"
|
||||
|
||||
#if CITRA_ARCH(arm64)
|
||||
#if defined(ENABLE_VULKAN) && CITRA_ARCH(arm64)
|
||||
#include <adrenotools/driver.h>
|
||||
#endif
|
||||
|
||||
|
@ -142,15 +146,29 @@ static Core::System::ResultStatus RunCitra(const std::string& filepath) {
|
|||
|
||||
const auto graphics_api = Settings::values.graphics_api.GetValue();
|
||||
switch (graphics_api) {
|
||||
#ifdef ENABLE_OPENGL
|
||||
case Settings::GraphicsAPI::OpenGL:
|
||||
window = std::make_unique<EmuWindow_Android_OpenGL>(system, s_surf);
|
||||
break;
|
||||
#endif
|
||||
#ifdef ENABLE_VULKAN
|
||||
case Settings::GraphicsAPI::Vulkan:
|
||||
window = std::make_unique<EmuWindow_Android_Vulkan>(s_surf, vulkan_library);
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
LOG_CRITICAL(Frontend, "Unknown graphics API {}, using Vulkan", graphics_api);
|
||||
LOG_CRITICAL(Frontend,
|
||||
"Unknown or unsupported graphics API {}, falling back to available default",
|
||||
graphics_api);
|
||||
#ifdef ENABLE_OPENGL
|
||||
window = std::make_unique<EmuWindow_Android_OpenGL>(system, s_surf);
|
||||
#elif ENABLE_VULKAN
|
||||
window = std::make_unique<EmuWindow_Android_Vulkan>(s_surf, vulkan_library);
|
||||
#else
|
||||
// TODO: Add a null renderer backend for this, perhaps.
|
||||
#error "At least one renderer must be enabled."
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
||||
// Forces a config reload on game boot, if the user changed settings in the UI
|
||||
|
@ -239,7 +257,7 @@ static Core::System::ResultStatus RunCitra(const std::string& filepath) {
|
|||
void InitializeGpuDriver(const std::string& hook_lib_dir, const std::string& custom_driver_dir,
|
||||
const std::string& custom_driver_name,
|
||||
const std::string& file_redirect_dir) {
|
||||
#if CITRA_ARCH(arm64)
|
||||
#if defined(ENABLE_VULKAN) && CITRA_ARCH(arm64)
|
||||
void* handle{};
|
||||
const char* file_redirect_dir_{};
|
||||
int featureFlags{};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue