- Posts: 328
[SOLVED] Empty preprocessor definitions don't work in 4.4
- brussell
-
Topic Author
- Offline
Less More
2 years 5 months ago - 2 years 5 months ago #1 by brussell
Empty preprocessor definitions don't work in 4.4 was created by brussell
When using an empty definition likeReshade throws an error: error: X3004: undeclared identifier 'TEST'
I use this often in my code, for example like this:
This works with every other Reshade version I know (at least since 0.18).
So is this a bug or intended?
edit: I found an alternative for my use case: "#define TEST ;"
But I'm still interested if this intended or not.
#define TEST
I use this often in my code, for example like this:
//Aspectbars Definitions
#if (UPSCALE_ASPECT_BARS == 1)
#define ASPECTBARS [branch] if (texcoord.x < 0.125 || texcoord.x > 1 - 0.125) { return 0.0.xxxx; }
#else
#define ASPECTBARS
#endif
...
float4 PS_Adaption(float4 pos : SV_Position, float2 texcoord : TEXCOORD) : SV_Target
{
ASPECTBARS
float4 color = tex2Dlod(SAMPLERCURRENT, float4(texcoord, 0, 0));
...
return color;
}
This works with every other Reshade version I know (at least since 0.18).
So is this a bug or intended?
edit: I found an alternative for my use case: "#define TEST ;"
But I'm still interested if this intended or not.
Last edit: 2 years 5 months ago by brussell.
Please Log in or Create an account to join the conversation.
- crosire
-
- Offline
Less More
- Posts: 3988
2 years 5 months ago - 2 years 5 months ago #2 by crosire
Replied by crosire on topic Empty preprocessor definitions don't work in 4.4
I can't reproduce that. Works fine with both 4.4.2 and master here. Could you post a full file with which this happens?
Last edit: 2 years 5 months ago by crosire.
Please Log in or Create an account to join the conversation.
- brussell
-
Topic Author
- Offline
Less More
- Posts: 328
2 years 5 months ago - 2 years 5 months ago #3 by brussell
Replied by brussell on topic Empty preprocessor definitions don't work in 4.4
Ok.The following works with Reshade 4.3 but NOT with 4.4.2 ("ReShade.fx(3, 1): error X3000: syntax error: unexpected 'identifier'")
It only throws an error if TEST is used more than once. So the example without the second TEST works fine.
#define TEST
TEST
TEST
technique TestReshade < enabled = 1;> { }
It only throws an error if TEST is used more than once. So the example without the second TEST works fine.
Last edit: 2 years 5 months ago by brussell.
Please Log in or Create an account to join the conversation.
- crosire
-
- Offline
Less More
- Posts: 3988
2 years 5 months ago #4 by crosire
Replied by crosire on topic Empty preprocessor definitions don't work in 4.4
Thank you. Fixed in github.com/crosire/reshade/commit/f2c0ca...9d3cf4ce9f586a4972b5.
The following user(s) said Thank You: brussell
Please Log in or Create an account to join the conversation.