summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-emit-metal.cpp
diff options
context:
space:
mode:
authorJay Kwak <82421531+jkwak-work@users.noreply.github.com>2024-04-24 07:18:21 -0700
committerGitHub <noreply@github.com>2024-04-24 07:18:21 -0700
commit97631e9a8aae44315a96d57fa8bca75b3799f9cb (patch)
treed6796f4a3daad9af8b02645d4c7a50c1f1b01eac /source/slang/slang-emit-metal.cpp
parentc6b9a91253bce6d450efc281b3f86617b3eef633 (diff)
Avoid DXC warnings for missing bitwise op parantheses (#4004)
Resolves #3980 Based on the operator precedence, Slang may omits the parentheses if they are not needed. DXC prints warnings for such cases and some applications may treat the warnings as errors. This commit emits parentheses to avoid the DXC warning even when they are not needed.
Diffstat (limited to 'source/slang/slang-emit-metal.cpp')
-rw-r--r--source/slang/slang-emit-metal.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/slang/slang-emit-metal.cpp b/source/slang/slang-emit-metal.cpp
index 17d074e75..bf4a67b09 100644
--- a/source/slang/slang-emit-metal.cpp
+++ b/source/slang/slang-emit-metal.cpp
@@ -283,7 +283,7 @@ bool MetalSourceEmitter::tryEmitInstExprImpl(IRInst* inst, const EmitOpInfo& inO
needClose = maybeEmitParens(outerPrec, prec);
emitOperand(inst->getOperand(0), leftSide(outerPrec, prec));
m_writer->emit("+");
- emitOperand(inst->getOperand(1), rightSide(prec, outerPrec));
+ emitOperand(inst->getOperand(1), rightSide(outerPrec, prec));
maybeCloseParens(needClose);
return true;
}