mirror of
https://github.com/citra-emu/citra-canary.git
synced 2024-12-26 09:25:35 +00:00
sdl: add GLES support
This commit is contained in:
parent
9af8d61ba2
commit
cd21abe50f
|
@ -105,6 +105,7 @@ void Config::ReadValues() {
|
|||
Settings::values.use_cpu_jit = sdl2_config->GetBoolean("Core", "use_cpu_jit", true);
|
||||
|
||||
// Renderer
|
||||
Settings::values.use_gles = sdl2_config->GetBoolean("Renderer", "use_gles", false);
|
||||
Settings::values.use_hw_renderer = sdl2_config->GetBoolean("Renderer", "use_hw_renderer", true);
|
||||
#ifdef __APPLE__
|
||||
// Hardware shader is broken on macos thanks to poor drivers.
|
||||
|
|
|
@ -92,6 +92,10 @@ udp_pad_index=
|
|||
use_cpu_jit =
|
||||
|
||||
[Renderer]
|
||||
# Whether to render using GLES or OpenGL
|
||||
# 0 (default): OpenGL, 1: GLES
|
||||
use_gles =
|
||||
|
||||
# Whether to use software or hardware rendering.
|
||||
# 0: Software, 1 (default): Hardware
|
||||
use_hw_renderer =
|
||||
|
|
|
@ -122,8 +122,13 @@ EmuWindow_SDL2::EmuWindow_SDL2(bool fullscreen) {
|
|||
SDL_SetMainReady();
|
||||
|
||||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
|
||||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 3);
|
||||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
|
||||
if (Settings::values.use_gles) {
|
||||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 2);
|
||||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES);
|
||||
} else {
|
||||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 3);
|
||||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
|
||||
}
|
||||
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
|
||||
SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8);
|
||||
SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 8);
|
||||
|
@ -155,7 +160,9 @@ EmuWindow_SDL2::EmuWindow_SDL2(bool fullscreen) {
|
|||
exit(1);
|
||||
}
|
||||
|
||||
if (!gladLoadGLLoader(static_cast<GLADloadproc>(SDL_GL_GetProcAddress))) {
|
||||
auto gl_load_func = Settings::values.use_gles ? gladLoadGLES2Loader : gladLoadGLLoader;
|
||||
|
||||
if (!gl_load_func(static_cast<GLADloadproc>(SDL_GL_GetProcAddress))) {
|
||||
LOG_CRITICAL(Frontend, "Failed to initialize GL functions: {}", SDL_GetError());
|
||||
exit(1);
|
||||
}
|
||||
|
|
|
@ -67,6 +67,7 @@ void LogSetting(const std::string& name, const T& value) {
|
|||
void LogSettings() {
|
||||
LOG_INFO(Config, "Citra Configuration:");
|
||||
LogSetting("Core_UseCpuJit", Settings::values.use_cpu_jit);
|
||||
LogSetting("Renderer_UseGLES", Settings::values.use_gles);
|
||||
LogSetting("Renderer_UseHwRenderer", Settings::values.use_hw_renderer);
|
||||
LogSetting("Renderer_UseHwShader", Settings::values.use_hw_shader);
|
||||
LogSetting("Renderer_ShadersAccurateGs", Settings::values.shaders_accurate_gs);
|
||||
|
|
|
@ -130,6 +130,7 @@ struct Values {
|
|||
u64 init_time;
|
||||
|
||||
// Renderer
|
||||
bool use_gles;
|
||||
bool use_hw_renderer;
|
||||
bool use_hw_shader;
|
||||
bool shaders_accurate_gs;
|
||||
|
|
Loading…
Reference in a new issue