Skip to content

Commit 475e3cc

Browse files
authored
[SM6.10] Restrict Wave and ThreadGroup scope matrix ops to compute stage (#8331)
Spec recently updated in microsoft/hlsl-specs#841.
1 parent eb67a90 commit 475e3cc

4 files changed

Lines changed: 37 additions & 9 deletions

File tree

lib/DXIL/DxilOperations.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3980,7 +3980,7 @@ void OP::GetMinShaderModelAndMask(OpCode C, bool bWithTranslation,
39803980
(2147483671 <= op && op <= 2147483672) || op == 2147483676) {
39813981
major = 6;
39823982
minor = 10;
3983-
mask = SFLAG(Compute) | SFLAG(Mesh) | SFLAG(Amplification);
3983+
mask = SFLAG(Compute);
39843984
return;
39853985
}
39863986
// Instructions: GetGroupWaveIndex=2147483649, GetGroupWaveCount=2147483650

tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-as.ll

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,22 @@
11
; REQUIRES: dxil-1-10
2-
; RUN: %dxv %s 2>&1 | FileCheck %s
3-
4-
; CHECK: Validation succeeded.
2+
; RUN: not %dxv %s 2>&1 | FileCheck %s
3+
4+
; CHECK: Function: mainAS: error: Opcode LinAlgMatrixMultiply not valid in shader model as_6_10.
5+
; CHECK: Function: mainAS: error: Opcode LinAlgMatrixAccumulate not valid in shader model as_6_10.
6+
; CHECK: Function: mainAS: error: Opcode LinAlgMatrixStoreToDescriptor not valid in shader model as_6_10.
7+
; CHECK: Function: mainAS: error: Opcode LinAlgMatrixLength not valid in shader model as_6_10.
8+
; CHECK: Function: mainAS: error: Opcode LinAlgCopyConvertMatrix not valid in shader model as_6_10.
9+
; CHECK: Function: mainAS: error: Opcode LinAlgFillMatrix not valid in shader model as_6_10.
10+
; CHECK: Function: mainAS: error: Opcode LinAlgMatrixGetCoordinate not valid in shader model as_6_10.
11+
; CHECK: Function: mainAS: error: Opcode LinAlgMatrixGetElement not valid in shader model as_6_10.
12+
; CHECK: Function: mainAS: error: Opcode LinAlgMatrixMultiplyAccumulate not valid in shader model as_6_10.
13+
; CHECK: Function: mainAS: error: Opcode LinAlgMatrixSetElement not valid in shader model as_6_10.
14+
; CHECK: Function: mainAS: error: Opcode LinAlgMatrixStoreToMemory not valid in shader model as_6_10.
15+
; CHECK: Function: mainAS: error: Opcode LinAlgMatrixAccumulateToMemory not valid in shader model as_6_10.
16+
; CHECK: Function: mainAS: error: Opcode LinAlgMatrixLoadFromMemory not valid in shader model as_6_10.
17+
; CHECK: Function: mainAS: error: Entry function performs some operation that is incompatible with the shader stage or other entry properties. See other errors for details.
18+
; CHECK: Function: mainAS: error: Function uses features incompatible with the shader stage (as) of the entry function.
19+
; CHECK: Validation failed.
520

621
target datalayout = "e-m:e-p:32:32-i1:32-i8:32-i16:32-i32:32-i64:64-f16:32-f32:32-f64:64-n8:16:32:64"
722
target triple = "dxil-ms-dx"

tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-ms.ll

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,22 @@
11
; REQUIRES: dxil-1-10
2-
; RUN: %dxv %s 2>&1 | FileCheck %s
3-
4-
; CHECK: Validation succeeded.
2+
; RUN: not %dxv %s 2>&1 | FileCheck %s
3+
4+
; CHECK: Function: mainMeS: error: Opcode LinAlgMatrixMultiply not valid in shader model ms_6_10.
5+
; CHECK: Function: mainMeS: error: Opcode LinAlgMatrixAccumulate not valid in shader model ms_6_10.
6+
; CHECK: Function: mainMeS: error: Opcode LinAlgMatrixStoreToDescriptor not valid in shader model ms_6_10.
7+
; CHECK: Function: mainMeS: error: Opcode LinAlgMatrixLength not valid in shader model ms_6_10.
8+
; CHECK: Function: mainMeS: error: Opcode LinAlgCopyConvertMatrix not valid in shader model ms_6_10.
9+
; CHECK: Function: mainMeS: error: Opcode LinAlgFillMatrix not valid in shader model ms_6_10.
10+
; CHECK: Function: mainMeS: error: Opcode LinAlgMatrixGetCoordinate not valid in shader model ms_6_10.
11+
; CHECK: Function: mainMeS: error: Opcode LinAlgMatrixGetElement not valid in shader model ms_6_10.
12+
; CHECK: Function: mainMeS: error: Opcode LinAlgMatrixMultiplyAccumulate not valid in shader model ms_6_10.
13+
; CHECK: Function: mainMeS: error: Opcode LinAlgMatrixSetElement not valid in shader model ms_6_10.
14+
; CHECK: Function: mainMeS: error: Opcode LinAlgMatrixStoreToMemory not valid in shader model ms_6_10.
15+
; CHECK: Function: mainMeS: error: Opcode LinAlgMatrixAccumulateToMemory not valid in shader model ms_6_10.
16+
; CHECK: Function: mainMeS: error: Opcode LinAlgMatrixLoadFromMemory not valid in shader model ms_6_10.
17+
; CHECK: Function: mainMeS: error: Entry function performs some operation that is incompatible with the shader stage or other entry properties. See other errors for details.
18+
; CHECK: Function: mainMeS: error: Function uses features incompatible with the shader stage (ms) of the entry function.
19+
; CHECK: Validation failed.
520

621
target datalayout = "e-m:e-p:32:32-i1:32-i8:32-i16:32-i32:32-i64:64-f16:32-f32:32-f64:64-n8:16:32:64"
722
target triple = "dxil-ms-dx"

utils/hct/hctdb.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1181,8 +1181,6 @@ def populate_categories_and_models_ExperimentalOps(self):
11811181
i.shader_model = experimental_sm
11821182
i.shader_stages = (
11831183
"compute",
1184-
"mesh",
1185-
"amplification",
11861184
)
11871185

11881186
for i in insts("DebugBreak", "IsDebuggerPresent"):

0 commit comments

Comments
 (0)