From 03c002ee2a4fa37283209be3d4723c4e5f87143b Mon Sep 17 00:00:00 2001 From: gal20 <71563441+gal20@users.noreply.github.com> Date: Sat, 14 Nov 2020 19:58:12 +0200 Subject: [PATCH] make result not optional This fixes crash when hardware shader is enabled in the flatpak version --- src/video_core/renderer_opengl/gl_shader_manager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/video_core/renderer_opengl/gl_shader_manager.cpp b/src/video_core/renderer_opengl/gl_shader_manager.cpp index f0ca01b27..acd6a6503 100644 --- a/src/video_core/renderer_opengl/gl_shader_manager.cpp +++ b/src/video_core/renderer_opengl/gl_shader_manager.cpp @@ -254,7 +254,7 @@ public: explicit ShaderDoubleCache(bool separable) : separable(separable) {} std::tuple> Get( const KeyConfigType& key, const Pica::Shader::ShaderSetup& setup) { - std::optional result{}; + ShaderDecompiler::ProgramResult result{}; auto map_it = shader_map.find(key); if (map_it == shader_map.end()) { auto program_opt = CodeGenerator(setup, key, separable); @@ -267,7 +267,7 @@ public: auto [iter, new_shader] = shader_cache.emplace(program, OGLShaderStage{separable}); OGLShaderStage& cached_shader = iter->second; if (new_shader) { - result->code = program; + result.code = program; cached_shader.Create(program.c_str(), ShaderType); } shader_map[key] = &cached_shader;