From 4046052d16b32227b4acf1b178a905d729436768 Mon Sep 17 00:00:00 2001 From: baldurk Date: Fri, 13 Mar 2026 10:13:55 +0000 Subject: [PATCH] Warning fixes in glslang * These could likely be upstreamed but are extremely minor (just silencing warnings, not fixing issues) and we will have local changes either way. --- renderdoc/3rdparty/glslang/SPIRV/GlslangToSpv.cpp | 2 +- renderdoc/3rdparty/glslang/glslang/Include/Types.h | 4 ++-- .../glslang/MachineIndependent/ParseContextBase.cpp | 2 +- .../glslang/glslang/MachineIndependent/ParseHelper.cpp | 4 ++-- .../glslang/glslang/MachineIndependent/Versions.cpp | 8 ++++---- .../glslang/glslang/MachineIndependent/linkValidate.cpp | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/renderdoc/3rdparty/glslang/SPIRV/GlslangToSpv.cpp b/renderdoc/3rdparty/glslang/SPIRV/GlslangToSpv.cpp index 12f034b50..c0369d37d 100644 --- a/renderdoc/3rdparty/glslang/SPIRV/GlslangToSpv.cpp +++ b/renderdoc/3rdparty/glslang/SPIRV/GlslangToSpv.cpp @@ -6366,7 +6366,7 @@ spv::Id TGlslangToSpvTraverser::makeArraySizeId(const glslang::TArraySizes& arra assert(size > 0); if (boolType) { - return builder.makeBoolConstant(size); + return builder.makeBoolConstant(size ? true : false); } else { return builder.makeUintConstant(size); } diff --git a/renderdoc/3rdparty/glslang/glslang/Include/Types.h b/renderdoc/3rdparty/glslang/glslang/Include/Types.h index d927b2a85..90a67438e 100644 --- a/renderdoc/3rdparty/glslang/glslang/Include/Types.h +++ b/renderdoc/3rdparty/glslang/glslang/Include/Types.h @@ -1560,7 +1560,7 @@ public: bool isCoopmatOrvec() const { return isCoopmat() || isCoopvecNV() || isLongVector(); } bool isLongVector() const { return longVector; } bool isCoopvecOrLongVector() const { return isCoopvecNV() || isLongVector(); } - bool isTensorARM() const { return tensorRankARM; } + bool isTensorARM() const { return tensorRankARM > 0; } bool hasTypeParameter() const { return isCoopmat() || isCoopvecNV() || isLongVector() || isTensorARM(); } bool isTensorLayoutNV() const { return basicType == EbtTensorLayoutNV; } @@ -2002,7 +2002,7 @@ public: bool isLongVector() const { return longVector; } bool isCoopVecOrLongVector() const { return isCoopVecNV() || isLongVector(); } bool isTileAttachmentQCOM() const { return tileAttachmentQCOM; } - bool isTensorARM() const { return tensorRankARM; } + bool isTensorARM() const { return tensorRankARM > 0; } bool hasTypeParameter() const { return isCoopMat() || isCoopVecNV() || isLongVector() || isTensorARM(); } int getTensorRankARM() const { return static_cast(tensorRankARM); } bool isReference() const { return getBasicType() == EbtReference; } diff --git a/renderdoc/3rdparty/glslang/glslang/MachineIndependent/ParseContextBase.cpp b/renderdoc/3rdparty/glslang/glslang/MachineIndependent/ParseContextBase.cpp index 45ada17db..04df40ade 100644 --- a/renderdoc/3rdparty/glslang/glslang/MachineIndependent/ParseContextBase.cpp +++ b/renderdoc/3rdparty/glslang/glslang/MachineIndependent/ParseContextBase.cpp @@ -59,7 +59,7 @@ void TParseContextBase::outputMessage(const TSourceLoc& loc, const char* szReaso safe_vsprintf(szExtraInfo, maxSize, szExtraInfoFormat, args); infoSink.info.prefix(prefix); - infoSink.info.location(loc, messages & EShMsgAbsolutePath, messages & EShMsgDisplayErrorColumn); + infoSink.info.location(loc, (messages & EShMsgAbsolutePath) != 0, (messages & EShMsgDisplayErrorColumn) != 0); infoSink.info << "'" << szToken << "' : " << szReason << " " << szExtraInfo << "\n"; if (prefix == EPrefixError) { diff --git a/renderdoc/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp b/renderdoc/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp index 6fbcaba51..0fb11d67a 100644 --- a/renderdoc/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp +++ b/renderdoc/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp @@ -588,7 +588,7 @@ TIntermTyped* TParseContext::handleBracketDereference(const TSourceLoc& loc, TIn if (base->getType().getQualifier().isFrontEndConstant() && index->getQualifier().isFrontEndConstant()) { // both base and index are front-end constants checkIndex(loc, base->getType(), indexValue); - return intermediate.foldDereference(base, indexValue, loc); + return intermediate.foldDereference(base, int(indexValue), loc); } // at least one of base and index is not a front-end constant variable... @@ -618,7 +618,7 @@ TIntermTyped* TParseContext::handleBracketDereference(const TSourceLoc& loc, TIn if (index->getQualifier().isFrontEndConstant()) { if (base->getType().isUnsizedArray()) { - base->getWritableType().updateImplicitArraySize(indexValue + 1); + base->getWritableType().updateImplicitArraySize(int(indexValue + 1)); base->getWritableType().setImplicitlySized(true); if (base->getQualifier().builtIn == EbvClipDistance && indexValue >= resources.maxClipDistances) { diff --git a/renderdoc/3rdparty/glslang/glslang/MachineIndependent/Versions.cpp b/renderdoc/3rdparty/glslang/glslang/MachineIndependent/Versions.cpp index 4238d4f6c..48a5ac928 100644 --- a/renderdoc/3rdparty/glslang/glslang/MachineIndependent/Versions.cpp +++ b/renderdoc/3rdparty/glslang/glslang/MachineIndependent/Versions.cpp @@ -829,7 +829,7 @@ void TParseVersions::profileRequires(const TSourceLoc& loc, int profileMask, int for (int i = 0; i < numExtensions; ++i) { switch (getExtensionBehavior(extensions[i])) { case EBhWarn: - infoSink.info.message(EPrefixWarning, ("extension " + TString(extensions[i]) + " is being used for " + featureDesc).c_str(), loc, messages & EShMsgAbsolutePath, messages & EShMsgDisplayErrorColumn); + infoSink.info.message(EPrefixWarning, ("extension " + TString(extensions[i]) + " is being used for " + featureDesc).c_str(), loc, (messages & EShMsgAbsolutePath) != 0, (messages & EShMsgDisplayErrorColumn) != 0); [[fallthrough]]; case EBhRequire: case EBhEnable: @@ -868,7 +868,7 @@ void TParseVersions::checkDeprecated(const TSourceLoc& loc, int profileMask, int else if (! suppressWarnings()) infoSink.info.message(EPrefixWarning, (TString(featureDesc) + " deprecated in version " + String(depVersion) + "; may be removed in future release").c_str(), - loc, messages & EShMsgAbsolutePath, messages & EShMsgDisplayErrorColumn); + loc, (messages & EShMsgAbsolutePath) != 0, (messages & EShMsgDisplayErrorColumn) != 0); } } } @@ -906,13 +906,13 @@ bool TParseVersions::checkExtensionsRequested(const TSourceLoc& loc, int numExte TExtensionBehavior behavior = getExtensionBehavior(extensions[i]); if (behavior == EBhDisable && relaxedErrors()) { infoSink.info.message(EPrefixWarning, "The following extension must be enabled to use this feature:", loc, - messages & EShMsgAbsolutePath, messages & EShMsgDisplayErrorColumn); + (messages & EShMsgAbsolutePath) != 0, (messages & EShMsgDisplayErrorColumn) != 0); behavior = EBhWarn; } if (behavior == EBhWarn) { infoSink.info.message(EPrefixWarning, ("extension " + TString(extensions[i]) + " is being used for " + featureDesc).c_str(), - loc, messages & EShMsgAbsolutePath, messages & EShMsgDisplayErrorColumn); + loc, (messages & EShMsgAbsolutePath) != 0, (messages & EShMsgDisplayErrorColumn) != 0); warned = true; } } diff --git a/renderdoc/3rdparty/glslang/glslang/MachineIndependent/linkValidate.cpp b/renderdoc/3rdparty/glslang/glslang/MachineIndependent/linkValidate.cpp index 0879fa79a..f4486400a 100644 --- a/renderdoc/3rdparty/glslang/glslang/MachineIndependent/linkValidate.cpp +++ b/renderdoc/3rdparty/glslang/glslang/MachineIndependent/linkValidate.cpp @@ -62,7 +62,7 @@ void TIntermediate::error(TInfoSink& infoSink, const TSourceLoc* loc, EShMessage { infoSink.info.prefix(EPrefixError); if (loc) - infoSink.info.location(*loc, messages & EShMsgAbsolutePath, messages & EShMsgDisplayErrorColumn); + infoSink.info.location(*loc, (messages & EShMsgAbsolutePath) != 0, (messages & EShMsgDisplayErrorColumn) != 0); if (unitStage == EShLangCount) infoSink.info << "Linking " << StageName(language) << " stage: " << message << "\n"; else if (language == EShLangCount) @@ -79,7 +79,7 @@ void TIntermediate::warn(TInfoSink& infoSink, const TSourceLoc* loc, EShMessages { infoSink.info.prefix(EPrefixWarning); if (loc) - infoSink.info.location(*loc, messages & EShMsgAbsolutePath, messages & EShMsgDisplayErrorColumn); + infoSink.info.location(*loc, (messages & EShMsgAbsolutePath) != 0, (messages & EShMsgDisplayErrorColumn) != 0); if (unitStage == EShLangCount) infoSink.info << "Linking " << StageName(language) << " stage: " << message << "\n"; else if (language == EShLangCount)