From 142cb65ed297421ae22dd6a9c38e214365fa507a Mon Sep 17 00:00:00 2001 From: waqas Date: Wed, 16 Sep 2026 15:43:49 +0400 Subject: [PATCH 1/2] shaders: replace switch with if/else in world2d fragment shader Apple's OpenGL shader compiler crashes while linking this shader. The stack ends in glpLLVMCGSwitchStatement, and the crash reproduces with both Homebrew clang and Apple clang, so it is a driver bug rather than a build problem. Using if/else avoids the compiler path entirely and lets the world render stage load on macOS. Co-Authored-By: Claude Opus 5 (1M context) --- assets/shaders/world2d.frag.glsl | 36 +++++++++++++++----------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/assets/shaders/world2d.frag.glsl b/assets/shaders/world2d.frag.glsl index 98d323e0f6..362fe0c0e3 100644 --- a/assets/shaders/world2d.frag.glsl +++ b/assets/shaders/world2d.frag.glsl @@ -19,25 +19,23 @@ vec2 uv = vec2( void main() { vec4 tex_val = texture(tex, uv); int alpha = int(round(tex_val.a * 255)); - switch (alpha) { - case 0: - col = tex_val; - discard; - - // do not save the ID - return; - case 254: - col = vec4(1.0f, 0.0f, 0.0f, 1.0f); - break; - case 252: - col = vec4(0.0f, 1.0f, 0.0f, 1.0f); - break; - case 250: - col = vec4(0.0f, 0.0f, 1.0f, 1.0f); - break; - default: - col = tex_val; - break; + // Apple's OpenGL shader compiler crashes on the switch statement that + // used to be here (glpLLVMCGSwitchStatement), so use if/else instead. + if (alpha == 0) { + col = tex_val; + discard; + } + else if (alpha == 254) { + col = vec4(1.0f, 0.0f, 0.0f, 1.0f); + } + else if (alpha == 252) { + col = vec4(0.0f, 1.0f, 0.0f, 1.0f); + } + else if (alpha == 250) { + col = vec4(0.0f, 0.0f, 1.0f, 1.0f); + } + else { + col = tex_val; } id = u_id; } From 1329af80d371515fdc3fe307070cc98cc97b7ff9 Mon Sep 17 00:00:00 2001 From: waqas Date: Mon, 21 Sep 2026 14:21:46 +0400 Subject: [PATCH 2/2] copying.md: add Rana Waqas to the authors list Co-Authored-By: Claude Opus 5 (1M context) --- copying.md | 1 + 1 file changed, 1 insertion(+) diff --git a/copying.md b/copying.md index c3c6ebc67d..5e5661f5a5 100644 --- a/copying.md +++ b/copying.md @@ -170,6 +170,7 @@ _the openage authors_ are: | Nicolas Sanchez | nicolassanchez02 | nicolasjpsanchez à gmail dawt com | | Manas Pradhan | manas-maker | manasmpradhan5 à gmail dawt com | | Jason Lu | jasonlu, lugt | lu.gt à 163 dawt com | +| Rana Waqas | ranawaqas-ai | waqaskhan137 à gmail dawt com | If you're a first-time committer, add yourself to the above list. This is not just for legal reasons, but also to keep an overview of all those nicknames.