diff --git a/renderdoc/3rdparty/glslang/SPIRV/GlslangToSpv.cpp b/renderdoc/3rdparty/glslang/SPIRV/GlslangToSpv.cpp index c7984a9f8..c065f9628 100644 --- a/renderdoc/3rdparty/glslang/SPIRV/GlslangToSpv.cpp +++ b/renderdoc/3rdparty/glslang/SPIRV/GlslangToSpv.cpp @@ -3090,7 +3090,7 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt case glslang::EOpConstructF16Mat4x3: case glslang::EOpConstructF16Mat4x4: isMatrix = true; - [[fallthrough]]; + DELIBERATE_FALLTHROUGH; case glslang::EOpConstructFloat: case glslang::EOpConstructVec2: case glslang::EOpConstructVec3: @@ -3266,7 +3266,7 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt case glslang::EOpAtomicStore: noReturnValue = true; - [[fallthrough]]; + DELIBERATE_FALLTHROUGH; case glslang::EOpAtomicLoad: atomic = true; break; @@ -3374,7 +3374,7 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt case glslang::EOpHitObjectRecordHitWithIndexMotionNV: case glslang::EOpReorderThreadNV: noReturnValue = true; - [[fallthrough]]; + DELIBERATE_FALLTHROUGH; case glslang::EOpHitObjectIsEmptyNV: case glslang::EOpHitObjectIsMissNV: case glslang::EOpHitObjectIsHitNV: @@ -8367,7 +8367,7 @@ spv::Id TGlslangToSpvTraverser::createSubgroupOperation(glslang::TOperator op, s case glslang::EOpSubgroupQuadAny: builder.addExtension(spv::E_SPV_KHR_quad_control); builder.addCapability(spv::CapabilityQuadControlKHR); - [[fallthrough]]; + DELIBERATE_FALLTHROUGH; case glslang::EOpSubgroupAll: case glslang::EOpSubgroupAny: case glslang::EOpSubgroupAllEqual: diff --git a/renderdoc/3rdparty/glslang/SPIRV/SpvBuilder.cpp b/renderdoc/3rdparty/glslang/SPIRV/SpvBuilder.cpp index 2f1816ce7..4c870b6fc 100644 --- a/renderdoc/3rdparty/glslang/SPIRV/SpvBuilder.cpp +++ b/renderdoc/3rdparty/glslang/SPIRV/SpvBuilder.cpp @@ -2335,7 +2335,7 @@ void Builder::setupFunctionDebugInfo(Function* function, const char* name, const currentDebugScopeId.pop(); } -Id Builder::makeDebugFunction([[maybe_unused]] Function* function, Id nameId, Id funcTypeId) +Id Builder::makeDebugFunction(MAYBE_UNUSED Function* function, Id nameId, Id funcTypeId) { assert(function != nullptr); assert(nameId != 0); diff --git a/renderdoc/3rdparty/glslang/glslang/Include/visibility.h b/renderdoc/3rdparty/glslang/glslang/Include/visibility.h index 9bb8f3faa..ae20c8916 100644 --- a/renderdoc/3rdparty/glslang/glslang/Include/visibility.h +++ b/renderdoc/3rdparty/glslang/glslang/Include/visibility.h @@ -52,3 +52,15 @@ // and do not appear in publicly installed headers. They are not considered to be // part of the glslang library ABI. #define GLSLANG_EXPORT_FOR_TESTS GLSLANG_EXPORT + +#ifndef DELIBERATE_FALLTHROUGH + +#if (__cplusplus >= 201703L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) +#define DELIBERATE_FALLTHROUGH [[fallthrough]] +#define MAYBE_UNUSED [[maybe_unused]] +#else +#define DELIBERATE_FALLTHROUGH +#define MAYBE_UNUSED +#endif + +#endif diff --git a/renderdoc/3rdparty/glslang/glslang/MachineIndependent/Initialize.cpp b/renderdoc/3rdparty/glslang/glslang/MachineIndependent/Initialize.cpp index e6600eb1b..6949128fc 100644 --- a/renderdoc/3rdparty/glslang/glslang/MachineIndependent/Initialize.cpp +++ b/renderdoc/3rdparty/glslang/glslang/MachineIndependent/Initialize.cpp @@ -8175,7 +8175,7 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion symbolTable.setFunctionExtensions("texture2DArrayLod", 1, &E_GL_EXT_texture_array); symbolTable.setFunctionExtensions("shadow1DArrayLod", 1, &E_GL_EXT_texture_array); } - [[fallthrough]]; + DELIBERATE_FALLTHROUGH; case EShLangTessControl: if (profile == EEsProfile && version >= 310) { @@ -8190,7 +8190,7 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion BuiltInVariable("gl_BoundingBox", EbvBoundingBox, symbolTable); } } - [[fallthrough]]; + DELIBERATE_FALLTHROUGH; case EShLangTessEvaluation: case EShLangGeometry: @@ -10329,7 +10329,7 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion symbolTable.relateToOperator("fetchMicroTriangleVertexPositionNV", EOpFetchMicroTriangleVertexPositionNV); symbolTable.relateToOperator("fetchMicroTriangleVertexBarycentricNV", EOpFetchMicroTriangleVertexBarycentricNV); } - [[fallthrough]]; + DELIBERATE_FALLTHROUGH; case EShLangClosestHit: case EShLangMiss: if (profile != EEsProfile && version >= 460) { diff --git a/renderdoc/3rdparty/glslang/glslang/MachineIndependent/Intermediate.cpp b/renderdoc/3rdparty/glslang/glslang/MachineIndependent/Intermediate.cpp index f14ff1408..8f2a77767 100644 --- a/renderdoc/3rdparty/glslang/glslang/MachineIndependent/Intermediate.cpp +++ b/renderdoc/3rdparty/glslang/glslang/MachineIndependent/Intermediate.cpp @@ -1074,7 +1074,7 @@ void TIntermediate::addBiShapeConversion(TOperator op, TIntermTyped*& lhsNode, T // matrix multiply does not change shapes if (lhsNode->isMatrix() && rhsNode->isMatrix()) return; - [[fallthrough]]; + DELIBERATE_FALLTHROUGH; case EOpAdd: case EOpSub: case EOpDiv: @@ -3247,7 +3247,7 @@ bool TIntermediate::promoteBinary(TIntermBinary& node) if (left->getType() == right->getType()) return true; - [[fallthrough]]; + DELIBERATE_FALLTHROUGH; case EOpMul: case EOpMulAssign: @@ -3397,7 +3397,7 @@ bool TIntermediate::promoteBinary(TIntermBinary& node) case EOpAssign: if (left->getVectorSize() != right->getVectorSize() || left->getMatrixCols() != right->getMatrixCols() || left->getMatrixRows() != right->getMatrixRows()) return false; - [[fallthrough]]; + DELIBERATE_FALLTHROUGH; case EOpAdd: case EOpSub: diff --git a/renderdoc/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp b/renderdoc/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp index 41c6179b3..adf90ed00 100644 --- a/renderdoc/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp +++ b/renderdoc/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp @@ -6535,7 +6535,7 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi error(loc, "needs a literal integer", "max_primitives", ""); return; } - [[fallthrough]]; + DELIBERATE_FALLTHROUGH; case EShLangTask: // Fall through @@ -8810,7 +8810,7 @@ TIntermTyped* TParseContext::constructBuiltIn(const TType& type, TOperator op, T intermediate.addBuiltInFunctionCall(node->getLoc(), EOpConstructUVec2, false, newSrcNode, type); return newNode; } - [[fallthrough]]; + DELIBERATE_FALLTHROUGH; case EOpConstructUVec3: case EOpConstructUVec4: case EOpConstructUint: @@ -8832,7 +8832,7 @@ TIntermTyped* TParseContext::constructBuiltIn(const TType& type, TOperator op, T intermediate.addBuiltInFunctionCall(node->getLoc(), EOpPackUint2x32, true, node, type); return newNode; } - [[fallthrough]]; + DELIBERATE_FALLTHROUGH; case EOpConstructDVec2: case EOpConstructDVec3: case EOpConstructDVec4: @@ -8990,7 +8990,7 @@ TIntermTyped* TParseContext::constructBuiltIn(const TType& type, TOperator op, T TIntermTyped* newNode = intermediate.addBuiltInFunctionCall(node->getLoc(), EOpConvPtrToUint64, true, node, type); return newNode; } - [[fallthrough]]; + DELIBERATE_FALLTHROUGH; case EOpConstructU64Vec2: case EOpConstructU64Vec3: case EOpConstructU64Vec4: @@ -9966,7 +9966,7 @@ void TParseContext::updateStandaloneQualifierDefaults(const TSourceLoc& loc, con error(loc, "cannot apply to 'out'", TQualifier::getGeometryString(publicType.shaderQualifiers.geometry), ""); break; } - [[fallthrough]]; + DELIBERATE_FALLTHROUGH; case ElgPoints: case ElgLineStrip: case ElgTriangleStrip: diff --git a/renderdoc/3rdparty/glslang/glslang/MachineIndependent/Versions.cpp b/renderdoc/3rdparty/glslang/glslang/MachineIndependent/Versions.cpp index 66405a889..70684dd24 100644 --- a/renderdoc/3rdparty/glslang/glslang/MachineIndependent/Versions.cpp +++ b/renderdoc/3rdparty/glslang/glslang/MachineIndependent/Versions.cpp @@ -779,7 +779,7 @@ void TParseVersions::profileRequires(const TSourceLoc& loc, int profileMask, int switch (getExtensionBehavior(extensions[i])) { case EBhWarn: infoSink.info.message(EPrefixWarning, ("extension " + TString(extensions[i]) + " is being used for " + featureDesc).c_str(), loc, (messages & EShMsgAbsolutePath) != 0, (messages & EShMsgDisplayErrorColumn) != 0); - [[fallthrough]]; + DELIBERATE_FALLTHROUGH; case EBhRequire: case EBhEnable: okay = true; diff --git a/renderdoc/3rdparty/glslang/glslang/MachineIndependent/intermOut.cpp b/renderdoc/3rdparty/glslang/glslang/MachineIndependent/intermOut.cpp index ccfff38c4..e9a4e0851 100644 --- a/renderdoc/3rdparty/glslang/glslang/MachineIndependent/intermOut.cpp +++ b/renderdoc/3rdparty/glslang/glslang/MachineIndependent/intermOut.cpp @@ -1435,7 +1435,7 @@ void TIntermediate::output(TInfoSink& infoSink, bool tree) infoSink.debug << "max_vertices = " << vertices << "\n"; infoSink.debug << "max_primitives = " << primitives << "\n"; infoSink.debug << "output primitive = " << TQualifier::getGeometryString(outputPrimitive) << "\n"; - [[fallthrough]]; + DELIBERATE_FALLTHROUGH; case EShLangTask: // Fall through case EShLangCompute: diff --git a/renderdoc/3rdparty/glslang/glslang/MachineIndependent/linkValidate.cpp b/renderdoc/3rdparty/glslang/glslang/MachineIndependent/linkValidate.cpp index 584cc8a9f..431248d07 100644 --- a/renderdoc/3rdparty/glslang/glslang/MachineIndependent/linkValidate.cpp +++ b/renderdoc/3rdparty/glslang/glslang/MachineIndependent/linkValidate.cpp @@ -1491,7 +1491,7 @@ void TIntermediate::finalCheck(TInfoSink& infoSink, bool keepUncalled) error(infoSink, "At least one shader must specify a layout(max_vertices = value)"); if (primitives == TQualifier::layoutNotSet) error(infoSink, "At least one shader must specify a layout(max_primitives = value)"); - [[fallthrough]]; + DELIBERATE_FALLTHROUGH; case EShLangTask: if (numTaskNVBlocks > 1) error(infoSink, "Only one taskNV interface block is allowed per shader");