Several fixes to make glslang compile with higher warning levels.

This commit is contained in:
Patrick 2022-12-08 21:31:51 +01:00
parent ed257e2bdf
commit 5a89963b4c
Signed by: mewin
GPG Key ID: CEDB412C39B5BC47
8 changed files with 57 additions and 21 deletions

View File

@ -181,6 +181,7 @@ void Builder::postProcessType(const Instruction& inst, Id typeId)
else if (width == 8) else if (width == 8)
addCapability(CapabilityInt8); addCapability(CapabilityInt8);
} }
[[fallthrough]]; // @MEWIN - 2022-12-07 - Added this to get rid of implicit-fallthrough warning.
default: default:
if (basicTypeOp == OpTypeInt) { if (basicTypeOp == OpTypeInt) {
if (width == 16) if (width == 16)

View File

@ -239,8 +239,8 @@ public:
OperandParameters operands; OperandParameters operands;
protected: protected:
int typePresent : 1; unsigned typePresent : 1; // @MEWIN - 2022-12-07 - Changed to unsigned to get rid of -Woverflow warnings.
int resultPresent : 1; 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 // The set of objects that hold all the instruction/operand

View File

@ -150,17 +150,17 @@ EProfile EDesktopProfile = static_cast<EProfile>(ENoProfile | ECoreProfile | ECo
#else #else
const Versioning Es300Desktop130Version[] = { { EEsProfile, 0, 300, 0, nullptr }, const Versioning Es300Desktop130Version[] = { { EEsProfile, 0, 300, 0, nullptr },
{ EDesktopProfile, 0, 130, 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* Es300Desktop130 = &Es300Desktop130Version[0];
const Versioning Es310Desktop420Version[] = { { EEsProfile, 0, 310, 0, nullptr }, const Versioning Es310Desktop420Version[] = { { EEsProfile, 0, 310, 0, nullptr },
{ EDesktopProfile, 0, 420, 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* Es310Desktop420 = &Es310Desktop420Version[0];
const Versioning Es310Desktop450Version[] = { { EEsProfile, 0, 310, 0, nullptr }, const Versioning Es310Desktop450Version[] = { { EEsProfile, 0, 310, 0, nullptr },
{ EDesktopProfile, 0, 450, 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]; const Versioning* Es310Desktop450 = &Es310Desktop450Version[0];
#endif #endif
@ -269,14 +269,14 @@ const BuiltInFunction BaseFunctions[] = {
{ EOpMix, "mix", 3, TypeIU, ClassLB, Es310Desktop450 }, { EOpMix, "mix", 3, TypeIU, ClassLB, Es310Desktop450 },
#endif #endif
{ EOpNull } { EOpNull, nullptr, 0, TypeB, ClassRegular, nullptr } // @MEWIN - 2022-12-08 - Added missing initializers.
}; };
const BuiltInFunction DerivativeFunctions[] = { const BuiltInFunction DerivativeFunctions[] = {
{ EOpDPdx, "dFdx", 1, TypeF, ClassRegular, nullptr }, { EOpDPdx, "dFdx", 1, TypeF, ClassRegular, nullptr },
{ EOpDPdy, "dFdy", 1, TypeF, ClassRegular, nullptr }, { EOpDPdy, "dFdy", 1, TypeF, ClassRegular, nullptr },
{ EOpFwidth, "fwidth", 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. // For functions declared some other way, but still use the table to relate to operator.
@ -330,7 +330,7 @@ const CustomFunction CustomFunctions[] = {
{ EOpTextureProjGrad, "textureProjGrad", nullptr }, { EOpTextureProjGrad, "textureProjGrad", nullptr },
{ EOpTextureProjGradOffset, "textureProjGradOffset", 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 // For the given table of functions, add all the indicated prototypes for each

View File

@ -1297,6 +1297,7 @@ void TIntermediate::addBiShapeConversion(TOperator op, TIntermTyped*& lhsNode, T
// matrix multiply does not change shapes // matrix multiply does not change shapes
if (lhsNode->isMatrix() && rhsNode->isMatrix()) if (lhsNode->isMatrix() && rhsNode->isMatrix())
return; return;
[[fallthrough]]; // @MEWIN - 2022-12-08 - Added fallthrough to fix compiler warnings.
case EOpAdd: case EOpAdd:
case EOpSub: case EOpSub:
case EOpDiv: case EOpDiv:

View File

@ -7173,7 +7173,7 @@ TIntermTyped* TParseContext::vkRelaxedRemapFunctionCall(const TSourceLoc& loc, T
realFunc.addParameter(TParameter().copyParam((*function)[i])); 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)); realFunc.addParameter(TParameter().copyParam(tmpP));
arguments = intermediate.growAggregate(arguments, intermediate.addConstantUnion(1, loc, true)); arguments = intermediate.growAggregate(arguments, intermediate.addConstantUnion(1, loc, true));
@ -7190,7 +7190,7 @@ TIntermTyped* TParseContext::vkRelaxedRemapFunctionCall(const TSourceLoc& loc, T
realFunc.addParameter(TParameter().copyParam((*function)[i])); 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)); realFunc.addParameter(TParameter().copyParam(tmpP));
arguments = intermediate.growAggregate(arguments, intermediate.addConstantUnion(-1, loc, true)); arguments = intermediate.growAggregate(arguments, intermediate.addConstantUnion(-1, loc, true));
@ -7989,6 +7989,7 @@ TIntermTyped* TParseContext::constructBuiltIn(const TType& type, TOperator op, T
intermediate.addBuiltInFunctionCall(node->getLoc(), EOpConstructUVec2, false, newSrcNode, type); intermediate.addBuiltInFunctionCall(node->getLoc(), EOpConstructUVec2, false, newSrcNode, type);
return newNode; return newNode;
} }
[[fallthrough]]; // @MEWIN - 2022-12-08 - Added fallthrough.
case EOpConstructUVec3: case EOpConstructUVec3:
case EOpConstructUVec4: case EOpConstructUVec4:
case EOpConstructUint: case EOpConstructUint:
@ -8010,6 +8011,7 @@ TIntermTyped* TParseContext::constructBuiltIn(const TType& type, TOperator op, T
intermediate.addBuiltInFunctionCall(node->getLoc(), EOpPackUint2x32, true, node, type); intermediate.addBuiltInFunctionCall(node->getLoc(), EOpPackUint2x32, true, node, type);
return newNode; return newNode;
} }
[[fallthrough]]; // @MEWIN - 2022-12-08 - Added fallthrough.
#ifndef GLSLANG_WEB #ifndef GLSLANG_WEB
case EOpConstructDVec2: case EOpConstructDVec2:

View File

@ -173,7 +173,7 @@ void TType::buildMangledName(TString& mangledName) const
if (arraySizes->getDimNode(i)->getAsSymbolNode()) if (arraySizes->getDimNode(i)->getAsSymbolNode())
snprintf(buf, maxSize, "s%lld", arraySizes->getDimNode(i)->getAsSymbolNode()->getId()); snprintf(buf, maxSize, "s%lld", arraySizes->getDimNode(i)->getAsSymbolNode()->getId());
else else
snprintf(buf, maxSize, "s%p", arraySizes->getDimNode(i)); snprintf(buf, maxSize, "s%p", static_cast<void*>(arraySizes->getDimNode(i))); // @MEWIN - 2022-12-08 - Added cast to void* to fix warning about wrong format.
} else } else
snprintf(buf, maxSize, "%d", arraySizes->getDimSize(i)); snprintf(buf, maxSize, "%d", arraySizes->getDimSize(i));
mangledName += '['; mangledName += '[';

View File

@ -51,16 +51,16 @@ class TInfoSink;
namespace glslang { namespace glslang {
class TIntermediate; class TIntermediate;
struct TVarEntryInfo { struct TVarEntryInfo { // @MEWIN - 2022-12-08 - Added initializers to fix compiler warnings.
long long id; long long id = 0;
TIntermSymbol* symbol; TIntermSymbol* symbol = nullptr;
bool live; bool live = false;
int newBinding; int newBinding = 0;
int newSet; int newSet = 0;
int newLocation; int newLocation = 0;
int newComponent; int newComponent = 0;
int newIndex; int newIndex = 0;
EShLanguage stage; EShLanguage stage = EShLangVertex;
void clearNewAssignments() { void clearNewAssignments() {
newBinding = -1; newBinding = -1;

View File

@ -709,6 +709,7 @@ public:
switch ((int)sampler.shadow) { switch ((int)sampler.shadow) {
case false: return sampler.arrayed ? GL_SAMPLER_1D_ARRAY : GL_SAMPLER_1D; 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; 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: case Esd2D:
switch ((int)sampler.ms) { switch ((int)sampler.ms) {
@ -716,8 +717,10 @@ public:
switch ((int)sampler.shadow) { switch ((int)sampler.shadow) {
case false: return sampler.arrayed ? GL_SAMPLER_2D_ARRAY : GL_SAMPLER_2D; 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; 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; 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: case Esd3D:
return GL_SAMPLER_3D; return GL_SAMPLER_3D;
@ -725,11 +728,13 @@ public:
switch ((int)sampler.shadow) { switch ((int)sampler.shadow) {
case false: return sampler.arrayed ? GL_SAMPLER_CUBE_MAP_ARRAY : GL_SAMPLER_CUBE; 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; 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: case EsdRect:
return sampler.shadow ? GL_SAMPLER_2D_RECT_SHADOW : GL_SAMPLER_2D_RECT; return sampler.shadow ? GL_SAMPLER_2D_RECT_SHADOW : GL_SAMPLER_2D_RECT;
case EsdBuffer: case EsdBuffer:
return GL_SAMPLER_BUFFER; return GL_SAMPLER_BUFFER;
default: return 0; // @MEWIN - 2022-12-08 - Added default case to fix compiler warnings.
} }
case EbtFloat16: case EbtFloat16:
switch ((int)sampler.dim) { switch ((int)sampler.dim) {
@ -737,6 +742,7 @@ public:
switch ((int)sampler.shadow) { switch ((int)sampler.shadow) {
case false: return sampler.arrayed ? GL_FLOAT16_SAMPLER_1D_ARRAY_AMD : GL_FLOAT16_SAMPLER_1D_AMD; 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; 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: case Esd2D:
switch ((int)sampler.ms) { switch ((int)sampler.ms) {
@ -744,8 +750,10 @@ public:
switch ((int)sampler.shadow) { switch ((int)sampler.shadow) {
case false: return sampler.arrayed ? GL_FLOAT16_SAMPLER_2D_ARRAY_AMD : GL_FLOAT16_SAMPLER_2D_AMD; 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; 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; 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: case Esd3D:
return GL_FLOAT16_SAMPLER_3D_AMD; return GL_FLOAT16_SAMPLER_3D_AMD;
@ -753,11 +761,13 @@ public:
switch ((int)sampler.shadow) { switch ((int)sampler.shadow) {
case false: return sampler.arrayed ? GL_FLOAT16_SAMPLER_CUBE_MAP_ARRAY_AMD : GL_FLOAT16_SAMPLER_CUBE_AMD; 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; 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: case EsdRect:
return sampler.shadow ? GL_FLOAT16_SAMPLER_2D_RECT_SHADOW_AMD : GL_FLOAT16_SAMPLER_2D_RECT_AMD; return sampler.shadow ? GL_FLOAT16_SAMPLER_2D_RECT_SHADOW_AMD : GL_FLOAT16_SAMPLER_2D_RECT_AMD;
case EsdBuffer: case EsdBuffer:
return GL_FLOAT16_SAMPLER_BUFFER_AMD; return GL_FLOAT16_SAMPLER_BUFFER_AMD;
default: return 0; // @MEWIN - 2022-12-08 - Added default case to fix compiler warnings.
} }
case EbtInt: case EbtInt:
switch ((int)sampler.dim) { switch ((int)sampler.dim) {
@ -768,6 +778,7 @@ public:
case false: return sampler.arrayed ? GL_INT_SAMPLER_2D_ARRAY : GL_INT_SAMPLER_2D; 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 case true: return sampler.arrayed ? GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY
: GL_INT_SAMPLER_2D_MULTISAMPLE; : GL_INT_SAMPLER_2D_MULTISAMPLE;
default: return 0; // @MEWIN - 2022-12-08 - Added default case to fix compiler warnings.
} }
case Esd3D: case Esd3D:
return GL_INT_SAMPLER_3D; return GL_INT_SAMPLER_3D;
@ -777,6 +788,7 @@ public:
return GL_INT_SAMPLER_2D_RECT; return GL_INT_SAMPLER_2D_RECT;
case EsdBuffer: case EsdBuffer:
return GL_INT_SAMPLER_BUFFER; return GL_INT_SAMPLER_BUFFER;
default: return 0; // @MEWIN - 2022-12-08 - Added default case to fix compiler warnings.
} }
case EbtUint: case EbtUint:
switch ((int)sampler.dim) { switch ((int)sampler.dim) {
@ -787,6 +799,7 @@ public:
case false: return sampler.arrayed ? GL_UNSIGNED_INT_SAMPLER_2D_ARRAY : GL_UNSIGNED_INT_SAMPLER_2D; 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 case true: return sampler.arrayed ? GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY
: GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE; : GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE;
default: return 0; // @MEWIN - 2022-12-08 - Added default case to fix compiler warnings.
} }
case Esd3D: case Esd3D:
return GL_UNSIGNED_INT_SAMPLER_3D; return GL_UNSIGNED_INT_SAMPLER_3D;
@ -796,6 +809,7 @@ public:
return GL_UNSIGNED_INT_SAMPLER_2D_RECT; return GL_UNSIGNED_INT_SAMPLER_2D_RECT;
case EsdBuffer: case EsdBuffer:
return GL_UNSIGNED_INT_SAMPLER_BUFFER; return GL_UNSIGNED_INT_SAMPLER_BUFFER;
default: return 0; // @MEWIN - 2022-12-08 - Added default case to fix compiler warnings.
} }
default: default:
return 0; return 0;
@ -811,6 +825,7 @@ public:
switch ((int)sampler.ms) { switch ((int)sampler.ms) {
case false: return sampler.arrayed ? GL_IMAGE_2D_ARRAY : GL_IMAGE_2D; 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; 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: case Esd3D:
return GL_IMAGE_3D; return GL_IMAGE_3D;
@ -820,6 +835,8 @@ public:
return GL_IMAGE_2D_RECT; return GL_IMAGE_2D_RECT;
case EsdBuffer: case EsdBuffer:
return GL_IMAGE_BUFFER; return GL_IMAGE_BUFFER;
default:
return 0; // @MEWIN - 2022-12-08 - Added default case to fix compiler warnings.
} }
case EbtFloat16: case EbtFloat16:
switch ((int)sampler.dim) { switch ((int)sampler.dim) {
@ -829,6 +846,7 @@ public:
switch ((int)sampler.ms) { switch ((int)sampler.ms) {
case false: return sampler.arrayed ? GL_FLOAT16_IMAGE_2D_ARRAY_AMD : GL_FLOAT16_IMAGE_2D_AMD; 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; 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: case Esd3D:
return GL_FLOAT16_IMAGE_3D_AMD; return GL_FLOAT16_IMAGE_3D_AMD;
@ -838,6 +856,8 @@ public:
return GL_FLOAT16_IMAGE_2D_RECT_AMD; return GL_FLOAT16_IMAGE_2D_RECT_AMD;
case EsdBuffer: case EsdBuffer:
return GL_FLOAT16_IMAGE_BUFFER_AMD; return GL_FLOAT16_IMAGE_BUFFER_AMD;
default:
return 0; // @MEWIN - 2022-12-08 - Added default case to fix compiler warnings.
} }
case EbtInt: case EbtInt:
switch ((int)sampler.dim) { switch ((int)sampler.dim) {
@ -847,6 +867,7 @@ public:
switch ((int)sampler.ms) { switch ((int)sampler.ms) {
case false: return sampler.arrayed ? GL_INT_IMAGE_2D_ARRAY : GL_INT_IMAGE_2D; 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; 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: case Esd3D:
return GL_INT_IMAGE_3D; return GL_INT_IMAGE_3D;
@ -856,6 +877,8 @@ public:
return GL_INT_IMAGE_2D_RECT; return GL_INT_IMAGE_2D_RECT;
case EsdBuffer: case EsdBuffer:
return GL_INT_IMAGE_BUFFER; return GL_INT_IMAGE_BUFFER;
default:
return 0; // @MEWIN - 2022-12-08 - Added default case to fix compiler warnings.
} }
case EbtUint: case EbtUint:
switch ((int)sampler.dim) { switch ((int)sampler.dim) {
@ -866,6 +889,7 @@ public:
case false: return sampler.arrayed ? GL_UNSIGNED_INT_IMAGE_2D_ARRAY : GL_UNSIGNED_INT_IMAGE_2D; 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 case true: return sampler.arrayed ? GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY
: GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE; : GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE;
default: return 0; // @MEWIN - 2022-12-08 - Added default case to fix compiler warnings.
} }
case Esd3D: case Esd3D:
return GL_UNSIGNED_INT_IMAGE_3D; return GL_UNSIGNED_INT_IMAGE_3D;
@ -875,6 +899,8 @@ public:
return GL_UNSIGNED_INT_IMAGE_2D_RECT; return GL_UNSIGNED_INT_IMAGE_2D_RECT;
case EsdBuffer: case EsdBuffer:
return GL_UNSIGNED_INT_IMAGE_BUFFER; return GL_UNSIGNED_INT_IMAGE_BUFFER;
default:
return 0; // @MEWIN - 2022-12-08 - Added default case to fix compiler warnings.
} }
default: default:
return 0; return 0;
@ -939,6 +965,8 @@ public:
case 4: return GL_FLOAT_MAT4; case 4: return GL_FLOAT_MAT4;
default: return 0; default: return 0;
} }
default:
return 0; // @MEWIN - 2022-12-08 - Added default case to fix compiler warnings.
} }
case EbtDouble: case EbtDouble:
switch (type.getMatrixCols()) { switch (type.getMatrixCols()) {
@ -963,6 +991,8 @@ public:
case 4: return GL_DOUBLE_MAT4; case 4: return GL_DOUBLE_MAT4;
default: return 0; default: return 0;
} }
default:
return 0; // @MEWIN - 2022-12-08 - Added default case to fix compiler warnings.
} }
case EbtFloat16: case EbtFloat16:
switch (type.getMatrixCols()) { switch (type.getMatrixCols()) {
@ -987,6 +1017,8 @@ public:
case 4: return GL_FLOAT16_MAT4_AMD; case 4: return GL_FLOAT16_MAT4_AMD;
default: return 0; default: return 0;
} }
default:
return 0; // @MEWIN - 2022-12-08 - Added default case to fix compiler warnings.
} }
default: default:
return 0; return 0;