Is it possible to use project level conditional defines in hlsl code?
I'm trying to conditionaly compile a shader using MonoGame Content Procesor. Depending on project type (ie. Windows, Windows8...) different shader models should be used. Pragma directives are supported. The code:
#if WINDOWS
PixelShader = compile ps_3_0 PixelShaderFunction();
#else
...
... doesn't work as WINDOWS is interpreted as false. Judging from the article on Gamasutra this should work. This answer on Gamedev lists constants which should be defined when using MonoGame.
I've also tried adding constants into csproj manually (in content project, then in dummy content compiler csproj).
Is there something I'm missing?
My sln structure is as follows:
- MonoGameContentProject - holds .fx file
- MonoGameDummyProject - has content reference to content project, builds .fx file
- WindowsProject - has a link to dummy project xnb file in the windows build directory
#if WIN32
\$\endgroup\$