godotengine / godotengine/godot
Shader include with incorrect case in path will work in editor but fail to compile in release
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 117k
- Forks
- 26.8k
- PR merge metrics
- PR metrics pending
Description
Tested versions
Godot Engine v4.5.stable.mono.official.876b29033
System information
Windows 11, Vulkan 1.4.303 - Forward+ - Using Device #0: NVIDIA - NVIDIA GeForce RTX 3070
Issue description
Shader include with incorrect case in path will work in editor fail to compile in release
With error:
SHADER ERROR: Tokenizer: Unknown character #35: '#'
at: (null) (:3)
ERROR: Shader compilation failed.
at: (servers/rendering/renderer_rd/renderer_canvas_render_rd.cpp:1578)
ERROR: Parameter "version" is null.
at: version_get_shader (./servers/rendering/renderer_rd/shader_rd.h:183)
Steps to reproduce
- Create a .gdshaderinc file
- Include it in another shader, but with some incorrect capitalisation
- It will work in the editor
- Export a release build
- Shader will not compile in release build.
Minimal reproduction project (MRP)
Attached.
Here Left.gdshader has correct path, but Right.gdshader has incorrect path (wrong case in Shader dir). Both work in the editor, but right will fail in release.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the attached Shader-include-error.zip and reproduce the difference between the editor and an exported release build using Left.gdshader and Right.gdshader. Trace how each build resolves the referenced .gdshaderinc path, then verify that an incorrectly cased include is handled consistently and that both shaders compile as expected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100