renderer_vulkan: Add experimental Vulkan renderer
This commit is contained in:
@ -11,6 +11,7 @@
|
||||
#include "video_core/renderer_base.h"
|
||||
#include "video_core/renderer_opengl/gl_vars.h"
|
||||
#include "video_core/renderer_opengl/renderer_opengl.h"
|
||||
#include "video_core/renderer_vulkan/renderer_vulkan.h"
|
||||
#include "video_core/video_core.h"
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@ -44,15 +45,26 @@ ResultStatus Init(Frontend::EmuWindow& emu_window, Frontend::EmuWindow* secondar
|
||||
g_memory = &memory;
|
||||
Pica::Init();
|
||||
|
||||
OpenGL::GLES = Settings::values.graphics_api.GetValue() == Settings::GraphicsAPI::OpenGLES;
|
||||
const Settings::GraphicsAPI graphics_api = Settings::values.graphics_api.GetValue();
|
||||
switch (graphics_api) {
|
||||
case Settings::GraphicsAPI::OpenGL:
|
||||
case Settings::GraphicsAPI::OpenGLES:
|
||||
OpenGL::GLES = graphics_api == Settings::GraphicsAPI::OpenGLES;
|
||||
g_renderer = std::make_unique<OpenGL::RendererOpenGL>(emu_window, secondary_window);
|
||||
break;
|
||||
case Settings::GraphicsAPI::Vulkan:
|
||||
g_renderer = std::make_unique<Vulkan::RendererVulkan>(emu_window);
|
||||
break;
|
||||
default:
|
||||
LOG_CRITICAL(Render, "Invalid graphics API enum value {}", graphics_api);
|
||||
UNREACHABLE();
|
||||
}
|
||||
|
||||
g_renderer = std::make_unique<OpenGL::RendererOpenGL>(emu_window, secondary_window);
|
||||
ResultStatus result = g_renderer->Init();
|
||||
|
||||
if (result != ResultStatus::Success) {
|
||||
LOG_ERROR(Render, "initialization failed !");
|
||||
LOG_ERROR(Render, "Video core initialization failed");
|
||||
} else {
|
||||
LOG_DEBUG(Render, "initialized OK");
|
||||
LOG_INFO(Render, "Video core initialization OK");
|
||||
}
|
||||
|
||||
return result;
|
||||
|
Reference in New Issue
Block a user