Shader compilation problems on Vulkan

Bugs that have been investigated and resolved somehow.

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.
Post Reply
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Shader compilation problems on Vulkan

Post by Graf Zahl »

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.
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: Shader compilation problems on Vulkan

Post by _mental_ »

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.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Shader compilation problems on Vulkan

Post by Graf Zahl »

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.
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: Shader compilation problems on Vulkan

Post by _mental_ »

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.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Shader compilation problems on Vulkan

Post by Graf Zahl »

It also needs to get fixed on OpenGL, because if Apple fails here, there's no guarantee that other implementors also remove deprecated functionality.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Shader compilation problems on Vulkan

Post by Graf Zahl »

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.
Post Reply

Return to “Closed Bugs [GZDoom]”