Skip to content

Commit 15fe220

Browse files
author
Greg Roth
authored
Add mesh launch type for node shaders (#6436)
Adds the ability to specify a mesh node which functions largely like a broadcasting node. This will generate code, metadata, and rdat info for a minimal mesh node. Diagnostics are changed to allow the mesh nodes to be generated. Tests for RDAT and metadata are included. Errors referencing only broadcasting nodes now mention mesh nodes where appropriate. Fixes #6432
1 parent 11ee8de commit 15fe220

16 files changed

Lines changed: 547 additions & 203 deletions

File tree

include/dxc/DXIL/DxilConstants.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ namespace DXIL {
2929
const unsigned kDxilMajor = 1;
3030
/* <py::lines('VALRULE-TEXT')>hctdb_instrhelp.get_dxil_version_minor()</py>*/
3131
// VALRULE-TEXT:BEGIN
32-
const unsigned kDxilMinor = 8;
32+
const unsigned kDxilMinor = 9;
3333
// VALRULE-TEXT:END
3434

3535
inline unsigned MakeDxilVersion(unsigned DxilMajor, unsigned DxilMinor) {
@@ -1603,6 +1603,7 @@ enum class NodeLaunchType {
16031603
Broadcasting,
16041604
Coalescing,
16051605
Thread,
1606+
Mesh,
16061607

16071608
LastEntry
16081609
};

include/dxc/DXIL/DxilShaderModel.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class ShaderModel {
3333
// clang-format on
3434
// VALRULE-TEXT:BEGIN
3535
static const unsigned kHighestMajor = 6;
36-
static const unsigned kHighestMinor = 8;
36+
static const unsigned kHighestMinor = 9;
3737
// VALRULE-TEXT:END
3838
static const unsigned kOfflineMinor = 0xF;
3939

@@ -74,6 +74,7 @@ class ShaderModel {
7474
bool IsSM66Plus() const { return IsSMAtLeast(6, 6); }
7575
bool IsSM67Plus() const { return IsSMAtLeast(6, 7); }
7676
bool IsSM68Plus() const { return IsSMAtLeast(6, 8); }
77+
bool IsSM69Plus() const { return IsSMAtLeast(6, 9); }
7778
// VALRULE-TEXT:END
7879
const char *GetName() const { return m_pszName; }
7980
const char *GetKindName() const;
@@ -109,7 +110,7 @@ class ShaderModel {
109110
bool m_bTypedUavs, unsigned m_UAVRegsLim);
110111
/* <py::lines('VALRULE-TEXT')>hctdb_instrhelp.get_num_shader_models()</py>*/
111112
// VALRULE-TEXT:BEGIN
112-
static const unsigned kNumShaderModels = 92;
113+
static const unsigned kNumShaderModels = 101;
113114
// VALRULE-TEXT:END
114115
static const ShaderModel ms_ShaderModels[kNumShaderModels];
115116

include/dxc/DxilContainer/RDAT_LibraryTypes.inl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,9 +307,10 @@ RDAT_DXIL_ENUM_START(hlsl::DXIL::NodeLaunchType, uint32_t)
307307
RDAT_ENUM_VALUE_NODEF(Broadcasting)
308308
RDAT_ENUM_VALUE_NODEF(Coalescing)
309309
RDAT_ENUM_VALUE_NODEF(Thread)
310+
RDAT_ENUM_VALUE_NODEF(Mesh)
310311
RDAT_ENUM_VALUE_NODEF(LastEntry)
311312
#if DEF_RDAT_ENUMS == DEF_RDAT_DUMP_IMPL
312-
static_assert((unsigned)hlsl::DXIL::NodeLaunchType::LastEntry == 4,
313+
static_assert((unsigned)hlsl::DXIL::NodeLaunchType::LastEntry == 5,
313314
"otherwise, RDAT_DXIL_ENUM definition needs updating");
314315
#endif
315316
RDAT_ENUM_END()

include/dxc/Support/HLSLOptions.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ def fvk_allow_rwstructuredbuffer_arrays: Flag<["-"], "fvk-allow-rwstructuredbuff
412412
def target_profile : JoinedOrSeparate<["-", "/"], "T">, Flags<[CoreOption]>, Group<hlslcomp_Group>, MetaVarName<"<profile>">,
413413
/* <py::lines('VALRULE-TEXT')>hctdb_instrhelp.get_target_profiles()</py>*/
414414
// VALRULE-TEXT:BEGIN
415-
HelpText<"Set target profile. \n\t<profile>: ps_6_0, ps_6_1, ps_6_2, ps_6_3, ps_6_4, ps_6_5, ps_6_6, ps_6_7, ps_6_8, \n\t\t vs_6_0, vs_6_1, vs_6_2, vs_6_3, vs_6_4, vs_6_5, vs_6_6, vs_6_7, vs_6_8, \n\t\t gs_6_0, gs_6_1, gs_6_2, gs_6_3, gs_6_4, gs_6_5, gs_6_6, gs_6_7, gs_6_8, \n\t\t hs_6_0, hs_6_1, hs_6_2, hs_6_3, hs_6_4, hs_6_5, hs_6_6, hs_6_7, hs_6_8, \n\t\t ds_6_0, ds_6_1, ds_6_2, ds_6_3, ds_6_4, ds_6_5, ds_6_6, ds_6_7, ds_6_8, \n\t\t cs_6_0, cs_6_1, cs_6_2, cs_6_3, cs_6_4, cs_6_5, cs_6_6, cs_6_7, cs_6_8, \n\t\t lib_6_1, lib_6_2, lib_6_3, lib_6_4, lib_6_5, lib_6_6, lib_6_7, lib_6_8, \n\t\t ms_6_5, ms_6_6, ms_6_7, ms_6_8, \n\t\t as_6_5, as_6_6, as_6_7, as_6_8, \n\t\t ">;
415+
HelpText<"Set target profile. \n\t<profile>: ps_6_0, ps_6_1, ps_6_2, ps_6_3, ps_6_4, ps_6_5, ps_6_6, ps_6_7, ps_6_8, ps_6_9, \n\t\t vs_6_0, vs_6_1, vs_6_2, vs_6_3, vs_6_4, vs_6_5, vs_6_6, vs_6_7, vs_6_8, vs_6_9, \n\t\t gs_6_0, gs_6_1, gs_6_2, gs_6_3, gs_6_4, gs_6_5, gs_6_6, gs_6_7, gs_6_8, gs_6_9, \n\t\t hs_6_0, hs_6_1, hs_6_2, hs_6_3, hs_6_4, hs_6_5, hs_6_6, hs_6_7, hs_6_8, hs_6_9, \n\t\t ds_6_0, ds_6_1, ds_6_2, ds_6_3, ds_6_4, ds_6_5, ds_6_6, ds_6_7, ds_6_8, ds_6_9, \n\t\t cs_6_0, cs_6_1, cs_6_2, cs_6_3, cs_6_4, cs_6_5, cs_6_6, cs_6_7, cs_6_8, cs_6_9, \n\t\t lib_6_1, lib_6_2, lib_6_3, lib_6_4, lib_6_5, lib_6_6, lib_6_7, lib_6_8, lib_6_9, \n\t\t ms_6_5, ms_6_6, ms_6_7, ms_6_8, ms_6_9, \n\t\t as_6_5, as_6_6, as_6_7, as_6_8, as_6_9, \n\t\t ">;
416416
// VALRULE-TEXT:END
417417
def entrypoint : JoinedOrSeparate<["-", "/"], "E">, Flags<[CoreOption, RewriteOption]>, Group<hlslcomp_Group>,
418418
HelpText<"Entry point name">;

lib/DXIL/DxilModule.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2164,8 +2164,11 @@ static void AdjustMinimumShaderModelAndFlags(const DxilFunctionProps *props,
21642164
DXIL::UpdateToMaxOfVersions(minMajor, minMinor, 6, 5);
21652165
else if (props->IsRay())
21662166
DXIL::UpdateToMaxOfVersions(minMajor, minMinor, 6, 3);
2167-
else if (props->IsNode())
2167+
else if (props->IsNode()) {
21682168
DXIL::UpdateToMaxOfVersions(minMajor, minMinor, 6, 8);
2169+
if (props->Node.LaunchType == DXIL::NodeLaunchType::Mesh)
2170+
DXIL::UpdateToMaxOfVersions(minMajor, minMinor, 6, 9);
2171+
}
21692172
}
21702173

21712174
// Adjust minimum shader model based on flags.

lib/DXIL/DxilShaderModel.cpp

Lines changed: 115 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ bool ShaderModel::IsValidForDxil() const {
6464
case 6:
6565
case 7:
6666
case 8:
67+
case 9:
6768
// VALRULE-TEXT:END
6869
return true;
6970
case kOfflineMinor:
@@ -91,85 +92,94 @@ const ShaderModel *ShaderModel::Get(Kind Kind, unsigned Major, unsigned Minor) {
9192
{1542, 10}, // ps_6_6
9293
{1543, 11}, // ps_6_7
9394
{1544, 12}, // ps_6_8
94-
{66560, 13}, // vs_4_0
95-
{66561, 14}, // vs_4_1
96-
{66816, 15}, // vs_5_0
97-
{66817, 16}, // vs_5_1
98-
{67072, 17}, // vs_6_0
99-
{67073, 18}, // vs_6_1
100-
{67074, 19}, // vs_6_2
101-
{67075, 20}, // vs_6_3
102-
{67076, 21}, // vs_6_4
103-
{67077, 22}, // vs_6_5
104-
{67078, 23}, // vs_6_6
105-
{67079, 24}, // vs_6_7
106-
{67080, 25}, // vs_6_8
107-
{132096, 26}, // gs_4_0
108-
{132097, 27}, // gs_4_1
109-
{132352, 28}, // gs_5_0
110-
{132353, 29}, // gs_5_1
111-
{132608, 30}, // gs_6_0
112-
{132609, 31}, // gs_6_1
113-
{132610, 32}, // gs_6_2
114-
{132611, 33}, // gs_6_3
115-
{132612, 34}, // gs_6_4
116-
{132613, 35}, // gs_6_5
117-
{132614, 36}, // gs_6_6
118-
{132615, 37}, // gs_6_7
119-
{132616, 38}, // gs_6_8
120-
{197888, 39}, // hs_5_0
121-
{197889, 40}, // hs_5_1
122-
{198144, 41}, // hs_6_0
123-
{198145, 42}, // hs_6_1
124-
{198146, 43}, // hs_6_2
125-
{198147, 44}, // hs_6_3
126-
{198148, 45}, // hs_6_4
127-
{198149, 46}, // hs_6_5
128-
{198150, 47}, // hs_6_6
129-
{198151, 48}, // hs_6_7
130-
{198152, 49}, // hs_6_8
131-
{263424, 50}, // ds_5_0
132-
{263425, 51}, // ds_5_1
133-
{263680, 52}, // ds_6_0
134-
{263681, 53}, // ds_6_1
135-
{263682, 54}, // ds_6_2
136-
{263683, 55}, // ds_6_3
137-
{263684, 56}, // ds_6_4
138-
{263685, 57}, // ds_6_5
139-
{263686, 58}, // ds_6_6
140-
{263687, 59}, // ds_6_7
141-
{263688, 60}, // ds_6_8
142-
{328704, 61}, // cs_4_0
143-
{328705, 62}, // cs_4_1
144-
{328960, 63}, // cs_5_0
145-
{328961, 64}, // cs_5_1
146-
{329216, 65}, // cs_6_0
147-
{329217, 66}, // cs_6_1
148-
{329218, 67}, // cs_6_2
149-
{329219, 68}, // cs_6_3
150-
{329220, 69}, // cs_6_4
151-
{329221, 70}, // cs_6_5
152-
{329222, 71}, // cs_6_6
153-
{329223, 72}, // cs_6_7
154-
{329224, 73}, // cs_6_8
155-
{394753, 74}, // lib_6_1
156-
{394754, 75}, // lib_6_2
157-
{394755, 76}, // lib_6_3
158-
{394756, 77}, // lib_6_4
159-
{394757, 78}, // lib_6_5
160-
{394758, 79}, // lib_6_6
161-
{394759, 80}, // lib_6_7
162-
{394760, 81}, // lib_6_8
95+
{1545, 13}, // ps_6_9
96+
{66560, 14}, // vs_4_0
97+
{66561, 15}, // vs_4_1
98+
{66816, 16}, // vs_5_0
99+
{66817, 17}, // vs_5_1
100+
{67072, 18}, // vs_6_0
101+
{67073, 19}, // vs_6_1
102+
{67074, 20}, // vs_6_2
103+
{67075, 21}, // vs_6_3
104+
{67076, 22}, // vs_6_4
105+
{67077, 23}, // vs_6_5
106+
{67078, 24}, // vs_6_6
107+
{67079, 25}, // vs_6_7
108+
{67080, 26}, // vs_6_8
109+
{67081, 27}, // vs_6_9
110+
{132096, 28}, // gs_4_0
111+
{132097, 29}, // gs_4_1
112+
{132352, 30}, // gs_5_0
113+
{132353, 31}, // gs_5_1
114+
{132608, 32}, // gs_6_0
115+
{132609, 33}, // gs_6_1
116+
{132610, 34}, // gs_6_2
117+
{132611, 35}, // gs_6_3
118+
{132612, 36}, // gs_6_4
119+
{132613, 37}, // gs_6_5
120+
{132614, 38}, // gs_6_6
121+
{132615, 39}, // gs_6_7
122+
{132616, 40}, // gs_6_8
123+
{132617, 41}, // gs_6_9
124+
{197888, 42}, // hs_5_0
125+
{197889, 43}, // hs_5_1
126+
{198144, 44}, // hs_6_0
127+
{198145, 45}, // hs_6_1
128+
{198146, 46}, // hs_6_2
129+
{198147, 47}, // hs_6_3
130+
{198148, 48}, // hs_6_4
131+
{198149, 49}, // hs_6_5
132+
{198150, 50}, // hs_6_6
133+
{198151, 51}, // hs_6_7
134+
{198152, 52}, // hs_6_8
135+
{198153, 53}, // hs_6_9
136+
{263424, 54}, // ds_5_0
137+
{263425, 55}, // ds_5_1
138+
{263680, 56}, // ds_6_0
139+
{263681, 57}, // ds_6_1
140+
{263682, 58}, // ds_6_2
141+
{263683, 59}, // ds_6_3
142+
{263684, 60}, // ds_6_4
143+
{263685, 61}, // ds_6_5
144+
{263686, 62}, // ds_6_6
145+
{263687, 63}, // ds_6_7
146+
{263688, 64}, // ds_6_8
147+
{263689, 65}, // ds_6_9
148+
{328704, 66}, // cs_4_0
149+
{328705, 67}, // cs_4_1
150+
{328960, 68}, // cs_5_0
151+
{328961, 69}, // cs_5_1
152+
{329216, 70}, // cs_6_0
153+
{329217, 71}, // cs_6_1
154+
{329218, 72}, // cs_6_2
155+
{329219, 73}, // cs_6_3
156+
{329220, 74}, // cs_6_4
157+
{329221, 75}, // cs_6_5
158+
{329222, 76}, // cs_6_6
159+
{329223, 77}, // cs_6_7
160+
{329224, 78}, // cs_6_8
161+
{329225, 79}, // cs_6_9
162+
{394753, 80}, // lib_6_1
163+
{394754, 81}, // lib_6_2
164+
{394755, 82}, // lib_6_3
165+
{394756, 83}, // lib_6_4
166+
{394757, 84}, // lib_6_5
167+
{394758, 85}, // lib_6_6
168+
{394759, 86}, // lib_6_7
169+
{394760, 87}, // lib_6_8
170+
{394761, 88}, // lib_6_9
163171
// lib_6_x is for offline linking only, and relaxes restrictions
164-
{394767, 82}, // lib_6_x
165-
{853509, 83}, // ms_6_5
166-
{853510, 84}, // ms_6_6
167-
{853511, 85}, // ms_6_7
168-
{853512, 86}, // ms_6_8
169-
{919045, 87}, // as_6_5
170-
{919046, 88}, // as_6_6
171-
{919047, 89}, // as_6_7
172-
{919048, 90}, // as_6_8
172+
{394767, 89}, // lib_6_x
173+
{853509, 90}, // ms_6_5
174+
{853510, 91}, // ms_6_6
175+
{853511, 92}, // ms_6_7
176+
{853512, 93}, // ms_6_8
177+
{853513, 94}, // ms_6_9
178+
{919045, 95}, // as_6_5
179+
{919046, 96}, // as_6_6
180+
{919047, 97}, // as_6_7
181+
{919048, 98}, // as_6_8
182+
{919049, 99}, // as_6_9
173183
};
174184
unsigned hash = (unsigned)Kind << 16 | Major << 8 | Minor;
175185
auto pred = [](const std::pair<unsigned, unsigned> &elem, unsigned val) {
@@ -303,6 +313,12 @@ const ShaderModel *ShaderModel::GetByName(llvm::StringRef Name) {
303313
break;
304314
} else
305315
return GetInvalid();
316+
case '9':
317+
if (Major == 6) {
318+
Minor = 9;
319+
break;
320+
} else
321+
return GetInvalid();
306322
// VALRULE-TEXT:END
307323
case 'x':
308324
if (kind == Kind::Library && Major == 6) {
@@ -354,8 +370,11 @@ void ShaderModel::GetDxilVersion(unsigned &DxilMajor,
354370
case 8:
355371
DxilMinor = 8;
356372
break;
373+
case 9:
374+
DxilMinor = 9;
375+
break;
357376
case kOfflineMinor: // Always update this to highest dxil version
358-
DxilMinor = 8;
377+
DxilMinor = 9;
359378
break;
360379
// VALRULE-TEXT:END
361380
default:
@@ -401,6 +420,9 @@ void ShaderModel::GetMinValidatorVersion(unsigned &ValMajor,
401420
case 8:
402421
ValMinor = 8;
403422
break;
423+
case 9:
424+
ValMinor = 9;
425+
break;
404426
// VALRULE-TEXT:END
405427
case kOfflineMinor:
406428
ValMajor = 0;
@@ -541,6 +563,7 @@ const ShaderModel ShaderModel::ms_ShaderModels[kNumShaderModels] = {
541563
SM(Kind::Pixel, 6, 6, "ps_6_6", 32, 8, true, true, UINT_MAX),
542564
SM(Kind::Pixel, 6, 7, "ps_6_7", 32, 8, true, true, UINT_MAX),
543565
SM(Kind::Pixel, 6, 8, "ps_6_8", 32, 8, true, true, UINT_MAX),
566+
SM(Kind::Pixel, 6, 9, "ps_6_9", 32, 8, true, true, UINT_MAX),
544567
SM(Kind::Vertex, 4, 0, "vs_4_0", 16, 16, false, false, 0),
545568
SM(Kind::Vertex, 4, 1, "vs_4_1", 32, 32, false, false, 0),
546569
SM(Kind::Vertex, 5, 0, "vs_5_0", 32, 32, true, true, 64),
@@ -554,6 +577,7 @@ const ShaderModel ShaderModel::ms_ShaderModels[kNumShaderModels] = {
554577
SM(Kind::Vertex, 6, 6, "vs_6_6", 32, 32, true, true, UINT_MAX),
555578
SM(Kind::Vertex, 6, 7, "vs_6_7", 32, 32, true, true, UINT_MAX),
556579
SM(Kind::Vertex, 6, 8, "vs_6_8", 32, 32, true, true, UINT_MAX),
580+
SM(Kind::Vertex, 6, 9, "vs_6_9", 32, 32, true, true, UINT_MAX),
557581
SM(Kind::Geometry, 4, 0, "gs_4_0", 16, 32, false, false, 0),
558582
SM(Kind::Geometry, 4, 1, "gs_4_1", 32, 32, false, false, 0),
559583
SM(Kind::Geometry, 5, 0, "gs_5_0", 32, 32, true, true, 64),
@@ -567,6 +591,7 @@ const ShaderModel ShaderModel::ms_ShaderModels[kNumShaderModels] = {
567591
SM(Kind::Geometry, 6, 6, "gs_6_6", 32, 32, true, true, UINT_MAX),
568592
SM(Kind::Geometry, 6, 7, "gs_6_7", 32, 32, true, true, UINT_MAX),
569593
SM(Kind::Geometry, 6, 8, "gs_6_8", 32, 32, true, true, UINT_MAX),
594+
SM(Kind::Geometry, 6, 9, "gs_6_9", 32, 32, true, true, UINT_MAX),
570595
SM(Kind::Hull, 5, 0, "hs_5_0", 32, 32, true, true, 64),
571596
SM(Kind::Hull, 5, 1, "hs_5_1", 32, 32, true, true, 64),
572597
SM(Kind::Hull, 6, 0, "hs_6_0", 32, 32, true, true, UINT_MAX),
@@ -578,6 +603,7 @@ const ShaderModel ShaderModel::ms_ShaderModels[kNumShaderModels] = {
578603
SM(Kind::Hull, 6, 6, "hs_6_6", 32, 32, true, true, UINT_MAX),
579604
SM(Kind::Hull, 6, 7, "hs_6_7", 32, 32, true, true, UINT_MAX),
580605
SM(Kind::Hull, 6, 8, "hs_6_8", 32, 32, true, true, UINT_MAX),
606+
SM(Kind::Hull, 6, 9, "hs_6_9", 32, 32, true, true, UINT_MAX),
581607
SM(Kind::Domain, 5, 0, "ds_5_0", 32, 32, true, true, 64),
582608
SM(Kind::Domain, 5, 1, "ds_5_1", 32, 32, true, true, 64),
583609
SM(Kind::Domain, 6, 0, "ds_6_0", 32, 32, true, true, UINT_MAX),
@@ -589,6 +615,7 @@ const ShaderModel ShaderModel::ms_ShaderModels[kNumShaderModels] = {
589615
SM(Kind::Domain, 6, 6, "ds_6_6", 32, 32, true, true, UINT_MAX),
590616
SM(Kind::Domain, 6, 7, "ds_6_7", 32, 32, true, true, UINT_MAX),
591617
SM(Kind::Domain, 6, 8, "ds_6_8", 32, 32, true, true, UINT_MAX),
618+
SM(Kind::Domain, 6, 9, "ds_6_9", 32, 32, true, true, UINT_MAX),
592619
SM(Kind::Compute, 4, 0, "cs_4_0", 0, 0, false, false, 0),
593620
SM(Kind::Compute, 4, 1, "cs_4_1", 0, 0, false, false, 0),
594621
SM(Kind::Compute, 5, 0, "cs_5_0", 0, 0, true, true, 64),
@@ -602,6 +629,7 @@ const ShaderModel ShaderModel::ms_ShaderModels[kNumShaderModels] = {
602629
SM(Kind::Compute, 6, 6, "cs_6_6", 0, 0, true, true, UINT_MAX),
603630
SM(Kind::Compute, 6, 7, "cs_6_7", 0, 0, true, true, UINT_MAX),
604631
SM(Kind::Compute, 6, 8, "cs_6_8", 0, 0, true, true, UINT_MAX),
632+
SM(Kind::Compute, 6, 9, "cs_6_9", 0, 0, true, true, UINT_MAX),
605633
SM(Kind::Library, 6, 1, "lib_6_1", 32, 32, true, true, UINT_MAX),
606634
SM(Kind::Library, 6, 2, "lib_6_2", 32, 32, true, true, UINT_MAX),
607635
SM(Kind::Library, 6, 3, "lib_6_3", 32, 32, true, true, UINT_MAX),
@@ -610,37 +638,43 @@ const ShaderModel ShaderModel::ms_ShaderModels[kNumShaderModels] = {
610638
SM(Kind::Library, 6, 6, "lib_6_6", 32, 32, true, true, UINT_MAX),
611639
SM(Kind::Library, 6, 7, "lib_6_7", 32, 32, true, true, UINT_MAX),
612640
SM(Kind::Library, 6, 8, "lib_6_8", 32, 32, true, true, UINT_MAX),
641+
SM(Kind::Library, 6, 9, "lib_6_9", 32, 32, true, true, UINT_MAX),
613642
// lib_6_x is for offline linking only, and relaxes restrictions
614643
SM(Kind::Library, 6, kOfflineMinor, "lib_6_x", 32, 32, true, true,
615644
UINT_MAX),
616645
SM(Kind::Mesh, 6, 5, "ms_6_5", 0, 0, true, true, UINT_MAX),
617646
SM(Kind::Mesh, 6, 6, "ms_6_6", 0, 0, true, true, UINT_MAX),
618647
SM(Kind::Mesh, 6, 7, "ms_6_7", 0, 0, true, true, UINT_MAX),
619648
SM(Kind::Mesh, 6, 8, "ms_6_8", 0, 0, true, true, UINT_MAX),
649+
SM(Kind::Mesh, 6, 9, "ms_6_9", 0, 0, true, true, UINT_MAX),
620650
SM(Kind::Amplification, 6, 5, "as_6_5", 0, 0, true, true, UINT_MAX),
621651
SM(Kind::Amplification, 6, 6, "as_6_6", 0, 0, true, true, UINT_MAX),
622652
SM(Kind::Amplification, 6, 7, "as_6_7", 0, 0, true, true, UINT_MAX),
623653
SM(Kind::Amplification, 6, 8, "as_6_8", 0, 0, true, true, UINT_MAX),
654+
SM(Kind::Amplification, 6, 9, "as_6_9", 0, 0, true, true, UINT_MAX),
624655
// Values before Invalid must remain sorted by Kind, then Major, then Minor.
625656
SM(Kind::Invalid, 0, 0, "invalid", 0, 0, false, false, 0),
626657
// VALRULE-TEXT:END
627658
};
628659

629660
static const char *NodeLaunchTypeNames[] = {"invalid", "broadcasting",
630-
"coalescing", "thread"};
661+
"coalescing", "thread", "mesh"};
631662

632663
const char *ShaderModel::GetNodeLaunchTypeName(DXIL::NodeLaunchType launchTy) {
633-
static_assert(static_cast<unsigned>(DXIL::NodeLaunchType::Thread) ==
664+
static_assert(static_cast<unsigned>(DXIL::NodeLaunchType::Mesh) ==
634665
_countof(NodeLaunchTypeNames) - 1,
635666
"Invalid launch type or names");
636667
return NodeLaunchTypeNames[static_cast<unsigned int>(launchTy)];
637668
}
638669

639670
DXIL::NodeLaunchType ShaderModel::NodeLaunchTypeFromName(llvm::StringRef name) {
671+
static_assert(static_cast<unsigned>(DXIL::NodeLaunchType::LastEntry) == 5,
672+
"NodeLaunchTypeFromName needs updating for new NodeLaunchType");
640673
return llvm::StringSwitch<DXIL::NodeLaunchType>(name.lower())
641674
.Case("broadcasting", DXIL::NodeLaunchType::Broadcasting)
642675
.Case("coalescing", DXIL::NodeLaunchType::Coalescing)
643676
.Case("thread", DXIL::NodeLaunchType::Thread)
677+
.Case("mesh", DXIL::NodeLaunchType::Mesh)
644678
.Default(DXIL::NodeLaunchType::Invalid);
645679
}
646680

tools/clang/include/clang/Basic/Attr.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -941,7 +941,7 @@ def HLSLCXXOverload : InheritableAttr {
941941

942942
def HLSLNodeLaunch : InheritableAttr {
943943
let Spellings = [CXX11<"", "nodelaunch", 2017>];
944-
let Args = [StringArgument<"LaunchType">]; // one of broadcasting, coalescing, thread
944+
let Args = [StringArgument<"LaunchType">]; // one of broadcasting, coalescing, thread, mesh
945945
let Documentation = [Undocumented];
946946
}
947947

0 commit comments

Comments
 (0)