Skip to content

Commit 5d3f8b2

Browse files
Simplify Matrix Layout check
1 parent ee9f3a2 commit 5d3f8b2

1 file changed

Lines changed: 2 additions & 11 deletions

File tree

lib/DxilValidation/DxilValidation.cpp

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,17 +1002,8 @@ static bool CheckInMemoryInterpretations(uint32_t input) {
10021002
}
10031003

10041004
static bool CheckMatrixLayout(unsigned input) {
1005-
1006-
DXIL::DXILMatrixLayout ValidSet[] = {
1007-
DXIL::DXILMatrixLayout::RowMajor, DXIL::DXILMatrixLayout::ColumnMajor,
1008-
DXIL::DXILMatrixLayout::MulOptimal,
1009-
DXIL::DXILMatrixLayout::OuterProductOptimal};
1010-
1011-
for (auto Val : ValidSet) {
1012-
if (Val == static_cast<DXIL::DXILMatrixLayout>(input))
1013-
return true;
1014-
}
1015-
return false;
1005+
return (input <=
1006+
static_cast<unsigned>(DXIL::DXILMatrixLayout::OuterProductOptimal));
10161007
}
10171008

10181009
static void ValidateImmOperandsForMatVecOps(CallInst *CI, DXIL::OpCode opcode,

0 commit comments

Comments
 (0)