[pull] master from libretro:master#984
Merged
pull[bot] merged 4 commits intoAlexandre1er:masterfrom May 1, 2026
Merged
Conversation
The gl3 (glcore video driver) shader fallback selector and dispatcher both had RARCH_SHADER_CG arms, but those branches were unreachable in any build configuration: 1. The Cg fallback in gl3_get_fallback_shader_type gates on GFX_CTX_FLAGS_SHADERS_CG. No context driver ever sets that flag when the active video driver is "glcore" -- audited x_ctx.c:1106-1116, wgl_ctx.c:778-788, drm_ctx.c, drm_go2_ctx.c, orbis_ctx.c, switch_ctx.c, wayland_ctx.c, xegl_ctx.c (eight context drivers, all of which the glcore branch advertises only SHADERS_SLANG). The Cg flag is only set by ps3_ctx (which uses the rsx driver, not glcore) and by the legacy / non-Core branch of x_ctx and wgl_ctx (gated on !core_hw_context_enable, so only for the gl driver, not glcore). 2. Even if the gating were bypassed, gl_cg_backend in shader_gl_cg.c uses cgGLEnableProfile / cgGLBindProgram / cgGLEnableClientState et al. These rely on the legacy ARB asm program pipeline (GL_VERTEX_PROGRAM_ARB style) which is removed from Core Profile contexts. NVIDIA's Cg runtime hasn't been updated since 2012 and has no Core Profile support. Remove: - the RARCH_SHADER_CG case in gl3_get_fallback_shader_type - the RARCH_SHADER_CG case in gl3_shader_driver_set_backend - HAVE_CG from the function-level guard - the now-unused 3rd loop iteration (the cycle is GLSL <-> SLANG) The fallback chain becomes a 2-element cycle: GLSL falls back to SLANG and vice versa, matching what the gating actually allows. Add a comment at the top of gl3_get_fallback_shader_type explaining the gl3-vs-Cg situation so future readers don't reintroduce the dead arm. No behaviour change on any build: HAVE_CG was defined for some Windows builds, but the gates above already prevented those branches from executing.
The comment added in 276e4bc said gl3 'only ever advertises slang via spirv-cross', which overstated things. Context drivers do only advertise SLANG for glcore, but the gl3 fallback selector itself accepts both GLSL and SLANG as first-class types -- and 42aa9fd just made GLSL a valid GL3_DEFAULT_SHADER_TYPE on builds without slang. Reword the comment to be specific about what is and isn't dead: - Cg is dead (no context flag, ARB asm pipeline incompatible with Core Profile) - GLSL is alive (Core-compatible API surface, kept as fallback for no-slang builds) - Slang is the practical default No code change.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )