[GH-ISSUE #7233] Shader packs: a // comment ending in a backslash should take the next line with it #3183

Closed
opened 2026-11-03 04:06:29 +07:00 by bsakaguchi · 1 comment
Owner

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

Originally assigned to: @arslanarm on GitHub.

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

What happens: GLSL 4.60, 3.4 Comments: "a single-line comment ending in the line-continuation character (\) includes the next line in the comment". That line is then neither code nor a directive.

Horizon's preprocessor ends such a comment at the line break and reads the next line. A #define, #if or #endif there takes effect in Horizon but not in Iris.

Seen in Iris 1.11.7 (+ Sodium 0.9.2 on 26.3) with a probe pack written for this (#version 330 compatibility, one scene). A #define on the line after such a comment stays undefined, both when the comment follows code on its line and when it is alone on its line. Only that #version was tested.

An example (written for this issue):

#version 330 compatibility
const float k = 1.0; // ends in a backslash \
#define HIDDEN
void main() {
#ifdef HIDDEN
    gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0); // Horizon
#else
    gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0); // Iris
#endif
}

No pack among Modrinth's 40 most-downloaded shader packs changes with a fix (real_packs), so this is about parity with Iris rather than a pack that breaks today.

Expected: the comment takes the next line, as in Iris.

Originally created by @arslanarm on GitHub (Nov 2, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/7233 Originally assigned to: @arslanarm on GitHub. > 🤖 Filed by arslanarm's AI agent (Claude Code, Claude Opus 5.5), not by arslanarm personally. **What happens:** GLSL 4.60, 3.4 Comments: "a single-line comment ending in the line-continuation character (\\) includes the next line in the comment". That line is then neither code nor a directive. Horizon's preprocessor ends such a comment at the line break and reads the next line. A `#define`, `#if` or `#endif` there takes effect in Horizon but not in Iris. **Seen in Iris 1.11.7** (+ Sodium 0.9.2 on 26.3) with a probe pack written for this (`#version 330 compatibility`, one scene). A `#define` on the line after such a comment stays undefined, both when the comment follows code on its line and when it is alone on its line. Only that `#version` was tested. **An example** (written for this issue): ```glsl #version 330 compatibility const float k = 1.0; // ends in a backslash \ #define HIDDEN void main() { #ifdef HIDDEN gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0); // Horizon #else gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0); // Iris #endif } ``` No pack among Modrinth's 40 most-downloaded shader packs changes with a fix (`real_packs`), so this is about parity with Iris rather than a pack that breaks today. Expected: the comment takes the next line, as in Iris.
Author
Owner

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

🤖 Agent: /claim

<!-- gh-comment-id:6578442954 --> @arslanarm commented on GitHub (Nov 2, 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#3183
No description provided.