[Fixed] Shader compilation problems on Vulkan

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Shader compilation problems on Vulkan

Postby Graf Zahl » Tue Jul 02, 2019 2:17 am

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.
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Shader compilation problems on Vulkan

Postby _mental_ » Tue Jul 02, 2019 2:33 am

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.
_mental_
 
 
 
Joined: 07 Aug 2011

Re: Shader compilation problems on Vulkan

Postby Graf Zahl » Tue Jul 02, 2019 4:04 am

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.
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Shader compilation problems on Vulkan

Postby _mental_ » Tue Jul 02, 2019 4:48 am

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.
_mental_
 
 
 
Joined: 07 Aug 2011

Re: Shader compilation problems on Vulkan

Postby Graf Zahl » Tue Jul 02, 2019 5:05 am

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 Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Shader compilation problems on Vulkan

Postby Graf Zahl » Sun Aug 18, 2019 7:45 am

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.
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany


Return to Closed Bugs

Who is online

Users browsing this forum: LedIris, _mental_ and 14 guests