Compare commits
4 Commits
b2b90e54e2
...
0d4f1c6b8d
| Author | SHA1 | Date | |
|---|---|---|---|
| 0d4f1c6b8d | |||
| ebdbba3643 | |||
| 4438979baf | |||
| 5a89963b4c |
@ -227,16 +227,18 @@ if(ENABLE_GLSLANG_JS)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Request C++11
|
||||
# BEGIN @MEWIN - 2023-11-04 - Increased to C++17 so my changes actually work when compiling the regular way.
|
||||
# Request C++17
|
||||
if(${CMAKE_VERSION} VERSION_LESS 3.1)
|
||||
# CMake versions before 3.1 do not understand CMAKE_CXX_STANDARD
|
||||
# remove this block once CMake >=3.1 has fixated in the ecosystem
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
|
||||
else()
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
endif()
|
||||
# END @MEWIN
|
||||
|
||||
function(glslang_set_link_args TARGET)
|
||||
# For MinGW compiles, statically link against the GCC and C++ runtimes.
|
||||
@ -402,4 +404,4 @@ if(ENABLE_GLSLANG_INSTALL)
|
||||
DESTINATION
|
||||
"${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -226,7 +226,7 @@ void SpirvToolsTransform(const glslang::TIntermediate& intermediate, std::vector
|
||||
bool SpirvToolsAnalyzeDeadOutputStores(spv_target_env target_env, std::vector<unsigned int>& spirv,
|
||||
std::unordered_set<uint32_t>* live_locs,
|
||||
std::unordered_set<uint32_t>* live_builtins,
|
||||
spv::SpvBuildLogger* logger)
|
||||
[[maybe_unused]] spv::SpvBuildLogger* logger) // @MEWIN 2023-11-04 - Added [[maybe_unused]] to fix compiler warnings.
|
||||
{
|
||||
spvtools::Optimizer optimizer(target_env);
|
||||
optimizer.SetMessageConsumer(OptimizerMesssageConsumer);
|
||||
@ -242,7 +242,7 @@ bool SpirvToolsAnalyzeDeadOutputStores(spv_target_env target_env, std::vector<un
|
||||
void SpirvToolsEliminateDeadOutputStores(spv_target_env target_env, std::vector<unsigned int>& spirv,
|
||||
std::unordered_set<uint32_t>* live_locs,
|
||||
std::unordered_set<uint32_t>* live_builtins,
|
||||
spv::SpvBuildLogger* logger)
|
||||
[[maybe_unused]] spv::SpvBuildLogger* logger) // @MEWIN 2023-11-04 - Added [[maybe_unused]] to fix compiler warnings.
|
||||
{
|
||||
spvtools::Optimizer optimizer(target_env);
|
||||
optimizer.SetMessageConsumer(OptimizerMesssageConsumer);
|
||||
@ -259,7 +259,7 @@ void SpirvToolsEliminateDeadOutputStores(spv_target_env target_env, std::vector<
|
||||
}
|
||||
|
||||
void SpirvToolsEliminateDeadInputComponents(spv_target_env target_env, std::vector<unsigned int>& spirv,
|
||||
spv::SpvBuildLogger* logger)
|
||||
[[maybe_unused]] spv::SpvBuildLogger* logger) // @MEWIN 2023-11-04 - Added [[maybe_unused]] to fix compiler warnings.
|
||||
{
|
||||
spvtools::Optimizer optimizer(target_env);
|
||||
optimizer.SetMessageConsumer(OptimizerMesssageConsumer);
|
||||
|
||||
@ -239,8 +239,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
|
||||
|
||||
@ -150,17 +150,17 @@ EProfile EDesktopProfile = static_cast<EProfile>(ENoProfile | ECoreProfile | ECo
|
||||
#else
|
||||
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];
|
||||
#endif
|
||||
|
||||
@ -269,14 +269,14 @@ const BuiltInFunction BaseFunctions[] = {
|
||||
{ EOpMix, "mix", 3, TypeIU, ClassLB, Es310Desktop450 },
|
||||
#endif
|
||||
|
||||
{ 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.
|
||||
@ -330,7 +330,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
|
||||
|
||||
@ -1297,6 +1297,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:
|
||||
|
||||
@ -7173,7 +7173,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));
|
||||
|
||||
@ -7190,7 +7190,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));
|
||||
|
||||
@ -7989,6 +7989,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:
|
||||
@ -8010,6 +8011,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.
|
||||
#ifndef GLSLANG_WEB
|
||||
|
||||
case EOpConstructDVec2:
|
||||
|
||||
@ -1768,13 +1768,45 @@ TShader::TShader(EShLanguage s)
|
||||
environment.target.hlslFunctionality1 = false;
|
||||
}
|
||||
|
||||
// BEGIN @MEWIN - 2022-12-08 - Added code to allow moving TShaders (and storing them inside STL containers).
|
||||
TShader::TShader(TShader&& other)
|
||||
{
|
||||
(*this) = std::move(other);
|
||||
}
|
||||
|
||||
TShader& TShader::operator=(TShader&& other)
|
||||
{
|
||||
if (this != &other)
|
||||
{
|
||||
pool = std::exchange(other.pool, nullptr);
|
||||
stage = other.stage;
|
||||
compiler = std::exchange(other.compiler, nullptr);
|
||||
intermediate = std::exchange(other.intermediate, nullptr);
|
||||
infoSink = std::exchange(other.infoSink, nullptr);
|
||||
strings = other.strings;
|
||||
lengths = other.lengths;
|
||||
stringNames = other.stringNames;
|
||||
numStrings = other.numStrings;
|
||||
preamble = other.preamble;
|
||||
sourceEntryPointName = other.sourceEntryPointName;
|
||||
overrideVersion = other.overrideVersion;
|
||||
environment = other.environment;
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
TShader::~TShader()
|
||||
{
|
||||
delete infoSink;
|
||||
delete compiler;
|
||||
delete intermediate;
|
||||
delete pool;
|
||||
if (infoSink)
|
||||
{
|
||||
delete infoSink;
|
||||
delete compiler;
|
||||
delete intermediate;
|
||||
delete pool;
|
||||
}
|
||||
}
|
||||
// END @MEWIN
|
||||
|
||||
void TShader::setStrings(const char* const* s, int n)
|
||||
{
|
||||
|
||||
@ -173,7 +173,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<void*>(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 += '[';
|
||||
|
||||
@ -51,16 +51,16 @@ class TInfoSink;
|
||||
namespace glslang {
|
||||
|
||||
class TIntermediate;
|
||||
struct TVarEntryInfo {
|
||||
long long id;
|
||||
TIntermSymbol* symbol;
|
||||
bool live;
|
||||
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;
|
||||
int newBinding = 0;
|
||||
int newSet = 0;
|
||||
int newLocation = 0;
|
||||
int newComponent = 0;
|
||||
int newIndex = 0;
|
||||
EShLanguage stage = EShLangVertex;
|
||||
|
||||
void clearNewAssignments() {
|
||||
newBinding = -1;
|
||||
|
||||
@ -93,6 +93,7 @@ void TIntermediate::merge(TInfoSink& infoSink, TIntermediate& unit)
|
||||
mergeCallGraphs(infoSink, unit);
|
||||
mergeModes(infoSink, unit);
|
||||
mergeTrees(infoSink, unit);
|
||||
mergeSources(infoSink, unit); // @MEWIN 2023-02-22 - Added function to merge source files when linking shaders.
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -378,6 +379,37 @@ void TIntermediate::mergeTrees(TInfoSink& infoSink, TIntermediate& unit)
|
||||
ioAccessed.insert(unit.ioAccessed.begin(), unit.ioAccessed.end());
|
||||
}
|
||||
|
||||
// BEGIN @MEWIN - 2023-02-22 - Added function to merge source files when linking shaders.
|
||||
void TIntermediate::mergeSources(TInfoSink& infoSink, TIntermediate& unit)
|
||||
{
|
||||
auto addSource = [&](const char* name, const char* text, size_t len)
|
||||
{
|
||||
if (sourceFile == name) {
|
||||
return;
|
||||
}
|
||||
auto it = includeText.find(name);
|
||||
if (it != includeText.end()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (sourceText.empty())
|
||||
{
|
||||
setSourceFile(name);
|
||||
addSourceText(text, len);
|
||||
}
|
||||
else {
|
||||
addIncludeText(name, text, len);
|
||||
}
|
||||
};
|
||||
if (!unit.getSourceFile().empty()) {
|
||||
addSource(unit.getSourceFile().c_str(), unit.getSourceText().c_str(), unit.getSourceText().length());
|
||||
}
|
||||
|
||||
for (const auto& [name, text] : unit.includeText) {
|
||||
addSource(name.c_str(), text.c_str(), text.length());
|
||||
}
|
||||
}
|
||||
// END @MEWIN
|
||||
#endif
|
||||
|
||||
static const TString& getNameForIdMap(TIntermSymbol* symbol)
|
||||
|
||||
@ -1131,6 +1131,7 @@ protected:
|
||||
void mergeCallGraphs(TInfoSink&, TIntermediate&);
|
||||
void mergeModes(TInfoSink&, TIntermediate&);
|
||||
void mergeTrees(TInfoSink&, TIntermediate&);
|
||||
void mergeSources(TInfoSink&, TIntermediate&); // @MEWIN 2023-02-22 - Added function to merge source files when linking shaders.
|
||||
void seedIdMap(TIdMaps& idMaps, long long& IdShift);
|
||||
void remapIds(const TIdMaps& idMaps, long long idShift, TIntermediate&);
|
||||
void mergeBodies(TInfoSink&, TIntermSequence& globals, const TIntermSequence& unitGlobals);
|
||||
|
||||
@ -709,6 +709,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) {
|
||||
@ -716,8 +717,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;
|
||||
@ -725,11 +728,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) {
|
||||
@ -737,6 +742,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) {
|
||||
@ -744,8 +750,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;
|
||||
@ -753,11 +761,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) {
|
||||
@ -768,6 +778,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;
|
||||
@ -777,6 +788,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) {
|
||||
@ -787,6 +799,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;
|
||||
@ -796,6 +809,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;
|
||||
@ -811,6 +825,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;
|
||||
@ -820,6 +835,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) {
|
||||
@ -829,6 +846,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;
|
||||
@ -838,6 +856,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) {
|
||||
@ -847,6 +867,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;
|
||||
@ -856,6 +877,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) {
|
||||
@ -866,6 +889,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;
|
||||
@ -875,6 +899,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;
|
||||
@ -939,6 +965,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()) {
|
||||
@ -963,6 +991,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()) {
|
||||
@ -987,6 +1017,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;
|
||||
|
||||
@ -464,7 +464,14 @@ enum TBlockStorageClass
|
||||
class TShader {
|
||||
public:
|
||||
GLSLANG_EXPORT explicit TShader(EShLanguage);
|
||||
GLSLANG_EXPORT virtual ~TShader();
|
||||
// BEGIN @MEWIN - 2022-12-08 - Added code to allow moving TShaders (and storing them inside STL containers).
|
||||
GLSLANG_EXPORT TShader(const TShader&) = delete;
|
||||
GLSLANG_EXPORT TShader(TShader&& other);
|
||||
GLSLANG_EXPORT ~TShader();
|
||||
|
||||
GLSLANG_EXPORT TShader& operator=(const TShader&) = delete;
|
||||
GLSLANG_EXPORT TShader& operator=(TShader&& other);
|
||||
// END @MEWIN
|
||||
GLSLANG_EXPORT void setStrings(const char* const* s, int n);
|
||||
GLSLANG_EXPORT void setStringsWithLengths(
|
||||
const char* const* s, const int* l, int n);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user