Skip to content

Commit cf257ae

Browse files
jsmall-zzztgjones
authored andcommitted
Add profiles for dxil/dxc. Add 5.1 for DXBC.
Assuming DXIL is default output set default profile to be cs_6_0
1 parent f2a67a2 commit cf257ae

File tree

1 file changed

+68
-1
lines changed

1 file changed

+68
-1
lines changed

src/ShaderPlayground.Core/Compilers/Slang/SlangCompiler.cs

Lines changed: 68 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ internal sealed class SlangCompiler : IShaderCompiler
1616
CommonParameters.CreateVersionParameter("slang"),
1717
// The default HLSL entry point (CommonParameters.HlslEntryPoint) uses PSMain, but the Slang sample is a compute shader with "computeMain"
1818
new ShaderCompilerParameter("EntryPoint", "Entry point", ShaderCompilerParameterType.TextBox, defaultValue: "computeMain"),
19-
new ShaderCompilerParameter("Profile", "Profile", ShaderCompilerParameterType.ComboBox, ProfileOptions, "cs_5_0"),
19+
// Default to cs_6_0 as assuming DXIL will be the default target
20+
new ShaderCompilerParameter("Profile", "Profile", ShaderCompilerParameterType.ComboBox, ProfileOptions, "cs_6_0"),
2021
new ShaderCompilerParameter("OptimizationLevel", "Optimization level", ShaderCompilerParameterType.ComboBox, OptimizationLevelOptions, "Default"),
2122
CommonParameters.CreateOutputParameter(new[] { LanguageNames.Dxil, LanguageNames.SpirV, LanguageNames.Dxbc, LanguageNames.Hlsl, LanguageNames.Glsl, LanguageNames.Cpp, LanguageNames.Cuda, LanguageNames.Ptx })
2223
};
@@ -31,20 +32,86 @@ internal sealed class SlangCompiler : IShaderCompiler
3132

3233
private static readonly string[] ProfileOptions =
3334
{
35+
// DXBC
3436
"cs_4_0",
3537
"cs_4_1",
3638
"cs_5_0",
39+
"cs_5_1",
40+
// DXIL
41+
"cs_6_0",
42+
"cs_6_1",
43+
"cs_6_2",
44+
"cs_6_3",
45+
"cs_6_4",
46+
"cs_6_5",
47+
"cs_6_6",
48+
49+
// DXBC
3750
"ds_5_0",
51+
"ds_5_1",
52+
// DXIL
53+
"ds_6_0",
54+
"ds_6_1",
55+
"ds_6_2",
56+
"ds_6_3",
57+
"ds_6_4",
58+
"ds_6_5",
59+
"ds_6_6",
60+
61+
// DXBC
3862
"gs_4_0",
3963
"gs_4_1",
4064
"gs_5_0",
65+
"gs_5_1",
66+
// DXIL
67+
"gs_6_0",
68+
"gs_6_1",
69+
"gs_6_2",
70+
"gs_6_3",
71+
"gs_6_4",
72+
"gs_6_5",
73+
"gs_6_6",
74+
75+
// DXBC
4176
"hs_5_0",
77+
"hs_5_1",
78+
// DXIL
79+
"hs_6_0",
80+
"hs_6_1",
81+
"hs_6_2",
82+
"hs_6_3",
83+
"hs_6_4",
84+
"hs_6_5",
85+
"hs_6_6",
86+
87+
// DXBC
4288
"ps_4_0",
4389
"ps_4_1",
4490
"ps_5_0",
91+
"ps_5_1",
92+
// DXIL
93+
"ps_6_0",
94+
"ps_6_1",
95+
"ps_6_2",
96+
"ps_6_3",
97+
"ps_6_4",
98+
"ps_6_5",
99+
"ps_6_6",
100+
101+
// DXBC
45102
"vs_4_0",
46103
"vs_4_1",
47104
"vs_5_0",
105+
"vs_5_1",
106+
// DXIL
107+
"vs_6_0",
108+
"vs_6_1",
109+
"vs_6_2",
110+
"vs_6_3",
111+
"vs_6_4",
112+
"vs_6_5",
113+
"vs_6_6",
114+
48115
"glsl_vertex",
49116
"glsl_tess_control",
50117
"glsl_tess_eval",

0 commit comments

Comments
 (0)