diff options
author | Alexander Orzechowski <alex@ozal.ski> | 2022-12-13 20:39:03 +0100 |
---|---|---|
committer | Alexander Orzechowski <alex@ozal.ski> | 2022-12-13 21:01:51 +0100 |
commit | 09e3029c1118616394e5e9c45dfcdd4adcdf86ad (patch) | |
tree | 652f0490e20ecd253171c43cc7a9271712793be5 /src/video_core | |
parent | OpenGL: Check for threading support (diff) | |
download | yuzu-09e3029c1118616394e5e9c45dfcdd4adcdf86ad.tar yuzu-09e3029c1118616394e5e9c45dfcdd4adcdf86ad.tar.gz yuzu-09e3029c1118616394e5e9c45dfcdd4adcdf86ad.tar.bz2 yuzu-09e3029c1118616394e5e9c45dfcdd4adcdf86ad.tar.lz yuzu-09e3029c1118616394e5e9c45dfcdd4adcdf86ad.tar.xz yuzu-09e3029c1118616394e5e9c45dfcdd4adcdf86ad.tar.zst yuzu-09e3029c1118616394e5e9c45dfcdd4adcdf86ad.zip |
Diffstat (limited to 'src/video_core')
-rw-r--r-- | src/video_core/renderer_opengl/gl_device.cpp | 8 | ||||
-rw-r--r-- | src/video_core/renderer_opengl/gl_device.h | 3 | ||||
-rw-r--r-- | src/video_core/renderer_opengl/renderer_opengl.cpp | 4 |
3 files changed, 7 insertions, 8 deletions
diff --git a/src/video_core/renderer_opengl/gl_device.cpp b/src/video_core/renderer_opengl/gl_device.cpp index 4c5020def..cee5c3247 100644 --- a/src/video_core/renderer_opengl/gl_device.cpp +++ b/src/video_core/renderer_opengl/gl_device.cpp @@ -112,7 +112,7 @@ bool IsASTCSupported() { } } // Anonymous namespace -Device::Device() { +Device::Device(Core::Frontend::EmuWindow& emu_window) { if (!GLAD_GL_VERSION_4_6) { LOG_ERROR(Render_OpenGL, "OpenGL 4.6 is not available"); throw std::runtime_error{"Insufficient version"}; @@ -127,10 +127,8 @@ Device::Device() { #ifdef __unix__ constexpr bool is_linux = true; - const bool is_wayland = strcasecmp(getenv("XDG_SESSION_TYPE"), "wayland") == 0; #else constexpr bool is_linux = false; - constexpr bool is_wayland = false; #endif bool disable_fast_buffer_sub_data = false; @@ -195,12 +193,12 @@ Device::Device() { } } + strict_context_required = emu_window.StrictContextRequired(); // Blocks AMD and Intel OpenGL drivers on Windows from using asynchronous shader compilation. // Blocks EGL on Wayland from using asynchronous shader compilation. use_asynchronous_shaders = Settings::values.use_asynchronous_shaders.GetValue() && - !(is_amd || (is_intel && !is_linux)) && !is_wayland; + !(is_amd || (is_intel && !is_linux)) && !strict_context_required; use_driver_cache = is_nvidia; - strict_context_required = is_wayland; LOG_INFO(Render_OpenGL, "Renderer_VariableAOFFI: {}", has_variable_aoffi); LOG_INFO(Render_OpenGL, "Renderer_ComponentIndexingBug: {}", has_component_indexing_bug); diff --git a/src/video_core/renderer_opengl/gl_device.h b/src/video_core/renderer_opengl/gl_device.h index adb79c56e..2a72d84be 100644 --- a/src/video_core/renderer_opengl/gl_device.h +++ b/src/video_core/renderer_opengl/gl_device.h @@ -5,6 +5,7 @@ #include <cstddef> #include "common/common_types.h" +#include "core/frontend/emu_window.h" #include "shader_recompiler/stage.h" namespace Settings { @@ -15,7 +16,7 @@ namespace OpenGL { class Device { public: - explicit Device(); + explicit Device(Core::Frontend::EmuWindow& emu_window); [[nodiscard]] std::string GetVendorName() const; diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp index 5b5e178ad..bc75680f0 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.cpp +++ b/src/video_core/renderer_opengl/renderer_opengl.cpp @@ -140,8 +140,8 @@ RendererOpenGL::RendererOpenGL(Core::TelemetrySession& telemetry_session_, Core::Memory::Memory& cpu_memory_, Tegra::GPU& gpu_, std::unique_ptr<Core::Frontend::GraphicsContext> context_) : RendererBase{emu_window_, std::move(context_)}, telemetry_session{telemetry_session_}, - emu_window{emu_window_}, cpu_memory{cpu_memory_}, gpu{gpu_}, state_tracker{}, - program_manager{device}, + emu_window{emu_window_}, cpu_memory{cpu_memory_}, gpu{gpu_}, device{emu_window_}, + state_tracker{}, program_manager{device}, rasterizer(emu_window, gpu, cpu_memory, device, screen_info, program_manager, state_tracker) { if (Settings::values.renderer_debug && GLAD_GL_KHR_debug) { glEnable(GL_DEBUG_OUTPUT); |