[GH-ISSUE #5699] Shader packs: samplers named like functions, locals named like samplers, const parameters and arrays of arrays mistranslate #1778

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

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

Originally assigned to: @TobiasLogic on GitHub.

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

Four more spots where shaders/ packs that run in Iris fail or go wrong in Horizon's translation:

  • A sampler named like a function. Bloop declares uniform sampler2D texture; and reads it with texture(texture, lmtexcoord). Every texture(...) call in those programs is then taken for the sampler (texture(shadow, ...) too), and naga stops with "Expected Semicolon, found LeftParen": 43 times in Bloop on main.
  • A local named like a sampler that reads it in its own initializer. Potato's world0/composite1.fsh:105 declares float depth = texture(depth, bcoord).x; where depth is a sampler ("Expected RightParen, found Identifier("depth")"). In GLSL the new name's scope starts after its initializer (GLSL 4.60 §4.2.2), so the call still reads the parameter; the translator hid the sampler from the declaration on.
  • const parameters (float f(const in float x)): naga's parser refuses the qualifier.
  • Arrays of arrays. naga's GLSL frontend nests T x[A][B] (and T[A][B], struct members, parameters) the other way round: float x[3][2] comes out as 2 arrays of 3, so x[2][1] reads past the inner array (clamped) or fails validation with a constant index. Photon sums its sky light in shared vec3 m[256][9].
Originally created by @TobiasLogic on GitHub (Nov 1, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/5699 Originally assigned to: @TobiasLogic on GitHub. > 🤖 Filed by TobiasLogic's AI agent (Claude Code, Claude Opus 5.5), not by TobiasLogic personally. Four more spots where `shaders/` packs that run in Iris fail or go wrong in Horizon's translation: - **A sampler named like a function.** Bloop declares `uniform sampler2D texture;` and reads it with `texture(texture, lmtexcoord)`. Every `texture(...)` call in those programs is then taken for the sampler (`texture(shadow, ...)` too), and naga stops with "Expected Semicolon, found LeftParen": 43 times in Bloop on main. - **A local named like a sampler that reads it in its own initializer.** Potato's `world0/composite1.fsh:105` declares `float depth = texture(depth, bcoord).x;` where `depth` is a sampler ("Expected RightParen, found Identifier("depth")"). In GLSL the new name's scope starts after its initializer (GLSL 4.60 §4.2.2), so the call still reads the parameter; the translator hid the sampler from the declaration on. - **`const` parameters** (`float f(const in float x)`): naga's parser refuses the qualifier. - **Arrays of arrays.** naga's GLSL frontend nests `T x[A][B]` (and `T[A][B]`, struct members, parameters) the other way round: `float x[3][2]` comes out as 2 arrays of 3, so `x[2][1]` reads past the inner array (clamped) or fails validation with a constant index. Photon sums its sky light in `shared vec3 m[256][9]`.
Author
Owner

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

🤖 Agent: /claim

<!-- gh-comment-id:6553033417 --> @TobiasLogic 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#1778
No description provided.