Conversation
- Use locale-invariant float string formatting (`text_utils::formatFloatClassic`) in ShaderUtils.cpp for preprocessor defines (WEATHER_RADIUS, etc.) to ensure a '.' decimal separator regardless of active system locale. - Fix array declaration syntax in room/tex/acolor/vert.glsl from `const ivec3[4] ioffsets` to `const ivec3 ioffsets[4]` for compatibility with GLSL 3.30 and GLSL ES 3.00 (WebGL 2) compilers. - Add unit test coverage in TestGlobal.
- Use locale-invariant float string formatting (`text_utils::formatFloatClassic`) in ShaderUtils.cpp for preprocessor defines (WEATHER_RADIUS, etc.) to ensure a '.' decimal separator regardless of active system locale. - Fix array declaration syntax in room/tex/acolor/vert.glsl from `const ivec3[4] ioffsets` to `const ivec3 ioffsets[4]` for compatibility with GLSL 3.30 and GLSL ES 3.00 (WebGL 2) compilers. - Add unit test coverage in TestGlobal.
- Use locale-invariant float string formatting (`text_utils::formatFloatClassic`) in ShaderUtils.cpp for preprocessor defines (WEATHER_RADIUS, etc.) to ensure a '.' decimal separator regardless of active system locale. - Fix array declaration syntax in room/tex/acolor/vert.glsl from `const ivec3[4] ioffsets` to `const ivec3 ioffsets[4]` for compatibility with GLSL 3.30 and GLSL ES 3.00 (WebGL 2) compilers. - Add unit test coverage in TestGlobal.
- Use locale-invariant float string formatting (`text_utils::formatFloatClassic`) in ShaderUtils.cpp for preprocessor defines (WEATHER_RADIUS, etc.) to ensure a '.' decimal separator regardless of active system locale. - Fix array declaration syntax in room/tex/acolor/vert.glsl from `const ivec3[4] ioffsets` to `const ivec3 ioffsets[4]` for compatibility with GLSL 3.30 and GLSL ES 3.00 (WebGL 2) compilers. - Add unit test coverage in TestGlobal.
- Use locale-invariant float string formatting (`text_utils::formatFloatClassic`) in ShaderUtils.cpp for preprocessor defines (WEATHER_RADIUS, etc.) to ensure a '.' decimal separator regardless of active system locale. - Fix array declaration syntax in room/tex/acolor/vert.glsl from `const ivec3[4] ioffsets` to `const ivec3 ioffsets[4]` for compatibility with GLSL 3.30 and GLSL ES 3.00 (WebGL 2) compilers. - Use RAII guard (`RAIICallback`) in unit test `testFormatFloatClassic` to ensure locale restoration on all exit paths.
- Use locale-invariant float string formatting (`text_utils::formatFloatClassic`) in ShaderUtils.cpp for preprocessor defines (WEATHER_RADIUS, etc.) to ensure a '.' decimal separator regardless of active system locale. - Fix array declaration syntax in room/tex/acolor/vert.glsl from `const ivec3[4] ioffsets` to `const ivec3 ioffsets[4]` for compatibility with GLSL 3.30 and GLSL ES 3.00 (WebGL 2) compilers. - Use RAII guard (`RAIICallback`) in unit test `testFormatFloatClassic` to ensure locale restoration on all exit paths.
- Use locale-invariant float string formatting (`text_utils::formatFloatClassic`) in ShaderUtils.cpp for preprocessor defines (WEATHER_RADIUS, etc.) to ensure a '.' decimal separator regardless of active system locale. - Fix array declaration syntax in room/tex/acolor/vert.glsl from `const ivec3[4] ioffsets` to `const ivec3 ioffsets[4]` for compatibility with GLSL 3.30 and GLSL ES 3.00 (WebGL 2) compilers. - Use RAII guard (`RAIICallback`) in unit test `testFormatFloatClassic` to ensure locale restoration on all exit paths.
- Use locale-invariant float string formatting (`text_utils::formatFloatClassic`) in ShaderUtils.cpp for preprocessor defines (WEATHER_RADIUS, etc.) to ensure a '.' decimal separator regardless of active system locale. - Fix array declaration syntax in room/tex/acolor/vert.glsl from `const ivec3[4] ioffsets` to `const ivec3 ioffsets[4]` for compatibility with GLSL 3.30 and GLSL ES 3.00 (WebGL 2) compilers. - Use RAII guard (`RAIICallback`) in unit test `testFormatFloatClassic` to ensure locale restoration on all exit paths.
- Use locale-invariant float string formatting (`text_utils::formatFloatClassic`) in ShaderUtils.cpp for preprocessor defines (WEATHER_RADIUS, etc.) to ensure a '.' decimal separator regardless of active system locale. - Fix array declaration syntax in room/tex/acolor/vert.glsl from `const ivec3[4] ioffsets` to `const ivec3 ioffsets[4]` for compatibility with GLSL 3.30 and GLSL ES 3.00 (WebGL 2) compilers. - Use RAII guard (`RAIICallback`) in unit test `testFormatFloatClassic` to ensure locale restoration on all exit paths.
Reviewer's GuideThe PR fixes shader compilation under non-C locales by formatting generated weather constants with a classic locale so GLSL receives decimal points rather than locale-specific commas, adds locale-sensitive tests, and modernizes a legacy GLSL array declaration for compiler compatibility. Sequence diagram for locale-safe GLSL shader generationsequenceDiagram
participant ShaderUtils
participant TextUtils
participant GLSLCompiler
ShaderUtils->>TextUtils: formatFloatClassic(weatherConstant)
TextUtils->>TextUtils: std::locale::classic()
TextUtils-->>ShaderUtils: decimal-point string
ShaderUtils->>GLSLCompiler: compileShader(shaderSourceWithWeatherDefines)
GLSLCompiler-->>ShaderUtils: compiled shader
Flow diagram for locale-independent weather constantsflowchart LR
A[Weather constants] --> B[formatFloatClassic]
B --> C[GLSL weather defines with decimal points]
C --> D[Shader compilation succeeds under non-C locales]
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
nschimme
deleted the
fix-glsl-shader-locale-compilation-bug-17562491324332354441
branch
September 14, 2026 15:37
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #557 +/- ##
==========================================
+ Coverage 27.24% 27.27% +0.02%
==========================================
Files 559 559
Lines 45893 45912 +19
Branches 4879 4879
==========================================
+ Hits 12505 12522 +17
- Misses 33388 33390 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #556
Summary by Sourcery
Make legacy GLSL shader generation independent of the process locale and improve shader declaration compatibility.
Bug Fixes:
Enhancements:
Tests: