Skip to content

Commit 4f0acfb

Browse files
committed
Fix type and remove condition
Change int to uint and remove condition that can never be true since coopMatKHRuse is unsigned and CM_MatrixUseA is a contant zero.
1 parent f7c9108 commit 4f0acfb

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

glslang/MachineIndependent/ParseHelper.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1895,9 +1895,9 @@ static const uint32_t spv_Scope_Subgroup = 3;
18951895
void TParseContext::handleVector2CoopMatConversionCall(const TSourceLoc& loc, const TFunction* fnCandidate,
18961896
TIntermTyped*& result, TIntermNode* arguments)
18971897
{
1898-
const int CM_MatrixUseA = 0; // == gl_MatrixUseA
1899-
const int CM_MatrixUseB = 1; // == gl_MatrixUseB
1900-
const int CM_MatrixUseAccumulator = 2; // == gl_MatrixUseAccumulator
1898+
const uint32_t CM_MatrixUseA = 0; // == gl_MatrixUseA
1899+
const uint32_t CM_MatrixUseB = 1; // == gl_MatrixUseB
1900+
const uint32_t CM_MatrixUseAccumulator = 2; // == gl_MatrixUseAccumulator
19011901

19021902
TOperator builtinOp = fnCandidate->getBuiltInOp();
19031903

@@ -1989,7 +1989,7 @@ void TParseContext::handleVector2CoopMatConversionCall(const TSourceLoc& loc, co
19891989
error(loc, "cooperative matrix has unsupported scope; gl_SubgroupScope is expected", "", "");
19901990
}
19911991

1992-
if (coopMatKHRuse < CM_MatrixUseA || coopMatKHRuse > CM_MatrixUseAccumulator) {
1992+
if (coopMatKHRuse > CM_MatrixUseAccumulator) {
19931993
coopMatKHRuse = CM_MatrixUseA;
19941994
error(loc, "cooperative matrix use must be one of gl_MatrixUseA, gl_MatrixUseB, gl_MatrixUseAccumulator",
19951995
"", "");
@@ -2067,7 +2067,7 @@ void TParseContext::handleVector2CoopMatConversionCall(const TSourceLoc& loc, co
20672067
error(loc, "cooperative matrix has unsupported scope; gl_SubgroupScope is expected", "", "");
20682068
}
20692069

2070-
if (coopMatKHRuse < CM_MatrixUseA || coopMatKHRuse > CM_MatrixUseAccumulator) {
2070+
if (coopMatKHRuse > CM_MatrixUseAccumulator) {
20712071
coopMatKHRuse = CM_MatrixUseA;
20722072
error(loc, "cooperative matrix use must be one of gl_MatrixUseA, gl_MatrixUseB, gl_MatrixUseAccumulator",
20732073
"", "");

0 commit comments

Comments
 (0)