-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HLSL2GLSL Converter: handle preprocessor-defined shader function retu…
…rn type
- Loading branch information
1 parent
431f4ee
commit 06cfb24
Showing
4 changed files
with
213 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
Tests/DiligentCoreAPITest/assets/shaders/HLSL2GLSLConverter/PreprocessorTest.hlsl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
struct PSOutput | ||
{ | ||
float4 Color : SV_Target0; | ||
}; | ||
|
||
struct PSInput | ||
{ | ||
float4 Pos : SV_Position; | ||
}; | ||
|
||
# define PS_OUTPUT PSOutput | ||
# define PS_INPUT PSInput | ||
|
||
#ifdef MACRO0 | ||
# define PS_OUTPUT abc | ||
#elif defined(MACRO1) | ||
# define PS_OUTPUT xyz | ||
#endif | ||
|
||
PS_OUTPUT main(in PSInput PSIn) | ||
{ | ||
PS_OUTPUT PSOut; | ||
PSOut.Color = float4(PSIn.Pos.xy, 0.0, 0.0); | ||
return PSOut; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters