Skip to content

GL: make shared/waterconfig.h pure ASCII, fixes AMD GLSL "#endif miss… - #2194

Merged
Xottab-DUTY merged 1 commit into
OpenXRay:devfrom
klaxons1:watershaderfix-gcn1-terascale-win
Oct 15, 2026
Merged

Xottab-DUTY merged 1 commit into
OpenXRay:devfrom
klaxons1:watershaderfix-gcn1-terascale-win

Conversation

@klaxons1

Copy link
Copy Markdown
Contributor

…ing"

shared/waterconfig.h was the only shader source in the whole tree carrying non-ASCII bytes: it is CP1251-encoded and has Russian comments on lines 4, 23 and 35. The engine feeds shader text to glShaderSource() as a list of raw byte strings, so AMD's GLSL front-end receives the invalid UTF-8 sequence 0xED 0xE0 (line 4, first bytes of the first Russian word), aborts the preprocessor while #ifndef _WATERCONFIG_H is still open and reports

ERROR: 44:4: error(# 92) Syntax error: #endif missing. Compilation stopped

where 44 is the index of this file in the glShaderSource() string array and 4 is its line. Only the water shaders include this header, which is why just gl\water_soft.vs, gl\waterd_soft.vs and gl\waterd_soft.ps fail on AMD and get silently replaced with stub_default.

Боже неужели с текущими ресурсами я смог исправить баг над которым я думал два года назад. Вообщем виндовые амд драйверы семейства gcn1, terascale 2 и ниже достаточно строгие в компиляции шейдеров. я сперва думал что они просто сломаны а оказалось нет, в шейдерах не должно быть просто cp1251.

До пулреквеста:
image

После пулреквеста:
image

…ing"

shared/waterconfig.h was the only shader source in the whole tree carrying
non-ASCII bytes: it is CP1251-encoded and has Russian comments on lines 4,
23 and 35. The engine feeds shader text to glShaderSource() as a list of raw
byte strings, so AMD's GLSL front-end receives the invalid UTF-8 sequence
0xED 0xE0 (line 4, first bytes of the first Russian word), aborts the
preprocessor while #ifndef _WATERCONFIG_H is still open and reports

  ERROR: 44:4: error(# 92) Syntax error: #endif missing. Compilation stopped

where 44 is the index of this file in the glShaderSource() string array and
4 is its line. Only the water shaders include this header, which is why just
gl\water_soft.vs, gl\waterd_soft.vs and gl\waterd_soft.ps fail on AMD and get
silently replaced with stub_default.
@github-actions github-actions Bot added the Game assets A feature or an issue that involves gamedata change label Oct 14, 2026
@Xottab-DUTY Xottab-DUTY added Bug The issue in the run-time. Renderer Portability OpenGL and removed Game assets A feature or an issue that involves gamedata change labels Oct 15, 2026
@Xottab-DUTY
Xottab-DUTY merged commit c62d9d3 into OpenXRay:dev Oct 15, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug The issue in the run-time. OpenGL Portability Renderer

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants