godotengine / godotengine/godot

Shader include with incorrect case in path will work in editor but fail to compile in release

Open
#110,708 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug topic:export topic:shaders
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.

Shader-include-error.zip

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.