godotengine / godotengine/godot
Unclear shader function behavior with precision modifiers
- Dominant language
- C++
- Stars
- 117k
- Forks
- 26.8k
- PR merge metrics
- PR metrics pending
Description
### Tested versions
Reproducible in: 4.6.3-stable, 4.7.1-stable, v4.8.dev (eda2a48) (master)
### System information
Godot v4.8.dev (eda2a48) - Windows 11 (build 26200) - Multi-window, 2 monitors - Direct3D 12 (Forward+) - dedicated NVIDIA GeForce RTX 4080 SUPER (NVIDIA; 32.0.15.9186) - AMD Ryzen 7 7800X3D 8-Core Processor (16 threads) - 63.11 GiB memory - WASAPI (48000 Hz, Stereo/mono)
### Issue description
You can create functions in shaders which use the precision modifier, this is not clear from the documentation and I am unsure if it does anything https://docs.godotengine.org/en/stable/tutorials/shaders/shader_reference/shading_language.html#precision
Also you can create a void function using this modifier which does not make sense to me and I would expect a warning or an error.
### Steps to reproduce
In a new project create a text shader and add a function with a precision modifier as in the example above
### Minimal reproduction project (MRP)
N/A
Contributor guide
Research direction
Start with the linked shader precision documentation and reproduce the example in a new text-shader project using the listed Godot versions. Determine what the precision modifier means on shader functions, including void functions, then update the documentation to explain the behavior and clarify whether a warning or error is expected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- godot
- Domain
- compilers, documentation
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100