Skip to content

Commit 594d5e8

Browse files
committed
[SM6.10] Update DXIL ops for hlsl-specs/769
Updates the DXIL ops to reflect the shape required by microsoft/hlsl-specs#769 HL ops are not updated as they are blocked until the HL LinAlgMatrix type is available
1 parent 4687c52 commit 594d5e8

File tree

9 files changed

+344
-444
lines changed

9 files changed

+344
-444
lines changed

docs/DXIL.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3076,7 +3076,7 @@ ID Name Description
30763076
2147483656 RayQuery_CandidateTriangleObjectPosition returns candidate triangle vertices in object space as <9 x float>
30773077
2147483657 RayQuery_CommittedTriangleObjectPosition returns committed triangle vertices in object space as <9 x float>
30783078
2147483658 HitObject_TriangleObjectPosition returns triangle vertices in object space as <9 x float>
3079-
2147483659 CreateMatrix creates a handle to a Matrix
3079+
2147483659 LinAlgMatrixReserved0 reserved
30803080
2147483660 FillMatrix fills a matrix with a scalar value
30813081
2147483661 CopyConvertMatrix Converts and copies the element and use type of the source matrix to the destination matrix with optional transpose
30823082
2147483662 MatrixLoadFromDescriptor fills a matrix with data from a [RW]ByteAddressBuffer
@@ -3094,10 +3094,10 @@ ID Name Description
30943094
2147483674 MatrixVecMulAdd Multiplies a MxK dimension matrix and a K sized input vector then adds a M sized bias vector
30953095
2147483675 MatrixAccumulateToDescriptor accumulates a matrix to a RWByteAddressBuffer
30963096
2147483676 MatrixAccumulateToMemory accumulates a matrix to groupshared memory
3097-
2147483677 MatrixOuterProduct Outer products an M sized vector and a K sized vector producing an MxK matrix
3098-
2147483678 LinAlgMatrixReserved0 reserved
3099-
2147483679 LinAlgMatrixReserved1 reserved
3100-
2147483680 LinAlgMatrixReserved2 reserved
3097+
2147483677 MatrixOuterProduct Outer products an M sized vector and a N sized vector producing an MxN matrix
3098+
2147483678 LinAlgMatrixReserved1 reserved
3099+
2147483679 LinAlgMatrixReserved2 reserved
3100+
2147483680 LinAlgMatrixReserved3 reserved
31013101
========== ======================================== ===================================================================================================================
31023102

31033103

include/dxc/DXIL/DxilConstants.h

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -512,9 +512,10 @@ static const OpCodeTableID TableID = OpCodeTableID::ExperimentalOps;
512512
// Enumeration for ExperimentalOps DXIL operations
513513
enum class OpCode : unsigned {
514514
//
515-
LinAlgMatrixReserved0 = 30, // reserved
516-
LinAlgMatrixReserved1 = 31, // reserved
517-
LinAlgMatrixReserved2 = 32, // reserved
515+
LinAlgMatrixReserved0 = 11, // reserved
516+
LinAlgMatrixReserved1 = 30, // reserved
517+
LinAlgMatrixReserved2 = 31, // reserved
518+
LinAlgMatrixReserved3 = 32, // reserved
518519

519520
// Group Wave Ops
520521
GetGroupWaveCount = 2, // returns the number of waves in the thread group
@@ -532,7 +533,6 @@ enum class OpCode : unsigned {
532533
CopyConvertMatrix =
533534
13, // Converts and copies the element and use type of the source matrix
534535
// to the destination matrix with optional transpose
535-
CreateMatrix = 11, // creates a handle to a Matrix
536536
FillMatrix = 12, // fills a matrix with a scalar value
537537
MatrixAccumulate = 24, // accumulate A or B matrix into Accumulator matrix
538538
// following LHS += RHS
@@ -552,8 +552,8 @@ enum class OpCode : unsigned {
552552
15, // fills a matrix with data from a groupshared array
553553
MatrixMulOp =
554554
23, // applies a multiplication op to matrix C using A and B as parameters
555-
MatrixOuterProduct = 29, // Outer products an M sized vector and a K sized
556-
// vector producing an MxK matrix
555+
MatrixOuterProduct = 29, // Outer products an M sized vector and a N sized
556+
// vector producing an MxN matrix
557557
MatrixQueryAccumulatorLayout = 22, // returns comptime 0 when accumulator
558558
// matrix are A layout, 1 when B layout
559559
MatrixSetElement = 19, // sets the element of the matrix corresponding to the
@@ -1242,8 +1242,8 @@ enum class OpCode : unsigned {
12421242
EXP_OPCODE(ExperimentalOps,
12431243
HitObject_TriangleObjectPosition), // returns triangle vertices in
12441244
// object space as <9 x float>
1245-
// CreateMatrix = 0x8000000B, 2147483659U, -2147483637
1246-
EXP_OPCODE(ExperimentalOps, CreateMatrix), // creates a handle to a Matrix
1245+
// LinAlgMatrixReserved0 = 0x8000000B, 2147483659U, -2147483637
1246+
EXP_OPCODE(ExperimentalOps, LinAlgMatrixReserved0), // reserved
12471247
// FillMatrix = 0x8000000C, 2147483660U, -2147483636
12481248
EXP_OPCODE(ExperimentalOps, FillMatrix), // fills a matrix with a scalar value
12491249
// CopyConvertMatrix = 0x8000000D, 2147483661U, -2147483635
@@ -1316,14 +1316,14 @@ enum class OpCode : unsigned {
13161316
MatrixAccumulateToMemory), // accumulates a matrix to groupshared memory
13171317
// MatrixOuterProduct = 0x8000001D, 2147483677U, -2147483619
13181318
EXP_OPCODE(ExperimentalOps,
1319-
MatrixOuterProduct), // Outer products an M sized vector and a K
1320-
// sized vector producing an MxK matrix
1321-
// LinAlgMatrixReserved0 = 0x8000001E, 2147483678U, -2147483618
1322-
EXP_OPCODE(ExperimentalOps, LinAlgMatrixReserved0), // reserved
1323-
// LinAlgMatrixReserved1 = 0x8000001F, 2147483679U, -2147483617
1319+
MatrixOuterProduct), // Outer products an M sized vector and a N
1320+
// sized vector producing an MxN matrix
1321+
// LinAlgMatrixReserved1 = 0x8000001E, 2147483678U, -2147483618
13241322
EXP_OPCODE(ExperimentalOps, LinAlgMatrixReserved1), // reserved
1325-
// LinAlgMatrixReserved2 = 0x80000020, 2147483680U, -2147483616
1323+
// LinAlgMatrixReserved2 = 0x8000001F, 2147483679U, -2147483617
13261324
EXP_OPCODE(ExperimentalOps, LinAlgMatrixReserved2), // reserved
1325+
// LinAlgMatrixReserved3 = 0x80000020, 2147483680U, -2147483616
1326+
EXP_OPCODE(ExperimentalOps, LinAlgMatrixReserved3), // reserved
13271327
};
13281328
// OPCODE-ENUM:END
13291329
#undef EXP_OPCODE
@@ -1480,7 +1480,6 @@ enum class OpCodeClass : unsigned {
14801480

14811481
// Linear Algebra Operations
14821482
CopyConvertMatrix,
1483-
CreateMatrix,
14841483
FillMatrix,
14851484
MatVecMul,
14861485
MatVecMulAdd,
@@ -1688,7 +1687,7 @@ enum class OpCodeClass : unsigned {
16881687
NodeOutputIsValid,
16891688
OutputComplete,
16901689

1691-
NumOpClasses = 223, // exclusive last value of enumeration
1690+
NumOpClasses = 222, // exclusive last value of enumeration
16921691
};
16931692
// OPCODECLASS-ENUM:END
16941693

0 commit comments

Comments
 (0)