Skip to content

Commit 6224ab6

Browse files
committed
gl3: clarify shader-fallback comment about GLSL vs Cg
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.
1 parent 42aa9fd commit 6224ab6

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

gfx/drivers/gl3.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2142,12 +2142,14 @@ static enum rarch_shader_type gl3_get_fallback_shader_type(enum rarch_shader_typ
21422142
flags.flags = 0;
21432143
video_context_driver_get_flags(&flags);
21442144

2145-
/* gl3 (glcore video driver) only ever advertises slang via spirv-cross.
2146-
* Cg requires the legacy fixed-function / ARB asm pipeline that Core
2147-
* Profile contexts don't expose, and no context driver advertises
2148-
* GFX_CTX_FLAGS_SHADERS_CG when the active video driver is "glcore"
2149-
* (see e.g. x_ctx.c, wgl_ctx.c). Treat any incoming RARCH_SHADER_CG
2150-
* the same as an unknown type and fall back to slang. */
2145+
/* No context driver advertises GFX_CTX_FLAGS_SHADERS_CG for the
2146+
* "glcore" video driver -- audited x_ctx.c, wgl_ctx.c, drm_ctx.c,
2147+
* wayland_ctx.c, etc. Cg requires the legacy fixed-function / ARB
2148+
* asm pipeline that Core Profile contexts don't expose, so no
2149+
* RARCH_SHADER_CG path is wired up here. GLSL and slang are both
2150+
* Core Profile-compatible and remain valid; in practice context
2151+
* drivers advertise SLANG for glcore but the GLSL fallback is kept
2152+
* for builds without slang/spirv-cross. */
21512153
if (type != RARCH_SHADER_GLSL && type != RARCH_SHADER_SLANG)
21522154
{
21532155
type = GL3_DEFAULT_SHADER_TYPE;

0 commit comments

Comments
 (0)