-
-
Notifications
You must be signed in to change notification settings - Fork 22k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Constructing a varying vector exceeding a declaration limit within a shader freezes the editor #76667
Comments
I can confirm this on 4.1.dev d6dde81 (Linux, GeForce RTX 4090 with NVIDIA 530.41.03):
Modifying the shader without the ShaderMaterial preview being visible in the inspector does not result in a freeze. This likely occurs because the The issue still occurs if replacing all Running with Vulkan validation layers installed and
|
I did a little more looking into it:
Switching the case of the matrix name in the second example:
So I suppose there are separate considerations for uppercase and lowercase variables. The limit in both examples seems to be 21 vectors regardless of type. Adding a Additionally, if you combine the vector declarations from both examples:
No matter which order you declare the cases in, the uppercase ones seem to take priority and act as if they were declared first. |
We need to add a clear user-facing error when users exceed the number of varyings supported by user hardware. Godot uses up to 11 varyings and it reserves the slots for those 11. Vulkan devices are only guaranteed to support 16 varyings (64 components / 4), but most devices support 32 https://vulkan.gpuinfo.org/displaydevicelimit.php?name=maxVertexOutputComponents&platform=all (except apple devices which seem to have one less) |
Interestingly, I don't get a crash on Windows 11 on the same GeForce RTX 4090 (NVIDIA 531.61), even if
The editor doesn't freeze at all, it just continues rendering after a small fraction of a second and can still be used. This indicates that |
Just flagging that this is still an issue in 4.3-dev 5 on a NVIDIA GeForce GTX 980 Ti. To get back into the project I had to corrupt the scenes using that offending shader (by renaming it). In my case any more than 32 components (ie. floats) in varyings caused the freeze. Perhaps if it is a complicaed fix (accounting for hardware, etc) a note in the shaders section of the documentation could support users in identifying the cause of the problem? |
Godot version
4.0.2.stable.official
System information
Windows 10, NVIDIA GeForce RTX 2080 SUPER, Driver 516.94, Vulkan backend
Issue description
If there is a shadermaterial being rendered when a varying vector that exceeds a declaration limit is constructed within the vertex function of its shader, the editor will freeze.
Example code:
Steps to reproduce
Minimal reproduction project
issue_just_why.zip
The text was updated successfully, but these errors were encountered: