diff --git a/SPIRV/SpvPostProcess.cpp b/SPIRV/SpvPostProcess.cpp index 13001a67..4da9561e 100644 --- a/SPIRV/SpvPostProcess.cpp +++ b/SPIRV/SpvPostProcess.cpp @@ -181,6 +181,7 @@ void Builder::postProcessType(const Instruction& inst, Id typeId) else if (width == 8) addCapability(CapabilityInt8); } + [[fallthrough]]; // @MEWIN - 2022-12-07 - Added this to get rid of implicit-fallthrough warning. default: if (basicTypeOp == OpTypeInt) { if (width == 16) diff --git a/SPIRV/doc.h b/SPIRV/doc.h index b60ad340..bc9dc1ec 100644 --- a/SPIRV/doc.h +++ b/SPIRV/doc.h @@ -240,8 +240,8 @@ public: OperandParameters operands; protected: - int typePresent : 1; - int resultPresent : 1; + unsigned typePresent : 1; // @MEWIN - 2022-12-07 - Changed to unsigned to get rid of -Woverflow warnings. + unsigned resultPresent : 1; // @MEWIN - 2022-12-07 - Changed to unsigned to get rid of -Woverflow warnings. }; // The set of objects that hold all the instruction/operand diff --git a/glslang/MachineIndependent/Initialize.cpp b/glslang/MachineIndependent/Initialize.cpp index 8d5ce9af..c135cb4e 100755 --- a/glslang/MachineIndependent/Initialize.cpp +++ b/glslang/MachineIndependent/Initialize.cpp @@ -141,17 +141,17 @@ EProfile EDesktopProfile = static_cast(ENoProfile | ECoreProfile | ECo // Declare pointers to put into the table for versioning. const Versioning Es300Desktop130Version[] = { { EEsProfile, 0, 300, 0, nullptr }, { EDesktopProfile, 0, 130, 0, nullptr }, - { EBadProfile } }; + { EBadProfile, 0, 0, 0, nullptr } }; // @MEWIN - 2022-12-07 - Added missing initializers. const Versioning* Es300Desktop130 = &Es300Desktop130Version[0]; const Versioning Es310Desktop420Version[] = { { EEsProfile, 0, 310, 0, nullptr }, { EDesktopProfile, 0, 420, 0, nullptr }, - { EBadProfile } }; + { EBadProfile, 0, 0, 0, nullptr } }; // @MEWIN - 2022-12-07 - Added missing initializers. const Versioning* Es310Desktop420 = &Es310Desktop420Version[0]; const Versioning Es310Desktop450Version[] = { { EEsProfile, 0, 310, 0, nullptr }, { EDesktopProfile, 0, 450, 0, nullptr }, - { EBadProfile } }; + { EBadProfile, 0, 0, 0, nullptr } }; // @MEWIN - 2022-12-07 - Added missing initializers. const Versioning* Es310Desktop450 = &Es310Desktop450Version[0]; // The main descriptor of what a set of function prototypes can look like, and @@ -257,14 +257,14 @@ const BuiltInFunction BaseFunctions[] = { { EOpMix, "mix", 3, TypeB, ClassRegular, Es310Desktop450 }, { EOpMix, "mix", 3, TypeIU, ClassLB, Es310Desktop450 }, - { EOpNull } + { EOpNull, nullptr, 0, TypeB, ClassRegular, nullptr } // @MEWIN - 2022-12-08 - Added missing initializers. }; const BuiltInFunction DerivativeFunctions[] = { { EOpDPdx, "dFdx", 1, TypeF, ClassRegular, nullptr }, { EOpDPdy, "dFdy", 1, TypeF, ClassRegular, nullptr }, { EOpFwidth, "fwidth", 1, TypeF, ClassRegular, nullptr }, - { EOpNull } + { EOpNull, nullptr, 0, TypeB, ClassRegular, nullptr } // @MEWIN - 2022-12-08 - Added missing initializers. }; // For functions declared some other way, but still use the table to relate to operator. @@ -318,7 +318,7 @@ const CustomFunction CustomFunctions[] = { { EOpTextureProjGrad, "textureProjGrad", nullptr }, { EOpTextureProjGradOffset, "textureProjGradOffset", nullptr }, - { EOpNull } + { EOpNull, nullptr, nullptr } // @MEWIN - 2022-12-08 - Added missing initializers. }; // For the given table of functions, add all the indicated prototypes for each diff --git a/glslang/MachineIndependent/Intermediate.cpp b/glslang/MachineIndependent/Intermediate.cpp index a8e3b38b..5aaa96bb 100644 --- a/glslang/MachineIndependent/Intermediate.cpp +++ b/glslang/MachineIndependent/Intermediate.cpp @@ -1277,6 +1277,7 @@ void TIntermediate::addBiShapeConversion(TOperator op, TIntermTyped*& lhsNode, T // matrix multiply does not change shapes if (lhsNode->isMatrix() && rhsNode->isMatrix()) return; + [[fallthrough]]; // @MEWIN - 2022-12-08 - Added fallthrough to fix compiler warnings. case EOpAdd: case EOpSub: case EOpDiv: diff --git a/glslang/MachineIndependent/ParseHelper.cpp b/glslang/MachineIndependent/ParseHelper.cpp index 592e9aa8..f3d982ac 100644 --- a/glslang/MachineIndependent/ParseHelper.cpp +++ b/glslang/MachineIndependent/ParseHelper.cpp @@ -7227,7 +7227,7 @@ TIntermTyped* TParseContext::vkRelaxedRemapFunctionCall(const TSourceLoc& loc, T realFunc.addParameter(TParameter().copyParam((*function)[i])); } - TParameter tmpP = { nullptr, &uintType }; + TParameter tmpP = { nullptr, &uintType, nullptr }; // @MEWIN - 2022-12-08 - Added missing initializer. realFunc.addParameter(TParameter().copyParam(tmpP)); arguments = intermediate.growAggregate(arguments, intermediate.addConstantUnion(1, loc, true)); @@ -7244,7 +7244,7 @@ TIntermTyped* TParseContext::vkRelaxedRemapFunctionCall(const TSourceLoc& loc, T realFunc.addParameter(TParameter().copyParam((*function)[i])); } - TParameter tmpP = { nullptr, &uintType }; + TParameter tmpP = { nullptr, &uintType, nullptr }; // @MEWIN - 2022-12-08 - Added missing initializer. realFunc.addParameter(TParameter().copyParam(tmpP)); arguments = intermediate.growAggregate(arguments, intermediate.addConstantUnion(-1, loc, true)); @@ -8078,6 +8078,7 @@ TIntermTyped* TParseContext::constructBuiltIn(const TType& type, TOperator op, T intermediate.addBuiltInFunctionCall(node->getLoc(), EOpConstructUVec2, false, newSrcNode, type); return newNode; } + [[fallthrough]]; // @MEWIN - 2022-12-08 - Added fallthrough. case EOpConstructUVec3: case EOpConstructUVec4: case EOpConstructUint: @@ -8099,6 +8100,7 @@ TIntermTyped* TParseContext::constructBuiltIn(const TType& type, TOperator op, T intermediate.addBuiltInFunctionCall(node->getLoc(), EOpPackUint2x32, true, node, type); return newNode; } + [[fallthrough]]; // @MEWIN - 2022-12-08 - Added fallthrough. case EOpConstructDVec2: case EOpConstructDVec3: case EOpConstructDVec4: diff --git a/glslang/MachineIndependent/SymbolTable.cpp b/glslang/MachineIndependent/SymbolTable.cpp index dae5a8b9..3e7778cb 100644 --- a/glslang/MachineIndependent/SymbolTable.cpp +++ b/glslang/MachineIndependent/SymbolTable.cpp @@ -168,7 +168,7 @@ void TType::buildMangledName(TString& mangledName) const if (arraySizes->getDimNode(i)->getAsSymbolNode()) snprintf(buf, maxSize, "s%lld", arraySizes->getDimNode(i)->getAsSymbolNode()->getId()); else - snprintf(buf, maxSize, "s%p", arraySizes->getDimNode(i)); + snprintf(buf, maxSize, "s%p", static_cast(arraySizes->getDimNode(i))); // @MEWIN - 2022-12-08 - Added cast to void* to fix warning about wrong format. } else snprintf(buf, maxSize, "%d", arraySizes->getDimSize(i)); mangledName += '['; diff --git a/glslang/MachineIndependent/iomapper.h b/glslang/MachineIndependent/iomapper.h index 35babbce..f852f872 100644 --- a/glslang/MachineIndependent/iomapper.h +++ b/glslang/MachineIndependent/iomapper.h @@ -49,17 +49,17 @@ class TInfoSink; namespace glslang { class TIntermediate; -struct TVarEntryInfo { - long long id; - TIntermSymbol* symbol; - bool live; - bool upgradedToPushConstant; - int newBinding; - int newSet; - int newLocation; - int newComponent; - int newIndex; - EShLanguage stage; +struct TVarEntryInfo { // @MEWIN - 2022-12-08 - Added initializers to fix compiler warnings. + long long id = 0; + TIntermSymbol* symbol = nullptr; + bool live = false; + bool upgradedToPushConstant = false; + int newBinding = 0; + int newSet = 0; + int newLocation = 0; + int newComponent = 0; + int newIndex = 0; + EShLanguage stage = EShLangVertex; void clearNewAssignments() { upgradedToPushConstant = false; diff --git a/glslang/MachineIndependent/reflection.cpp b/glslang/MachineIndependent/reflection.cpp index 6c7d3a2c..a029d3cb 100644 --- a/glslang/MachineIndependent/reflection.cpp +++ b/glslang/MachineIndependent/reflection.cpp @@ -707,6 +707,7 @@ public: switch ((int)sampler.shadow) { case false: return sampler.arrayed ? GL_SAMPLER_1D_ARRAY : GL_SAMPLER_1D; case true: return sampler.arrayed ? GL_SAMPLER_1D_ARRAY_SHADOW : GL_SAMPLER_1D_SHADOW; + default: return 0; // @MEWIN - 2022-12-08 - Added default case to fix compiler warnings. } case Esd2D: switch ((int)sampler.ms) { @@ -714,8 +715,10 @@ public: switch ((int)sampler.shadow) { case false: return sampler.arrayed ? GL_SAMPLER_2D_ARRAY : GL_SAMPLER_2D; case true: return sampler.arrayed ? GL_SAMPLER_2D_ARRAY_SHADOW : GL_SAMPLER_2D_SHADOW; + default: return 0; // @MEWIN - 2022-12-08 - Added default case to fix compiler warnings. } case true: return sampler.arrayed ? GL_SAMPLER_2D_MULTISAMPLE_ARRAY : GL_SAMPLER_2D_MULTISAMPLE; + default: return 0; // @MEWIN - 2022-12-08 - Added default case to fix compiler warnings. } case Esd3D: return GL_SAMPLER_3D; @@ -723,11 +726,13 @@ public: switch ((int)sampler.shadow) { case false: return sampler.arrayed ? GL_SAMPLER_CUBE_MAP_ARRAY : GL_SAMPLER_CUBE; case true: return sampler.arrayed ? GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW : GL_SAMPLER_CUBE_SHADOW; + default: return 0; // @MEWIN - 2022-12-08 - Added default case to fix compiler warnings. } case EsdRect: return sampler.shadow ? GL_SAMPLER_2D_RECT_SHADOW : GL_SAMPLER_2D_RECT; case EsdBuffer: return GL_SAMPLER_BUFFER; + default: return 0; // @MEWIN - 2022-12-08 - Added default case to fix compiler warnings. } case EbtFloat16: switch ((int)sampler.dim) { @@ -735,6 +740,7 @@ public: switch ((int)sampler.shadow) { case false: return sampler.arrayed ? GL_FLOAT16_SAMPLER_1D_ARRAY_AMD : GL_FLOAT16_SAMPLER_1D_AMD; case true: return sampler.arrayed ? GL_FLOAT16_SAMPLER_1D_ARRAY_SHADOW_AMD : GL_FLOAT16_SAMPLER_1D_SHADOW_AMD; + default: return 0; // @MEWIN - 2022-12-08 - Added default case to fix compiler warnings. } case Esd2D: switch ((int)sampler.ms) { @@ -742,8 +748,10 @@ public: switch ((int)sampler.shadow) { case false: return sampler.arrayed ? GL_FLOAT16_SAMPLER_2D_ARRAY_AMD : GL_FLOAT16_SAMPLER_2D_AMD; case true: return sampler.arrayed ? GL_FLOAT16_SAMPLER_2D_ARRAY_SHADOW_AMD : GL_FLOAT16_SAMPLER_2D_SHADOW_AMD; + default: return 0; // @MEWIN - 2022-12-08 - Added default case to fix compiler warnings. } case true: return sampler.arrayed ? GL_FLOAT16_SAMPLER_2D_MULTISAMPLE_ARRAY_AMD : GL_FLOAT16_SAMPLER_2D_MULTISAMPLE_AMD; + default: return 0; // @MEWIN - 2022-12-08 - Added default case to fix compiler warnings. } case Esd3D: return GL_FLOAT16_SAMPLER_3D_AMD; @@ -751,11 +759,13 @@ public: switch ((int)sampler.shadow) { case false: return sampler.arrayed ? GL_FLOAT16_SAMPLER_CUBE_MAP_ARRAY_AMD : GL_FLOAT16_SAMPLER_CUBE_AMD; case true: return sampler.arrayed ? GL_FLOAT16_SAMPLER_CUBE_MAP_ARRAY_SHADOW_AMD : GL_FLOAT16_SAMPLER_CUBE_SHADOW_AMD; + default: return 0; // @MEWIN - 2022-12-08 - Added default case to fix compiler warnings. } case EsdRect: return sampler.shadow ? GL_FLOAT16_SAMPLER_2D_RECT_SHADOW_AMD : GL_FLOAT16_SAMPLER_2D_RECT_AMD; case EsdBuffer: return GL_FLOAT16_SAMPLER_BUFFER_AMD; + default: return 0; // @MEWIN - 2022-12-08 - Added default case to fix compiler warnings. } case EbtInt: switch ((int)sampler.dim) { @@ -766,6 +776,7 @@ public: case false: return sampler.arrayed ? GL_INT_SAMPLER_2D_ARRAY : GL_INT_SAMPLER_2D; case true: return sampler.arrayed ? GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY : GL_INT_SAMPLER_2D_MULTISAMPLE; + default: return 0; // @MEWIN - 2022-12-08 - Added default case to fix compiler warnings. } case Esd3D: return GL_INT_SAMPLER_3D; @@ -775,6 +786,7 @@ public: return GL_INT_SAMPLER_2D_RECT; case EsdBuffer: return GL_INT_SAMPLER_BUFFER; + default: return 0; // @MEWIN - 2022-12-08 - Added default case to fix compiler warnings. } case EbtUint: switch ((int)sampler.dim) { @@ -785,6 +797,7 @@ public: case false: return sampler.arrayed ? GL_UNSIGNED_INT_SAMPLER_2D_ARRAY : GL_UNSIGNED_INT_SAMPLER_2D; case true: return sampler.arrayed ? GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY : GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE; + default: return 0; // @MEWIN - 2022-12-08 - Added default case to fix compiler warnings. } case Esd3D: return GL_UNSIGNED_INT_SAMPLER_3D; @@ -794,6 +807,7 @@ public: return GL_UNSIGNED_INT_SAMPLER_2D_RECT; case EsdBuffer: return GL_UNSIGNED_INT_SAMPLER_BUFFER; + default: return 0; // @MEWIN - 2022-12-08 - Added default case to fix compiler warnings. } default: return 0; @@ -809,6 +823,7 @@ public: switch ((int)sampler.ms) { case false: return sampler.arrayed ? GL_IMAGE_2D_ARRAY : GL_IMAGE_2D; case true: return sampler.arrayed ? GL_IMAGE_2D_MULTISAMPLE_ARRAY : GL_IMAGE_2D_MULTISAMPLE; + default: return 0; // @MEWIN - 2022-12-08 - Added default case to fix compiler warnings. } case Esd3D: return GL_IMAGE_3D; @@ -818,6 +833,8 @@ public: return GL_IMAGE_2D_RECT; case EsdBuffer: return GL_IMAGE_BUFFER; + default: + return 0; // @MEWIN - 2022-12-08 - Added default case to fix compiler warnings. } case EbtFloat16: switch ((int)sampler.dim) { @@ -827,6 +844,7 @@ public: switch ((int)sampler.ms) { case false: return sampler.arrayed ? GL_FLOAT16_IMAGE_2D_ARRAY_AMD : GL_FLOAT16_IMAGE_2D_AMD; case true: return sampler.arrayed ? GL_FLOAT16_IMAGE_2D_MULTISAMPLE_ARRAY_AMD : GL_FLOAT16_IMAGE_2D_MULTISAMPLE_AMD; + default: return 0; // @MEWIN - 2022-12-08 - Added default case to fix compiler warnings. } case Esd3D: return GL_FLOAT16_IMAGE_3D_AMD; @@ -836,6 +854,8 @@ public: return GL_FLOAT16_IMAGE_2D_RECT_AMD; case EsdBuffer: return GL_FLOAT16_IMAGE_BUFFER_AMD; + default: + return 0; // @MEWIN - 2022-12-08 - Added default case to fix compiler warnings. } case EbtInt: switch ((int)sampler.dim) { @@ -845,6 +865,7 @@ public: switch ((int)sampler.ms) { case false: return sampler.arrayed ? GL_INT_IMAGE_2D_ARRAY : GL_INT_IMAGE_2D; case true: return sampler.arrayed ? GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY : GL_INT_IMAGE_2D_MULTISAMPLE; + default: return 0; // @MEWIN - 2022-12-08 - Added default case to fix compiler warnings. } case Esd3D: return GL_INT_IMAGE_3D; @@ -854,6 +875,8 @@ public: return GL_INT_IMAGE_2D_RECT; case EsdBuffer: return GL_INT_IMAGE_BUFFER; + default: + return 0; // @MEWIN - 2022-12-08 - Added default case to fix compiler warnings. } case EbtUint: switch ((int)sampler.dim) { @@ -864,6 +887,7 @@ public: case false: return sampler.arrayed ? GL_UNSIGNED_INT_IMAGE_2D_ARRAY : GL_UNSIGNED_INT_IMAGE_2D; case true: return sampler.arrayed ? GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY : GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE; + default: return 0; // @MEWIN - 2022-12-08 - Added default case to fix compiler warnings. } case Esd3D: return GL_UNSIGNED_INT_IMAGE_3D; @@ -873,6 +897,8 @@ public: return GL_UNSIGNED_INT_IMAGE_2D_RECT; case EsdBuffer: return GL_UNSIGNED_INT_IMAGE_BUFFER; + default: + return 0; // @MEWIN - 2022-12-08 - Added default case to fix compiler warnings. } default: return 0; @@ -937,6 +963,8 @@ public: case 4: return GL_FLOAT_MAT4; default: return 0; } + default: + return 0; // @MEWIN - 2022-12-08 - Added default case to fix compiler warnings. } case EbtDouble: switch (type.getMatrixCols()) { @@ -961,6 +989,8 @@ public: case 4: return GL_DOUBLE_MAT4; default: return 0; } + default: + return 0; // @MEWIN - 2022-12-08 - Added default case to fix compiler warnings. } case EbtFloat16: switch (type.getMatrixCols()) { @@ -985,6 +1015,8 @@ public: case 4: return GL_FLOAT16_MAT4_AMD; default: return 0; } + default: + return 0; // @MEWIN - 2022-12-08 - Added default case to fix compiler warnings. } default: return 0;