This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

xerxes: fix libretro-dolphin shader compilation on libretro

The libretro Dolphin core fails to initialize shader compiler worker
threads because CreateSharedContext() returns nullptr (libretro API
doesn't support creating additional GL contexts).

This patch disables background shader compilation in libretro builds,
forcing synchronous compilation which works correctly.

+33 -1
+18
5pkgs/libretro-dolphin/disable-background-shaders.patch
··· 1 + diff --git a/Source/Core/VideoBackends/OGL/Render.cpp b/Source/Core/VideoBackends/OGL/Render.cpp 2 + --- a/Source/Core/VideoBackends/OGL/Render.cpp 3 + +++ b/Source/Core/VideoBackends/OGL/Render.cpp 4 + @@ -674,8 +674,14 @@ Renderer::Renderer(std::unique_ptr<GLContext> main_gl_context, float backbuffer_ 5 + g_Config.backend_info.bSupportsComputeShaders && g_ogl_config.bSupportsImageLoadStore; 6 + 7 + // Background compiling is supported only when shared contexts aren't broken. 8 + +#ifdef __LIBRETRO__ 9 + + // Libretro cannot create shared GL contexts via CreateSharedContext(), 10 + + // so disable background shader compilation entirely. 11 + + g_Config.backend_info.bSupportsBackgroundCompiling = false; 12 + +#else 13 + g_Config.backend_info.bSupportsBackgroundCompiling = 14 + !DriverDetails::HasBug(DriverDetails::BUG_SHARED_CONTEXT_SHADER_COMPILATION); 15 + +#endif 16 + 17 + // Program binaries are supported on GL4.1+, ARB_get_program_binary, or ES3. 18 + if (supports_glsl_cache)
+9
5pkgs/libretro-dolphin/package.nix
··· 1 + { 2 + libretro, 3 + }: 4 + 5 + libretro.dolphin.overrideAttrs (old: { 6 + patches = (old.patches or [ ]) ++ [ 7 + ./disable-background-shaders.patch 8 + ]; 9 + })
+6 -1
machines/xerxes/config.nix
··· 22 22 environment.systemPackages = [ 23 23 pkgs.bitwarden-desktop 24 24 pkgs.rbw 25 - pkgs.retroarch-free 25 + # retroarch with patched dolphin core (fixes shader compiler thread issue) 26 + (pkgs.retroarch.withCores ( 27 + cores: 28 + builtins.filter (c: c.pname or "" != "libretro-dolphin") pkgs.retroarch-free.cores 29 + ++ [ self.packages.${pkgs.system}.libretro-dolphin ] 30 + )) 26 31 pkgs.pavucontrol 27 32 pkgs.claude-code 28 33 pkgs.ripgrep