mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-05-22 05:07:01 +02:00
[video_core] Properly disable/avoid building OpenGL when it's disabled (#3692)
- OpenGL symbols would still be included in builds without OpenGL, this pr fixes that - Same goes for Vulkan, but now with `ENABLE_VULKAN` - Add support to have OpenGL-only builds (why would you do this?) - Add support for headless runs (yes you could just select NULL backend, but why not compile it headless? :) Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3692 Reviewed-by: crueter <crueter@eden-emu.dev> Reviewed-by: DraVee <chimera@dravee.dev> Reviewed-by: MaranBr <maranbr@eden-emu.dev> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
This commit is contained in:
parent
d35fc7b7ee
commit
5a0780b826
9 changed files with 125 additions and 89 deletions
|
|
@ -1020,8 +1020,7 @@ bool GRenderWindow::InitializeOpenGL() {
|
|||
|
||||
return true;
|
||||
#else
|
||||
QMessageBox::warning(this, tr("OpenGL not available!"),
|
||||
tr("Eden has not been compiled with OpenGL support."));
|
||||
QMessageBox::warning(this, tr("OpenGL not available!"), tr("Eden has not been compiled with OpenGL support."));
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
|
@ -1031,7 +1030,6 @@ bool GRenderWindow::InitializeVulkan() {
|
|||
child_widget = child;
|
||||
child_widget->windowHandle()->create();
|
||||
main_context = std::make_unique<DummyContext>();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3784,14 +3784,30 @@ void MainWindow::OnToggleAdaptingFilter() {
|
|||
|
||||
void MainWindow::OnToggleGraphicsAPI() {
|
||||
auto api = Settings::values.renderer_backend.GetValue();
|
||||
if (api != Settings::RendererBackend::Vulkan) {
|
||||
api = Settings::RendererBackend::Vulkan;
|
||||
} else {
|
||||
switch (api) {
|
||||
#ifdef HAS_OPENGL
|
||||
case Settings::RendererBackend::Vulkan:
|
||||
api = Settings::RendererBackend::OpenGL_GLSL;
|
||||
#else
|
||||
break;
|
||||
case Settings::RendererBackend::OpenGL_GLSL:
|
||||
api = Settings::RendererBackend::OpenGL_GLSL;
|
||||
break;
|
||||
case Settings::RendererBackend::OpenGL_SPIRV:
|
||||
api = Settings::RendererBackend::OpenGL_GLASM;
|
||||
break;
|
||||
case Settings::RendererBackend::OpenGL_GLASM:
|
||||
api = Settings::RendererBackend::Null;
|
||||
break;
|
||||
#else
|
||||
case Settings::RendererBackend::Vulkan:
|
||||
api = Settings::RendererBackend::Null;
|
||||
break;
|
||||
#endif
|
||||
case Settings::RendererBackend::Null:
|
||||
api = Settings::RendererBackend::Vulkan;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
Settings::values.renderer_backend.SetValue(api);
|
||||
renderer_status_button->setChecked(api == Settings::RendererBackend::Vulkan);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,10 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
// Don't move this! put it below and MSVC will get angry!
|
||||
#include "video_core/vulkan_common/vulkan_wrapper.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
|
|
|
|||
|
|
@ -77,4 +77,5 @@ void PopulateRecords(std::vector<Record>& records, QWindow* window) try {
|
|||
} catch (const Vulkan::vk::Exception& exception) {
|
||||
LOG_ERROR(Frontend, "Failed to enumerate devices with error: {}", exception.what());
|
||||
}
|
||||
|
||||
} // namespace VkDeviceInfo
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue