diff --git a/SPIRV/GlslangToSpv.cpp b/SPIRV/GlslangToSpv.cpp index 564455b0..3ccf9f09 100755 --- a/SPIRV/GlslangToSpv.cpp +++ b/SPIRV/GlslangToSpv.cpp @@ -3052,7 +3052,7 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt case glslang::EOpConstructF16Mat4x3: case glslang::EOpConstructF16Mat4x4: isMatrix = true; - // fall through + [[fallthrough]]; case glslang::EOpConstructFloat: case glslang::EOpConstructVec2: case glslang::EOpConstructVec3: @@ -3223,7 +3223,7 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt case glslang::EOpAtomicStore: noReturnValue = true; - // fallthrough + [[fallthrough]]; case glslang::EOpAtomicLoad: atomic = true; break; @@ -3326,7 +3326,7 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt case glslang::EOpHitObjectRecordHitWithIndexMotionNV: case glslang::EOpReorderThreadNV: noReturnValue = true; - //Fallthrough + [[fallthrough]]; case glslang::EOpHitObjectIsEmptyNV: case glslang::EOpHitObjectIsMissNV: case glslang::EOpHitObjectIsHitNV: diff --git a/SPIRV/disassemble.cpp b/SPIRV/disassemble.cpp index c5e961cf..2a368b2c 100644 --- a/SPIRV/disassemble.cpp +++ b/SPIRV/disassemble.cpp @@ -360,7 +360,7 @@ void SpirvStream::disassembleInstruction(Id resultId, Id /*typeId*/, Op opCode, switch (stream[word]) { case 8: idDescriptor[resultId] = "int8_t"; break; case 16: idDescriptor[resultId] = "int16_t"; break; - default: assert(0); // fallthrough + default: assert(0); [[fallthrough]]; case 32: idDescriptor[resultId] = "int"; break; case 64: idDescriptor[resultId] = "int64_t"; break; } @@ -368,7 +368,7 @@ void SpirvStream::disassembleInstruction(Id resultId, Id /*typeId*/, Op opCode, case OpTypeFloat: switch (stream[word]) { case 16: idDescriptor[resultId] = "float16_t"; break; - default: assert(0); // fallthrough + default: assert(0); [[fallthrough]]; case 32: idDescriptor[resultId] = "float"; break; case 64: idDescriptor[resultId] = "float64_t"; break; } diff --git a/glslang/HLSL/hlslParseHelper.cpp b/glslang/HLSL/hlslParseHelper.cpp index b0fb5f46..74c9c1d7 100644 --- a/glslang/HLSL/hlslParseHelper.cpp +++ b/glslang/HLSL/hlslParseHelper.cpp @@ -402,7 +402,7 @@ TIntermTyped* HlslParseContext::handleLvalue(const TSourceLoc& loc, const char* case EOpLeftShiftAssign: case EOpRightShiftAssign: isModifyOp = true; - // fall through... + [[fallthrough]]; case EOpAssign: { // Since this is an lvalue, we'll convert an image load to a sequence like this @@ -4507,13 +4507,13 @@ void HlslParseContext::decomposeSampleMethods(const TSourceLoc& loc, TIntermType int cmpValues = 0; // 1 if there is a compare value (handier than a bool below) switch (op) { - case EOpMethodGatherCmpRed: cmpValues = 1; // fall through + case EOpMethodGatherCmpRed: cmpValues = 1; [[fallthrough]]; case EOpMethodGatherRed: channel = 0; break; - case EOpMethodGatherCmpGreen: cmpValues = 1; // fall through + case EOpMethodGatherCmpGreen: cmpValues = 1; [[fallthrough]]; case EOpMethodGatherGreen: channel = 1; break; - case EOpMethodGatherCmpBlue: cmpValues = 1; // fall through + case EOpMethodGatherCmpBlue: cmpValues = 1; [[fallthrough]]; case EOpMethodGatherBlue: channel = 2; break; - case EOpMethodGatherCmpAlpha: cmpValues = 1; // fall through + case EOpMethodGatherCmpAlpha: cmpValues = 1; [[fallthrough]]; case EOpMethodGatherAlpha: channel = 3; break; default: assert(0); break; } diff --git a/glslang/MachineIndependent/Initialize.cpp b/glslang/MachineIndependent/Initialize.cpp index 054cf1d6..858ae6ad 100755 --- a/glslang/MachineIndependent/Initialize.cpp +++ b/glslang/MachineIndependent/Initialize.cpp @@ -8126,7 +8126,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); } - // Fall through + [[fallthrough]]; case EShLangTessControl: if (profile == EEsProfile && version >= 310) { @@ -8141,7 +8141,7 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion BuiltInVariable("gl_BoundingBox", EbvBoundingBox, symbolTable); } } - // Fall through + [[fallthrough]]; case EShLangTessEvaluation: case EShLangGeometry: @@ -10231,7 +10231,8 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion if (profile != EEsProfile && version >= 460) { symbolTable.relateToOperator("fetchMicroTriangleVertexPositionNV", EOpFetchMicroTriangleVertexPositionNV); symbolTable.relateToOperator("fetchMicroTriangleVertexBarycentricNV", EOpFetchMicroTriangleVertexBarycentricNV); - } // fallthrough + } + [[fallthrough]]; case EShLangClosestHit: case EShLangMiss: if (profile != EEsProfile && version >= 460) { diff --git a/glslang/MachineIndependent/Intermediate.cpp b/glslang/MachineIndependent/Intermediate.cpp index 9dc30ffd..b5bd37cb 100644 --- a/glslang/MachineIndependent/Intermediate.cpp +++ b/glslang/MachineIndependent/Intermediate.cpp @@ -3533,7 +3533,7 @@ bool TIntermediate::promoteBinary(TIntermBinary& node) if (left->getType() == right->getType()) return true; - // Fall through + [[fallthrough]]; case EOpMul: case EOpMulAssign: @@ -3682,7 +3682,7 @@ bool TIntermediate::promoteBinary(TIntermBinary& node) case EOpAssign: if (left->getVectorSize() != right->getVectorSize() || left->getMatrixCols() != right->getMatrixCols() || left->getMatrixRows() != right->getMatrixRows()) return false; - // fall through + [[fallthrough]]; case EOpAdd: case EOpSub: diff --git a/glslang/MachineIndependent/ParseHelper.cpp b/glslang/MachineIndependent/ParseHelper.cpp index 8491e28a..f6503ecc 100644 --- a/glslang/MachineIndependent/ParseHelper.cpp +++ b/glslang/MachineIndependent/ParseHelper.cpp @@ -6260,7 +6260,7 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi error(loc, "needs a literal integer", "max_primitives", ""); return; } - // Fall through + [[fallthrough]]; case EShLangTask: // Fall through @@ -8609,7 +8609,7 @@ TIntermTyped* TParseContext::constructBuiltIn(const TType& type, TOperator op, T TIntermTyped* newNode = intermediate.addBuiltInFunctionCall(node->getLoc(), EOpConvPtrToUint64, true, node, type); return newNode; } - // fall through + [[fallthrough]]; case EOpConstructU64Vec2: case EOpConstructU64Vec3: case EOpConstructU64Vec4: @@ -9674,7 +9674,7 @@ void TParseContext::updateStandaloneQualifierDefaults(const TSourceLoc& loc, con error(loc, "cannot apply to 'out'", TQualifier::getGeometryString(publicType.shaderQualifiers.geometry), ""); break; } - // Fall through + [[fallthrough]]; case ElgPoints: case ElgLineStrip: case ElgTriangleStrip: diff --git a/glslang/MachineIndependent/Versions.cpp b/glslang/MachineIndependent/Versions.cpp index 978e25a1..4019371a 100644 --- a/glslang/MachineIndependent/Versions.cpp +++ b/glslang/MachineIndependent/Versions.cpp @@ -766,7 +766,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); - // fall through + [[fallthrough]]; case EBhRequire: case EBhEnable: okay = true; diff --git a/glslang/MachineIndependent/intermOut.cpp b/glslang/MachineIndependent/intermOut.cpp index 8ef87453..f0621bd9 100644 --- a/glslang/MachineIndependent/intermOut.cpp +++ b/glslang/MachineIndependent/intermOut.cpp @@ -1587,7 +1587,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"; - // Fall through + [[fallthrough]]; case EShLangTask: // Fall through case EShLangCompute: diff --git a/glslang/MachineIndependent/linkValidate.cpp b/glslang/MachineIndependent/linkValidate.cpp index d69300b8..1bd6678b 100644 --- a/glslang/MachineIndependent/linkValidate.cpp +++ b/glslang/MachineIndependent/linkValidate.cpp @@ -1350,7 +1350,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)"); - // fall through + [[fallthrough]]; case EShLangTask: if (numTaskNVBlocks > 1) error(infoSink, "Only one taskNV interface block is allowed per shader");