Reporting because right now I cannot address this myself:
A user shader using 'texture2D' to look up a texture fails to compile with Vulkan. Manually changing 'texture2D' to 'texture' makes it work.
Discovered with Freaky Panties.
Shader compilation problems on Vulkan
Moderator: GZDoom Developers
Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Re: Shader compilation problems on Vulkan
The problem exists with Apple’s OpenGL too. But with Vulkan it affects all platforms.
I would solve this by adding texture?D functions to our shader header. This solution was already used for noise functions.
I would solve this by adding texture?D functions to our shader header. This solution was already used for noise functions.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49056
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Shader compilation problems on Vulkan
I don't think that's a good idea - on Windows 'texrture2D' is still a valid builtin function. So this has to be done platform specific or the text has to be replaced in-place before compilation.
Re: Shader compilation problems on Vulkan
Our shader header is different for OpenGL and Vulkan.
I mentioned Apple’s OpenGL just for the sake of completeness. I have no plans to fix it.
With Vulkan renderer texture2D needs to be handled regardless of platform.
I mentioned Apple’s OpenGL just for the sake of completeness. I have no plans to fix it.
With Vulkan renderer texture2D needs to be handled regardless of platform.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49056
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Shader compilation problems on Vulkan
It also needs to get fixed on OpenGL, because if Apple fails here, there's no guarantee that other implementors also remove deprecated functionality.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49056
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Shader compilation problems on Vulkan
I tried to fix it as a function override, but that doesn't work. It seems 'texture2d' is a token, not an identifier, so the only way to change it is to patch the shader source.