Skip to content

Can't import GLSL shaders in headless mode #94734

@TCROC

Description

@TCROC

Tested versions

4.3.beta.mono.custom_build.ba7c5b0c8

System information

Godot v4.3.beta.mono (ba7c5b0) - Pop!_OS 22.04 LTS - Wayland - Vulkan (Forward+) - dedicated Intel(R) Arc(tm) A750 Graphics (DG2) - AMD Ryzen 7 5800X 8-Core Processor (16 Threads)

Issue description

Godot currently doesn't support importing glsl shaders in a headless context. This creates a problem for continuous integration / pipelines. @clayjohn worded it perfectly in the rocket chat so I'll just quote it here:

This is a very valuable workflow when you are targeting multiple platforms and becomes super important when working with a team. Basically everyone on the team can work on the platform of their choice, then the CI makes an export build for all target platforms and then you can test release builds on all platforms

Since CI doesn't have a GPU, you have to be able to import all resources, then export the game without access to a GPU. Ultimately, the game will be played on a device with a GPU, but the import/export process happens without one

This appears to be the PR that disabled glsl imports in headless mode: #92539

I tried simply reverting that PR and interestingly, it does seem to import the glsl shader. However, it crashes in the exported project when that shader is loaded if it wasn't previously loaded in a non-headless context.

Steps to reproduce

  1. Clone the proton scatter repo or use the zipped mrp (which is also just the proton scatter repo): https://github.com/HungryProton/scatter.git
  2. Open in godot
  3. Notice that the trees are loading in the showcase scene.
  4. Create an export preset
  5. Delete the .godot folder in the project directory so there aren't any cached imports.
  6. Run the command: godot --headless --path path/to/project --import
  7. Notice the errors regarding failed glsl imports.
  8. Run the command: godot --headless --path path/to/project --export-debug PresetName path/to/export/game.exe
  9. Notice the errors regarding glsl
  10. Start the exported game and notice that the trees no longer load

Minimal reproduction project (MRP)

scatter.zip

https://github.com/HungryProton/scatter.git

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions