@@ -13,7 +13,7 @@ internal sealed class RgaCompiler : IShaderCompiler
13
13
static RgaCompiler ( )
14
14
{
15
15
ProcessHelper . Run (
16
- Path . Combine ( AppContext . BaseDirectory , "Binaries" , "rga" , "2.2 " , "rga.exe" ) ,
16
+ Path . Combine ( AppContext . BaseDirectory , "Binaries" , "rga" , "2.4.1 " , "rga.exe" ) ,
17
17
"-s dx11 --list-asics" ,
18
18
out var stdOutput ,
19
19
out var _ ) ;
@@ -78,6 +78,7 @@ static RgaCompiler()
78
78
79
79
private static readonly string [ ] DirectXModeOptions =
80
80
{
81
+ "dxr" ,
81
82
"dx11" ,
82
83
"dx12" ,
83
84
} ;
@@ -97,6 +98,7 @@ public ShaderCompilerResult Compile(ShaderCode shaderCode, ShaderCompilerArgumen
97
98
98
99
var isVersion21OrLater = version >= new Version ( 2 , 1 ) ;
99
100
var isVersion22OrLater = version >= new Version ( 2 , 2 ) ;
101
+ var isVersion241OrLater = version >= new Version ( 2 , 4 , 1 ) ;
100
102
101
103
var asic = arguments . GetString ( "Asic" ) ;
102
104
var directXMode = arguments . GetString ( "DirectXMode" ) ;
@@ -119,6 +121,16 @@ public ShaderCompilerResult Compile(ShaderCode shaderCode, ShaderCompilerArgumen
119
121
case LanguageNames . Hlsl :
120
122
switch ( directXMode )
121
123
{
124
+ case "dxr" :
125
+ if ( ! isVersion241OrLater )
126
+ {
127
+ throw new InvalidOperationException ( "DXR mode is only supported on RGA 2.4.1 and above" ) ;
128
+ }
129
+ args += " -s dxr" ;
130
+ args += $ " --export { entryPoint } ";
131
+ args += $ " --hlsl \" { tempFile . FilePath } \" ";
132
+ break ;
133
+
122
134
case "dx11" :
123
135
args += isVersion22OrLater ? $ " -s dx11" : " -s hlsl" ;
124
136
args += $ " --profile { targetProfile } --function { entryPoint } ";
0 commit comments