I would like to have code for cpu and gpu in one file, but when I use the slang file to generate GPU code slang crashes with an internal error 99999. This is mainly caused by export vars/functions like the following below.
Compiling to cpp is fine but when I use the same slang file for glsl even though it is not used by the GPU code slang crashes.
I already tried [require(cpp)] but it seems to have no effect. Is there another way to exclude code for certain targets? There is a way inside a function but what about global vars?
It would be awesome if one could annotate something like the example above with [require(cpp)] and then it would just be ignored if the target is not cpp
Edit: Of course I can resort to defines, but would be nice to have a better solution
I would like to have code for cpu and gpu in one file, but when I use the slang file to generate GPU code slang crashes with an internal error 99999. This is mainly caused by export vars/functions like the following below.
E.g., I use a COM Interface in my code
Compiling to cpp is fine but when I use the same slang file for glsl even though it is not used by the GPU code slang crashes.
I already tried
[require(cpp)]
but it seems to have no effect. Is there another way to exclude code for certain targets? There is a way inside a function but what about global vars?It would be awesome if one could annotate something like the example above with [require(cpp)] and then it would just be ignored if the target is not cpp
Edit: Of course I can resort to defines, but would be nice to have a better solution