Standalone: Implement -D and -U for preprocessor macros.
Works for both GLSL and HLSL. Fixes #87.
This commit is contained in:
parent
04acb1b7c9
commit
a931366f56
7 changed files with 262 additions and 13 deletions
31
Test/hlsl.-D-U.frag
Normal file
31
Test/hlsl.-D-U.frag
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
|
||||
#define IN_SHADER
|
||||
|
||||
static float4 color;
|
||||
|
||||
void main()
|
||||
{
|
||||
#if FOO==200
|
||||
color = 1.0;
|
||||
#else
|
||||
#error expected FOO 200
|
||||
#endif
|
||||
|
||||
#ifdef FOO
|
||||
color -= 5.0;
|
||||
#else
|
||||
#error expected FOO 200
|
||||
#endif
|
||||
|
||||
#ifdef IN_SHADER
|
||||
color++;
|
||||
#else
|
||||
#error IN_SHADER was undef
|
||||
#endif
|
||||
|
||||
#ifdef UNDEFED
|
||||
#error UNDEFED defined
|
||||
#else
|
||||
color *= 3.0;
|
||||
#endif
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue