[GH-ISSUE #6175] Shader packs: textureGatherOffsets, scalar dot/normalize, return conversions, discard's else and bool uniforms named by locals fail to translate #2004

Closed
opened 2026-11-02 15:51:16 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @arslanarm on GitHub (Nov 1, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/6175

Originally assigned to: @arslanarm on GitHub.

🤖 Filed by arslanarm's AI agent (Claude Code, Claude Opus 5.5), not by arslanarm personally.

Five GLSL constructs that real shaders/ packs use fail in horizon-shaders' translation (seen running 40 popular packs from Modrinth through Horizon and comparing with Iris; program counts are real_packs error lines over those packs, measured before #5701 merged):

  1. textureGatherOffsets is unknown to naga ("Unknown function 'textureGatherOffsets'"): Mellow's deferred1 is skipped.
  2. dot(float, float) and normalize(float) (GLSL genType overloads) fail with BuiltinArgumentsInvalid("Dot"): 36 composite programs over the 40 packs.
  3. A returned value is not converted to the function's type (return 1; in a float function): "The return expression ... does not match the declared return type", 70 programs (Kappa's GetEmissionScale, ...).
  4. discard / return; are rewritten as if (true) discard, which takes the pack's own else: if (c) discard; else x += 1.0; silently loses its else. A return value; followed by code in its block fails naga's validation ("Expression not visited by the appropriate statement": Miniature's hand program).
  5. A parameter or local named like a bool uniform (float fogify(..., in bool isSpectator, ...)) is rewritten into (hz_bool_isSpectator != 0) inside the declaration: "Expected RightParen, found LeftParen" (Pixel Perfect).
Originally created by @arslanarm on GitHub (Nov 1, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/6175 Originally assigned to: @arslanarm on GitHub. > 🤖 Filed by arslanarm's AI agent (Claude Code, Claude Opus 5.5), not by arslanarm personally. Five GLSL constructs that real `shaders/` packs use fail in `horizon-shaders`' translation (seen running 40 popular packs from Modrinth through Horizon and comparing with Iris; program counts are `real_packs` error lines over those packs, measured before #5701 merged): 1. `textureGatherOffsets` is unknown to naga ("Unknown function 'textureGatherOffsets'"): Mellow's `deferred1` is skipped. 2. `dot(float, float)` and `normalize(float)` (GLSL genType overloads) fail with `BuiltinArgumentsInvalid("Dot")`: 36 composite programs over the 40 packs. 3. A returned value is not converted to the function's type (`return 1;` in a `float` function): "The `return` expression ... does not match the declared return type", 70 programs (Kappa's `GetEmissionScale`, ...). 4. `discard` / `return;` are rewritten as `if (true) discard`, which takes the pack's own `else`: `if (c) discard; else x += 1.0;` silently loses its `else`. A `return value;` followed by code in its block fails naga's validation ("Expression not visited by the appropriate statement": Miniature's hand program). 5. A parameter or local named like a `bool` uniform (`float fogify(..., in bool isSpectator, ...)`) is rewritten into `(hz_bool_isSpectator != 0)` inside the declaration: "Expected RightParen, found LeftParen" (Pixel Perfect).
Author
Owner

@arslanarm commented on GitHub (Nov 1, 2026):

🤖 Agent: /claim

<!-- gh-comment-id:6561648185 --> @arslanarm commented on GitHub (Nov 1, 2026): 🤖 Agent: /claim
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#2004
No description provided.