summaryrefslogtreecommitdiff
path: root/source/slang/slang-emit-glsl.cpp
diff options
context:
space:
mode:
authorEllie Hermaszewska <ellieh@nvidia.com>2023-04-27 12:36:59 +0800
committerGitHub <noreply@github.com>2023-04-26 21:36:59 -0700
commit3acbe8145c60f4d1e7a180b4602a94269a489df5 (patch)
tree8031e7ca897260ac3ab6d2a920864f3114bc8668 /source/slang/slang-emit-glsl.cpp
parenta3da31c189a1cc9bdf85a42ac359b8c2777f3550 (diff)
Fix most of the disabled warnings on gcc/clang (#2839)
Diffstat (limited to 'source/slang/slang-emit-glsl.cpp')
-rw-r--r--source/slang/slang-emit-glsl.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/slang/slang-emit-glsl.cpp b/source/slang/slang-emit-glsl.cpp
index d0154ab91..0abd78137 100644
--- a/source/slang/slang-emit-glsl.cpp
+++ b/source/slang/slang-emit-glsl.cpp
@@ -1654,7 +1654,7 @@ bool GLSLSourceEmitter::tryEmitInstExprImpl(IRInst* inst, const EmitOpInfo& inOu
case kIROp_Not:
{
IRInst* operand = inst->getOperand(0);
- if (auto vectorType = as<IRVectorType>(operand->getDataType()))
+ if (const auto vectorType = as<IRVectorType>(operand->getDataType()))
{
EmitOpInfo outerPrec = inOuterPrec;
bool needClose = false;
@@ -1719,7 +1719,7 @@ bool GLSLSourceEmitter::tryEmitInstExprImpl(IRInst* inst, const EmitOpInfo& inOu
auto prec = getInfo(EmitOp::Postfix);
EmitOpInfo outerPrec = inOuterPrec;
- bool needClose = maybeEmitParens(outerPrec, outerPrec);
+ bool needClose = maybeEmitParens(outerPrec, prec);
m_writer->emit(funcName);
m_writer->emit("(");
@@ -1745,7 +1745,7 @@ bool GLSLSourceEmitter::tryEmitInstExprImpl(IRInst* inst, const EmitOpInfo& inOu
auto prec = getInfo(EmitOp::Postfix);
EmitOpInfo outerPrec = inOuterPrec;
- bool needClose = maybeEmitParens(outerPrec, outerPrec);
+ bool needClose = maybeEmitParens(outerPrec, prec);
// TODO: the GLSL `mod` function amounts to a floating-point
// modulus rather than a floating-point remainder. We need
@@ -2175,7 +2175,7 @@ void GLSLSourceEmitter::emitSimpleTypeImpl(IRType* type)
_emitGLSLTextureOrTextureSamplerType(imageType, "image");
return;
}
- else if (auto structuredBufferType = as<IRHLSLStructuredBufferTypeBase>(type))
+ else if (const auto structuredBufferType = as<IRHLSLStructuredBufferTypeBase>(type))
{
// TODO: We desugar global variables with structured-buffer type into GLSL
// `buffer` declarations, but we don't currently handle structured-buffer types