mirror of
https://github.com/libretro/RetroArch
synced 2025-02-28 22:13:51 +00:00
(glslang) Simplifications - move nullptr to NULL
This commit is contained in:
parent
0b29d52b67
commit
354c5afab4
@ -102,7 +102,7 @@ bool InitThread()
|
||||
return false;
|
||||
}
|
||||
|
||||
glslang::SetThreadPoolAllocator(nullptr);
|
||||
glslang::SetThreadPoolAllocator(NULL);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
30
deps/glslang/glslang/SPIRV/GlslangToSpv.cpp
vendored
30
deps/glslang/glslang/SPIRV/GlslangToSpv.cpp
vendored
@ -1019,7 +1019,7 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion, const gl
|
||||
spv::SpvBuildLogger* buildLogger, glslang::SpvOptions& options)
|
||||
: TIntermTraverser(true, false, true),
|
||||
options(options),
|
||||
shaderEntry(nullptr), currentFunction(nullptr),
|
||||
shaderEntry(NULL), currentFunction(NULL),
|
||||
sequenceDepth(0), logger(buildLogger),
|
||||
builder(spvVersion, (glslang::GetKhronosToolId() << 16) | GetSpirvGeneratorVersion(), logger),
|
||||
inEntryPoint(false), entryPointTerminated(false), linkageOnly(false),
|
||||
@ -2122,8 +2122,8 @@ bool TGlslangToSpvTraverser::visitSelection(glslang::TVisit /* visit */, glslang
|
||||
// false otherwise.
|
||||
const auto bothSidesPolicy = [&]() -> bool {
|
||||
// do we have both sides?
|
||||
if (node->getTrueBlock() == nullptr ||
|
||||
node->getFalseBlock() == nullptr)
|
||||
if (node->getTrueBlock() == NULL ||
|
||||
node->getFalseBlock() == NULL)
|
||||
return false;
|
||||
|
||||
// required? (unless we write additional code to look for side effects
|
||||
@ -2223,13 +2223,13 @@ bool TGlslangToSpvTraverser::visitSelection(glslang::TVisit /* visit */, glslang
|
||||
spv::Builder::If ifBuilder(condition, control, builder);
|
||||
|
||||
// emit the "then" statement
|
||||
if (node->getTrueBlock() != nullptr) {
|
||||
if (node->getTrueBlock() != NULL) {
|
||||
node->getTrueBlock()->traverse(this);
|
||||
if (result != spv::NoResult)
|
||||
builder.createStore(accessChainLoad(node->getTrueBlock()->getAsTyped()->getType()), result);
|
||||
}
|
||||
|
||||
if (node->getFalseBlock() != nullptr) {
|
||||
if (node->getFalseBlock() != NULL) {
|
||||
ifBuilder.makeBeginElse();
|
||||
// emit the "else" statement
|
||||
node->getFalseBlock()->traverse(this);
|
||||
@ -2288,7 +2288,7 @@ bool TGlslangToSpvTraverser::visitSwitch(glslang::TVisit /* visit */, glslang::T
|
||||
// statements between the last case and the end of the switch statement
|
||||
if ((caseValues.size() && (int)codeSegments.size() == valueIndexToSegment[caseValues.size() - 1]) ||
|
||||
(int)codeSegments.size() == defaultSegment)
|
||||
codeSegments.push_back(nullptr);
|
||||
codeSegments.push_back(NULL);
|
||||
|
||||
// make the switch statement
|
||||
std::vector<spv::Block*> segmentBlocks; // returned, as the blocks allocated in the call
|
||||
@ -2873,7 +2873,7 @@ void TGlslangToSpvTraverser::decorateStructType(const glslang::TType& type,
|
||||
// nonuniform
|
||||
builder.addMemberDecoration(spvType, member, TranslateNonUniformDecoration(glslangMember.getQualifier()));
|
||||
|
||||
if (glslangIntermediate->getHlslFunctionality1() && memberQualifier.semanticName != nullptr) {
|
||||
if (glslangIntermediate->getHlslFunctionality1() && memberQualifier.semanticName != NULL) {
|
||||
builder.addExtension("SPV_GOOGLE_hlsl_functionality1");
|
||||
builder.addMemberDecoration(spvType, member, (spv::Decoration)spv::DecorationHlslSemanticGOOGLE,
|
||||
memberQualifier.semanticName);
|
||||
@ -2920,7 +2920,7 @@ spv::Id TGlslangToSpvTraverser::makeArraySizeId(const glslang::TArraySizes& arra
|
||||
{
|
||||
// First, see if this is sized with a node, meaning a specialization constant:
|
||||
glslang::TIntermTyped* specNode = arraySizes.getDimNode(dim);
|
||||
if (specNode != nullptr) {
|
||||
if (specNode != NULL) {
|
||||
builder.clearAccessChain();
|
||||
specNode->traverse(this);
|
||||
return accessChainLoad(specNode->getAsTyped()->getType());
|
||||
@ -6434,7 +6434,7 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol
|
||||
}
|
||||
#endif
|
||||
|
||||
if (glslangIntermediate->getHlslFunctionality1() && symbol->getType().getQualifier().semanticName != nullptr) {
|
||||
if (glslangIntermediate->getHlslFunctionality1() && symbol->getType().getQualifier().semanticName != NULL) {
|
||||
builder.addExtension("SPV_GOOGLE_hlsl_functionality1");
|
||||
builder.addDecoration(id, (spv::Decoration)spv::DecorationHlslSemanticGOOGLE,
|
||||
symbol->getType().getQualifier().semanticName);
|
||||
@ -6631,15 +6631,15 @@ spv::Id TGlslangToSpvTraverser::createSpvConstantFromConstUnionArray(const glsla
|
||||
bool TGlslangToSpvTraverser::isTrivialLeaf(const glslang::TIntermTyped* node)
|
||||
{
|
||||
// don't know what this is
|
||||
if (node == nullptr)
|
||||
if (node == NULL)
|
||||
return false;
|
||||
|
||||
// a constant is safe
|
||||
if (node->getAsConstantUnion() != nullptr)
|
||||
if (node->getAsConstantUnion() != NULL)
|
||||
return true;
|
||||
|
||||
// not a symbol means non-trivial
|
||||
if (node->getAsSymbolNode() == nullptr)
|
||||
if (node->getAsSymbolNode() == NULL)
|
||||
return false;
|
||||
|
||||
// a symbol, depends on what's being read
|
||||
@ -6663,7 +6663,7 @@ bool TGlslangToSpvTraverser::isTrivialLeaf(const glslang::TIntermTyped* node)
|
||||
// Return true if trivial.
|
||||
bool TGlslangToSpvTraverser::isTrivial(const glslang::TIntermTyped* node)
|
||||
{
|
||||
if (node == nullptr)
|
||||
if (node == NULL)
|
||||
return false;
|
||||
|
||||
// count non scalars as trivial, as well as anything coming from HLSL
|
||||
@ -6679,7 +6679,7 @@ bool TGlslangToSpvTraverser::isTrivial(const glslang::TIntermTyped* node)
|
||||
// not a simple operation
|
||||
const glslang::TIntermBinary* binaryNode = node->getAsBinaryNode();
|
||||
const glslang::TIntermUnary* unaryNode = node->getAsUnaryNode();
|
||||
if (binaryNode == nullptr && unaryNode == nullptr)
|
||||
if (binaryNode == NULL && unaryNode == NULL)
|
||||
return false;
|
||||
|
||||
// not on leaf nodes
|
||||
@ -6796,7 +6796,7 @@ void GlslangToSpv(const glslang::TIntermediate& intermediate, std::vector<unsign
|
||||
return;
|
||||
|
||||
glslang::SpvOptions defaultOptions;
|
||||
if (options == nullptr)
|
||||
if (options == NULL)
|
||||
options = &defaultOptions;
|
||||
|
||||
glslang::GetThreadPoolAllocator().push();
|
||||
|
4
deps/glslang/glslang/SPIRV/GlslangToSpv.h
vendored
4
deps/glslang/glslang/SPIRV/GlslangToSpv.h
vendored
@ -55,8 +55,8 @@ struct SpvOptions {
|
||||
};
|
||||
|
||||
void GlslangToSpv(const glslang::TIntermediate& intermediate, std::vector<unsigned int>& spirv,
|
||||
SpvOptions* options = nullptr);
|
||||
SpvOptions* options = NULL);
|
||||
void GlslangToSpv(const glslang::TIntermediate& intermediate, std::vector<unsigned int>& spirv,
|
||||
spv::SpvBuildLogger* logger, SpvOptions* options = nullptr);
|
||||
spv::SpvBuildLogger* logger, SpvOptions* options = NULL);
|
||||
|
||||
}
|
||||
|
@ -71,8 +71,8 @@ public:
|
||||
return;
|
||||
callback_(block);
|
||||
visited_.insert(block);
|
||||
Block* mergeBlock = nullptr;
|
||||
Block* continueBlock = nullptr;
|
||||
Block* mergeBlock = NULL;
|
||||
Block* continueBlock = NULL;
|
||||
auto mergeInst = block->getMergeInstruction();
|
||||
if (mergeInst) {
|
||||
Id mergeId = mergeInst->getIdOperand(0);
|
||||
|
2
deps/glslang/glslang/SPIRV/SpvBuilder.cpp
vendored
2
deps/glslang/glslang/SPIRV/SpvBuilder.cpp
vendored
@ -1506,7 +1506,7 @@ Id Builder::smearScalar(Decoration precision, Id scalar, Id vectorType)
|
||||
if (numComponents == 1)
|
||||
return scalar;
|
||||
|
||||
Instruction* smear = nullptr;
|
||||
Instruction* smear = NULL;
|
||||
if (generatingOpCodeForSpecConst) {
|
||||
auto members = std::vector<spv::Id>(numComponents, scalar);
|
||||
// Sometime even in spec-constant-op mode, the temporary vector created by
|
||||
|
54
deps/glslang/glslang/SPIRV/doc.cpp
vendored
54
deps/glslang/glslang/SPIRV/doc.cpp
vendored
@ -467,7 +467,7 @@ const char* ImageChannelOrderString(int format)
|
||||
case 17: return "sRGBA";
|
||||
case 18: return "sBGRA";
|
||||
|
||||
default:
|
||||
default:
|
||||
return "Bad";
|
||||
}
|
||||
}
|
||||
@ -739,7 +739,7 @@ const char* CapabilityString(int info)
|
||||
case 22: return "Int16";
|
||||
case 23: return "TessellationPointSize";
|
||||
case 24: return "GeometryPointSize";
|
||||
case 25: return "ImageGatherExtended";
|
||||
case 25: return "ImageGatherExtended";
|
||||
case 26: return "Bad";
|
||||
case 27: return "StorageImageMultisample";
|
||||
case 28: return "UniformBufferArrayDynamicIndexing";
|
||||
@ -1371,37 +1371,37 @@ void Parameterize()
|
||||
DecorationOperands[DecorationAlignment].push(OperandLiteralNumber, "'Alignment'");
|
||||
|
||||
OperandClassParams[OperandSource].set(0, SourceString, 0);
|
||||
OperandClassParams[OperandExecutionModel].set(0, ExecutionModelString, nullptr);
|
||||
OperandClassParams[OperandAddressing].set(0, AddressingString, nullptr);
|
||||
OperandClassParams[OperandMemory].set(0, MemoryString, nullptr);
|
||||
OperandClassParams[OperandExecutionModel].set(0, ExecutionModelString, NULL);
|
||||
OperandClassParams[OperandAddressing].set(0, AddressingString, NULL);
|
||||
OperandClassParams[OperandMemory].set(0, MemoryString, NULL);
|
||||
OperandClassParams[OperandExecutionMode].set(ExecutionModeCeiling, ExecutionModeString, ExecutionModeParams);
|
||||
OperandClassParams[OperandExecutionMode].setOperands(ExecutionModeOperands);
|
||||
OperandClassParams[OperandStorage].set(0, StorageClassString, nullptr);
|
||||
OperandClassParams[OperandDimensionality].set(0, DimensionString, nullptr);
|
||||
OperandClassParams[OperandSamplerAddressingMode].set(0, SamplerAddressingModeString, nullptr);
|
||||
OperandClassParams[OperandSamplerFilterMode].set(0, SamplerFilterModeString, nullptr);
|
||||
OperandClassParams[OperandSamplerImageFormat].set(0, ImageFormatString, nullptr);
|
||||
OperandClassParams[OperandImageChannelOrder].set(0, ImageChannelOrderString, nullptr);
|
||||
OperandClassParams[OperandImageChannelDataType].set(0, ImageChannelDataTypeString, nullptr);
|
||||
OperandClassParams[OperandStorage].set(0, StorageClassString, NULL);
|
||||
OperandClassParams[OperandDimensionality].set(0, DimensionString, NULL);
|
||||
OperandClassParams[OperandSamplerAddressingMode].set(0, SamplerAddressingModeString, NULL);
|
||||
OperandClassParams[OperandSamplerFilterMode].set(0, SamplerFilterModeString, NULL);
|
||||
OperandClassParams[OperandSamplerImageFormat].set(0, ImageFormatString, NULL);
|
||||
OperandClassParams[OperandImageChannelOrder].set(0, ImageChannelOrderString, NULL);
|
||||
OperandClassParams[OperandImageChannelDataType].set(0, ImageChannelDataTypeString, NULL);
|
||||
OperandClassParams[OperandImageOperands].set(ImageOperandsCeiling, ImageOperandsString, ImageOperandsParams, true);
|
||||
OperandClassParams[OperandFPFastMath].set(0, FPFastMathString, nullptr, true);
|
||||
OperandClassParams[OperandFPRoundingMode].set(0, FPRoundingModeString, nullptr);
|
||||
OperandClassParams[OperandLinkageType].set(0, LinkageTypeString, nullptr);
|
||||
OperandClassParams[OperandFuncParamAttr].set(0, FuncParamAttrString, nullptr);
|
||||
OperandClassParams[OperandAccessQualifier].set(0, AccessQualifierString, nullptr);
|
||||
OperandClassParams[OperandFPFastMath].set(0, FPFastMathString, NULL, true);
|
||||
OperandClassParams[OperandFPRoundingMode].set(0, FPRoundingModeString, NULL);
|
||||
OperandClassParams[OperandLinkageType].set(0, LinkageTypeString, NULL);
|
||||
OperandClassParams[OperandFuncParamAttr].set(0, FuncParamAttrString, NULL);
|
||||
OperandClassParams[OperandAccessQualifier].set(0, AccessQualifierString, NULL);
|
||||
OperandClassParams[OperandDecoration].set(DecorationCeiling, DecorationString, DecorationParams);
|
||||
OperandClassParams[OperandDecoration].setOperands(DecorationOperands);
|
||||
OperandClassParams[OperandBuiltIn].set(0, BuiltInString, nullptr);
|
||||
OperandClassParams[OperandBuiltIn].set(0, BuiltInString, NULL);
|
||||
OperandClassParams[OperandSelect].set(SelectControlCeiling, SelectControlString, SelectionControlParams, true);
|
||||
OperandClassParams[OperandLoop].set(LoopControlCeiling, LoopControlString, LoopControlParams, true);
|
||||
OperandClassParams[OperandFunction].set(FunctionControlCeiling, FunctionControlString, FunctionControlParams, true);
|
||||
OperandClassParams[OperandMemorySemantics].set(0, MemorySemanticsString, nullptr, true);
|
||||
OperandClassParams[OperandMemoryAccess].set(0, MemoryAccessString, nullptr, true);
|
||||
OperandClassParams[OperandScope].set(0, ScopeString, nullptr);
|
||||
OperandClassParams[OperandGroupOperation].set(0, GroupOperationString, nullptr);
|
||||
OperandClassParams[OperandKernelEnqueueFlags].set(0, KernelEnqueueFlagsString, nullptr);
|
||||
OperandClassParams[OperandKernelProfilingInfo].set(0, KernelProfilingInfoString, nullptr, true);
|
||||
OperandClassParams[OperandCapability].set(0, CapabilityString, nullptr);
|
||||
OperandClassParams[OperandMemorySemantics].set(0, MemorySemanticsString, NULL, true);
|
||||
OperandClassParams[OperandMemoryAccess].set(0, MemoryAccessString, NULL, true);
|
||||
OperandClassParams[OperandScope].set(0, ScopeString, NULL);
|
||||
OperandClassParams[OperandGroupOperation].set(0, GroupOperationString, NULL);
|
||||
OperandClassParams[OperandKernelEnqueueFlags].set(0, KernelEnqueueFlagsString, NULL);
|
||||
OperandClassParams[OperandKernelProfilingInfo].set(0, KernelProfilingInfoString, NULL, true);
|
||||
OperandClassParams[OperandCapability].set(0, CapabilityString, NULL);
|
||||
OperandClassParams[OperandOpcode].set(OpCodeMask + 1, OpcodeString, 0);
|
||||
|
||||
// set name of operator, an initial set of <id> style operands, and the description
|
||||
@ -1943,11 +1943,11 @@ void Parameterize()
|
||||
InstructionDesc[OpBitFieldSExtract].operands.push(OperandId, "'Base'");
|
||||
InstructionDesc[OpBitFieldSExtract].operands.push(OperandId, "'Offset'");
|
||||
InstructionDesc[OpBitFieldSExtract].operands.push(OperandId, "'Count'");
|
||||
|
||||
|
||||
InstructionDesc[OpBitFieldUExtract].operands.push(OperandId, "'Base'");
|
||||
InstructionDesc[OpBitFieldUExtract].operands.push(OperandId, "'Offset'");
|
||||
InstructionDesc[OpBitFieldUExtract].operands.push(OperandId, "'Count'");
|
||||
|
||||
|
||||
InstructionDesc[OpBitReverse].operands.push(OperandId, "'Base'");
|
||||
|
||||
InstructionDesc[OpBitCount].operands.push(OperandId, "'Base'");
|
||||
|
2
deps/glslang/glslang/SPIRV/hex_float.h
vendored
2
deps/glslang/glslang/SPIRV/hex_float.h
vendored
@ -643,7 +643,7 @@ inline uint8_t get_nibble_from_character(int character) {
|
||||
const char* dec = "0123456789";
|
||||
const char* lower = "abcdef";
|
||||
const char* upper = "ABCDEF";
|
||||
const char* p = nullptr;
|
||||
const char* p = NULL;
|
||||
if ((p = strchr(dec, character)))
|
||||
return static_cast<uint8_t>(p - dec);
|
||||
else if ((p = strchr(lower, character)))
|
||||
|
13
deps/glslang/glslang/SPIRV/spvIR.h
vendored
13
deps/glslang/glslang/SPIRV/spvIR.h
vendored
@ -84,8 +84,8 @@ const MemorySemanticsMask MemorySemanticsAllMemory =
|
||||
|
||||
class Instruction {
|
||||
public:
|
||||
Instruction(Id resultId, Id typeId, Op opCode) : resultId(resultId), typeId(typeId), opCode(opCode), block(nullptr) { }
|
||||
explicit Instruction(Op opCode) : resultId(NoResult), typeId(NoType), opCode(opCode), block(nullptr) { }
|
||||
Instruction(Id resultId, Id typeId, Op opCode) : resultId(resultId), typeId(typeId), opCode(opCode), block(NULL) { }
|
||||
explicit Instruction(Op opCode) : resultId(NoResult), typeId(NoType), opCode(opCode), block(NULL) { }
|
||||
virtual ~Instruction() {}
|
||||
void addIdOperand(Id id) { operands.push_back(id); }
|
||||
void addImmediateOperand(unsigned int immediate) { operands.push_back(immediate); }
|
||||
@ -182,16 +182,17 @@ public:
|
||||
bool isUnreachable() const { return unreachable; }
|
||||
// Returns the block's merge instruction, if one exists (otherwise null).
|
||||
const Instruction* getMergeInstruction() const {
|
||||
if (instructions.size() < 2) return nullptr;
|
||||
if (instructions.size() < 2) return NULL;
|
||||
const Instruction* nextToLast = (instructions.cend() - 2)->get();
|
||||
switch (nextToLast->getOpCode()) {
|
||||
switch (nextToLast->getOpCode())
|
||||
{
|
||||
case OpSelectionMerge:
|
||||
case OpLoopMerge:
|
||||
return nextToLast;
|
||||
default:
|
||||
return nullptr;
|
||||
break;
|
||||
}
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool isTerminated() const
|
||||
|
@ -222,12 +222,12 @@ inline const TString String(const int i, const int /*base*/ = 10)
|
||||
#endif
|
||||
|
||||
struct TSourceLoc {
|
||||
void init() { name = nullptr; string = 0; line = 0; column = 0; }
|
||||
void init() { name = NULL; string = 0; line = 0; column = 0; }
|
||||
void init(int stringNum) { init(); string = stringNum; }
|
||||
// Returns the name if it exists. Otherwise, returns the string number.
|
||||
std::string getStringNameOrNum(bool quoteStringName = true) const
|
||||
{
|
||||
if (name != nullptr)
|
||||
if (name != NULL)
|
||||
return quoteStringName ? ("\"" + std::string(name) + "\"") : name;
|
||||
return std::to_string((long long)string);
|
||||
}
|
||||
|
@ -846,13 +846,13 @@ class TConstUnionArray {
|
||||
public:
|
||||
POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator())
|
||||
|
||||
TConstUnionArray() : unionArray(nullptr) { }
|
||||
TConstUnionArray() : unionArray(NULL) { }
|
||||
virtual ~TConstUnionArray() { }
|
||||
|
||||
explicit TConstUnionArray(int size)
|
||||
{
|
||||
if (size == 0)
|
||||
unionArray = nullptr;
|
||||
unionArray = NULL;
|
||||
else
|
||||
unionArray = new TConstUnionVector(size);
|
||||
}
|
||||
@ -894,7 +894,7 @@ public:
|
||||
return sum;
|
||||
}
|
||||
|
||||
bool empty() const { return unionArray == nullptr; }
|
||||
bool empty() const { return unionArray == NULL; }
|
||||
|
||||
protected:
|
||||
typedef TVector<TConstUnion> TConstUnionVector;
|
||||
|
52
deps/glslang/glslang/glslang/Include/Types.h
vendored
52
deps/glslang/glslang/glslang/Include/Types.h
vendored
@ -431,7 +431,7 @@ public:
|
||||
// drop qualifiers that don't belong in a temporary variable
|
||||
void makeTemporary()
|
||||
{
|
||||
semanticName = nullptr;
|
||||
semanticName = NULL;
|
||||
storage = EvqTemporary;
|
||||
builtIn = EbvNone;
|
||||
clearInterstage();
|
||||
@ -1119,8 +1119,8 @@ public:
|
||||
vectorSize = 1;
|
||||
matrixRows = 0;
|
||||
matrixCols = 0;
|
||||
arraySizes = nullptr;
|
||||
userDef = nullptr;
|
||||
arraySizes = NULL;
|
||||
userDef = NULL;
|
||||
loc = l;
|
||||
}
|
||||
|
||||
@ -1155,7 +1155,7 @@ public:
|
||||
|
||||
bool isScalar() const
|
||||
{
|
||||
return matrixCols == 0 && vectorSize == 1 && arraySizes == nullptr && userDef == nullptr;
|
||||
return matrixCols == 0 && vectorSize == 1 && arraySizes == NULL && userDef == NULL;
|
||||
}
|
||||
|
||||
// "Image" is a superset of "Subpass"
|
||||
@ -1174,7 +1174,7 @@ public:
|
||||
explicit TType(TBasicType t = EbtVoid, TStorageQualifier q = EvqTemporary, int vs = 1, int mc = 0, int mr = 0,
|
||||
bool isVector = false) :
|
||||
basicType(t), vectorSize(vs), matrixCols(mc), matrixRows(mr), vector1(isVector && vs == 1),
|
||||
arraySizes(nullptr), structure(nullptr), fieldName(nullptr), typeName(nullptr)
|
||||
arraySizes(NULL), structure(NULL), fieldName(NULL), typeName(NULL)
|
||||
{
|
||||
sampler.clear();
|
||||
qualifier.clear();
|
||||
@ -1184,7 +1184,7 @@ public:
|
||||
TType(TBasicType t, TStorageQualifier q, TPrecisionQualifier p, int vs = 1, int mc = 0, int mr = 0,
|
||||
bool isVector = false) :
|
||||
basicType(t), vectorSize(vs), matrixCols(mc), matrixRows(mr), vector1(isVector && vs == 1),
|
||||
arraySizes(nullptr), structure(nullptr), fieldName(nullptr), typeName(nullptr)
|
||||
arraySizes(NULL), structure(NULL), fieldName(NULL), typeName(NULL)
|
||||
{
|
||||
sampler.clear();
|
||||
qualifier.clear();
|
||||
@ -1195,7 +1195,7 @@ public:
|
||||
explicit TType(const TPublicType& p) :
|
||||
basicType(p.basicType),
|
||||
vectorSize(p.vectorSize), matrixCols(p.matrixCols), matrixRows(p.matrixRows), vector1(false),
|
||||
arraySizes(p.arraySizes), structure(nullptr), fieldName(nullptr), typeName(nullptr)
|
||||
arraySizes(p.arraySizes), structure(NULL), fieldName(NULL), typeName(NULL)
|
||||
{
|
||||
if (basicType == EbtSampler)
|
||||
sampler = p.sampler;
|
||||
@ -1208,9 +1208,9 @@ public:
|
||||
}
|
||||
}
|
||||
// for construction of sampler types
|
||||
TType(const TSampler& sampler, TStorageQualifier q = EvqUniform, TArraySizes* as = nullptr) :
|
||||
TType(const TSampler& sampler, TStorageQualifier q = EvqUniform, TArraySizes* as = NULL) :
|
||||
basicType(EbtSampler), vectorSize(1), matrixCols(0), matrixRows(0), vector1(false),
|
||||
arraySizes(as), structure(nullptr), fieldName(nullptr), typeName(nullptr),
|
||||
arraySizes(as), structure(NULL), fieldName(NULL), typeName(NULL),
|
||||
sampler(sampler)
|
||||
{
|
||||
qualifier.clear();
|
||||
@ -1224,7 +1224,7 @@ public:
|
||||
if (type.isArray()) {
|
||||
shallowCopy(type);
|
||||
if (type.getArraySizes()->getNumDims() == 1) {
|
||||
arraySizes = nullptr;
|
||||
arraySizes = NULL;
|
||||
} else {
|
||||
// want our own copy of the array, so we can edit it
|
||||
arraySizes = new TArraySizes;
|
||||
@ -1258,7 +1258,7 @@ public:
|
||||
// for making structures, ...
|
||||
TType(TTypeList* userDef, const TString& n) :
|
||||
basicType(EbtStruct), vectorSize(1), matrixCols(0), matrixRows(0), vector1(false),
|
||||
arraySizes(nullptr), structure(userDef), fieldName(nullptr)
|
||||
arraySizes(NULL), structure(userDef), fieldName(NULL)
|
||||
{
|
||||
sampler.clear();
|
||||
qualifier.clear();
|
||||
@ -1267,7 +1267,7 @@ public:
|
||||
// For interface blocks
|
||||
TType(TTypeList* userDef, const TString& n, const TQualifier& q) :
|
||||
basicType(EbtBlock), vectorSize(1), matrixCols(0), matrixRows(0), vector1(false),
|
||||
qualifier(q), arraySizes(nullptr), structure(userDef), fieldName(nullptr)
|
||||
qualifier(q), arraySizes(NULL), structure(userDef), fieldName(NULL)
|
||||
{
|
||||
sampler.clear();
|
||||
typeName = NewPoolTString(n.c_str());
|
||||
@ -1346,7 +1346,7 @@ public:
|
||||
virtual int getOuterArraySize() const { return arraySizes->getOuterSize(); }
|
||||
virtual TIntermTyped* getOuterArrayNode() const { return arraySizes->getOuterNode(); }
|
||||
virtual int getCumulativeArraySize() const { return arraySizes->getCumulativeSize(); }
|
||||
virtual bool isArrayOfArrays() const { return arraySizes != nullptr && arraySizes->getNumDims() > 1; }
|
||||
virtual bool isArrayOfArrays() const { return arraySizes != NULL && arraySizes->getNumDims() > 1; }
|
||||
virtual int getImplicitArraySize() const { return arraySizes->getImplicitSize(); }
|
||||
virtual const TArraySizes* getArraySizes() const { return arraySizes; }
|
||||
virtual TArraySizes* getArraySizes() { return arraySizes; }
|
||||
@ -1355,13 +1355,13 @@ public:
|
||||
virtual bool isScalarOrVec1() const { return isScalar() || vector1; }
|
||||
virtual bool isVector() const { return vectorSize > 1 || vector1; }
|
||||
virtual bool isMatrix() const { return matrixCols ? true : false; }
|
||||
virtual bool isArray() const { return arraySizes != nullptr; }
|
||||
virtual bool isArray() const { return arraySizes != NULL; }
|
||||
virtual bool isSizedArray() const { return isArray() && arraySizes->isSized(); }
|
||||
virtual bool isUnsizedArray() const { return isArray() && !arraySizes->isSized(); }
|
||||
virtual bool isArrayVariablyIndexed() const { return arraySizes->isVariablyIndexed(); }
|
||||
virtual void setArrayVariablyIndexed() { arraySizes->setVariablyIndexed(); }
|
||||
virtual void updateImplicitArraySize(int size) { arraySizes->updateImplicitSize(size); }
|
||||
virtual bool isStruct() const { return structure != nullptr; }
|
||||
virtual bool isStruct() const { return structure != NULL; }
|
||||
virtual bool isFloatingDomain() const { return basicType == EbtFloat || basicType == EbtDouble || basicType == EbtFloat16; }
|
||||
virtual bool isIntegerDomain() const
|
||||
{
|
||||
@ -1498,15 +1498,15 @@ public:
|
||||
}
|
||||
void clearArraySizes()
|
||||
{
|
||||
arraySizes = nullptr;
|
||||
arraySizes = NULL;
|
||||
}
|
||||
|
||||
// Add inner array sizes, to any existing sizes, via copy; the
|
||||
// sizes passed in can still be reused for other purposes.
|
||||
void copyArrayInnerSizes(const TArraySizes* s)
|
||||
{
|
||||
if (s != nullptr) {
|
||||
if (arraySizes == nullptr)
|
||||
if (s != NULL) {
|
||||
if (arraySizes == NULL)
|
||||
copyArraySizes(*s);
|
||||
else
|
||||
arraySizes->addInnerSizes(*s);
|
||||
@ -1783,7 +1783,7 @@ public:
|
||||
else
|
||||
components = vectorSize;
|
||||
|
||||
if (arraySizes != nullptr) {
|
||||
if (arraySizes != NULL) {
|
||||
components *= arraySizes->getCumulativeSize();
|
||||
}
|
||||
|
||||
@ -1807,12 +1807,12 @@ public:
|
||||
//
|
||||
bool sameStructType(const TType& right) const
|
||||
{
|
||||
// Most commonly, they are both nullptr, or the same pointer to the same actual structure
|
||||
// Most commonly, they are both NULL, or the same pointer to the same actual structure
|
||||
if (structure == right.structure)
|
||||
return true;
|
||||
|
||||
// Both being nullptr was caught above, now they both have to be structures of the same number of elements
|
||||
if (structure == nullptr || right.structure == nullptr ||
|
||||
// Both being NULL was caught above, now they both have to be structures of the same number of elements
|
||||
if (structure == NULL || right.structure == NULL ||
|
||||
structure->size() != right.structure->size())
|
||||
return false;
|
||||
|
||||
@ -1841,8 +1841,8 @@ public:
|
||||
// See if two type's arrayness match
|
||||
bool sameArrayness(const TType& right) const
|
||||
{
|
||||
return ((arraySizes == nullptr && right.arraySizes == nullptr) ||
|
||||
(arraySizes != nullptr && right.arraySizes != nullptr && *arraySizes == *right.arraySizes));
|
||||
return ((arraySizes == NULL && right.arraySizes == NULL) ||
|
||||
(arraySizes != NULL && right.arraySizes != NULL && *arraySizes == *right.arraySizes));
|
||||
}
|
||||
|
||||
// See if two type's arrayness match in everything except their outer dimension
|
||||
@ -1927,8 +1927,8 @@ protected:
|
||||
// from a scalar.
|
||||
TQualifier qualifier;
|
||||
|
||||
TArraySizes* arraySizes; // nullptr unless an array; can be shared across types
|
||||
TTypeList* structure; // nullptr unless this is a struct; can be shared across types
|
||||
TArraySizes* arraySizes; // NULL unless an array; can be shared across types
|
||||
TTypeList* structure; // NULL unless this is a struct; can be shared across types
|
||||
TString *fieldName; // for structure field names
|
||||
TString *typeName; // for structure type name
|
||||
TSampler sampler;
|
||||
|
26
deps/glslang/glslang/glslang/Include/arrays.h
vendored
26
deps/glslang/glslang/glslang/Include/arrays.h
vendored
@ -56,12 +56,12 @@ extern bool SameSpecializationConstants(TIntermTyped*, TIntermTyped*);
|
||||
// size and specialization constant nodes are the same.
|
||||
struct TArraySize {
|
||||
unsigned int size;
|
||||
TIntermTyped* node; // nullptr means no specialization constant node
|
||||
TIntermTyped* node; // NULL means no specialization constant node
|
||||
bool operator==(const TArraySize& rhs) const
|
||||
{
|
||||
if (size != rhs.size)
|
||||
return false;
|
||||
if (node == nullptr || rhs.node == nullptr)
|
||||
if (node == NULL || rhs.node == NULL)
|
||||
return node == rhs.node;
|
||||
|
||||
return SameSpecializationConstants(node, rhs.node);
|
||||
@ -82,14 +82,14 @@ struct TSmallArrayVector {
|
||||
//
|
||||
POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator())
|
||||
|
||||
TSmallArrayVector() : sizes(nullptr) { }
|
||||
TSmallArrayVector() : sizes(NULL) { }
|
||||
virtual ~TSmallArrayVector() { dealloc(); }
|
||||
|
||||
// For breaking into two non-shared copies, independently modifiable.
|
||||
TSmallArrayVector& operator=(const TSmallArrayVector& from)
|
||||
{
|
||||
if (from.sizes == nullptr)
|
||||
sizes = nullptr;
|
||||
if (from.sizes == NULL)
|
||||
sizes = NULL;
|
||||
else {
|
||||
alloc();
|
||||
*sizes = *from.sizes;
|
||||
@ -100,7 +100,7 @@ struct TSmallArrayVector {
|
||||
|
||||
int size() const
|
||||
{
|
||||
if (sizes == nullptr)
|
||||
if (sizes == NULL)
|
||||
return 0;
|
||||
return (int)sizes->size();
|
||||
}
|
||||
@ -170,9 +170,9 @@ struct TSmallArrayVector {
|
||||
|
||||
bool operator==(const TSmallArrayVector& rhs) const
|
||||
{
|
||||
if (sizes == nullptr && rhs.sizes == nullptr)
|
||||
if (sizes == NULL && rhs.sizes == NULL)
|
||||
return true;
|
||||
if (sizes == nullptr || rhs.sizes == nullptr)
|
||||
if (sizes == NULL || rhs.sizes == NULL)
|
||||
return false;
|
||||
return *sizes == *rhs.sizes;
|
||||
}
|
||||
@ -183,13 +183,13 @@ protected:
|
||||
|
||||
void alloc()
|
||||
{
|
||||
if (sizes == nullptr)
|
||||
if (sizes == NULL)
|
||||
sizes = new TVector<TArraySize>;
|
||||
}
|
||||
void dealloc()
|
||||
{
|
||||
delete sizes;
|
||||
sizes = nullptr;
|
||||
sizes = NULL;
|
||||
}
|
||||
|
||||
TVector<TArraySize>* sizes; // will either hold such a pointer, or in the future, hold the two array sizes
|
||||
@ -240,7 +240,7 @@ struct TArraySizes {
|
||||
return size;
|
||||
}
|
||||
void addInnerSize() { addInnerSize((unsigned)UnsizedArraySize); }
|
||||
void addInnerSize(int s) { addInnerSize((unsigned)s, nullptr); }
|
||||
void addInnerSize(int s) { addInnerSize((unsigned)s, NULL); }
|
||||
void addInnerSize(int s, TIntermTyped* n) { sizes.push_back((unsigned)s, n); }
|
||||
void addInnerSize(TArraySize pair) { sizes.push_back(pair.size, pair.node); }
|
||||
void addInnerSizes(const TArraySizes& s) { sizes.push_back(s.sizes); }
|
||||
@ -268,7 +268,7 @@ struct TArraySizes {
|
||||
bool isInnerSpecialization() const
|
||||
{
|
||||
for (int d = 1; d < sizes.size(); ++d) {
|
||||
if (sizes.getDimNode(d) != nullptr)
|
||||
if (sizes.getDimNode(d) != NULL)
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -276,7 +276,7 @@ struct TArraySizes {
|
||||
}
|
||||
bool isOuterSpecialization()
|
||||
{
|
||||
return sizes.getDimNode(0) != nullptr;
|
||||
return sizes.getDimNode(0) != NULL;
|
||||
}
|
||||
|
||||
bool hasUnsized() const { return getOuterSize() == UnsizedArraySize || isInnerUnsized(); }
|
||||
|
@ -1158,7 +1158,7 @@ public:
|
||||
// it is essential to use "symbol = sym" to assign to symbol
|
||||
TIntermSymbol(int i, const TString& n, const TType& t)
|
||||
: TIntermTyped(t), id(i),
|
||||
constSubtree(nullptr)
|
||||
constSubtree(NULL)
|
||||
{ name = n; }
|
||||
virtual int getId() const { return id; }
|
||||
virtual const TString& getName() const { return name; }
|
||||
@ -1471,8 +1471,8 @@ typedef TVector<TStorageQualifier> TQualifierList;
|
||||
//
|
||||
class TIntermAggregate : public TIntermOperator {
|
||||
public:
|
||||
TIntermAggregate() : TIntermOperator(EOpNull), userDefined(false), pragmaTable(nullptr) { }
|
||||
TIntermAggregate(TOperator o) : TIntermOperator(o), pragmaTable(nullptr) { }
|
||||
TIntermAggregate() : TIntermOperator(EOpNull), userDefined(false), pragmaTable(NULL) { }
|
||||
TIntermAggregate(TOperator o) : TIntermOperator(o), pragmaTable(NULL) { }
|
||||
~TIntermAggregate() { delete pragmaTable; }
|
||||
virtual TIntermAggregate* getAsAggregate() { return this; }
|
||||
virtual const TIntermAggregate* getAsAggregate() const { return this; }
|
||||
|
@ -701,7 +701,7 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType)
|
||||
//
|
||||
TIntermTyped* TIntermediate::fold(TIntermAggregate* aggrNode)
|
||||
{
|
||||
if (aggrNode == nullptr)
|
||||
if (aggrNode == NULL)
|
||||
return aggrNode;
|
||||
|
||||
if (! areAllChildConst(aggrNode))
|
||||
|
@ -41,7 +41,7 @@ namespace glslang {
|
||||
void TInfoSinkBase::append(const char* s)
|
||||
{
|
||||
if (outputStream & EString) {
|
||||
if (s == nullptr)
|
||||
if (s == NULL)
|
||||
sink.append("(null)");
|
||||
else {
|
||||
checkMem(strlen(s));
|
||||
|
@ -103,7 +103,7 @@ TIntermSymbol* TIntermediate::addSymbol(const TType& type, const TSourceLoc& loc
|
||||
{
|
||||
TConstUnionArray unionArray; // just a null constant
|
||||
|
||||
return addSymbol(0, "", type, unionArray, nullptr, loc);
|
||||
return addSymbol(0, "", type, unionArray, NULL, loc);
|
||||
}
|
||||
|
||||
//
|
||||
@ -111,26 +111,26 @@ TIntermSymbol* TIntermediate::addSymbol(const TType& type, const TSourceLoc& loc
|
||||
//
|
||||
// Returns the added node.
|
||||
//
|
||||
// Returns nullptr if the working conversions and promotions could not be found.
|
||||
// Returns NULL if the working conversions and promotions could not be found.
|
||||
//
|
||||
TIntermTyped* TIntermediate::addBinaryMath(TOperator op, TIntermTyped* left, TIntermTyped* right, TSourceLoc loc)
|
||||
{
|
||||
// No operations work on blocks
|
||||
if (left->getType().getBasicType() == EbtBlock || right->getType().getBasicType() == EbtBlock)
|
||||
return nullptr;
|
||||
return NULL;
|
||||
|
||||
// Try converting the children's base types to compatible types.
|
||||
auto children = addConversion(op, left, right);
|
||||
left = std::get<0>(children);
|
||||
right = std::get<1>(children);
|
||||
|
||||
if (left == nullptr || right == nullptr)
|
||||
return nullptr;
|
||||
if (left == NULL || right == NULL)
|
||||
return NULL;
|
||||
|
||||
// Convert the children's type shape to be compatible.
|
||||
addBiShapeConversion(op, left, right);
|
||||
if (left == nullptr || right == nullptr)
|
||||
return nullptr;
|
||||
if (left == NULL || right == NULL)
|
||||
return NULL;
|
||||
|
||||
//
|
||||
// Need a new node holding things together. Make
|
||||
@ -138,7 +138,7 @@ TIntermTyped* TIntermediate::addBinaryMath(TOperator op, TIntermTyped* left, TIn
|
||||
//
|
||||
TIntermBinary* node = addBinaryNode(op, left, right, loc);
|
||||
if (! promote(node))
|
||||
return nullptr;
|
||||
return NULL;
|
||||
|
||||
node->updatePrecision();
|
||||
|
||||
@ -222,24 +222,24 @@ TIntermUnary* TIntermediate::addUnaryNode(TOperator op, TIntermTyped* child, TSo
|
||||
//
|
||||
// Returns the added node.
|
||||
//
|
||||
// Returns nullptr if the 'right' type could not be converted to match the 'left' type,
|
||||
// Returns NULL if the 'right' type could not be converted to match the 'left' type,
|
||||
// or the resulting operation cannot be properly promoted.
|
||||
//
|
||||
TIntermTyped* TIntermediate::addAssign(TOperator op, TIntermTyped* left, TIntermTyped* right, TSourceLoc loc)
|
||||
{
|
||||
// No block assignment
|
||||
if (left->getType().getBasicType() == EbtBlock || right->getType().getBasicType() == EbtBlock)
|
||||
return nullptr;
|
||||
return NULL;
|
||||
|
||||
//
|
||||
// Like adding binary math, except the conversion can only go
|
||||
// from right to left.
|
||||
//
|
||||
|
||||
// convert base types, nullptr return means not possible
|
||||
// convert base types, NULL return means not possible
|
||||
right = addConversion(op, left->getType(), right);
|
||||
if (right == nullptr)
|
||||
return nullptr;
|
||||
if (right == NULL)
|
||||
return NULL;
|
||||
|
||||
// convert shape
|
||||
right = addUniShapeConversion(op, left->getType(), right);
|
||||
@ -248,7 +248,7 @@ TIntermTyped* TIntermediate::addAssign(TOperator op, TIntermTyped* left, TInterm
|
||||
TIntermBinary* node = addBinaryNode(op, left, right, loc);
|
||||
|
||||
if (! promote(node))
|
||||
return nullptr;
|
||||
return NULL;
|
||||
|
||||
node->updatePrecision();
|
||||
|
||||
@ -276,10 +276,10 @@ TIntermTyped* TIntermediate::addIndex(TOperator op, TIntermTyped* base, TIntermT
|
||||
TIntermTyped* TIntermediate::addUnaryMath(TOperator op, TIntermTyped* child, TSourceLoc loc)
|
||||
{
|
||||
if (child == 0)
|
||||
return nullptr;
|
||||
return NULL;
|
||||
|
||||
if (child->getType().getBasicType() == EbtBlock)
|
||||
return nullptr;
|
||||
return NULL;
|
||||
|
||||
switch (op) {
|
||||
case EOpLogicalNot:
|
||||
@ -288,7 +288,7 @@ TIntermTyped* TIntermediate::addUnaryMath(TOperator op, TIntermTyped* child, TSo
|
||||
}
|
||||
|
||||
if (child->getType().getBasicType() != EbtBool || child->getType().isMatrix() || child->getType().isArray() || child->getType().isVector()) {
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
break;
|
||||
|
||||
@ -298,7 +298,7 @@ TIntermTyped* TIntermediate::addUnaryMath(TOperator op, TIntermTyped* child, TSo
|
||||
case EOpPreDecrement:
|
||||
case EOpNegative:
|
||||
if (child->getType().getBasicType() == EbtStruct || child->getType().isArray())
|
||||
return nullptr;
|
||||
return NULL;
|
||||
default: break; // some compilers want this
|
||||
}
|
||||
|
||||
@ -328,8 +328,8 @@ TIntermTyped* TIntermediate::addUnaryMath(TOperator op, TIntermTyped* child, TSo
|
||||
child->getMatrixRows(),
|
||||
child->isVector()),
|
||||
child);
|
||||
if (child == nullptr)
|
||||
return nullptr;
|
||||
if (child == NULL)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
//
|
||||
@ -359,7 +359,7 @@ TIntermTyped* TIntermediate::addUnaryMath(TOperator op, TIntermTyped* child, TSo
|
||||
TIntermUnary* node = addUnaryNode(op, child, loc);
|
||||
|
||||
if (! promote(node))
|
||||
return nullptr;
|
||||
return NULL;
|
||||
|
||||
node->updatePrecision();
|
||||
|
||||
@ -389,8 +389,8 @@ TIntermTyped* TIntermediate::addBuiltInFunctionCall(const TSourceLoc& loc, TOper
|
||||
// including constness (which would differ from the prototype).
|
||||
//
|
||||
TIntermTyped* child = childNode->getAsTyped();
|
||||
if (child == nullptr)
|
||||
return nullptr;
|
||||
if (child == NULL)
|
||||
return NULL;
|
||||
|
||||
if (child->getAsConstantUnion()) {
|
||||
TIntermTyped* folded = child->getAsConstantUnion()->fold(op, returnType);
|
||||
@ -424,9 +424,9 @@ TIntermTyped* TIntermediate::setAggregateOperator(TIntermNode* node, TOperator o
|
||||
//
|
||||
// Make sure we have an aggregate. If not turn it into one.
|
||||
//
|
||||
if (node != nullptr) {
|
||||
if (node != NULL) {
|
||||
aggNode = node->getAsAggregate();
|
||||
if (aggNode == nullptr || aggNode->getOp() != EOpNull) {
|
||||
if (aggNode == NULL || aggNode->getOp() != EOpNull) {
|
||||
//
|
||||
// Make an aggregate containing this node.
|
||||
//
|
||||
@ -471,7 +471,7 @@ bool TIntermediate::isConversionAllowed(TOperator op, TIntermTyped* node) const
|
||||
// samplers can get assigned via a sampler constructor
|
||||
// (well, not yet, but code in the rest of this function is ready for it)
|
||||
if (node->getBasicType() == EbtSampler && op == EOpAssign &&
|
||||
node->getAsOperator() != nullptr && node->getAsOperator()->getOp() == EOpConstructTextureSampler)
|
||||
node->getAsOperator() != NULL && node->getAsOperator()->getOp() == EOpConstructTextureSampler)
|
||||
break;
|
||||
|
||||
// otherwise, opaque types can't even be operated on, let alone converted
|
||||
@ -491,7 +491,7 @@ TIntermUnary* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped
|
||||
//
|
||||
// Add a new newNode for the conversion.
|
||||
//
|
||||
TIntermUnary* newNode = nullptr;
|
||||
TIntermUnary* newNode = NULL;
|
||||
|
||||
TOperator newOp = EOpNull;
|
||||
|
||||
@ -510,7 +510,7 @@ TIntermUnary* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped
|
||||
case EbtInt64: newOp = EOpConvInt64ToDouble; break;
|
||||
case EbtUint64: newOp = EOpConvUint64ToDouble; break;
|
||||
default:
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
break;
|
||||
case EbtFloat:
|
||||
@ -527,7 +527,7 @@ TIntermUnary* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped
|
||||
case EbtInt64: newOp = EOpConvInt64ToFloat; break;
|
||||
case EbtUint64: newOp = EOpConvUint64ToFloat; break;
|
||||
default:
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
break;
|
||||
case EbtFloat16:
|
||||
@ -544,7 +544,7 @@ TIntermUnary* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped
|
||||
case EbtInt64: newOp = EOpConvInt64ToFloat16; break;
|
||||
case EbtUint64: newOp = EOpConvUint64ToFloat16; break;
|
||||
default:
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
break;
|
||||
case EbtBool:
|
||||
@ -561,7 +561,7 @@ TIntermUnary* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped
|
||||
case EbtInt64: newOp = EOpConvInt64ToBool; break;
|
||||
case EbtUint64: newOp = EOpConvUint64ToBool; break;
|
||||
default:
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
break;
|
||||
case EbtInt8:
|
||||
@ -578,7 +578,7 @@ TIntermUnary* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped
|
||||
case EbtDouble: newOp = EOpConvDoubleToInt8; break;
|
||||
case EbtFloat16: newOp = EOpConvFloat16ToInt8; break;
|
||||
default:
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
break;
|
||||
case EbtUint8:
|
||||
@ -595,7 +595,7 @@ TIntermUnary* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped
|
||||
case EbtDouble: newOp = EOpConvDoubleToUint8; break;
|
||||
case EbtFloat16: newOp = EOpConvFloat16ToUint8; break;
|
||||
default:
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
break;
|
||||
|
||||
@ -613,7 +613,7 @@ TIntermUnary* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped
|
||||
case EbtDouble: newOp = EOpConvDoubleToInt16; break;
|
||||
case EbtFloat16: newOp = EOpConvFloat16ToInt16; break;
|
||||
default:
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
break;
|
||||
case EbtUint16:
|
||||
@ -630,7 +630,7 @@ TIntermUnary* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped
|
||||
case EbtDouble: newOp = EOpConvDoubleToUint16; break;
|
||||
case EbtFloat16: newOp = EOpConvFloat16ToUint16; break;
|
||||
default:
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
break;
|
||||
|
||||
@ -648,7 +648,7 @@ TIntermUnary* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped
|
||||
case EbtInt64: newOp = EOpConvInt64ToInt; break;
|
||||
case EbtUint64: newOp = EOpConvUint64ToInt; break;
|
||||
default:
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
break;
|
||||
case EbtUint:
|
||||
@ -665,7 +665,7 @@ TIntermUnary* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped
|
||||
case EbtInt64: newOp = EOpConvInt64ToUint; break;
|
||||
case EbtUint64: newOp = EOpConvUint64ToUint; break;
|
||||
default:
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
break;
|
||||
case EbtInt64:
|
||||
@ -682,7 +682,7 @@ TIntermUnary* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped
|
||||
case EbtFloat16: newOp = EOpConvFloat16ToInt64; break;
|
||||
case EbtUint64: newOp = EOpConvUint64ToInt64; break;
|
||||
default:
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
break;
|
||||
case EbtUint64:
|
||||
@ -699,11 +699,11 @@ TIntermUnary* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped
|
||||
case EbtFloat16: newOp = EOpConvFloat16ToUint64; break;
|
||||
case EbtInt64: newOp = EOpConvInt64ToUint64; break;
|
||||
default:
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
TType newType(convertTo, EvqTemporary, node->getVectorSize(), node->getMatrixCols(), node->getMatrixRows());
|
||||
@ -729,21 +729,21 @@ TIntermUnary* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped
|
||||
// See addShapeConversion() for shape conversions.
|
||||
//
|
||||
// Returns the converted pair of nodes.
|
||||
// Returns <nullptr, nullptr> when there is no conversion.
|
||||
// Returns <NULL, NULL> when there is no conversion.
|
||||
std::tuple<TIntermTyped*, TIntermTyped*>
|
||||
TIntermediate::addConversion(TOperator op, TIntermTyped* node0, TIntermTyped* node1) const
|
||||
{
|
||||
if (!isConversionAllowed(op, node0) || !isConversionAllowed(op, node1))
|
||||
return std::make_tuple(nullptr, nullptr);
|
||||
return std::make_tuple((glslang::TIntermTyped*)NULL, (glslang::TIntermTyped*)NULL);
|
||||
|
||||
if (node0->getType() != node1->getType()) {
|
||||
// If differing structure, then no conversions.
|
||||
if (node0->isStruct() || node1->isStruct())
|
||||
return std::make_tuple(nullptr, nullptr);
|
||||
return std::make_tuple((glslang::TIntermTyped*)NULL, (glslang::TIntermTyped*)NULL);
|
||||
|
||||
// If differing arrays, then no conversions.
|
||||
if (node0->getType().isArray() || node1->getType().isArray())
|
||||
return std::make_tuple(nullptr, nullptr);
|
||||
return std::make_tuple((glslang::TIntermTyped*)NULL, (glslang::TIntermTyped*)NULL);
|
||||
}
|
||||
|
||||
auto promoteTo = std::make_tuple(EbtNumTypes, EbtNumTypes);
|
||||
@ -782,7 +782,7 @@ TIntermediate::addConversion(TOperator op, TIntermTyped* node0, TIntermTyped* no
|
||||
|
||||
promoteTo = getConversionDestinatonType(node0->getBasicType(), node1->getBasicType(), op);
|
||||
if (std::get<0>(promoteTo) == EbtNumTypes || std::get<1>(promoteTo) == EbtNumTypes)
|
||||
return std::make_tuple(nullptr, nullptr);
|
||||
return std::make_tuple((glslang::TIntermTyped*)NULL, (glslang::TIntermTyped*)NULL);
|
||||
|
||||
break;
|
||||
|
||||
@ -812,7 +812,7 @@ TIntermediate::addConversion(TOperator op, TIntermTyped* node0, TIntermTyped* no
|
||||
if (isTypeInt(node0->getBasicType()) && isTypeInt(node1->getBasicType()))
|
||||
return std::make_tuple(node0, node1);
|
||||
else
|
||||
return std::make_tuple(nullptr, nullptr);
|
||||
return std::make_tuple((glslang::TIntermTyped*)NULL, (glslang::TIntermTyped*)NULL);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -820,7 +820,7 @@ TIntermediate::addConversion(TOperator op, TIntermTyped* node0, TIntermTyped* no
|
||||
if (node0->getType() == node1->getType())
|
||||
return std::make_tuple(node0, node1);
|
||||
|
||||
return std::make_tuple(nullptr, nullptr);
|
||||
return std::make_tuple((glslang::TIntermTyped*)NULL, (glslang::TIntermTyped*)NULL);
|
||||
}
|
||||
|
||||
TIntermTyped* newNode0;
|
||||
@ -858,12 +858,12 @@ TIntermediate::addConversion(TOperator op, TIntermTyped* node0, TIntermTyped* no
|
||||
// Generally, this is focused on basic type conversion, not shape conversion.
|
||||
// See addShapeConversion() for shape conversions.
|
||||
//
|
||||
// Return nullptr if a conversion can't be done.
|
||||
// Return NULL if a conversion can't be done.
|
||||
//
|
||||
TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TIntermTyped* node) const
|
||||
{
|
||||
if (!isConversionAllowed(op, node))
|
||||
return nullptr;
|
||||
return NULL;
|
||||
|
||||
// Otherwise, if types are identical, no problem
|
||||
if (type == node->getType())
|
||||
@ -871,11 +871,11 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt
|
||||
|
||||
// If one's a structure, then no conversions.
|
||||
if (type.isStruct() || node->isStruct())
|
||||
return nullptr;
|
||||
return NULL;
|
||||
|
||||
// If one's an array, then no conversions.
|
||||
if (type.isArray() || node->getType().isArray())
|
||||
return nullptr;
|
||||
return NULL;
|
||||
|
||||
// Note: callers are responsible for other aspects of shape,
|
||||
// like vector and matrix sizes.
|
||||
@ -970,7 +970,7 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt
|
||||
if (canImplicitlyPromote(node->getBasicType(), type.getBasicType(), op))
|
||||
promoteTo = type.getBasicType();
|
||||
else
|
||||
return nullptr;
|
||||
return NULL;
|
||||
break;
|
||||
|
||||
// For GLSL, there are no conversions needed; the shift amount just needs to be an
|
||||
@ -985,7 +985,7 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt
|
||||
if (isTypeInt(type.getBasicType()) && isTypeInt(node->getBasicType()))
|
||||
return node;
|
||||
else
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -996,7 +996,7 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt
|
||||
if (type.getBasicType() == node->getType().getBasicType())
|
||||
return node;
|
||||
else
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (node->getAsConstantUnion())
|
||||
@ -1191,7 +1191,7 @@ TIntermTyped* TIntermediate::addShapeConversion(const TType& type, TIntermTyped*
|
||||
const int matSize = type.getMatrixRows() * type.getMatrixCols();
|
||||
TIntermAggregate* rhsAggregate = new TIntermAggregate();
|
||||
|
||||
const bool isSimple = (node->getAsSymbolNode() != nullptr) || (node->getAsConstantUnion() != nullptr);
|
||||
const bool isSimple = (node->getAsSymbolNode() != NULL) || (node->getAsConstantUnion() != NULL);
|
||||
|
||||
for (int x=0; x<matSize; ++x)
|
||||
rhsAggregate->getSequence().push_back(node);
|
||||
@ -2052,24 +2052,24 @@ TOperator TIntermediate::mapTypeToConstructorOp(const TType& type) const
|
||||
// Safe way to combine two nodes into an aggregate. Works with null pointers,
|
||||
// a node that's not a aggregate yet, etc.
|
||||
//
|
||||
// Returns the resulting aggregate, unless nullptr was passed in for
|
||||
// Returns the resulting aggregate, unless NULL was passed in for
|
||||
// both existing nodes.
|
||||
//
|
||||
TIntermAggregate* TIntermediate::growAggregate(TIntermNode* left, TIntermNode* right)
|
||||
{
|
||||
if (left == nullptr && right == nullptr)
|
||||
return nullptr;
|
||||
if (left == NULL && right == NULL)
|
||||
return NULL;
|
||||
|
||||
TIntermAggregate* aggNode = nullptr;
|
||||
if (left != nullptr)
|
||||
TIntermAggregate* aggNode = NULL;
|
||||
if (left != NULL)
|
||||
aggNode = left->getAsAggregate();
|
||||
if (aggNode == nullptr || aggNode->getOp() != EOpNull) {
|
||||
if (aggNode == NULL || aggNode->getOp() != EOpNull) {
|
||||
aggNode = new TIntermAggregate;
|
||||
if (left != nullptr)
|
||||
if (left != NULL)
|
||||
aggNode->getSequence().push_back(left);
|
||||
}
|
||||
|
||||
if (right != nullptr)
|
||||
if (right != NULL)
|
||||
aggNode->getSequence().push_back(right);
|
||||
|
||||
return aggNode;
|
||||
@ -2087,12 +2087,12 @@ TIntermAggregate* TIntermediate::growAggregate(TIntermNode* left, TIntermNode* r
|
||||
//
|
||||
// Turn an existing node into an aggregate.
|
||||
//
|
||||
// Returns an aggregate, unless nullptr was passed in for the existing node.
|
||||
// Returns an aggregate, unless NULL was passed in for the existing node.
|
||||
//
|
||||
TIntermAggregate* TIntermediate::makeAggregate(TIntermNode* node)
|
||||
{
|
||||
if (node == nullptr)
|
||||
return nullptr;
|
||||
if (node == NULL)
|
||||
return NULL;
|
||||
|
||||
TIntermAggregate* aggNode = new TIntermAggregate;
|
||||
aggNode->getSequence().push_back(node);
|
||||
@ -2103,8 +2103,8 @@ TIntermAggregate* TIntermediate::makeAggregate(TIntermNode* node)
|
||||
|
||||
TIntermAggregate* TIntermediate::makeAggregate(TIntermNode* node, const TSourceLoc& loc)
|
||||
{
|
||||
if (node == nullptr)
|
||||
return nullptr;
|
||||
if (node == NULL)
|
||||
return NULL;
|
||||
|
||||
TIntermAggregate* aggNode = new TIntermAggregate;
|
||||
aggNode->getSequence().push_back(node);
|
||||
@ -2180,7 +2180,7 @@ TIntermTyped* TIntermediate::addMethod(TIntermTyped* object, const TType& type,
|
||||
// Specialization constant operations include
|
||||
// - The ternary operator ( ? : )
|
||||
//
|
||||
// Returns the selection node created, or nullptr if one could not be.
|
||||
// Returns the selection node created, or NULL if one could not be.
|
||||
//
|
||||
TIntermTyped* TIntermediate::addSelection(TIntermTyped* cond, TIntermTyped* trueBlock, TIntermTyped* falseBlock,
|
||||
const TSourceLoc& loc)
|
||||
@ -2202,8 +2202,8 @@ TIntermTyped* TIntermediate::addSelection(TIntermTyped* cond, TIntermTyped* true
|
||||
trueBlock = std::get<0>(children);
|
||||
falseBlock = std::get<1>(children);
|
||||
|
||||
if (trueBlock == nullptr || falseBlock == nullptr)
|
||||
return nullptr;
|
||||
if (trueBlock == NULL || falseBlock == NULL)
|
||||
return NULL;
|
||||
|
||||
// Handle a vector condition as a mix
|
||||
if (!cond->getType().isScalarOrVec1()) {
|
||||
@ -2215,7 +2215,7 @@ TIntermTyped* TIntermediate::addSelection(TIntermTyped* cond, TIntermTyped* true
|
||||
|
||||
// After conversion, types have to match.
|
||||
if (falseBlock->getType() != trueBlock->getType())
|
||||
return nullptr;
|
||||
return NULL;
|
||||
|
||||
// make the mix operation
|
||||
TIntermAggregate* mix = makeAggregate(loc);
|
||||
@ -2235,7 +2235,7 @@ TIntermTyped* TIntermediate::addSelection(TIntermTyped* cond, TIntermTyped* true
|
||||
|
||||
// After conversion, types have to match.
|
||||
if (falseBlock->getType() != trueBlock->getType())
|
||||
return nullptr;
|
||||
return NULL;
|
||||
|
||||
// Eliminate the selection when the condition is a scalar and all operands are constant.
|
||||
if (cond->getAsConstantUnion() && trueBlock->getAsConstantUnion() && falseBlock->getAsConstantUnion()) {
|
||||
@ -2407,7 +2407,7 @@ TIntermTyped* TIntermediate::addSwizzle(TSwizzleSelectors<selectorType>& selecto
|
||||
// expression (just "." and []).
|
||||
//
|
||||
// Return the base of the l-value (where following indexing quits working).
|
||||
// Return nullptr if a chain following dereferences cannot be followed.
|
||||
// Return NULL if a chain following dereferences cannot be followed.
|
||||
//
|
||||
// 'swizzleOkay' says whether or not it is okay to consider a swizzle
|
||||
// a valid part of the dereference chain.
|
||||
@ -2416,18 +2416,18 @@ const TIntermTyped* TIntermediate::findLValueBase(const TIntermTyped* node, bool
|
||||
{
|
||||
do {
|
||||
const TIntermBinary* binary = node->getAsBinaryNode();
|
||||
if (binary == nullptr)
|
||||
if (binary == NULL)
|
||||
return node;
|
||||
TOperator op = binary->getOp();
|
||||
if (op != EOpIndexDirect && op != EOpIndexIndirect && op != EOpIndexDirectStruct && op != EOpVectorSwizzle && op != EOpMatrixSwizzle)
|
||||
return nullptr;
|
||||
return NULL;
|
||||
if (! swizzleOkay) {
|
||||
if (op == EOpVectorSwizzle || op == EOpMatrixSwizzle)
|
||||
return nullptr;
|
||||
return NULL;
|
||||
if ((op == EOpIndexDirect || op == EOpIndexIndirect) &&
|
||||
(binary->getLeft()->getType().isVector() || binary->getLeft()->getType().isScalar()) &&
|
||||
! binary->getLeft()->getType().isArray())
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
node = node->getAsBinaryNode()->getLeft();
|
||||
} while (true);
|
||||
@ -2456,10 +2456,10 @@ TIntermAggregate* TIntermediate::addForLoop(TIntermNode* body, TIntermNode* init
|
||||
|
||||
// make a sequence of the initializer and statement, but try to reuse the
|
||||
// aggregate already created for whatever is in the initializer, if there is one
|
||||
TIntermAggregate* loopSequence = (initializer == nullptr ||
|
||||
initializer->getAsAggregate() == nullptr) ? makeAggregate(initializer, loc)
|
||||
TIntermAggregate* loopSequence = (initializer == NULL ||
|
||||
initializer->getAsAggregate() == NULL) ? makeAggregate(initializer, loc)
|
||||
: initializer->getAsAggregate();
|
||||
if (loopSequence != nullptr && loopSequence->getOp() == EOpSequence)
|
||||
if (loopSequence != NULL && loopSequence->getOp() == EOpSequence)
|
||||
loopSequence->setOp(EOpNull);
|
||||
loopSequence = growAggregate(loopSequence, node);
|
||||
loopSequence->setOperator(EOpSequence);
|
||||
@ -2472,7 +2472,7 @@ TIntermAggregate* TIntermediate::addForLoop(TIntermNode* body, TIntermNode* init
|
||||
//
|
||||
TIntermBranch* TIntermediate::addBranch(TOperator branchOp, const TSourceLoc& loc)
|
||||
{
|
||||
return addBranch(branchOp, nullptr, loc);
|
||||
return addBranch(branchOp, NULL, loc);
|
||||
}
|
||||
|
||||
TIntermBranch* TIntermediate::addBranch(TOperator branchOp, TIntermTyped* expression, const TSourceLoc& loc)
|
||||
@ -2489,7 +2489,7 @@ TIntermBranch* TIntermediate::addBranch(TOperator branchOp, TIntermTyped* expres
|
||||
//
|
||||
bool TIntermediate::postProcess(TIntermNode* root, EShLanguage /*language*/)
|
||||
{
|
||||
if (root == nullptr)
|
||||
if (root == NULL)
|
||||
return true;
|
||||
|
||||
// Finish off the top-level sequence
|
||||
@ -2913,7 +2913,7 @@ bool TIntermOperator::isConstructor() const
|
||||
//
|
||||
bool TIntermediate::promote(TIntermOperator* node)
|
||||
{
|
||||
if (node == nullptr)
|
||||
if (node == NULL)
|
||||
return false;
|
||||
|
||||
if (node->getAsUnaryNode())
|
||||
@ -2942,7 +2942,7 @@ bool TIntermediate::promoteUnary(TIntermUnary& node)
|
||||
if (operand->getBasicType() != EbtBool) {
|
||||
// Add constructor to boolean type. If that fails, we can't do it, so return false.
|
||||
TIntermTyped* converted = addConversion(op, TType(EbtBool), operand);
|
||||
if (converted == nullptr)
|
||||
if (converted == NULL)
|
||||
return false;
|
||||
|
||||
// Use the result of converting the node to a bool.
|
||||
@ -3062,7 +3062,7 @@ bool TIntermediate::promoteBinary(TIntermBinary& node)
|
||||
left = createConversion(EbtInt, left);
|
||||
if (right->getBasicType() == EbtBool)
|
||||
right = createConversion(EbtInt, right);
|
||||
if (left == nullptr || right == nullptr)
|
||||
if (left == NULL || right == NULL)
|
||||
return false;
|
||||
node.setLeft(left);
|
||||
node.setRight(right);
|
||||
@ -3420,7 +3420,7 @@ bool TIntermediate::promoteAggregate(TIntermAggregate& node)
|
||||
// TODO: array and struct behavior
|
||||
|
||||
// Try converting all nodes to the given node's type
|
||||
TIntermSequence convertedArgs(numArgs, nullptr);
|
||||
TIntermSequence convertedArgs(numArgs, NULL);
|
||||
|
||||
// Try to convert all types to the nonConvArg type.
|
||||
for (int nonConvArg = 0; nonConvArg < numArgs; ++nonConvArg) {
|
||||
@ -3432,7 +3432,7 @@ bool TIntermediate::promoteAggregate(TIntermAggregate& node)
|
||||
|
||||
// If we successfully converted all the args, use the result.
|
||||
if (std::all_of(convertedArgs.begin(), convertedArgs.end(),
|
||||
[](const TIntermNode* node) { return node != nullptr; })) {
|
||||
[](const TIntermNode* node) { return node != NULL; })) {
|
||||
|
||||
std::swap(args, convertedArgs);
|
||||
return true;
|
||||
@ -3807,7 +3807,7 @@ const char* TIntermediate::getResourceName(TResourceType res)
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
|
@ -139,12 +139,12 @@ bool TParseContextBase::lValueErrorCheck(const TSourceLoc& loc, const char* op,
|
||||
return true;
|
||||
}
|
||||
|
||||
const char* symbol = nullptr;
|
||||
const char* symbol = NULL;
|
||||
TIntermSymbol* symNode = node->getAsSymbolNode();
|
||||
if (symNode != nullptr)
|
||||
if (symNode != NULL)
|
||||
symbol = symNode->getName().c_str();
|
||||
|
||||
const char* message = nullptr;
|
||||
const char* message = NULL;
|
||||
switch (node->getQualifier().storage) {
|
||||
case EvqConst: message = "can't modify a const"; break;
|
||||
case EvqConstReadOnly: message = "can't modify a const"; break;
|
||||
@ -173,7 +173,7 @@ bool TParseContextBase::lValueErrorCheck(const TSourceLoc& loc, const char* op,
|
||||
}
|
||||
}
|
||||
|
||||
if (message == nullptr && binaryNode == nullptr && symNode == nullptr) {
|
||||
if (message == NULL && binaryNode == NULL && symNode == NULL) {
|
||||
error(loc, " l-value required", op, "", "");
|
||||
|
||||
return true;
|
||||
@ -182,7 +182,7 @@ bool TParseContextBase::lValueErrorCheck(const TSourceLoc& loc, const char* op,
|
||||
//
|
||||
// Everything else is okay, no error.
|
||||
//
|
||||
if (message == nullptr)
|
||||
if (message == NULL)
|
||||
return false;
|
||||
|
||||
//
|
||||
@ -276,15 +276,15 @@ void TParseContextBase::makeEditable(TSymbol*& symbol)
|
||||
|
||||
// Return a writable version of the variable 'name'.
|
||||
//
|
||||
// Return nullptr if 'name' is not found. This should mean
|
||||
// Return NULL if 'name' is not found. This should mean
|
||||
// something is seriously wrong (e.g., compiler asking self for
|
||||
// built-in that doesn't exist).
|
||||
TVariable* TParseContextBase::getEditableVariable(const char* name)
|
||||
{
|
||||
bool builtIn;
|
||||
TSymbol* symbol = symbolTable.find(name, &builtIn);
|
||||
if (symbol == nullptr)
|
||||
return nullptr;
|
||||
if (symbol == NULL)
|
||||
return NULL;
|
||||
|
||||
if (builtIn)
|
||||
makeEditable(symbol);
|
||||
@ -398,7 +398,7 @@ const TFunction* TParseContextBase::selectFunction(
|
||||
|
||||
// 2. none viable...
|
||||
if (viableCandidates.size() == 0)
|
||||
return nullptr;
|
||||
return NULL;
|
||||
|
||||
// 3. only one viable...
|
||||
if (viableCandidates.size() == 1)
|
||||
@ -558,7 +558,7 @@ void TParseContextBase::parseSwizzleSelector(const TSourceLoc& loc, const TStrin
|
||||
void TParseContextBase::growGlobalUniformBlock(const TSourceLoc& loc, TType& memberType, const TString& memberName, TTypeList* typeList)
|
||||
{
|
||||
// Make the global block, if not yet made.
|
||||
if (globalUniformBlock == nullptr) {
|
||||
if (globalUniformBlock == NULL) {
|
||||
TQualifier blockQualifier;
|
||||
blockQualifier.clear();
|
||||
blockQualifier.storage = EvqUniform;
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -77,20 +77,20 @@ public:
|
||||
TParseContextBase(TSymbolTable& symbolTable, TIntermediate& interm, bool parsingBuiltins, int version,
|
||||
EProfile profile, const SpvVersion& spvVersion, EShLanguage language,
|
||||
TInfoSink& infoSink, bool forwardCompatible, EShMessages messages,
|
||||
const TString* entryPoint = nullptr)
|
||||
const TString* entryPoint = NULL)
|
||||
: TParseVersions(interm, version, profile, spvVersion, language, infoSink, forwardCompatible, messages),
|
||||
scopeMangler("::"),
|
||||
symbolTable(symbolTable),
|
||||
statementNestingLevel(0), loopNestingLevel(0), structNestingLevel(0), controlFlowNestingLevel(0),
|
||||
postEntryPointReturn(false),
|
||||
contextPragma(true, false),
|
||||
parsingBuiltins(parsingBuiltins), scanContext(nullptr), ppContext(nullptr),
|
||||
parsingBuiltins(parsingBuiltins), scanContext(NULL), ppContext(NULL),
|
||||
limits(resources.limits),
|
||||
globalUniformBlock(nullptr),
|
||||
globalUniformBlock(NULL),
|
||||
globalUniformBinding(TQualifier::layoutBindingEnd),
|
||||
globalUniformSet(TQualifier::layoutSetEnd)
|
||||
{
|
||||
if (entryPoint != nullptr)
|
||||
if (entryPoint != NULL)
|
||||
sourceEntryPointName = *entryPoint;
|
||||
}
|
||||
virtual ~TParseContextBase() { }
|
||||
@ -149,14 +149,14 @@ public:
|
||||
}
|
||||
|
||||
// Manage the global uniform block (default uniforms in GLSL, $Global in HLSL)
|
||||
virtual void growGlobalUniformBlock(const TSourceLoc&, TType&, const TString& memberName, TTypeList* typeList = nullptr);
|
||||
virtual void growGlobalUniformBlock(const TSourceLoc&, TType&, const TString& memberName, TTypeList* typeList = NULL);
|
||||
|
||||
// Potentially rename shader entry point function
|
||||
void renameShaderFunction(TString*& name) const
|
||||
{
|
||||
// Replace the entry point name given in the shader with the real entry point name,
|
||||
// if there is a substitution.
|
||||
if (name != nullptr && *name == sourceEntryPointName && intermediate.getEntryPointName().size() > 0)
|
||||
if (name != NULL && *name == sourceEntryPointName && intermediate.getEntryPointName().size() > 0)
|
||||
name = NewPoolTString(intermediate.getEntryPointName().c_str());
|
||||
}
|
||||
|
||||
@ -272,7 +272,7 @@ class TParseContext : public TParseContextBase {
|
||||
public:
|
||||
TParseContext(TSymbolTable&, TIntermediate&, bool parsingBuiltins, int version, EProfile, const SpvVersion& spvVersion, EShLanguage, TInfoSink&,
|
||||
bool forwardCompatible = false, EShMessages messages = EShMsgDefault,
|
||||
const TString* entryPoint = nullptr);
|
||||
const TString* entryPoint = NULL);
|
||||
virtual ~TParseContext();
|
||||
|
||||
bool obeyPrecisionQualifiers() const { return precisionManager.respectingPrecisionQualifiers(); };
|
||||
|
@ -81,8 +81,8 @@ bool DeinitializePoolIndex()
|
||||
TPoolAllocator::TPoolAllocator(int growthIncrement, int allocationAlignment) :
|
||||
pageSize(growthIncrement),
|
||||
alignment(allocationAlignment),
|
||||
freeList(nullptr),
|
||||
inUseList(nullptr),
|
||||
freeList(NULL),
|
||||
inUseList(NULL),
|
||||
numCalls(0)
|
||||
{
|
||||
//
|
||||
|
@ -302,8 +302,8 @@ namespace {
|
||||
|
||||
// A single global usable by all threads, by all versions, by all languages.
|
||||
// After a single process-level initialization, this is read only and thread safe
|
||||
std::unordered_map<const char*, int, str_hash, str_eq>* KeywordMap = nullptr;
|
||||
std::unordered_set<const char*, str_hash, str_eq>* ReservedSet = nullptr;
|
||||
std::unordered_map<const char*, int, str_hash, str_eq>* KeywordMap = NULL;
|
||||
std::unordered_set<const char*, str_hash, str_eq>* ReservedSet = NULL;
|
||||
|
||||
};
|
||||
|
||||
@ -311,7 +311,7 @@ namespace glslang {
|
||||
|
||||
void TScanContext::fillInKeywordMap()
|
||||
{
|
||||
if (KeywordMap != nullptr) {
|
||||
if (KeywordMap != NULL) {
|
||||
// this is really an error, as this should called only once per process
|
||||
// but, the only risk is if two threads called simultaneously
|
||||
return;
|
||||
@ -715,9 +715,9 @@ void TScanContext::fillInKeywordMap()
|
||||
void TScanContext::deleteKeywordMap()
|
||||
{
|
||||
delete KeywordMap;
|
||||
KeywordMap = nullptr;
|
||||
KeywordMap = NULL;
|
||||
delete ReservedSet;
|
||||
ReservedSet = nullptr;
|
||||
ReservedSet = NULL;
|
||||
}
|
||||
|
||||
// Called by yylex to get the next token.
|
||||
@ -1519,7 +1519,7 @@ int TScanContext::identifierOrType()
|
||||
return IDENTIFIER;
|
||||
|
||||
parserToken->sType.lex.symbol = _parseContext.symbolTable.find(*parserToken->sType.lex.string);
|
||||
if ((afterType == false && afterStruct == false) && parserToken->sType.lex.symbol != nullptr) {
|
||||
if ((afterType == false && afterStruct == false) && parserToken->sType.lex.symbol != NULL) {
|
||||
if (const TVariable* variable = parserToken->sType.lex.symbol->getAsVariable()) {
|
||||
if (variable->isUserType()) {
|
||||
afterType = true;
|
||||
|
@ -51,7 +51,7 @@ const int EndOfInput = -1;
|
||||
//
|
||||
class TInputScanner {
|
||||
public:
|
||||
TInputScanner(int n, const char* const s[], size_t L[], const char* const* names = nullptr,
|
||||
TInputScanner(int n, const char* const s[], size_t L[], const char* const* names = NULL,
|
||||
int b = 0, int f = 0, bool single = false) :
|
||||
numSources(n),
|
||||
// up to this point, common usage is "char*", but now we need positive 8-bit characters
|
||||
@ -63,7 +63,7 @@ public:
|
||||
for (int i = 0; i < numSources; ++i) {
|
||||
loc[i].init(i - stringBias);
|
||||
}
|
||||
if (names != nullptr) {
|
||||
if (names != NULL) {
|
||||
for (int i = 0; i < numSources; ++i)
|
||||
loc[i].name = names[i];
|
||||
}
|
||||
@ -186,8 +186,8 @@ public:
|
||||
{
|
||||
logicalSourceLoc.string = newString;
|
||||
loc[getLastValidSourceIndex()].string = newString;
|
||||
logicalSourceLoc.name = nullptr;
|
||||
loc[getLastValidSourceIndex()].name = nullptr;
|
||||
logicalSourceLoc.name = NULL;
|
||||
loc[getLastValidSourceIndex()].name = NULL;
|
||||
}
|
||||
|
||||
// for #include content indentation
|
||||
|
@ -77,7 +77,7 @@ TBuiltInParseables* CreateBuiltInParseables(TInfoSink& infoSink, EShSource sourc
|
||||
|
||||
default:
|
||||
infoSink.info.message(EPrefixInternalError, "Unable to determine source language");
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@ -98,7 +98,7 @@ TParseContextBase* CreateParseContext(TSymbolTable& symbolTable, TIntermediate&
|
||||
}
|
||||
default:
|
||||
infoSink.info.message(EPrefixInternalError, "Unable to determine source language");
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@ -195,12 +195,12 @@ enum EPrecisionClass {
|
||||
TSymbolTable* CommonSymbolTable[VersionCount][SpvVersionCount][ProfileCount][SourceCount][EPcCount] = {};
|
||||
TSymbolTable* SharedSymbolTables[VersionCount][SpvVersionCount][ProfileCount][SourceCount][EShLangCount] = {};
|
||||
|
||||
TPoolAllocator* PerProcessGPA = nullptr;
|
||||
TPoolAllocator* PerProcessGPA = NULL;
|
||||
|
||||
//
|
||||
// Parse and add to the given symbol table the content of the given shader string.
|
||||
//
|
||||
bool InitializeSymbolTable(const TString& builtIns, int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language,
|
||||
static bool InitializeSymbolTable(const TString& builtIns, int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language,
|
||||
EShSource source, TInfoSink& infoSink, TSymbolTable& symbolTable)
|
||||
{
|
||||
TIntermediate intermediate(language, version, profile);
|
||||
@ -245,7 +245,7 @@ bool InitializeSymbolTable(const TString& builtIns, int version, EProfile profil
|
||||
return true;
|
||||
}
|
||||
|
||||
int CommonIndex(EProfile profile, EShLanguage language)
|
||||
static int CommonIndex(EProfile profile, EShLanguage language)
|
||||
{
|
||||
return (profile == EEsProfile && language == EShLangFragment) ? EPcFragment : EPcGeneral;
|
||||
}
|
||||
@ -253,7 +253,7 @@ int CommonIndex(EProfile profile, EShLanguage language)
|
||||
//
|
||||
// To initialize per-stage shared tables, with the common table already complete.
|
||||
//
|
||||
void InitializeStageSymbolTable(TBuiltInParseables& builtInParseables, int version, EProfile profile, const SpvVersion& spvVersion,
|
||||
static void InitializeStageSymbolTable(TBuiltInParseables& builtInParseables, int version, EProfile profile, const SpvVersion& spvVersion,
|
||||
EShLanguage language, EShSource source, TInfoSink& infoSink, TSymbolTable** commonTable,
|
||||
TSymbolTable** symbolTables)
|
||||
{
|
||||
@ -271,11 +271,11 @@ void InitializeStageSymbolTable(TBuiltInParseables& builtInParseables, int versi
|
||||
// Initialize the full set of shareable symbol tables;
|
||||
// The common (cross-stage) and those shareable per-stage.
|
||||
//
|
||||
bool InitializeSymbolTables(TInfoSink& infoSink, TSymbolTable** commonTable, TSymbolTable** symbolTables, int version, EProfile profile, const SpvVersion& spvVersion, EShSource source)
|
||||
static bool InitializeSymbolTables(TInfoSink& infoSink, TSymbolTable** commonTable, TSymbolTable** symbolTables, int version, EProfile profile, const SpvVersion& spvVersion, EShSource source)
|
||||
{
|
||||
std::unique_ptr<TBuiltInParseables> builtInParseables(CreateBuiltInParseables(infoSink, source));
|
||||
|
||||
if (builtInParseables == nullptr)
|
||||
if (builtInParseables == NULL)
|
||||
return false;
|
||||
|
||||
builtInParseables->initialize(version, profile, spvVersion);
|
||||
@ -319,12 +319,12 @@ bool InitializeSymbolTables(TInfoSink& infoSink, TSymbolTable** commonTable, TS
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AddContextSpecificSymbols(const TBuiltInResource* resources, TInfoSink& infoSink, TSymbolTable& symbolTable, int version,
|
||||
static bool AddContextSpecificSymbols(const TBuiltInResource* resources, TInfoSink& infoSink, TSymbolTable& symbolTable, int version,
|
||||
EProfile profile, const SpvVersion& spvVersion, EShLanguage language, EShSource source)
|
||||
{
|
||||
std::unique_ptr<TBuiltInParseables> builtInParseables(CreateBuiltInParseables(infoSink, source));
|
||||
|
||||
if (builtInParseables == nullptr)
|
||||
if (builtInParseables == NULL)
|
||||
return false;
|
||||
|
||||
builtInParseables->initialize(*resources, version, profile, spvVersion, language);
|
||||
@ -346,7 +346,7 @@ bool AddContextSpecificSymbols(const TBuiltInResource* resources, TInfoSink& inf
|
||||
// This only gets done the first time any thread needs a particular symbol table
|
||||
// (lazy evaluation).
|
||||
//
|
||||
void SetupBuiltinSymbolTable(int version, EProfile profile, const SpvVersion& spvVersion, EShSource source)
|
||||
static void SetupBuiltinSymbolTable(int version, EProfile profile, const SpvVersion& spvVersion, EShSource source)
|
||||
{
|
||||
TInfoSink infoSink;
|
||||
|
||||
@ -414,7 +414,7 @@ void SetupBuiltinSymbolTable(int version, EProfile profile, const SpvVersion& sp
|
||||
}
|
||||
|
||||
// Return true if the shader was correctly specified for version/profile/stage.
|
||||
bool DeduceVersionProfile(TInfoSink& infoSink, EShLanguage stage, bool versionNotFirst, int defaultVersion,
|
||||
static bool DeduceVersionProfile(TInfoSink& infoSink, EShLanguage stage, bool versionNotFirst, int defaultVersion,
|
||||
EShSource source, int& version, EProfile& profile, const SpvVersion& spvVersion)
|
||||
{
|
||||
const int FirstProfileVersion = 150;
|
||||
@ -588,7 +588,7 @@ bool DeduceVersionProfile(TInfoSink& infoSink, EShLanguage stage, bool versionNo
|
||||
// TEnvironment takes precedence, for what it sets, so sort all this out.
|
||||
// Ideally, the internal code could be made to use TEnvironment, but for
|
||||
// now, translate it to the historically used parameters.
|
||||
void TranslateEnvironment(const TEnvironment* environment, EShMessages& messages, EShSource& source,
|
||||
static void TranslateEnvironment(const TEnvironment* environment, EShMessages& messages, EShSource& source,
|
||||
EShLanguage& stage, SpvVersion& spvVersion)
|
||||
{
|
||||
// Set up environmental defaults, first ignoring 'environment'.
|
||||
@ -603,7 +603,7 @@ void TranslateEnvironment(const TEnvironment* environment, EShMessages& messages
|
||||
// Now, override, based on any content set in 'environment'.
|
||||
// 'environment' must be cleared to ESh*None settings when items
|
||||
// are not being set.
|
||||
if (environment != nullptr) {
|
||||
if (environment != NULL) {
|
||||
// input language
|
||||
if (environment->input.languageFamily != EShSourceNone) {
|
||||
stage = environment->input.stage;
|
||||
@ -653,7 +653,7 @@ void TranslateEnvironment(const TEnvironment* environment, EShMessages& messages
|
||||
|
||||
// Most processes are recorded when set in the intermediate representation,
|
||||
// These are the few that are not.
|
||||
void RecordProcesses(TIntermediate& intermediate, EShMessages messages, const std::string& sourceEntryPointName)
|
||||
static void RecordProcesses(TIntermediate& intermediate, EShMessages messages, const std::string& sourceEntryPointName)
|
||||
{
|
||||
if ((messages & EShMsgRelaxedErrors) != 0)
|
||||
intermediate.addProcess("relaxed-errors");
|
||||
@ -677,7 +677,7 @@ void RecordProcesses(TIntermediate& intermediate, EShMessages messages, const st
|
||||
// Which returns false if a failure was detected and true otherwise.
|
||||
//
|
||||
template<typename ProcessingContext>
|
||||
bool ProcessDeferred(
|
||||
static bool ProcessDeferred(
|
||||
TCompiler* compiler,
|
||||
const char* const shaderStrings[],
|
||||
const int numStrings,
|
||||
@ -698,7 +698,7 @@ bool ProcessDeferred(
|
||||
bool requireNonempty,
|
||||
TShader::Includer& includer,
|
||||
const std::string sourceEntryPointName = "",
|
||||
const TEnvironment* environment = nullptr) // optional way of fully setting all versions, overriding the above
|
||||
const TEnvironment* environment = NULL) // optional way of fully setting all versions, overriding the above
|
||||
{
|
||||
// This must be undone (.pop()) by the caller, after it finishes consuming the created tree.
|
||||
GetThreadPoolAllocator().push();
|
||||
@ -723,17 +723,17 @@ bool ProcessDeferred(
|
||||
std::unique_ptr<const char*[]> names(new const char*[numTotal]);
|
||||
for (int s = 0; s < numStrings; ++s) {
|
||||
strings[s + numPre] = shaderStrings[s];
|
||||
if (inputLengths == nullptr || inputLengths[s] < 0)
|
||||
if (inputLengths == NULL || inputLengths[s] < 0)
|
||||
lengths[s + numPre] = strlen(shaderStrings[s]);
|
||||
else
|
||||
lengths[s + numPre] = inputLengths[s];
|
||||
}
|
||||
if (stringNames != nullptr) {
|
||||
if (stringNames != NULL) {
|
||||
for (int s = 0; s < numStrings; ++s)
|
||||
names[s + numPre] = stringNames[s];
|
||||
} else {
|
||||
for (int s = 0; s < numStrings; ++s)
|
||||
names[s + numPre] = nullptr;
|
||||
names[s + numPre] = NULL;
|
||||
}
|
||||
|
||||
// Get all the stages, languages, clients, and other environment
|
||||
@ -742,7 +742,7 @@ bool ProcessDeferred(
|
||||
SpvVersion spvVersion;
|
||||
EShLanguage stage = compiler->getLanguage();
|
||||
TranslateEnvironment(environment, messages, source, stage, spvVersion);
|
||||
if (environment != nullptr && environment->target.hlslFunctionality1)
|
||||
if (environment != NULL && environment->target.hlslFunctionality1)
|
||||
intermediate.setHlslFunctionality1();
|
||||
|
||||
// First, without using the preprocessor or parser, find the #version, so we know what
|
||||
@ -815,9 +815,8 @@ bool ProcessDeferred(
|
||||
// Add built-in symbols that are potentially context dependent;
|
||||
// they get popped again further down.
|
||||
if (! AddContextSpecificSymbols(resources, compiler->infoSink, *symbolTable, version, profile, spvVersion,
|
||||
stage, source)) {
|
||||
stage, source))
|
||||
return false;
|
||||
}
|
||||
|
||||
//
|
||||
// Now we can process the full shader under proper symbols and rules.
|
||||
@ -850,15 +849,15 @@ bool ProcessDeferred(
|
||||
_parseContext->getPreamble(preamble);
|
||||
strings[0] = preamble.c_str();
|
||||
lengths[0] = strlen(strings[0]);
|
||||
names[0] = nullptr;
|
||||
names[0] = NULL;
|
||||
strings[1] = customPreamble;
|
||||
lengths[1] = strlen(strings[1]);
|
||||
names[1] = nullptr;
|
||||
names[1] = NULL;
|
||||
if (requireNonempty) {
|
||||
const int postIndex = numStrings + numPre;
|
||||
strings[postIndex] = "\n int;";
|
||||
lengths[postIndex] = strlen(strings[numStrings + numPre]);
|
||||
names[postIndex] = nullptr;
|
||||
names[postIndex] = NULL;
|
||||
}
|
||||
TInputScanner fullInput(numStrings + numPre + numPost, strings.get(), lengths.get(), names.get(), numPre, numPost);
|
||||
|
||||
@ -974,13 +973,12 @@ struct DoPreprocessing {
|
||||
outputBuffer += std::to_string(newLineNum);
|
||||
if (hasSource) {
|
||||
outputBuffer += ' ';
|
||||
if (sourceName != nullptr) {
|
||||
if (sourceName != NULL) {
|
||||
outputBuffer += '\"';
|
||||
outputBuffer += sourceName;
|
||||
outputBuffer += '\"';
|
||||
} else {
|
||||
} else
|
||||
outputBuffer += std::to_string(sourceNum);
|
||||
}
|
||||
}
|
||||
if (_parseContext.lineDirectiveShouldSetNextLine()) {
|
||||
// newLineNum is the new line number for the line following the #line
|
||||
@ -1007,9 +1005,8 @@ struct DoPreprocessing {
|
||||
int line, const glslang::TVector<glslang::TString>& ops) {
|
||||
lineSync.syncToLine(line);
|
||||
outputBuffer += "#pragma ";
|
||||
for(size_t i = 0; i < ops.size(); ++i) {
|
||||
for(size_t i = 0; i < ops.size(); ++i)
|
||||
outputBuffer += ops[i].c_str();
|
||||
}
|
||||
});
|
||||
|
||||
_parseContext.setErrorCallback([&lineSync, &outputBuffer](
|
||||
@ -1132,7 +1129,7 @@ bool PreprocessDeferred(
|
||||
// return: the tree and other information is filled into the intermediate argument,
|
||||
// and true is returned by the function for success.
|
||||
//
|
||||
bool CompileDeferred(
|
||||
static bool CompileDeferred(
|
||||
TCompiler* compiler,
|
||||
const char* const shaderStrings[],
|
||||
const int numStrings,
|
||||
@ -1149,7 +1146,7 @@ bool CompileDeferred(
|
||||
TIntermediate& intermediate,// returned tree, etc.
|
||||
TShader::Includer& includer,
|
||||
const std::string sourceEntryPointName = "",
|
||||
TEnvironment* environment = nullptr)
|
||||
TEnvironment* environment = NULL)
|
||||
{
|
||||
DoFullParse parser;
|
||||
return ProcessDeferred(compiler, shaderStrings, numStrings, inputLengths, stringNames,
|
||||
@ -1175,7 +1172,7 @@ int ShInitialize()
|
||||
++NumberOfClients;
|
||||
glslang::ReleaseGlobalLock();
|
||||
|
||||
if (PerProcessGPA == nullptr)
|
||||
if (PerProcessGPA == NULL)
|
||||
PerProcessGPA = new TPoolAllocator();
|
||||
|
||||
glslang::TScanContext::fillInKeywordMap();
|
||||
@ -1271,9 +1268,9 @@ int __fastcall ShFinalize()
|
||||
}
|
||||
}
|
||||
|
||||
if (PerProcessGPA != nullptr) {
|
||||
if (PerProcessGPA != NULL) {
|
||||
delete PerProcessGPA;
|
||||
PerProcessGPA = nullptr;
|
||||
PerProcessGPA = NULL;
|
||||
}
|
||||
|
||||
glslang::TScanContext::deleteKeywordMap();
|
||||
@ -1319,7 +1316,7 @@ int ShCompile(
|
||||
|
||||
TIntermediate intermediate(compiler->getLanguage());
|
||||
TShader::ForbidIncluder includer;
|
||||
bool success = CompileDeferred(compiler, shaderStrings, numStrings, inputLengths, nullptr,
|
||||
bool success = CompileDeferred(compiler, shaderStrings, numStrings, inputLengths, NULL,
|
||||
"", optLevel, resources, defaultVersion, ENoProfile, false,
|
||||
forwardCompatible, messages, intermediate, includer);
|
||||
|
||||
@ -1571,7 +1568,7 @@ public:
|
||||
};
|
||||
|
||||
TShader::TShader(EShLanguage s)
|
||||
: stage(s), lengths(nullptr), stringNames(nullptr), preamble("")
|
||||
: stage(s), lengths(NULL), stringNames(NULL), preamble("")
|
||||
{
|
||||
pool = new TPoolAllocator;
|
||||
infoSink = new TInfoSink;
|
||||
@ -1598,7 +1595,7 @@ void TShader::setStrings(const char* const* s, int n)
|
||||
{
|
||||
strings = s;
|
||||
numStrings = n;
|
||||
lengths = nullptr;
|
||||
lengths = NULL;
|
||||
}
|
||||
|
||||
void TShader::setStringsWithLengths(const char* const* s, const int* l, int n)
|
||||
@ -1723,7 +1720,7 @@ const char* TShader::getInfoDebugLog()
|
||||
return infoSink->debug.c_str();
|
||||
}
|
||||
|
||||
TProgram::TProgram() : reflection(0), ioMapper(nullptr), linked(false)
|
||||
TProgram::TProgram() : reflection(0), ioMapper(NULL), linked(false)
|
||||
{
|
||||
pool = new TPoolAllocator;
|
||||
infoSink = new TInfoSink;
|
||||
@ -1783,12 +1780,12 @@ bool TProgram::linkStage(EShLanguage stage, EShMessages messages)
|
||||
return true;
|
||||
|
||||
int numEsShaders = 0, numNonEsShaders = 0;
|
||||
for (auto it = stages[stage].begin(); it != stages[stage].end(); ++it) {
|
||||
if ((*it)->intermediate->getProfile() == EEsProfile) {
|
||||
for (auto it = stages[stage].begin(); it != stages[stage].end(); ++it)
|
||||
{
|
||||
if ((*it)->intermediate->getProfile() == EEsProfile)
|
||||
numEsShaders++;
|
||||
} else {
|
||||
else
|
||||
numNonEsShaders++;
|
||||
}
|
||||
}
|
||||
|
||||
if (numEsShaders > 0 && numNonEsShaders > 0) {
|
||||
@ -1814,9 +1811,8 @@ bool TProgram::linkStage(EShLanguage stage, EShMessages messages)
|
||||
|
||||
// The new TIntermediate must use the same origin as the original TIntermediates.
|
||||
// Otherwise linking will fail due to different coordinate systems.
|
||||
if (firstIntermediate->getOriginUpperLeft()) {
|
||||
if (firstIntermediate->getOriginUpperLeft())
|
||||
intermediate[stage]->setOriginUpperLeft();
|
||||
}
|
||||
intermediate[stage]->setSpv(firstIntermediate->getSpv());
|
||||
|
||||
newedIntermediate[stage] = true;
|
||||
@ -1839,12 +1835,12 @@ bool TProgram::linkStage(EShLanguage stage, EShMessages messages)
|
||||
return intermediate[stage]->getNumErrors() == 0;
|
||||
}
|
||||
|
||||
const char* TProgram::getInfoLog()
|
||||
const char* TProgram::getInfoLog(void)
|
||||
{
|
||||
return infoSink->info.c_str();
|
||||
}
|
||||
|
||||
const char* TProgram::getInfoDebugLog()
|
||||
const char* TProgram::getInfoDebugLog(void)
|
||||
{
|
||||
return infoSink->debug.c_str();
|
||||
}
|
||||
@ -1853,7 +1849,7 @@ const char* TProgram::getInfoDebugLog()
|
||||
// Reflection implementation.
|
||||
//
|
||||
|
||||
bool TProgram::buildReflection()
|
||||
bool TProgram::buildReflection(void)
|
||||
{
|
||||
if (! linked || reflection)
|
||||
return false;
|
||||
@ -1891,9 +1887,7 @@ const TType* TProgram::getUniformTType(int index) const { return reflection
|
||||
const TType* TProgram::getUniformBlockTType(int index) const { return reflection->getUniformBlock(index).getType(); }
|
||||
unsigned TProgram::getLocalSize(int dim) const { return reflection->getLocalSize(dim); }
|
||||
|
||||
//
|
||||
// I/O mapping implementation.
|
||||
//
|
||||
bool TProgram::mapIO(TIoMapResolver* resolver)
|
||||
{
|
||||
if (! linked || ioMapper)
|
||||
|
@ -294,7 +294,7 @@ TVariable::TVariable(const TVariable& copyOf) : TSymbol(copyOf)
|
||||
}
|
||||
|
||||
// don't support specialization-constant subtrees in cloned tables
|
||||
constSubtree = nullptr;
|
||||
constSubtree = NULL;
|
||||
}
|
||||
|
||||
TVariable* TVariable::clone() const
|
||||
|
@ -151,7 +151,7 @@ public:
|
||||
TVariable(const TString *name, const TType& t, bool uT = false )
|
||||
: TSymbol(name),
|
||||
userType(uT),
|
||||
constSubtree(nullptr),
|
||||
constSubtree(NULL),
|
||||
anonId(-1) { type.shallowCopy(t); }
|
||||
virtual TVariable* clone() const;
|
||||
virtual ~TVariable() { }
|
||||
@ -240,7 +240,7 @@ public:
|
||||
parameters.push_back(p);
|
||||
p.type->appendMangledName(mangledName);
|
||||
|
||||
if (p.defaultValue != nullptr)
|
||||
if (p.defaultValue != NULL)
|
||||
defaultParamCount++;
|
||||
}
|
||||
|
||||
@ -248,7 +248,7 @@ public:
|
||||
// 'this' is reflected in the list of parameters, but not the mangled name.
|
||||
virtual void addThisParameter(TType& type, const char* name)
|
||||
{
|
||||
TParameter p = { NewPoolTString(name), new TType, nullptr };
|
||||
TParameter p = { NewPoolTString(name), new TType, NULL };
|
||||
p.type->shallowCopy(type);
|
||||
parameters.insert(parameters.begin(), p);
|
||||
}
|
||||
@ -695,13 +695,13 @@ public:
|
||||
++thisDepth;
|
||||
symbol = table[level]->find(name);
|
||||
--level;
|
||||
} while (symbol == nullptr && level >= 0);
|
||||
} while (symbol == NULL && level >= 0);
|
||||
level++;
|
||||
if (builtIn)
|
||||
*builtIn = isBuiltInLevel(level);
|
||||
if (currentScope)
|
||||
*currentScope = isGlobalLevel(currentLevel()) || level == currentLevel(); // consider shared levels as "current scope" WRT user globals
|
||||
if (thisDepthP != nullptr) {
|
||||
if (thisDepthP != NULL) {
|
||||
if (! table[level]->isThisLevel())
|
||||
thisDepth = 0;
|
||||
*thisDepthP = thisDepth;
|
||||
|
@ -803,16 +803,16 @@ void TParseVersions::updateExtensionBehavior(const char* extension, TExtensionBe
|
||||
// Call for any operation needing full GLSL integer data-type support.
|
||||
void TParseVersions::fullIntegerCheck(const TSourceLoc& loc, const char* op)
|
||||
{
|
||||
profileRequires(loc, ENoProfile, 130, nullptr, op);
|
||||
profileRequires(loc, EEsProfile, 300, nullptr, op);
|
||||
profileRequires(loc, ENoProfile, 130, NULL, op);
|
||||
profileRequires(loc, EEsProfile, 300, NULL, op);
|
||||
}
|
||||
|
||||
// Call for any operation needing GLSL double data-type support.
|
||||
void TParseVersions::doubleCheck(const TSourceLoc& loc, const char* op)
|
||||
{
|
||||
requireProfile(loc, ECoreProfile | ECompatibilityProfile, op);
|
||||
profileRequires(loc, ECoreProfile, 400, nullptr, op);
|
||||
profileRequires(loc, ECompatibilityProfile, 400, nullptr, op);
|
||||
profileRequires(loc, ECoreProfile, 400, NULL, op);
|
||||
profileRequires(loc, ECompatibilityProfile, 400, NULL, op);
|
||||
}
|
||||
|
||||
// Call for any operation needing GLSL float16 data-type support.
|
||||
@ -830,8 +830,8 @@ void TParseVersions::float16Check(const TSourceLoc& loc, const char* op, bool bu
|
||||
#endif
|
||||
requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, "explicit types");
|
||||
requireProfile(loc, ECoreProfile | ECompatibilityProfile, op);
|
||||
profileRequires(loc, ECoreProfile, 450, nullptr, op);
|
||||
profileRequires(loc, ECompatibilityProfile, 450, nullptr, op);
|
||||
profileRequires(loc, ECoreProfile, 450, NULL, op);
|
||||
profileRequires(loc, ECompatibilityProfile, 450, NULL, op);
|
||||
}
|
||||
}
|
||||
|
||||
@ -843,8 +843,8 @@ void TParseVersions::explicitFloat32Check(const TSourceLoc& loc, const char* op,
|
||||
E_GL_KHX_shader_explicit_arithmetic_types_float32};
|
||||
requireExtensions(loc, 2, extensions, "explicit types");
|
||||
requireProfile(loc, ECoreProfile | ECompatibilityProfile, op);
|
||||
profileRequires(loc, ECoreProfile, 450, nullptr, op);
|
||||
profileRequires(loc, ECompatibilityProfile, 450, nullptr, op);
|
||||
profileRequires(loc, ECoreProfile, 450, NULL, op);
|
||||
profileRequires(loc, ECompatibilityProfile, 450, NULL, op);
|
||||
}
|
||||
}
|
||||
|
||||
@ -856,8 +856,8 @@ void TParseVersions::explicitFloat64Check(const TSourceLoc& loc, const char* op,
|
||||
E_GL_KHX_shader_explicit_arithmetic_types_float64};
|
||||
requireExtensions(loc, 2, extensions, "explicit types");
|
||||
requireProfile(loc, ECoreProfile | ECompatibilityProfile, op);
|
||||
profileRequires(loc, ECoreProfile, 450, nullptr, op);
|
||||
profileRequires(loc, ECompatibilityProfile, 450, nullptr, op);
|
||||
profileRequires(loc, ECoreProfile, 450, NULL, op);
|
||||
profileRequires(loc, ECompatibilityProfile, 450, NULL, op);
|
||||
}
|
||||
}
|
||||
|
||||
@ -869,8 +869,8 @@ void TParseVersions::explicitInt8Check(const TSourceLoc& loc, const char* op, bo
|
||||
E_GL_KHX_shader_explicit_arithmetic_types_int8};
|
||||
requireExtensions(loc, 2, extensions, "explicit types");
|
||||
requireProfile(loc, ECoreProfile | ECompatibilityProfile, op);
|
||||
profileRequires(loc, ECoreProfile, 450, nullptr, op);
|
||||
profileRequires(loc, ECompatibilityProfile, 450, nullptr, op);
|
||||
profileRequires(loc, ECoreProfile, 450, NULL, op);
|
||||
profileRequires(loc, ECompatibilityProfile, 450, NULL, op);
|
||||
}
|
||||
}
|
||||
|
||||
@ -881,8 +881,8 @@ void TParseVersions::float16OpaqueCheck(const TSourceLoc& loc, const char* op, b
|
||||
if (! builtIn) {
|
||||
requireExtensions(loc, 1, &E_GL_AMD_gpu_shader_half_float_fetch, op);
|
||||
requireProfile(loc, ECoreProfile | ECompatibilityProfile, op);
|
||||
profileRequires(loc, ECoreProfile, 450, nullptr, op);
|
||||
profileRequires(loc, ECompatibilityProfile, 450, nullptr, op);
|
||||
profileRequires(loc, ECoreProfile, 450, NULL, op);
|
||||
profileRequires(loc, ECompatibilityProfile, 450, NULL, op);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@ -901,8 +901,8 @@ void TParseVersions::explicitInt16Check(const TSourceLoc& loc, const char* op, b
|
||||
#endif
|
||||
requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, "explicit types");
|
||||
requireProfile(loc, ECoreProfile | ECompatibilityProfile, op);
|
||||
profileRequires(loc, ECoreProfile, 450, nullptr, op);
|
||||
profileRequires(loc, ECompatibilityProfile, 450, nullptr, op);
|
||||
profileRequires(loc, ECoreProfile, 450, NULL, op);
|
||||
profileRequires(loc, ECompatibilityProfile, 450, NULL, op);
|
||||
}
|
||||
}
|
||||
|
||||
@ -914,8 +914,8 @@ void TParseVersions::explicitInt32Check(const TSourceLoc& loc, const char* op, b
|
||||
E_GL_KHX_shader_explicit_arithmetic_types_int32};
|
||||
requireExtensions(loc, 2, extensions, "explicit types");
|
||||
requireProfile(loc, ECoreProfile | ECompatibilityProfile, op);
|
||||
profileRequires(loc, ECoreProfile, 450, nullptr, op);
|
||||
profileRequires(loc, ECompatibilityProfile, 450, nullptr, op);
|
||||
profileRequires(loc, ECoreProfile, 450, NULL, op);
|
||||
profileRequires(loc, ECompatibilityProfile, 450, NULL, op);
|
||||
}
|
||||
}
|
||||
|
||||
@ -928,8 +928,8 @@ void TParseVersions::int64Check(const TSourceLoc& loc, const char* op, bool buil
|
||||
E_GL_KHX_shader_explicit_arithmetic_types_int64};
|
||||
requireExtensions(loc, 3, extensions, "shader int64");
|
||||
requireProfile(loc, ECoreProfile | ECompatibilityProfile, op);
|
||||
profileRequires(loc, ECoreProfile, 450, nullptr, op);
|
||||
profileRequires(loc, ECompatibilityProfile, 450, nullptr, op);
|
||||
profileRequires(loc, ECoreProfile, 450, NULL, op);
|
||||
profileRequires(loc, ECompatibilityProfile, 450, NULL, op);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -45,7 +45,7 @@ bool TAttributeArgs::getInt(int& value, int argNum) const
|
||||
{
|
||||
const TConstUnion* intConst = getConstUnion(EbtInt, argNum);
|
||||
|
||||
if (intConst == nullptr)
|
||||
if (intConst == NULL)
|
||||
return false;
|
||||
|
||||
value = intConst->getIConst();
|
||||
@ -58,7 +58,7 @@ bool TAttributeArgs::getString(TString& value, int argNum, bool convertToLower)
|
||||
{
|
||||
const TConstUnion* stringConst = getConstUnion(EbtString, argNum);
|
||||
|
||||
if (stringConst == nullptr)
|
||||
if (stringConst == NULL)
|
||||
return false;
|
||||
|
||||
value = *stringConst->getSConst();
|
||||
@ -73,21 +73,21 @@ bool TAttributeArgs::getString(TString& value, int argNum, bool convertToLower)
|
||||
// How many arguments were supplied?
|
||||
int TAttributeArgs::size() const
|
||||
{
|
||||
return args == nullptr ? 0 : (int)args->getSequence().size();
|
||||
return args == NULL ? 0 : (int)args->getSequence().size();
|
||||
}
|
||||
|
||||
// Helper to get attribute const union. Returns nullptr on failure.
|
||||
// Helper to get attribute const union. Returns NULL on failure.
|
||||
const TConstUnion* TAttributeArgs::getConstUnion(TBasicType basicType, int argNum) const
|
||||
{
|
||||
if (args == nullptr)
|
||||
return nullptr;
|
||||
if (args == NULL)
|
||||
return NULL;
|
||||
|
||||
if (argNum >= (int)args->getSequence().size())
|
||||
return nullptr;
|
||||
return NULL;
|
||||
|
||||
const TConstUnion* constVal = &args->getSequence()[argNum]->getAsConstantUnion()->getConstArray()[0];
|
||||
if (constVal == nullptr || constVal->getType() != basicType)
|
||||
return nullptr;
|
||||
if (constVal == NULL || constVal->getType() != basicType)
|
||||
return NULL;
|
||||
|
||||
return constVal;
|
||||
}
|
||||
@ -113,9 +113,9 @@ TAttributeType TParseContext::attributeFromName(const TString& name) const
|
||||
// Make an initial leaf for the grammar from a no-argument attribute
|
||||
TAttributes* TParseContext::makeAttributes(const TString& identifier) const
|
||||
{
|
||||
TAttributes *attributes = nullptr;
|
||||
TAttributes *attributes = NULL;
|
||||
attributes = NewPoolObject(attributes);
|
||||
TAttributeArgs args = { attributeFromName(identifier), nullptr };
|
||||
TAttributeArgs args = { attributeFromName(identifier), NULL };
|
||||
attributes->push_back(args);
|
||||
return attributes;
|
||||
}
|
||||
@ -123,7 +123,7 @@ TAttributes* TParseContext::makeAttributes(const TString& identifier) const
|
||||
// Make an initial leaf for the grammar from a one-argument attribute
|
||||
TAttributes* TParseContext::makeAttributes(const TString& identifier, TIntermNode* node) const
|
||||
{
|
||||
TAttributes *attributes = nullptr;
|
||||
TAttributes *attributes = NULL;
|
||||
attributes = NewPoolObject(attributes);
|
||||
|
||||
// for now, node is always a simple single expression, but other code expects
|
||||
@ -148,7 +148,7 @@ TAttributes* TParseContext::mergeAttributes(TAttributes* attr1, TAttributes* att
|
||||
void TParseContext::handleSelectionAttributes(const TAttributes& attributes, TIntermNode* node)
|
||||
{
|
||||
TIntermSelection* selection = node->getAsSelectionNode();
|
||||
if (selection == nullptr)
|
||||
if (selection == NULL)
|
||||
return;
|
||||
|
||||
for (auto it = attributes.begin(); it != attributes.end(); ++it) {
|
||||
@ -177,7 +177,7 @@ void TParseContext::handleSelectionAttributes(const TAttributes& attributes, TIn
|
||||
void TParseContext::handleSwitchAttributes(const TAttributes& attributes, TIntermNode* node)
|
||||
{
|
||||
TIntermSwitch* selection = node->getAsSwitchNode();
|
||||
if (selection == nullptr)
|
||||
if (selection == NULL)
|
||||
return;
|
||||
|
||||
for (auto it = attributes.begin(); it != attributes.end(); ++it) {
|
||||
@ -206,17 +206,17 @@ void TParseContext::handleSwitchAttributes(const TAttributes& attributes, TInter
|
||||
void TParseContext::handleLoopAttributes(const TAttributes& attributes, TIntermNode* node)
|
||||
{
|
||||
TIntermLoop* loop = node->getAsLoopNode();
|
||||
if (loop == nullptr) {
|
||||
if (loop == NULL) {
|
||||
// the actual loop might be part of a sequence
|
||||
TIntermAggregate* agg = node->getAsAggregate();
|
||||
if (agg == nullptr)
|
||||
if (agg == NULL)
|
||||
return;
|
||||
for (auto it = agg->getSequence().begin(); it != agg->getSequence().end(); ++it) {
|
||||
loop = (*it)->getAsLoopNode();
|
||||
if (loop != nullptr)
|
||||
if (loop != NULL)
|
||||
break;
|
||||
}
|
||||
if (loop == nullptr)
|
||||
if (loop == NULL)
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1083,7 +1083,7 @@ fully_specified_type
|
||||
}
|
||||
|
||||
if ($2.arraySizes && parseContext.arrayQualifierError($2.loc, $1.qualifier))
|
||||
$2.arraySizes = nullptr;
|
||||
$2.arraySizes = NULL;
|
||||
|
||||
parseContext.checkNoShaderLayouts($2.loc, $1.shaderQualifiers);
|
||||
$2.shaderQualifiers.merge($1.shaderQualifiers);
|
||||
@ -3546,7 +3546,7 @@ translation_unit
|
||||
parseContext.intermediate.setTreeRoot($$);
|
||||
}
|
||||
| translation_unit external_declaration {
|
||||
if ($2 != nullptr) {
|
||||
if ($2 != NULL) {
|
||||
$$ = parseContext.intermediate.growAggregate($1, $2);
|
||||
parseContext.intermediate.setTreeRoot($$);
|
||||
}
|
||||
@ -3562,8 +3562,8 @@ external_declaration
|
||||
}
|
||||
| SEMICOLON {
|
||||
parseContext.requireProfile($1.loc, ~EEsProfile, "extraneous semicolon");
|
||||
parseContext.profileRequires($1.loc, ~EEsProfile, 460, nullptr, "extraneous semicolon");
|
||||
$$ = nullptr;
|
||||
parseContext.profileRequires($1.loc, ~EEsProfile, 460, NULL, "extraneous semicolon");
|
||||
$$ = NULL;
|
||||
}
|
||||
;
|
||||
|
||||
|
@ -92,7 +92,7 @@ using namespace glslang;
|
||||
|
||||
# ifndef YY_NULL
|
||||
# if defined __cplusplus && 201103L <= __cplusplus
|
||||
# define YY_NULL nullptr
|
||||
# define YY_NULL NULL
|
||||
# else
|
||||
# define YY_NULL 0
|
||||
# endif
|
||||
@ -5304,7 +5304,7 @@ yyreduce:
|
||||
}
|
||||
|
||||
if ((yyvsp[0].interm.type).arraySizes && parseContext.arrayQualifierError((yyvsp[0].interm.type).loc, (yyvsp[-1].interm.type).qualifier))
|
||||
(yyvsp[0].interm.type).arraySizes = nullptr;
|
||||
(yyvsp[0].interm.type).arraySizes = NULL;
|
||||
|
||||
parseContext.checkNoShaderLayouts((yyvsp[0].interm.type).loc, (yyvsp[-1].interm.type).shaderQualifiers);
|
||||
(yyvsp[0].interm.type).shaderQualifiers.merge((yyvsp[-1].interm.type).shaderQualifiers);
|
||||
@ -9710,7 +9710,7 @@ yyreduce:
|
||||
case 546:
|
||||
#line 3548 "MachineIndependent/glslang.y" /* yacc.c:1646 */
|
||||
{
|
||||
if ((yyvsp[0].interm.intermNode) != nullptr) {
|
||||
if ((yyvsp[0].interm.intermNode) != NULL) {
|
||||
(yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-1].interm.intermNode), (yyvsp[0].interm.intermNode));
|
||||
parseContext.intermediate.setTreeRoot((yyval.interm.intermNode));
|
||||
}
|
||||
@ -9738,8 +9738,8 @@ yyreduce:
|
||||
#line 3563 "MachineIndependent/glslang.y" /* yacc.c:1646 */
|
||||
{
|
||||
parseContext.requireProfile((yyvsp[0].lex).loc, ~EEsProfile, "extraneous semicolon");
|
||||
parseContext.profileRequires((yyvsp[0].lex).loc, ~EEsProfile, 460, nullptr, "extraneous semicolon");
|
||||
(yyval.interm.intermNode) = nullptr;
|
||||
parseContext.profileRequires((yyvsp[0].lex).loc, ~EEsProfile, 460, NULL, "extraneous semicolon");
|
||||
(yyval.interm.intermNode) = NULL;
|
||||
}
|
||||
#line 9749 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
|
||||
break;
|
||||
|
@ -127,7 +127,7 @@ public:
|
||||
|
||||
virtual void visitSymbol(TIntermSymbol* base)
|
||||
{
|
||||
TVarLiveMap* target = nullptr;
|
||||
TVarLiveMap* target = NULL;
|
||||
if (base->getQualifier().storage == EvqVaryingIn)
|
||||
target = &inputList;
|
||||
else if (base->getQualifier().storage == EvqVaryingOut)
|
||||
@ -359,7 +359,7 @@ struct TDefaultIoResolverBase : public glslang::TIoMapResolver
|
||||
{ }
|
||||
|
||||
int getBaseBinding(TResourceType res, unsigned int set) const {
|
||||
return selectBaseBinding(intermediate.getShiftBinding(res),
|
||||
return selectBaseBinding(intermediate.getShiftBinding(res),
|
||||
intermediate.getShiftBindingForSet(res, set));
|
||||
}
|
||||
|
||||
@ -535,7 +535,7 @@ protected:
|
||||
}
|
||||
|
||||
static bool isTextureType(const glslang::TType& type) {
|
||||
return (type.getBasicType() == glslang::EbtSampler &&
|
||||
return (type.getBasicType() == glslang::EbtSampler &&
|
||||
(type.getSampler().isTexture() || type.getSampler().isSubpass()));
|
||||
}
|
||||
|
||||
@ -634,7 +634,7 @@ t - for shader resource views (SRV)
|
||||
BYTEADDRESSBUFFER
|
||||
BUFFER
|
||||
TBUFFER
|
||||
|
||||
|
||||
s - for samplers
|
||||
SAMPLER
|
||||
SAMPLER1D
|
||||
@ -738,21 +738,21 @@ bool TIoMapper::addStage(EShLanguage stage, TIntermediate &intermediate, TInfoSi
|
||||
intermediate.hasShiftBindingForSet(TResourceType(res));
|
||||
}
|
||||
|
||||
if (!somethingToDo && resolver == nullptr)
|
||||
if (!somethingToDo && resolver == NULL)
|
||||
return true;
|
||||
|
||||
if (intermediate.getNumEntryPoints() != 1 || intermediate.isRecursive())
|
||||
return false;
|
||||
|
||||
TIntermNode* root = intermediate.getTreeRoot();
|
||||
if (root == nullptr)
|
||||
if (root == NULL)
|
||||
return false;
|
||||
|
||||
// if no resolver is provided, use the default resolver with the given shifts and auto map settings
|
||||
TDefaultIoResolver defaultResolver(intermediate);
|
||||
TDefaultHlslIoResolver defaultHlslResolver(intermediate);
|
||||
|
||||
if (resolver == nullptr) {
|
||||
if (resolver == NULL) {
|
||||
// TODO: use a passed in IO mapper for this
|
||||
if (intermediate.usingHlslIoMapping())
|
||||
resolver = &defaultHlslResolver;
|
||||
|
@ -133,7 +133,7 @@ void TParseContext::inductiveLoopBodyCheck(TIntermNode* body, int loopId, TSymbo
|
||||
{
|
||||
TInductiveTraverser it(loopId, symbolTable);
|
||||
|
||||
if (body == nullptr)
|
||||
if (body == NULL)
|
||||
return;
|
||||
|
||||
body->traverse(&it);
|
||||
|
@ -388,7 +388,7 @@ void TIntermediate::mergeErrorCheck(TInfoSink& infoSink, const TIntermSymbol& sy
|
||||
//
|
||||
void TIntermediate::finalCheck(TInfoSink& infoSink, bool keepUncalled)
|
||||
{
|
||||
if (getTreeRoot() == nullptr)
|
||||
if (getTreeRoot() == NULL)
|
||||
return;
|
||||
|
||||
if (numEntryPoints < 1) {
|
||||
@ -679,9 +679,9 @@ void TIntermediate::checkCallGraphBodies(TInfoSink& infoSink, bool keepUncalled)
|
||||
if (! keepUncalled) {
|
||||
for (int f = 0; f < (int)functionSequence.size(); ++f) {
|
||||
if (! reachable[f])
|
||||
functionSequence[f] = nullptr;
|
||||
functionSequence[f] = NULL;
|
||||
}
|
||||
functionSequence.erase(std::remove(functionSequence.begin(), functionSequence.end(), nullptr), functionSequence.end());
|
||||
functionSequence.erase(std::remove(functionSequence.begin(), functionSequence.end(), NULL), functionSequence.end());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -267,7 +267,7 @@ public:
|
||||
shiftBinding[res] = shift;
|
||||
|
||||
const char* name = getResourceName(res);
|
||||
if (name != nullptr)
|
||||
if (name != NULL)
|
||||
processes.addIfNonZero(name, shift);
|
||||
}
|
||||
|
||||
@ -281,7 +281,7 @@ public:
|
||||
shiftBindingForSet[res][set] = shift;
|
||||
|
||||
const char* name = getResourceName(res);
|
||||
if (name != nullptr) {
|
||||
if (name != NULL) {
|
||||
processes.addProcess(name);
|
||||
processes.addArgument(shift);
|
||||
processes.addArgument(set);
|
||||
@ -618,7 +618,7 @@ public:
|
||||
return semanticNameSet.insert(name).first->c_str();
|
||||
}
|
||||
|
||||
void setSourceFile(const char* file) { if (file != nullptr) sourceFile = file; }
|
||||
void setSourceFile(const char* file) { if (file != NULL) sourceFile = file; }
|
||||
const std::string& getSourceFile() const { return sourceFile; }
|
||||
void addSourceText(const char* text) { sourceText = sourceText + text; }
|
||||
const std::string& getSourceText() const { return sourceText; }
|
||||
|
@ -86,6 +86,8 @@ NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <cctype>
|
||||
#include <climits>
|
||||
|
||||
#include <compat/strl.h>
|
||||
|
||||
#include "PpContext.h"
|
||||
#include "PpTokens.h"
|
||||
|
||||
@ -159,7 +161,7 @@ int TPpContext::CPPdefine(TPpToken* ppToken)
|
||||
|
||||
// check for duplicate definition
|
||||
MacroSymbol* existing = lookupMacroDef(defAtom);
|
||||
if (existing != nullptr) {
|
||||
if (existing != NULL) {
|
||||
if (! existing->undef) {
|
||||
// Already defined -- need to make sure they are identical:
|
||||
// "Two replacement lists are identical if and only if the preprocessing tokens in both have the same number,
|
||||
@ -205,7 +207,7 @@ int TPpContext::CPPundef(TPpToken* ppToken)
|
||||
_parseContext.reservedPpErrorCheck(ppToken->loc, ppToken->name, "#undef");
|
||||
|
||||
MacroSymbol* macro = lookupMacroDef(atomStrings.getAtom(ppToken->name));
|
||||
if (macro != nullptr)
|
||||
if (macro != NULL)
|
||||
macro->undef = 1;
|
||||
token = scanToken(ppToken);
|
||||
if (token != '\n')
|
||||
@ -422,7 +424,7 @@ int TPpContext::eval(int token, int precedence, bool shortCircuit, int& res, boo
|
||||
}
|
||||
|
||||
MacroSymbol* macro = lookupMacroDef(atomStrings.getAtom(ppToken->name));
|
||||
res = macro != nullptr ? !macro->undef : 0;
|
||||
res = macro != NULL ? !macro->undef : 0;
|
||||
token = scanToken(ppToken);
|
||||
if (needclose) {
|
||||
if (token != ')') {
|
||||
@ -584,7 +586,7 @@ int TPpContext::CPPifdef(int defined, TPpToken* ppToken)
|
||||
while (token != '\n' && token != EndOfInput)
|
||||
token = scanToken(ppToken);
|
||||
}
|
||||
if (((macro != nullptr && !macro->undef) ? 1 : 0) != defined)
|
||||
if (((macro != NULL && !macro->undef) ? 1 : 0) != defined)
|
||||
token = CPPelse(1, ppToken);
|
||||
}
|
||||
|
||||
@ -628,17 +630,17 @@ int TPpContext::CPPinclude(TPpToken* ppToken)
|
||||
|
||||
// Find the inclusion, first look in "Local" ("") paths, if requested,
|
||||
// otherwise, only search the "System" (<>) paths.
|
||||
TShader::Includer::IncludeResult* res = nullptr;
|
||||
TShader::Includer::IncludeResult* res = NULL;
|
||||
if (startWithLocalSearch)
|
||||
res = includer.includeLocal(filename.c_str(), currentSourceFile.c_str(), includeStack.size() + 1);
|
||||
if (res == nullptr || res->headerName.empty()) {
|
||||
if (res == NULL || res->headerName.empty()) {
|
||||
includer.releaseInclude(res);
|
||||
res = includer.includeSystem(filename.c_str(), currentSourceFile.c_str(), includeStack.size() + 1);
|
||||
}
|
||||
|
||||
// Process the results
|
||||
if (res != nullptr && !res->headerName.empty()) {
|
||||
if (res->headerData != nullptr && res->headerLength > 0) {
|
||||
if (res != NULL && !res->headerName.empty()) {
|
||||
if (res->headerData != NULL && res->headerLength > 0) {
|
||||
// path for processing one or more tokens from an included header, hand off 'res'
|
||||
const bool forNextLine = _parseContext.lineDirectiveShouldSetNextLine();
|
||||
std::ostringstream prologue;
|
||||
@ -656,7 +658,7 @@ int TPpContext::CPPinclude(TPpToken* ppToken)
|
||||
} else {
|
||||
// error path, clean up
|
||||
std::string message =
|
||||
res != nullptr ? std::string(res->headerData, res->headerLength)
|
||||
res != NULL ? std::string(res->headerData, res->headerLength)
|
||||
: std::string("Could not process include directive");
|
||||
_parseContext.ppError(directiveLoc, message.c_str(), "#include", "for header name: %s", filename.c_str());
|
||||
includer.releaseInclude(res);
|
||||
@ -683,7 +685,7 @@ int TPpContext::CPPline(TPpToken* ppToken)
|
||||
int lineToken = 0;
|
||||
bool hasFile = false;
|
||||
int fileRes = 0; // Source file number after macro expansion.
|
||||
const char* sourceName = nullptr; // Optional source file name.
|
||||
const char* sourceName = NULL; // Optional source file name.
|
||||
bool lineErr = false;
|
||||
bool fileErr = false;
|
||||
token = eval(token, MIN_PRECEDENCE, false, lineRes, lineErr, ppToken);
|
||||
@ -820,7 +822,7 @@ int TPpContext::CPPversion(TPpToken* ppToken)
|
||||
token = scanToken(ppToken);
|
||||
|
||||
if (token == '\n') {
|
||||
_parseContext.notifyVersion(line, versionNumber, nullptr);
|
||||
_parseContext.notifyVersion(line, versionNumber, NULL);
|
||||
return token;
|
||||
} else {
|
||||
int profileAtom = atomStrings.getAtom(ppToken->name);
|
||||
@ -1000,7 +1002,7 @@ int TPpContext::scanHeaderName(TPpToken* ppToken, char delimit)
|
||||
|
||||
// Macro-expand a macro argument 'arg' to create 'expandedArg'.
|
||||
// Does not replace 'arg'.
|
||||
// Returns nullptr if no expanded argument is created.
|
||||
// Returns NULL if no expanded argument is created.
|
||||
TPpContext::TokenStream* TPpContext::PrescanMacroArg(TokenStream& arg, TPpToken* ppToken, bool newLineOkay)
|
||||
{
|
||||
// expand the argument
|
||||
@ -1020,7 +1022,7 @@ TPpContext::TokenStream* TPpContext::PrescanMacroArg(TokenStream& arg, TPpToken*
|
||||
if (token == EndOfInput) {
|
||||
// MacroExpand ate the marker, so had bad input, recover
|
||||
delete expandedArg;
|
||||
expandedArg = nullptr;
|
||||
expandedArg = NULL;
|
||||
} else {
|
||||
// remove the marker
|
||||
popInput();
|
||||
@ -1084,7 +1086,7 @@ int TPpContext::tMacroInput::scan(TPpToken* ppToken)
|
||||
break;
|
||||
if (i >= 0) {
|
||||
TokenStream* arg = expandedArgs[i];
|
||||
if (arg == nullptr || pasting)
|
||||
if (arg == NULL || pasting)
|
||||
arg = args[i];
|
||||
pp->pushTokenStreamInput(*arg, prepaste);
|
||||
|
||||
@ -1135,7 +1137,7 @@ int TPpContext::MacroExpand(TPpToken* ppToken, bool expandUndef, bool newLineOka
|
||||
if (_parseContext.getCurrentLoc().name)
|
||||
_parseContext.ppRequireExtensions(ppToken->loc, 1, &E_GL_GOOGLE_cpp_style_line_directive, "filename-based __FILE__");
|
||||
ppToken->ival = _parseContext.getCurrentLoc().string;
|
||||
snprintf(ppToken->name, sizeof(ppToken->name), "%s", ppToken->loc.getStringNameOrNum().c_str());
|
||||
strlcpy(ppToken->name, ppToken->loc.getStringNameOrNum().c_str(), sizeof(ppToken->name));
|
||||
UngetToken(PpAtomConstInt, ppToken);
|
||||
return 1;
|
||||
}
|
||||
@ -1150,19 +1152,19 @@ int TPpContext::MacroExpand(TPpToken* ppToken, bool expandUndef, bool newLineOka
|
||||
break;
|
||||
}
|
||||
|
||||
MacroSymbol* macro = macroAtom == 0 ? nullptr : lookupMacroDef(macroAtom);
|
||||
MacroSymbol* macro = macroAtom == 0 ? NULL : lookupMacroDef(macroAtom);
|
||||
int depth = 0;
|
||||
|
||||
// no recursive expansions
|
||||
if (macro != nullptr && macro->busy)
|
||||
if (macro != NULL && macro->busy)
|
||||
return 0;
|
||||
|
||||
// not expanding undefined macros
|
||||
if ((macro == nullptr || macro->undef) && ! expandUndef)
|
||||
if ((macro == NULL || macro->undef) && ! expandUndef)
|
||||
return 0;
|
||||
|
||||
// 0 is the value of an undefined macro
|
||||
if ((macro == nullptr || macro->undef) && expandUndef) {
|
||||
if ((macro == NULL || macro->undef) && expandUndef) {
|
||||
pushInput(new tZeroInput(this));
|
||||
return -1;
|
||||
}
|
||||
@ -1187,7 +1189,7 @@ int TPpContext::MacroExpand(TPpToken* ppToken, bool expandUndef, bool newLineOka
|
||||
in->args[i] = new TokenStream;
|
||||
in->expandedArgs.resize(in->mac->args.size());
|
||||
for (size_t i = 0; i < in->mac->args.size(); i++)
|
||||
in->expandedArgs[i] = nullptr;
|
||||
in->expandedArgs[i] = NULL;
|
||||
size_t arg = 0;
|
||||
bool tokenRecorded = false;
|
||||
do {
|
||||
|
@ -273,7 +273,7 @@ public:
|
||||
MacroSymbol* lookupMacroDef(int atom)
|
||||
{
|
||||
auto existingMacroIt = macroDefs.find(atom);
|
||||
return (existingMacroIt == macroDefs.end()) ? nullptr : &(existingMacroIt->second);
|
||||
return (existingMacroIt == macroDefs.end()) ? NULL : &(existingMacroIt->second);
|
||||
}
|
||||
void addMacroDef(int atom, MacroSymbol& macroDef) { macroDefs[atom] = macroDef; }
|
||||
|
||||
@ -527,7 +527,7 @@ protected:
|
||||
epilogue_(epilogue),
|
||||
includedFile_(includedFile),
|
||||
scanner(3, strings, lengths, names, 0, 0, true),
|
||||
prevScanner(nullptr),
|
||||
prevScanner(NULL),
|
||||
stringInput(pp, scanner)
|
||||
{
|
||||
strings[0] = prologue_.data();
|
||||
|
@ -288,9 +288,9 @@ int TPpContext::lFloatConst(int len, int ch, TPpToken* ppToken)
|
||||
}
|
||||
} else if (ch == 'f' || ch == 'F') {
|
||||
if (ifdepth == 0)
|
||||
_parseContext.profileRequires(ppToken->loc, EEsProfile, 300, nullptr, "floating-point suffix");
|
||||
_parseContext.profileRequires(ppToken->loc, EEsProfile, 300, NULL, "floating-point suffix");
|
||||
if (ifdepth == 0 && !_parseContext.relaxedErrors())
|
||||
_parseContext.profileRequires(ppToken->loc, ~EEsProfile, 120, nullptr, "floating-point suffix");
|
||||
_parseContext.profileRequires(ppToken->loc, ~EEsProfile, 120, NULL, "floating-point suffix");
|
||||
if (ifdepth == 0 && !hasDecimalOrExponent)
|
||||
_parseContext.ppError(ppToken->loc, "float literal needs a decimal point or exponent", "", "");
|
||||
saveName(ch);
|
||||
|
@ -274,7 +274,7 @@ TSymbolDefinitionCollectingTraverser::TSymbolDefinitionCollectingTraverser(
|
||||
: TIntermTraverser(true, false, false), symbol_definition_mapping_(*symbol_definition_mapping),
|
||||
precise_objects_(*precise_objects), precise_return_nodes_(*precise_return_nodes),
|
||||
current_object_(), accesschain_mapping_(*accesschain_mapping),
|
||||
current_function_definition_node_(nullptr) {}
|
||||
current_function_definition_node_(NULL) {}
|
||||
|
||||
// Visits a symbol node, set the current_object_ to the
|
||||
// current node symbol ID, and record a mapping from this node to the current
|
||||
@ -462,7 +462,7 @@ class TNoContractionAssigneeCheckingTraverser : public glslang::TIntermTraverser
|
||||
public:
|
||||
TNoContractionAssigneeCheckingTraverser(const AccessChainMapping& accesschain_mapping)
|
||||
: TIntermTraverser(true, false, false), accesschain_mapping_(accesschain_mapping),
|
||||
precise_object_(nullptr) {}
|
||||
precise_object_(NULL) {}
|
||||
|
||||
// Checks the preciseness of a given assignment node with a precise object
|
||||
// represented as access chain. The precise object shares the same symbol
|
||||
@ -654,7 +654,7 @@ protected:
|
||||
// Gets the struct dereference index that leads to 'precise' object.
|
||||
ObjectAccessChain precise_accesschain_index_str =
|
||||
getFrontElement(remained_accesschain_);
|
||||
unsigned precise_accesschain_index = (unsigned)strtoul(precise_accesschain_index_str.c_str(), nullptr, 10);
|
||||
unsigned precise_accesschain_index = (unsigned)strtoul(precise_accesschain_index_str.c_str(), NULL, 10);
|
||||
// Gets the node pointed by the access chain index extracted before.
|
||||
glslang::TIntermTyped* potential_precise_node =
|
||||
node->getSequence()[precise_accesschain_index]->getAsTyped();
|
||||
|
@ -372,7 +372,7 @@ public:
|
||||
return base;
|
||||
TIntermBinary* left = node->getLeft()->getAsBinaryNode();
|
||||
if (! left)
|
||||
return nullptr;
|
||||
return NULL;
|
||||
|
||||
return findBase(left);
|
||||
}
|
||||
@ -781,7 +781,7 @@ void TReflection::buildCounterIndices(const TIntermediate& intermediate)
|
||||
// Returns false if the input is too malformed to do this.
|
||||
bool TReflection::addStage(EShLanguage stage, const TIntermediate& intermediate)
|
||||
{
|
||||
if (intermediate.getTreeRoot() == nullptr ||
|
||||
if (intermediate.getTreeRoot() == NULL ||
|
||||
intermediate.getNumEntryPoints() != 1 ||
|
||||
intermediate.isRecursive())
|
||||
return false;
|
||||
|
@ -62,7 +62,7 @@ public:
|
||||
const TType* const getType() const { return type; }
|
||||
int getBinding() const
|
||||
{
|
||||
if (type == nullptr || !type->getQualifier().hasBinding())
|
||||
if (type == NULL || !type->getQualifier().hasBinding())
|
||||
return -1;
|
||||
return type->getQualifier().layoutBinding;
|
||||
}
|
||||
@ -76,7 +76,7 @@ public:
|
||||
int counterIndex;
|
||||
|
||||
protected:
|
||||
TObjectReflection() : offset(-1), glDefineType(-1), size(-1), index(-1), type(nullptr) { }
|
||||
TObjectReflection() : offset(-1), glDefineType(-1), size(-1), index(-1), type(NULL) { }
|
||||
|
||||
const TType* type;
|
||||
};
|
||||
|
@ -474,7 +474,7 @@ public:
|
||||
// and include depth.
|
||||
// On success, returns an IncludeResult containing the resolved name
|
||||
// and content of the include.
|
||||
// On failure, returns a nullptr, or an IncludeResult
|
||||
// On failure, returns a NULL, or an IncludeResult
|
||||
// with an empty string for the headerName and error details in the
|
||||
// header field.
|
||||
// The Includer retains ownership of the contents
|
||||
@ -489,14 +489,14 @@ public:
|
||||
// For the "system" or <>-style includes; search the "system" paths.
|
||||
virtual IncludeResult* includeSystem(const char* /*headerName*/,
|
||||
const char* /*includerName*/,
|
||||
size_t /*inclusionDepth*/) { return nullptr; }
|
||||
size_t /*inclusionDepth*/) { return NULL; }
|
||||
|
||||
// For the "local"-only aspect of a "" include. Should not search in the
|
||||
// "system" paths, because on returning a failure, the parser will
|
||||
// call includeSystem() to look in the "system" locations.
|
||||
virtual IncludeResult* includeLocal(const char* /*headerName*/,
|
||||
const char* /*includerName*/,
|
||||
size_t /*inclusionDepth*/) { return nullptr; }
|
||||
size_t /*inclusionDepth*/) { return NULL; }
|
||||
|
||||
// Signals that the parser will no longer use the contents of the
|
||||
// specified IncludeResult.
|
||||
|
Loading…
x
Reference in New Issue
Block a user