Shader compilation problems on Vulkan

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 a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: Shader compilation problems on Vulkan

Re: Shader compilation problems on Vulkan

by Graf Zahl » Sun Aug 18, 2019 6: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.

Re: Shader compilation problems on Vulkan

by Graf Zahl » Tue Jul 02, 2019 4: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.

Re: Shader compilation problems on Vulkan

by _mental_ » Tue Jul 02, 2019 3: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.

Re: Shader compilation problems on Vulkan

by Graf Zahl » Tue Jul 02, 2019 3: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.

Re: Shader compilation problems on Vulkan

by _mental_ » Tue Jul 02, 2019 1: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.

Shader compilation problems on Vulkan

by Graf Zahl » Tue Jul 02, 2019 1: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.

Top