-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
Vulkan shader error when passing screen texture to function #72290
Comments
The error log is this. |
The issue here is that when using Multiview (for XR) Godot's shader compiler internally converts the Here is a copy of the error that includes the full shader printout: shader-error.txt CC @BastiaanOlij and @Chaosus |
Well, that will require to generate the version of function with |
Interesting problem, just to understand a bit more of what is going on, @ueshita, is your project using stereoscopic rendering (i.e. are you using this for VR) because that would never have worked even before we changed the screen texture approach. If you aren't then your code shouldn't fail as we shouldn't be compiling the multiview versions of our shaders and thus we're still only using |
A different approach to solving this same problem is to add a new sampler type to user-space shaders. Earlier we rejected that approach as being too complex, but it may make sense for the XR usecase which will always need both multiview and non-multiview variants of the shader Lyuma has a PR with this approach for reference #62130 My feeling is that we should use Chaosus' approach for Godot 4.0 and then see if we can remove the limitation in a later release. |
Owh I remember @lyuma solution, that was indeed an interesting approach. The problem there is that we have a standing principle for not wanting large changes to the shader code base for edge cases, which this certainly is (multiview support, not breaking functions that take in samplers as a parameter). Agree that Chaosus approach is the best thing we can do with such a short timeframe before release, though I think it should be combined with merging that old PR of yours (#63829) that properly disables multiview shaders, and then only applying the multiview checks when multiview shaders are enabled. This way people who aren't writing XR games aren't hindered by this restriction, only those who actually enable multiview shaders will not be able to use functions together with screen textures. |
I am not using VR/XR now. |
Godot version
v4.0.beta16.official.518b9e580
System information
Windows 11, Vulkan, AMD Radeon 680M
Issue description
If I pass a uniform sampler2D with hint_screen_texture to the function, I get a Vulkan shader error.
This issue does not occur before beta15.
It seems to me that perhaps #71455 has an impact.
Steps to reproduce
Specify the following shader to MeshInstance3D and Run.
Minimal reproduction project
ShaderError.zip
The text was updated successfully, but these errors were encountered: