Commit 276e4bc
committed
gl3: remove dead Cg shader-backend paths from glcore driver
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.1 parent cd386a3 commit 276e4bc
1 file changed
Lines changed: 11 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2128 | 2128 | | |
2129 | 2129 | | |
2130 | 2130 | | |
2131 | | - | |
| 2131 | + | |
2132 | 2132 | | |
2133 | 2133 | | |
2134 | 2134 | | |
2135 | 2135 | | |
2136 | 2136 | | |
2137 | | - | |
| 2137 | + | |
| 2138 | + | |
| 2139 | + | |
| 2140 | + | |
| 2141 | + | |
| 2142 | + | |
| 2143 | + | |
2138 | 2144 | | |
2139 | 2145 | | |
2140 | 2146 | | |
2141 | | - | |
| 2147 | + | |
2142 | 2148 | | |
2143 | 2149 | | |
2144 | 2150 | | |
2145 | | - | |
| 2151 | + | |
2146 | 2152 | | |
2147 | 2153 | | |
2148 | 2154 | | |
2149 | | - | |
2150 | | - | |
2151 | | - | |
2152 | | - | |
2153 | | - | |
2154 | | - | |
2155 | | - | |
2156 | | - | |
2157 | 2155 | | |
2158 | 2156 | | |
2159 | 2157 | | |
2160 | 2158 | | |
2161 | 2159 | | |
2162 | | - | |
| 2160 | + | |
2163 | 2161 | | |
2164 | 2162 | | |
2165 | 2163 | | |
| |||
2231 | 2229 | | |
2232 | 2230 | | |
2233 | 2231 | | |
2234 | | - | |
2235 | | - | |
2236 | | - | |
2237 | | - | |
2238 | | - | |
2239 | 2232 | | |
2240 | 2233 | | |
2241 | 2234 | | |
| |||
0 commit comments