-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Editor crash when setting shader parameter for type uniform sampler2D array ("Attempting to initialize the wrong RID") #84966
Comments
Can you test with the latest beta 6, please? |
Successfully reproduced on v4.2.beta6.mono.official [6415006] - Windows 10.0.22621. Should be applicable on macOS and Linux as well. |
Why you referenced [ 6415006 ] ? |
That's the commit hash for beta 6. |
Confirmed, but does godot support sampler arrays? #49485 mentioned that "Support for texture samplers will be later" and looks like #77740 "removes sampler arrays in shaders (which are not supported by all devices)" . If it's not supported, we should probably give some error when compile the shader. But it should not crash, the crash call stack on my machine looks like this: |
I get the same error messages, but I can't repro the crash in any way either with official 4.2 beta 6 or current master build (ce9901e). Windows 10, NVIDIA GTX 970. Rendering seems to work correctly too despite those error messages. Seems to also work with Compatibility renderer with no errors. Removing godot/core/templates/rid_owner.h Lines 185 to 190 in ce9901e
Full stack trace of that first error ("Attempting to initialize the wrong RID"):
|
Yes, Godot 4 supports sampler arrays. If you go to Shader Globals in the project settings and attempt to add a new property, you can explicitly see sampler2D array in the type dropdown. Also sampler arrays work perfectly fine with no issue. The crash isn't related to shader support necessarily, but rather the editor itself. |
I recommend trying to reproduce on Forward+ to see if it's an issue with that pipeline exclusively. The reproduction project provided should crash if: |
Godot version
v4.2.beta6.mono.official [6415006]
System information
Godot v4.2.beta5.mono - Windows 10.0.22621 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 2080 SUPER (NVIDIA; 31.0.15.3742) - Intel(R) Core(TM) i9-9900 CPU @ 3.10GHz (16 Threads)
Godot v4.2.beta6 - Linux Mint 21 (Vanessa) - X11 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1080 (nvidia; 530.41.03) - Intel(R) Xeon(R) CPU E5-2650 v4 @ 2.20GHz (24 Threads)
This was also successfully reproduced on macOS (ARM) and Linux Mint; i.e., this issue is not OS agnostic.
Issue description
Sampler2D arrays are a new feature exclusive to Godot 4, but they appear to have not been tested at all.
While they work without issue when solely utilizing them in code, attempting to set a
uniform sampler2D[]
in the Godot property inspector will cause a crash on the next editor startup with the error "Attempting to initialize the wrong RID."For relevant logs, please refer to the attached message in the reproduction project, courtesy of @johnnyninjutsu on Discord.
Steps to reproduce
The crash only occurs after restarting the editor, so ensure you entirely save the project with Ctrl/Cmd + S and restart Godot for a successful repro.
Minimal reproduction project
Sampler2dArrayRepro.zip
Crash log:
NOTE: The sample production project and crash log were provided by @johnnyninjutsu on the Godot Engine Discord, who collaborated with me in developing a working repro and writing up this issue. Talk can be found here.
The text was updated successfully, but these errors were encountered: