Skip to content

Commit 4687c52

Browse files
authored
[SM6.10] Update DXIL op allowed shaders (#8102)
Sets the allowed shader stages for the LinAlg DXIL ops. This is another commit extracted from the defunct branch that needed to be merged in before it was lost. Real changes are in `utils/hct/hctdb.py` the rest is generated code
1 parent d6d73dd commit 4687c52

File tree

2 files changed

+39
-18
lines changed

2 files changed

+39
-18
lines changed

lib/DXIL/DxilOperations.cpp

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3916,22 +3916,31 @@ void OP::GetMinShaderModelAndMask(OpCode C, bool bWithTranslation,
39163916
// RayQuery_CommittedClusterID=2147483653,
39173917
// RayQuery_CandidateTriangleObjectPosition=2147483656,
39183918
// RayQuery_CommittedTriangleObjectPosition=2147483657,
3919-
// CreateMatrix=2147483659, FillMatrix=2147483660,
3920-
// CopyConvertMatrix=2147483661, MatrixLoadFromDescriptor=2147483662,
3919+
// CreateMatrix=2147483659, MatrixLoadFromDescriptor=2147483662,
3920+
// MatrixQueryAccumulatorLayout=2147483670, MatrixVecMul=2147483673,
3921+
// MatrixVecMulAdd=2147483674, MatrixAccumulateToDescriptor=2147483675,
3922+
// MatrixOuterProduct=2147483677
3923+
if ((305 <= op && op <= 308) || op == 2147483648 ||
3924+
(2147483652 <= op && op <= 2147483653) ||
3925+
(2147483656 <= op && op <= 2147483657) || op == 2147483659 ||
3926+
op == 2147483662 || op == 2147483670 ||
3927+
(2147483673 <= op && op <= 2147483675) || op == 2147483677) {
3928+
major = 6;
3929+
minor = 10;
3930+
return;
3931+
}
3932+
// Instructions: FillMatrix=2147483660, CopyConvertMatrix=2147483661,
39213933
// MatrixLoadFromMemory=2147483663, MatrixLength=2147483664,
39223934
// MatrixGetCoordinate=2147483665, MatrixGetElement=2147483666,
39233935
// MatrixSetElement=2147483667, MatrixStoreToDescriptor=2147483668,
3924-
// MatrixStoreToMemory=2147483669, MatrixQueryAccumulatorLayout=2147483670,
3925-
// MatrixMulOp=2147483671, MatrixAccumulate=2147483672,
3926-
// MatrixVecMul=2147483673, MatrixVecMulAdd=2147483674,
3927-
// MatrixAccumulateToDescriptor=2147483675,
3928-
// MatrixAccumulateToMemory=2147483676, MatrixOuterProduct=2147483677
3929-
if ((305 <= op && op <= 308) || op == 2147483648 ||
3930-
(2147483652 <= op && op <= 2147483653) ||
3931-
(2147483656 <= op && op <= 2147483657) ||
3932-
(2147483659 <= op && op <= 2147483677)) {
3936+
// MatrixStoreToMemory=2147483669, MatrixMulOp=2147483671,
3937+
// MatrixAccumulate=2147483672, MatrixAccumulateToMemory=2147483676
3938+
if ((2147483660 <= op && op <= 2147483661) ||
3939+
(2147483663 <= op && op <= 2147483669) ||
3940+
(2147483671 <= op && op <= 2147483672) || op == 2147483676) {
39333941
major = 6;
39343942
minor = 10;
3943+
mask = SFLAG(Compute) | SFLAG(Mesh) | SFLAG(Amplification);
39353944
return;
39363945
}
39373946
// Instructions: GetGroupWaveIndex=2147483649, GetGroupWaveCount=2147483650

utils/hct/hctdb.py

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1159,18 +1159,30 @@ def populate_categories_and_models_ExperimentalOps(self):
11591159
"miss",
11601160
)
11611161

1162+
# Thread/Wave/ThreadGroup scope operations
11621163
for i in insts(
1163-
"CreateMatrix,FillMatrix,CopyConvertMatrix,"
1164-
+ "MatrixLoadFromDescriptor,MatrixLoadFromMemory,"
1164+
"CreateMatrix,MatrixQueryAccumulatorLayout,"
1165+
+ "MatrixLoadFromDescriptor,MatrixAccumulateToDescriptor,"
1166+
+ "MatrixVecMul,MatrixVecMulAdd,MatrixOuterProduct"
1167+
):
1168+
i.category = "Linear Algebra Operations"
1169+
i.shader_model = experimental_sm
1170+
1171+
# Wave/ThreadGroup scope operations
1172+
for i in insts(
1173+
"FillMatrix,CopyConvertMatrix,"
11651174
+ "MatrixLength,MatrixGetCoordinate,MatrixGetElement,MatrixSetElement,"
1166-
+ "MatrixStoreToDescriptor,MatrixStoreToMemory,"
1167-
+ "MatrixQueryAccumulatorLayout,MatrixMulOp,MatrixAccumulate,"
1168-
+ "MatrixVecMul,MatrixVecMulAdd,"
1169-
+ "MatrixAccumulateToDescriptor,MatrixAccumulateToMemory,"
1170-
+ "MatrixOuterProduct"
1175+
+ "MatrixStoreToDescriptor,"
1176+
+ "MatrixLoadFromMemory,MatrixStoreToMemory,MatrixAccumulateToMemory,"
1177+
+ "MatrixMulOp,MatrixAccumulate"
11711178
):
11721179
i.category = "Linear Algebra Operations"
11731180
i.shader_model = experimental_sm
1181+
i.shader_stages = (
1182+
"compute",
1183+
"mesh",
1184+
"amplification",
1185+
)
11741186

11751187
def populate_llvm_instructions(self):
11761188
# Add instructions that map to LLVM instructions.

0 commit comments

Comments
 (0)