Skip to content

Commit efe12b6

Browse files
authored
Reserve SM 6.10 ops for GroupWaveIndex, ClusterID, TriangleObjectPosition (#7995)
This PR reserves HLSL intrinsic ops (HL opcodes) and DXIL ops for the following features and operations: Group Wave Index: - GetGroupWaveIndex - GetGroupWaveCount Clustered Geometry: - ClusterID - RayQuery::CandidateClusterID - RayQuery::CommittedClusterID - HitObject::ClusterID Triangle Object Positions (return void until later update): - TriangleObjectPosition - RayQuery::CandidateTriangleObjectPosition - RayQuery::CommittedTriangleObjectPosition - HitObject::TriangleObjectPosition Most file edits are auto-generated updates, except: - hctdb.py - gen_intrin_main.txt - HLOperationLower.cpp
1 parent 003bfd7 commit efe12b6

File tree

9 files changed

+770
-18
lines changed

9 files changed

+770
-18
lines changed

docs/DXIL.rst

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3062,11 +3062,21 @@ Given width, offset:
30623062
30633063
Opcode Table ExperimentalOps, id=32768: Experimental DXIL operations
30643064

3065-
========== =============== ================
3066-
ID Name Description
3067-
========== =============== ================
3068-
2147483648 ExperimentalNop nop does nothing
3069-
========== =============== ================
3065+
========== ======================================== ==================================================================
3066+
ID Name Description
3067+
========== ======================================== ==================================================================
3068+
2147483648 ExperimentalNop nop does nothing
3069+
2147483649 GetGroupWaveIndex returns the index of the wave in the thread group
3070+
2147483650 GetGroupWaveCount returns the number of waves in the thread group
3071+
2147483651 ClusterID returns the user-defined ClusterID of the intersected CLAS
3072+
2147483652 RayQuery_CandidateClusterID returns candidate hit cluster ID
3073+
2147483653 RayQuery_CommittedClusterID returns committed hit cluster ID
3074+
2147483654 HitObject_ClusterID returns the cluster ID of this committed hit
3075+
2147483655 TriangleObjectPosition returns triangle vertices in object space as <9 x float>
3076+
2147483656 RayQuery_CandidateTriangleObjectPosition returns candidate triangle vertices in object space as <9 x float>
3077+
2147483657 RayQuery_CommittedTriangleObjectPosition returns committed triangle vertices in object space as <9 x float>
3078+
2147483658 HitObject_TriangleObjectPosition returns triangle vertices in object space as <9 x float>
3079+
========== ======================================== ==================================================================
30703080

30713081

30723082
.. OPCODES-RST:END

include/dxc/DXIL/DxilConstants.h

Lines changed: 69 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -511,10 +511,34 @@ namespace ExperimentalOps {
511511
static const OpCodeTableID TableID = OpCodeTableID::ExperimentalOps;
512512
// Enumeration for ExperimentalOps DXIL operations
513513
enum class OpCode : unsigned {
514+
// Group Wave Ops
515+
GetGroupWaveCount = 2, // returns the number of waves in the thread group
516+
GetGroupWaveIndex = 1, // returns the index of the wave in the thread group
517+
518+
// Inline Ray Query
519+
RayQuery_CandidateClusterID = 4, // returns candidate hit cluster ID
520+
RayQuery_CandidateTriangleObjectPosition =
521+
8, // returns candidate triangle vertices in object space as <9 x float>
522+
RayQuery_CommittedClusterID = 5, // returns committed hit cluster ID
523+
RayQuery_CommittedTriangleObjectPosition =
524+
9, // returns committed triangle vertices in object space as <9 x float>
525+
514526
// No-op
515527
ExperimentalNop = 0, // nop does nothing
516528

517-
NumOpCodes = 1, // exclusive last value of enumeration
529+
// Raytracing System Values
530+
TriangleObjectPosition =
531+
7, // returns triangle vertices in object space as <9 x float>
532+
533+
// Raytracing uint System Values
534+
ClusterID = 3, // returns the user-defined ClusterID of the intersected CLAS
535+
536+
// Shader Execution Reordering
537+
HitObject_ClusterID = 6, // returns the cluster ID of this committed hit
538+
HitObject_TriangleObjectPosition =
539+
10, // returns triangle vertices in object space as <9 x float>
540+
541+
NumOpCodes = 11, // exclusive last value of enumeration
518542
};
519543
} // namespace ExperimentalOps
520544
static const unsigned NumOpCodeTables = 2;
@@ -1131,6 +1155,38 @@ enum class OpCode : unsigned {
11311155
// OpCodeTableID = 32768
11321156
// ExperimentalOps
11331157
EXP_OPCODE(ExperimentalOps, ExperimentalNop), // nop does nothing
1158+
EXP_OPCODE(
1159+
ExperimentalOps,
1160+
GetGroupWaveIndex), // returns the index of the wave in the thread group
1161+
EXP_OPCODE(
1162+
ExperimentalOps,
1163+
GetGroupWaveCount), // returns the number of waves in the thread group
1164+
EXP_OPCODE(
1165+
ExperimentalOps,
1166+
ClusterID), // returns the user-defined ClusterID of the intersected CLAS
1167+
EXP_OPCODE(ExperimentalOps,
1168+
RayQuery_CandidateClusterID), // returns candidate hit cluster ID
1169+
EXP_OPCODE(ExperimentalOps,
1170+
RayQuery_CommittedClusterID), // returns committed hit cluster ID
1171+
EXP_OPCODE(
1172+
ExperimentalOps,
1173+
HitObject_ClusterID), // returns the cluster ID of this committed hit
1174+
EXP_OPCODE(ExperimentalOps,
1175+
TriangleObjectPosition), // returns triangle vertices in object
1176+
// space as <9 x float>
1177+
EXP_OPCODE(
1178+
ExperimentalOps,
1179+
RayQuery_CandidateTriangleObjectPosition), // returns candidate triangle
1180+
// vertices in object space as
1181+
// <9 x float>
1182+
EXP_OPCODE(
1183+
ExperimentalOps,
1184+
RayQuery_CommittedTriangleObjectPosition), // returns committed triangle
1185+
// vertices in object space as
1186+
// <9 x float>
1187+
EXP_OPCODE(ExperimentalOps,
1188+
HitObject_TriangleObjectPosition), // returns triangle vertices in
1189+
// object space as <9 x float>
11341190
};
11351191
// OPCODE-ENUM:END
11361192
#undef EXP_OPCODE
@@ -1242,6 +1298,10 @@ enum class OpCodeClass : unsigned {
12421298
// Graphics shader
12431299
ViewID,
12441300

1301+
// Group Wave Ops
1302+
GetGroupWaveCount,
1303+
GetGroupWaveIndex,
1304+
12451305
// Helper Lanes
12461306
IsHelperLane,
12471307

@@ -1261,8 +1321,10 @@ enum class OpCodeClass : unsigned {
12611321
AllocateRayQuery,
12621322
AllocateRayQuery2,
12631323
RayQuery_Abort,
1324+
RayQuery_CandidateTriangleObjectPosition,
12641325
RayQuery_CommitNonOpaqueTriangleHit,
12651326
RayQuery_CommitProceduralPrimitiveHit,
1327+
RayQuery_CommittedTriangleObjectPosition,
12661328
RayQuery_Proceed,
12671329
RayQuery_StateMatrix,
12681330
RayQuery_StateScalar,
@@ -1339,6 +1401,9 @@ enum class OpCodeClass : unsigned {
13391401
RayTCurrent,
13401402
RayTMin,
13411403

1404+
// Raytracing System Values
1405+
TriangleObjectPosition,
1406+
13421407
// Raytracing hit uint System Values
13431408
HitKind,
13441409

@@ -1351,6 +1416,7 @@ enum class OpCodeClass : unsigned {
13511416
PrimitiveIndex,
13521417

13531418
// Raytracing uint System Values
1419+
ClusterID,
13541420
RayFlags,
13551421

13561422
// Resources - gather
@@ -1406,6 +1472,7 @@ enum class OpCodeClass : unsigned {
14061472
HitObject_StateScalar,
14071473
HitObject_StateVector,
14081474
HitObject_TraceRay,
1475+
HitObject_TriangleObjectPosition,
14091476
MaybeReorderThread,
14101477

14111478
// Synchronization
@@ -1465,7 +1532,7 @@ enum class OpCodeClass : unsigned {
14651532
NodeOutputIsValid,
14661533
OutputComplete,
14671534

1468-
NumOpClasses = 197, // exclusive last value of enumeration
1535+
NumOpClasses = 204, // exclusive last value of enumeration
14691536
};
14701537
// OPCODECLASS-ENUM:END
14711538

0 commit comments

Comments
 (0)