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.
This commit is contained in:
baldurk
2026-03-13 11:40:18 +00:00
parent 8008ea8d8b
commit 4046052d16
6 changed files with 12 additions and 12 deletions
+1 -1
View File
@@ -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);
}
+2 -2
View File
@@ -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<int>(tensorRankARM); }
bool isReference() const { return getBasicType() == EbtReference; }
@@ -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) {
@@ -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) {
@@ -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;
}
}
@@ -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)