glslang portability: Fixed a slew of OSX compilation warnings (but not all).
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@31469 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
parent
79eaa91e6f
commit
fae38ee277
@ -370,7 +370,7 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(const glslang::TIntermediate* gls
|
|||||||
if (glslangIntermediate->getXfbMode())
|
if (glslangIntermediate->getXfbMode())
|
||||||
builder.addExecutionMode(shaderEntry, spv::ExecutionModeXfb);
|
builder.addExecutionMode(shaderEntry, spv::ExecutionModeXfb);
|
||||||
|
|
||||||
spv::ExecutionMode mode;
|
unsigned int mode;
|
||||||
switch (glslangIntermediate->getStage()) {
|
switch (glslangIntermediate->getStage()) {
|
||||||
case EShLangVertex:
|
case EShLangVertex:
|
||||||
break;
|
break;
|
||||||
@ -384,10 +384,10 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(const glslang::TIntermediate* gls
|
|||||||
case glslang::ElgTriangles: mode = spv::ExecutionModeInputTriangles; break;
|
case glslang::ElgTriangles: mode = spv::ExecutionModeInputTriangles; break;
|
||||||
case glslang::ElgQuads: mode = spv::ExecutionModeInputQuads; break;
|
case glslang::ElgQuads: mode = spv::ExecutionModeInputQuads; break;
|
||||||
case glslang::ElgIsolines: mode = spv::ExecutionModeInputIsolines; break;
|
case glslang::ElgIsolines: mode = spv::ExecutionModeInputIsolines; break;
|
||||||
default: mode = (spv::ExecutionMode)spv::BadValue; break;
|
default: mode = spv::BadValue; break;
|
||||||
}
|
}
|
||||||
if (mode != spv::BadValue)
|
if (mode != spv::BadValue)
|
||||||
builder.addExecutionMode(shaderEntry, mode);
|
builder.addExecutionMode(shaderEntry, (spv::ExecutionMode)mode);
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
//builder.addExecutionMode(spv::VertexSpacingMdName, glslangIntermediate->getVertexSpacing());
|
//builder.addExecutionMode(spv::VertexSpacingMdName, glslangIntermediate->getVertexSpacing());
|
||||||
@ -402,20 +402,20 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(const glslang::TIntermediate* gls
|
|||||||
case glslang::ElgLinesAdjacency: mode = spv::ExecutionModeInputLinesAdjacency; break;
|
case glslang::ElgLinesAdjacency: mode = spv::ExecutionModeInputLinesAdjacency; break;
|
||||||
case glslang::ElgTriangles: mode = spv::ExecutionModeInputTriangles; break;
|
case glslang::ElgTriangles: mode = spv::ExecutionModeInputTriangles; break;
|
||||||
case glslang::ElgTrianglesAdjacency: mode = spv::ExecutionModeInputTrianglesAdjacency; break;
|
case glslang::ElgTrianglesAdjacency: mode = spv::ExecutionModeInputTrianglesAdjacency; break;
|
||||||
default: mode = (spv::ExecutionMode)spv::BadValue; break;
|
default: mode = spv::BadValue; break;
|
||||||
}
|
}
|
||||||
if (mode != spv::BadValue)
|
if (mode != spv::BadValue)
|
||||||
builder.addExecutionMode(shaderEntry, mode);
|
builder.addExecutionMode(shaderEntry, (spv::ExecutionMode)mode);
|
||||||
builder.addExecutionMode(shaderEntry, spv::ExecutionModeInvocations, glslangIntermediate->getInvocations());
|
builder.addExecutionMode(shaderEntry, spv::ExecutionModeInvocations, glslangIntermediate->getInvocations());
|
||||||
|
|
||||||
switch (glslangIntermediate->getOutputPrimitive()) {
|
switch (glslangIntermediate->getOutputPrimitive()) {
|
||||||
case glslang::ElgPoints: mode = spv::ExecutionModeOutputPoints; break;
|
case glslang::ElgPoints: mode = spv::ExecutionModeOutputPoints; break;
|
||||||
case glslang::ElgLineStrip: mode = spv::ExecutionModeOutputLineStrip; break;
|
case glslang::ElgLineStrip: mode = spv::ExecutionModeOutputLineStrip; break;
|
||||||
case glslang::ElgTriangleStrip: mode = spv::ExecutionModeOutputTriangleStrip; break;
|
case glslang::ElgTriangleStrip: mode = spv::ExecutionModeOutputTriangleStrip; break;
|
||||||
default: mode = (spv::ExecutionMode)spv::BadValue; break;
|
default: mode = spv::BadValue; break;
|
||||||
}
|
}
|
||||||
if (mode != spv::BadValue)
|
if (mode != spv::BadValue)
|
||||||
builder.addExecutionMode(shaderEntry, mode);
|
builder.addExecutionMode(shaderEntry, (spv::ExecutionMode)mode);
|
||||||
builder.addExecutionMode(shaderEntry, spv::ExecutionModeOutputVertices, glslangIntermediate->getVertices());
|
builder.addExecutionMode(shaderEntry, spv::ExecutionModeOutputVertices, glslangIntermediate->getVertices());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -1239,10 +1239,7 @@ spv::Id TGlslangToSpvTraverser::createSpvVariable(const glslang::TIntermSymbol*
|
|||||||
if (glslang::IsAnonymous(name))
|
if (glslang::IsAnonymous(name))
|
||||||
name = "";
|
name = "";
|
||||||
|
|
||||||
if (storageClass == spv::BadValue)
|
return builder.createVariable(storageClass, spvType, name);
|
||||||
return builder.createVariable(spv::StorageClassFunction, spvType, name);
|
|
||||||
else
|
|
||||||
return builder.createVariable(storageClass, spvType, name);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return type Id of the sampled type.
|
// Return type Id of the sampled type.
|
||||||
|
@ -2053,8 +2053,8 @@ void Builder::simplifyAccessChainSwizzle()
|
|||||||
void Builder::mergeAccessChainSwizzle()
|
void Builder::mergeAccessChainSwizzle()
|
||||||
{
|
{
|
||||||
// is there even a chance of doing something? Need a single-component swizzle
|
// is there even a chance of doing something? Need a single-component swizzle
|
||||||
if (accessChain.swizzle.size() > 1 ||
|
if ((accessChain.swizzle.size() > 1) ||
|
||||||
accessChain.swizzle.size() == 0 && accessChain.component == 0)
|
(accessChain.swizzle.size() == 0 && accessChain.component == 0))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// TODO: optimization: remove this, but for now confine this to non-dynamic accesses
|
// TODO: optimization: remove this, but for now confine this to non-dynamic accesses
|
||||||
|
@ -368,8 +368,8 @@ void SpirvStream::disassembleInstruction(Id resultId, Id /*typeId*/, Op opCode,
|
|||||||
disassembleIds(numOperands);
|
disassembleIds(numOperands);
|
||||||
return;
|
return;
|
||||||
case OperandVariableLiterals:
|
case OperandVariableLiterals:
|
||||||
if (opCode == OpDecorate && stream[word - 1] == DecorationBuiltIn ||
|
if ((opCode == OpDecorate && stream[word - 1] == DecorationBuiltIn) ||
|
||||||
opCode == OpMemberDecorate && stream[word - 1] == DecorationBuiltIn) {
|
(opCode == OpMemberDecorate && stream[word - 1] == DecorationBuiltIn)) {
|
||||||
out << BuiltInString(stream[word++]);
|
out << BuiltInString(stream[word++]);
|
||||||
--numOperands;
|
--numOperands;
|
||||||
++op;
|
++op;
|
||||||
|
@ -980,6 +980,8 @@ void FreeFileData(char** data)
|
|||||||
|
|
||||||
void InfoLogMsg(const char* msg, const char* name, const int num)
|
void InfoLogMsg(const char* msg, const char* name, const int num)
|
||||||
{
|
{
|
||||||
printf(num >= 0 ? "#### %s %s %d INFO LOG ####\n" :
|
if (num >= 0 )
|
||||||
"#### %s %s INFO LOG ####\n", msg, name, num);
|
printf("#### %s %s %d INFO LOG ####\n", msg, name, num);
|
||||||
|
else
|
||||||
|
printf("#### %s %s INFO LOG ####\n", msg, name);
|
||||||
}
|
}
|
||||||
|
@ -447,7 +447,8 @@ struct TIntermNodePair {
|
|||||||
//
|
//
|
||||||
class TIntermTyped : public TIntermNode {
|
class TIntermTyped : public TIntermNode {
|
||||||
public:
|
public:
|
||||||
TIntermTyped(const TType& t) { type.shallowCopy(t); }
|
TIntermTyped(const TType& t) { type.shallowCopy(t); }
|
||||||
|
TIntermTyped(TBasicType basicType) { TType bt(basicType); type.shallowCopy(bt); }
|
||||||
virtual TIntermTyped* getAsTyped() { return this; }
|
virtual TIntermTyped* getAsTyped() { return this; }
|
||||||
virtual const TIntermTyped* getAsTyped() const { return this; }
|
virtual const TIntermTyped* getAsTyped() const { return this; }
|
||||||
virtual void setType(const TType& t) { type.shallowCopy(t); }
|
virtual void setType(const TType& t) { type.shallowCopy(t); }
|
||||||
@ -535,9 +536,9 @@ protected:
|
|||||||
//
|
//
|
||||||
class TIntermSymbol : public TIntermTyped {
|
class TIntermSymbol : public TIntermTyped {
|
||||||
public:
|
public:
|
||||||
// if symbol is initialized as symbol(sym), the memory comes from the poolallocator of sym. If sym comes from
|
// if symbol is initialized as symbol(sym), the memory comes from the poolallocator of sym. If sym comes from
|
||||||
// per process threadPoolAllocator, then it causes increased memory usage per compile
|
// per process threadPoolAllocator, then it causes increased memory usage per compile
|
||||||
// it is essential to use "symbol = sym" to assign to symbol
|
// it is essential to use "symbol = sym" to assign to symbol
|
||||||
TIntermSymbol(int i, const TString& n, const TType& t) :
|
TIntermSymbol(int i, const TString& n, const TType& t) :
|
||||||
TIntermTyped(t), id(i) { name = n;}
|
TIntermTyped(t), id(i) { name = n;}
|
||||||
virtual int getId() const { return id; }
|
virtual int getId() const { return id; }
|
||||||
@ -582,8 +583,8 @@ public:
|
|||||||
bool isConstructor() const;
|
bool isConstructor() const;
|
||||||
virtual bool promote() { return true; }
|
virtual bool promote() { return true; }
|
||||||
protected:
|
protected:
|
||||||
TIntermOperator(TOperator o) : TIntermTyped(TType(EbtFloat)), op(o) {}
|
TIntermOperator(TOperator o) : TIntermTyped(EbtFloat), op(o) {}
|
||||||
TIntermOperator(TOperator o, TType& t) : TIntermTyped(t), op(o) {}
|
TIntermOperator(TOperator o, TType& t) : TIntermTyped(t), op(o) {}
|
||||||
TOperator op;
|
TOperator op;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -634,35 +635,35 @@ class TIntermAggregate : public TIntermOperator {
|
|||||||
public:
|
public:
|
||||||
TIntermAggregate() : TIntermOperator(EOpNull), userDefined(false), pragmaTable(0) { }
|
TIntermAggregate() : TIntermOperator(EOpNull), userDefined(false), pragmaTable(0) { }
|
||||||
TIntermAggregate(TOperator o) : TIntermOperator(o), pragmaTable(0) { }
|
TIntermAggregate(TOperator o) : TIntermOperator(o), pragmaTable(0) { }
|
||||||
~TIntermAggregate() { delete pragmaTable; }
|
~TIntermAggregate() { delete pragmaTable; }
|
||||||
virtual TIntermAggregate* getAsAggregate() { return this; }
|
virtual TIntermAggregate* getAsAggregate() { return this; }
|
||||||
virtual const TIntermAggregate* getAsAggregate() const { return this; }
|
virtual const TIntermAggregate* getAsAggregate() const { return this; }
|
||||||
virtual void setOperator(TOperator o) { op = o; }
|
virtual void setOperator(TOperator o) { op = o; }
|
||||||
virtual TIntermSequence& getSequence() { return sequence; }
|
virtual TIntermSequence& getSequence() { return sequence; }
|
||||||
virtual const TIntermSequence& getSequence() const { return sequence; }
|
virtual const TIntermSequence& getSequence() const { return sequence; }
|
||||||
virtual void setName(const TString& n) { name = n; }
|
virtual void setName(const TString& n) { name = n; }
|
||||||
virtual const TString& getName() const { return name; }
|
virtual const TString& getName() const { return name; }
|
||||||
virtual void traverse(TIntermTraverser*);
|
virtual void traverse(TIntermTraverser*);
|
||||||
virtual void setUserDefined() { userDefined = true; }
|
virtual void setUserDefined() { userDefined = true; }
|
||||||
virtual bool isUserDefined() { return userDefined; }
|
virtual bool isUserDefined() { return userDefined; }
|
||||||
virtual TQualifierList& getQualifierList() { return qualifier; }
|
virtual TQualifierList& getQualifierList() { return qualifier; }
|
||||||
virtual const TQualifierList& getQualifierList() const { return qualifier; }
|
virtual const TQualifierList& getQualifierList() const { return qualifier; }
|
||||||
void setOptimize(bool o) { optimize = o; }
|
void setOptimize(bool o) { optimize = o; }
|
||||||
void setDebug(bool d) { debug = d; }
|
void setDebug(bool d) { debug = d; }
|
||||||
bool getOptimize() { return optimize; }
|
bool getOptimize() { return optimize; }
|
||||||
bool getDebug() { return debug; }
|
bool getDebug() { return debug; }
|
||||||
void addToPragmaTable(const TPragmaTable& pTable);
|
void addToPragmaTable(const TPragmaTable& pTable);
|
||||||
const TPragmaTable& getPragmaTable() const { return *pragmaTable; }
|
const TPragmaTable& getPragmaTable() const { return *pragmaTable; }
|
||||||
protected:
|
protected:
|
||||||
TIntermAggregate(const TIntermAggregate&); // disallow copy constructor
|
TIntermAggregate(const TIntermAggregate&); // disallow copy constructor
|
||||||
TIntermAggregate& operator=(const TIntermAggregate&); // disallow assignment operator
|
TIntermAggregate& operator=(const TIntermAggregate&); // disallow assignment operator
|
||||||
TIntermSequence sequence;
|
TIntermSequence sequence;
|
||||||
TQualifierList qualifier;
|
TQualifierList qualifier;
|
||||||
TString name;
|
TString name;
|
||||||
bool userDefined; // used for user defined function names
|
bool userDefined; // used for user defined function names
|
||||||
bool optimize;
|
bool optimize;
|
||||||
bool debug;
|
bool debug;
|
||||||
TPragmaTable* pragmaTable;
|
TPragmaTable* pragmaTable;
|
||||||
};
|
};
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -671,7 +672,7 @@ protected:
|
|||||||
class TIntermSelection : public TIntermTyped {
|
class TIntermSelection : public TIntermTyped {
|
||||||
public:
|
public:
|
||||||
TIntermSelection(TIntermTyped* cond, TIntermNode* trueB, TIntermNode* falseB) :
|
TIntermSelection(TIntermTyped* cond, TIntermNode* trueB, TIntermNode* falseB) :
|
||||||
TIntermTyped(TType(EbtVoid)), condition(cond), trueBlock(trueB), falseBlock(falseB) {}
|
TIntermTyped(EbtVoid), condition(cond), trueBlock(trueB), falseBlock(falseB) {}
|
||||||
TIntermSelection(TIntermTyped* cond, TIntermNode* trueB, TIntermNode* falseB, const TType& type) :
|
TIntermSelection(TIntermTyped* cond, TIntermNode* trueB, TIntermNode* falseB, const TType& type) :
|
||||||
TIntermTyped(type), condition(cond), trueBlock(trueB), falseBlock(falseB) {}
|
TIntermTyped(type), condition(cond), trueBlock(trueB), falseBlock(falseB) {}
|
||||||
virtual void traverse(TIntermTraverser*);
|
virtual void traverse(TIntermTraverser*);
|
||||||
|
@ -132,6 +132,7 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TIntermTyped* const
|
|||||||
}
|
}
|
||||||
|
|
||||||
TConstUnionArray newConstArray(newComps);
|
TConstUnionArray newConstArray(newComps);
|
||||||
|
TType constBool(EbtBool, EvqConst);
|
||||||
|
|
||||||
switch(op) {
|
switch(op) {
|
||||||
case EOpAdd:
|
case EOpAdd:
|
||||||
@ -265,27 +266,27 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TIntermTyped* const
|
|||||||
|
|
||||||
case EOpLessThan:
|
case EOpLessThan:
|
||||||
newConstArray[0].setBConst(unionArray[0] < rightUnionArray[0]);
|
newConstArray[0].setBConst(unionArray[0] < rightUnionArray[0]);
|
||||||
returnType.shallowCopy(TType(EbtBool, EvqConst));
|
returnType.shallowCopy(constBool);
|
||||||
break;
|
break;
|
||||||
case EOpGreaterThan:
|
case EOpGreaterThan:
|
||||||
newConstArray[0].setBConst(unionArray[0] > rightUnionArray[0]);
|
newConstArray[0].setBConst(unionArray[0] > rightUnionArray[0]);
|
||||||
returnType.shallowCopy(TType(EbtBool, EvqConst));
|
returnType.shallowCopy(constBool);
|
||||||
break;
|
break;
|
||||||
case EOpLessThanEqual:
|
case EOpLessThanEqual:
|
||||||
newConstArray[0].setBConst(! (unionArray[0] > rightUnionArray[0]));
|
newConstArray[0].setBConst(! (unionArray[0] > rightUnionArray[0]));
|
||||||
returnType.shallowCopy(TType(EbtBool, EvqConst));
|
returnType.shallowCopy(constBool);
|
||||||
break;
|
break;
|
||||||
case EOpGreaterThanEqual:
|
case EOpGreaterThanEqual:
|
||||||
newConstArray[0].setBConst(! (unionArray[0] < rightUnionArray[0]));
|
newConstArray[0].setBConst(! (unionArray[0] < rightUnionArray[0]));
|
||||||
returnType.shallowCopy(TType(EbtBool, EvqConst));
|
returnType.shallowCopy(constBool);
|
||||||
break;
|
break;
|
||||||
case EOpEqual:
|
case EOpEqual:
|
||||||
newConstArray[0].setBConst(node->getConstArray() == unionArray);
|
newConstArray[0].setBConst(node->getConstArray() == unionArray);
|
||||||
returnType.shallowCopy(TType(EbtBool, EvqConst));
|
returnType.shallowCopy(constBool);
|
||||||
break;
|
break;
|
||||||
case EOpNotEqual:
|
case EOpNotEqual:
|
||||||
newConstArray[0].setBConst(node->getConstArray() != unionArray);
|
newConstArray[0].setBConst(node->getConstArray() != unionArray);
|
||||||
returnType.shallowCopy(TType(EbtBool, EvqConst));
|
returnType.shallowCopy(constBool);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -416,8 +416,8 @@ void TBuiltIns::initialize(int version, EProfile profile)
|
|||||||
"\n");
|
"\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (profile == EEsProfile && version >= 310 ||
|
if ((profile == EEsProfile && version >= 310) ||
|
||||||
profile != EEsProfile && version >= 430) {
|
(profile != EEsProfile && version >= 430)) {
|
||||||
commonBuiltins.append(
|
commonBuiltins.append(
|
||||||
"uint atomicAdd(coherent volatile inout uint, uint);"
|
"uint atomicAdd(coherent volatile inout uint, uint);"
|
||||||
" int atomicAdd(coherent volatile inout int, int);"
|
" int atomicAdd(coherent volatile inout int, int);"
|
||||||
@ -446,8 +446,8 @@ void TBuiltIns::initialize(int version, EProfile profile)
|
|||||||
"\n");
|
"\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (profile == EEsProfile && version >= 310 ||
|
if ((profile == EEsProfile && version >= 310) ||
|
||||||
profile != EEsProfile && version >= 450) {
|
(profile != EEsProfile && version >= 450)) {
|
||||||
commonBuiltins.append(
|
commonBuiltins.append(
|
||||||
"int mix(int x, int y, bool a);"
|
"int mix(int x, int y, bool a);"
|
||||||
"ivec2 mix(ivec2 x, ivec2 y, bvec2 a);"
|
"ivec2 mix(ivec2 x, ivec2 y, bvec2 a);"
|
||||||
@ -1330,8 +1330,8 @@ void TBuiltIns::initialize(int version, EProfile profile)
|
|||||||
//
|
//
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
if (profile != EEsProfile && version >= 430 ||
|
if ((profile != EEsProfile && version >= 430) ||
|
||||||
profile == EEsProfile && version >= 310) {
|
(profile == EEsProfile && version >= 310)) {
|
||||||
stageBuiltins[EShLangCompute].append(
|
stageBuiltins[EShLangCompute].append(
|
||||||
"in uvec3 gl_NumWorkGroups;"
|
"in uvec3 gl_NumWorkGroups;"
|
||||||
"const uvec3 gl_WorkGroupSize = uvec3(1,1,1);"
|
"const uvec3 gl_WorkGroupSize = uvec3(1,1,1);"
|
||||||
@ -2491,7 +2491,8 @@ void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProf
|
|||||||
}
|
}
|
||||||
|
|
||||||
// images (some in compute below)
|
// images (some in compute below)
|
||||||
if (profile == EEsProfile && version >= 310 || profile != EEsProfile && version >= 130) {
|
if ((profile == EEsProfile && version >= 310) ||
|
||||||
|
(profile != EEsProfile && version >= 130)) {
|
||||||
snprintf(builtInConstant, maxSize, "const int gl_MaxImageUnits = %d;", resources.maxImageUnits);
|
snprintf(builtInConstant, maxSize, "const int gl_MaxImageUnits = %d;", resources.maxImageUnits);
|
||||||
s.append(builtInConstant);
|
s.append(builtInConstant);
|
||||||
snprintf(builtInConstant, maxSize, "const int gl_MaxCombinedShaderOutputResources = %d;", resources.maxCombinedShaderOutputResources);
|
snprintf(builtInConstant, maxSize, "const int gl_MaxCombinedShaderOutputResources = %d;", resources.maxCombinedShaderOutputResources);
|
||||||
@ -2505,7 +2506,8 @@ void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProf
|
|||||||
}
|
}
|
||||||
|
|
||||||
// atomic counters (some in compute below)
|
// atomic counters (some in compute below)
|
||||||
if (profile == EEsProfile && version >= 310 || profile != EEsProfile && version >= 420) {
|
if ((profile == EEsProfile && version >= 310) ||
|
||||||
|
(profile != EEsProfile && version >= 420)) {
|
||||||
snprintf(builtInConstant, maxSize, "const int gl_MaxVertexAtomicCounters = %d;", resources. maxVertexAtomicCounters);
|
snprintf(builtInConstant, maxSize, "const int gl_MaxVertexAtomicCounters = %d;", resources. maxVertexAtomicCounters);
|
||||||
s.append(builtInConstant);
|
s.append(builtInConstant);
|
||||||
snprintf(builtInConstant, maxSize, "const int gl_MaxFragmentAtomicCounters = %d;", resources. maxFragmentAtomicCounters);
|
snprintf(builtInConstant, maxSize, "const int gl_MaxFragmentAtomicCounters = %d;", resources. maxFragmentAtomicCounters);
|
||||||
|
@ -2192,7 +2192,7 @@ void TParseContext::mergeQualifiers(TSourceLoc loc, TQualifier& dst, const TQual
|
|||||||
|
|
||||||
// Ordering
|
// Ordering
|
||||||
if (! force && ((profile != EEsProfile && version < 420) ||
|
if (! force && ((profile != EEsProfile && version < 420) ||
|
||||||
profile == EEsProfile && version < 310)
|
(profile == EEsProfile && version < 310))
|
||||||
&& ! extensionsTurnedOn(1, &GL_ARB_shading_language_420pack)) {
|
&& ! extensionsTurnedOn(1, &GL_ARB_shading_language_420pack)) {
|
||||||
// non-function parameters
|
// non-function parameters
|
||||||
if (src.invariant && (dst.isInterpolation() || dst.isAuxiliary() || dst.storage != EvqTemporary || dst.precision != EpqNone))
|
if (src.invariant && (dst.isInterpolation() || dst.isAuxiliary() || dst.storage != EvqTemporary || dst.precision != EpqNone))
|
||||||
@ -4854,7 +4854,7 @@ void TParseContext::invariantCheck(TSourceLoc loc, const TQualifier& qualifier)
|
|||||||
|
|
||||||
bool pipeOut = qualifier.isPipeOutput();
|
bool pipeOut = qualifier.isPipeOutput();
|
||||||
bool pipeIn = qualifier.isPipeInput();
|
bool pipeIn = qualifier.isPipeInput();
|
||||||
if (version >= 300 || profile != EEsProfile && version >= 420) {
|
if (version >= 300 || (profile != EEsProfile && version >= 420)) {
|
||||||
if (! pipeOut)
|
if (! pipeOut)
|
||||||
error(loc, "can only apply to an output", "invariant", "");
|
error(loc, "can only apply to an output", "invariant", "");
|
||||||
} else {
|
} else {
|
||||||
|
@ -1131,7 +1131,9 @@ int TScanContext::secondGenerationImage()
|
|||||||
return keyword;
|
return keyword;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (parseContext.symbolTable.atBuiltInLevel() || parseContext.profile != EEsProfile && (parseContext.version >= 420 || parseContext.extensionsTurnedOn(1, &GL_ARB_shader_image_load_store)))
|
if (parseContext.symbolTable.atBuiltInLevel() ||
|
||||||
|
(parseContext.profile != EEsProfile &&
|
||||||
|
(parseContext.version >= 420 || parseContext.extensionsTurnedOn(1, &GL_ARB_shader_image_load_store))))
|
||||||
return keyword;
|
return keyword;
|
||||||
|
|
||||||
if (parseContext.forwardCompatible)
|
if (parseContext.forwardCompatible)
|
||||||
|
@ -432,6 +432,9 @@ void TIntermediate::finalCheck(TInfoSink& infoSink)
|
|||||||
break;
|
break;
|
||||||
case EShLangCompute:
|
case EShLangCompute:
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
error(infoSink, "Unknown Stage.");
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Process the tree for any node-specific work.
|
// Process the tree for any node-specific work.
|
||||||
|
@ -285,9 +285,9 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
|||||||
ch = pp->getChar();
|
ch = pp->getChar();
|
||||||
}
|
}
|
||||||
} while ((ch >= 'a' && ch <= 'z') ||
|
} while ((ch >= 'a' && ch <= 'z') ||
|
||||||
(ch >= 'A' && ch <= 'Z') ||
|
(ch >= 'A' && ch <= 'Z') ||
|
||||||
(ch >= '0' && ch <= '9') ||
|
(ch >= '0' && ch <= '9') ||
|
||||||
ch == '_');
|
ch == '_');
|
||||||
|
|
||||||
// line continuation with no token before or after makes len == 0, and need to start over skipping white space, etc.
|
// line continuation with no token before or after makes len == 0, and need to start over skipping white space, etc.
|
||||||
if (len == 0)
|
if (len == 0)
|
||||||
@ -333,8 +333,8 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
|||||||
}
|
}
|
||||||
ch = pp->getChar();
|
ch = pp->getChar();
|
||||||
} while ((ch >= '0' && ch <= '9') ||
|
} while ((ch >= '0' && ch <= '9') ||
|
||||||
(ch >= 'A' && ch <= 'F') ||
|
(ch >= 'A' && ch <= 'F') ||
|
||||||
(ch >= 'a' && ch <= 'f'));
|
(ch >= 'a' && ch <= 'f'));
|
||||||
} else {
|
} else {
|
||||||
pp->parseContext.error(ppToken->loc, "bad digit in hexidecimal literal", "", "");
|
pp->parseContext.error(ppToken->loc, "bad digit in hexidecimal literal", "", "");
|
||||||
}
|
}
|
||||||
|
@ -381,16 +381,16 @@ public:
|
|||||||
// a sampler...
|
// a sampler...
|
||||||
switch (sampler.type) {
|
switch (sampler.type) {
|
||||||
case EbtFloat:
|
case EbtFloat:
|
||||||
switch (sampler.dim) {
|
switch ((int)sampler.dim) {
|
||||||
case Esd1D:
|
case Esd1D:
|
||||||
switch (sampler.shadow) {
|
switch ((int)sampler.shadow) {
|
||||||
case false: return sampler.arrayed ? GL_SAMPLER_1D_ARRAY : GL_SAMPLER_1D;
|
case false: return sampler.arrayed ? GL_SAMPLER_1D_ARRAY : GL_SAMPLER_1D;
|
||||||
case true: return sampler.arrayed ? GL_SAMPLER_1D_ARRAY_SHADOW : GL_SAMPLER_1D_SHADOW;
|
case true: return sampler.arrayed ? GL_SAMPLER_1D_ARRAY_SHADOW : GL_SAMPLER_1D_SHADOW;
|
||||||
}
|
}
|
||||||
case Esd2D:
|
case Esd2D:
|
||||||
switch (sampler.ms) {
|
switch ((int)sampler.ms) {
|
||||||
case false:
|
case false:
|
||||||
switch (sampler.shadow) {
|
switch ((int)sampler.shadow) {
|
||||||
case false: return sampler.arrayed ? GL_SAMPLER_2D_ARRAY : GL_SAMPLER_2D;
|
case false: return sampler.arrayed ? GL_SAMPLER_2D_ARRAY : GL_SAMPLER_2D;
|
||||||
case true: return sampler.arrayed ? GL_SAMPLER_2D_ARRAY_SHADOW : GL_SAMPLER_2D_SHADOW;
|
case true: return sampler.arrayed ? GL_SAMPLER_2D_ARRAY_SHADOW : GL_SAMPLER_2D_SHADOW;
|
||||||
}
|
}
|
||||||
@ -399,7 +399,7 @@ public:
|
|||||||
case Esd3D:
|
case Esd3D:
|
||||||
return GL_SAMPLER_3D;
|
return GL_SAMPLER_3D;
|
||||||
case EsdCube:
|
case EsdCube:
|
||||||
switch (sampler.shadow) {
|
switch ((int)sampler.shadow) {
|
||||||
case false: return sampler.arrayed ? GL_SAMPLER_CUBE_MAP_ARRAY : GL_SAMPLER_CUBE;
|
case false: return sampler.arrayed ? GL_SAMPLER_CUBE_MAP_ARRAY : GL_SAMPLER_CUBE;
|
||||||
case true: return sampler.arrayed ? GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW : GL_SAMPLER_CUBE_SHADOW;
|
case true: return sampler.arrayed ? GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW : GL_SAMPLER_CUBE_SHADOW;
|
||||||
}
|
}
|
||||||
@ -409,11 +409,11 @@ public:
|
|||||||
return GL_SAMPLER_BUFFER;
|
return GL_SAMPLER_BUFFER;
|
||||||
}
|
}
|
||||||
case EbtInt:
|
case EbtInt:
|
||||||
switch (sampler.dim) {
|
switch ((int)sampler.dim) {
|
||||||
case Esd1D:
|
case Esd1D:
|
||||||
return sampler.arrayed ? GL_INT_SAMPLER_1D_ARRAY : GL_INT_SAMPLER_1D;
|
return sampler.arrayed ? GL_INT_SAMPLER_1D_ARRAY : GL_INT_SAMPLER_1D;
|
||||||
case Esd2D:
|
case Esd2D:
|
||||||
switch (sampler.ms) {
|
switch ((int)sampler.ms) {
|
||||||
case false: return sampler.arrayed ? GL_INT_SAMPLER_2D_ARRAY : GL_INT_SAMPLER_2D;
|
case false: return sampler.arrayed ? GL_INT_SAMPLER_2D_ARRAY : GL_INT_SAMPLER_2D;
|
||||||
case true: return sampler.arrayed ? GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY : GL_INT_SAMPLER_2D_MULTISAMPLE;
|
case true: return sampler.arrayed ? GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY : GL_INT_SAMPLER_2D_MULTISAMPLE;
|
||||||
}
|
}
|
||||||
@ -427,11 +427,11 @@ public:
|
|||||||
return GL_INT_SAMPLER_BUFFER;
|
return GL_INT_SAMPLER_BUFFER;
|
||||||
}
|
}
|
||||||
case EbtUint:
|
case EbtUint:
|
||||||
switch (sampler.dim) {
|
switch ((int)sampler.dim) {
|
||||||
case Esd1D:
|
case Esd1D:
|
||||||
return sampler.arrayed ? GL_UNSIGNED_INT_SAMPLER_1D_ARRAY : GL_UNSIGNED_INT_SAMPLER_1D;
|
return sampler.arrayed ? GL_UNSIGNED_INT_SAMPLER_1D_ARRAY : GL_UNSIGNED_INT_SAMPLER_1D;
|
||||||
case Esd2D:
|
case Esd2D:
|
||||||
switch (sampler.ms) {
|
switch ((int)sampler.ms) {
|
||||||
case false: return sampler.arrayed ? GL_UNSIGNED_INT_SAMPLER_2D_ARRAY : GL_UNSIGNED_INT_SAMPLER_2D;
|
case false: return sampler.arrayed ? GL_UNSIGNED_INT_SAMPLER_2D_ARRAY : GL_UNSIGNED_INT_SAMPLER_2D;
|
||||||
case true: return sampler.arrayed ? GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY : GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE;
|
case true: return sampler.arrayed ? GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY : GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE;
|
||||||
}
|
}
|
||||||
@ -451,11 +451,11 @@ public:
|
|||||||
// an image...
|
// an image...
|
||||||
switch (sampler.type) {
|
switch (sampler.type) {
|
||||||
case EbtFloat:
|
case EbtFloat:
|
||||||
switch (sampler.dim) {
|
switch ((int)sampler.dim) {
|
||||||
case Esd1D:
|
case Esd1D:
|
||||||
return sampler.arrayed ? GL_IMAGE_1D_ARRAY : GL_IMAGE_1D;
|
return sampler.arrayed ? GL_IMAGE_1D_ARRAY : GL_IMAGE_1D;
|
||||||
case Esd2D:
|
case Esd2D:
|
||||||
switch (sampler.ms) {
|
switch ((int)sampler.ms) {
|
||||||
case false: return sampler.arrayed ? GL_IMAGE_2D_ARRAY : GL_IMAGE_2D;
|
case false: return sampler.arrayed ? GL_IMAGE_2D_ARRAY : GL_IMAGE_2D;
|
||||||
case true: return sampler.arrayed ? GL_IMAGE_2D_MULTISAMPLE_ARRAY : GL_IMAGE_2D_MULTISAMPLE;
|
case true: return sampler.arrayed ? GL_IMAGE_2D_MULTISAMPLE_ARRAY : GL_IMAGE_2D_MULTISAMPLE;
|
||||||
}
|
}
|
||||||
@ -469,11 +469,11 @@ public:
|
|||||||
return GL_IMAGE_BUFFER;
|
return GL_IMAGE_BUFFER;
|
||||||
}
|
}
|
||||||
case EbtInt:
|
case EbtInt:
|
||||||
switch (sampler.dim) {
|
switch ((int)sampler.dim) {
|
||||||
case Esd1D:
|
case Esd1D:
|
||||||
return sampler.arrayed ? GL_INT_IMAGE_1D_ARRAY : GL_INT_IMAGE_1D;
|
return sampler.arrayed ? GL_INT_IMAGE_1D_ARRAY : GL_INT_IMAGE_1D;
|
||||||
case Esd2D:
|
case Esd2D:
|
||||||
switch (sampler.ms) {
|
switch ((int)sampler.ms) {
|
||||||
case false: return sampler.arrayed ? GL_INT_IMAGE_2D_ARRAY : GL_INT_IMAGE_2D;
|
case false: return sampler.arrayed ? GL_INT_IMAGE_2D_ARRAY : GL_INT_IMAGE_2D;
|
||||||
case true: return sampler.arrayed ? GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY : GL_INT_IMAGE_2D_MULTISAMPLE;
|
case true: return sampler.arrayed ? GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY : GL_INT_IMAGE_2D_MULTISAMPLE;
|
||||||
}
|
}
|
||||||
@ -487,11 +487,11 @@ public:
|
|||||||
return GL_INT_IMAGE_BUFFER;
|
return GL_INT_IMAGE_BUFFER;
|
||||||
}
|
}
|
||||||
case EbtUint:
|
case EbtUint:
|
||||||
switch (sampler.dim) {
|
switch ((int)sampler.dim) {
|
||||||
case Esd1D:
|
case Esd1D:
|
||||||
return sampler.arrayed ? GL_UNSIGNED_INT_IMAGE_1D_ARRAY : GL_UNSIGNED_INT_IMAGE_1D;
|
return sampler.arrayed ? GL_UNSIGNED_INT_IMAGE_1D_ARRAY : GL_UNSIGNED_INT_IMAGE_1D;
|
||||||
case Esd2D:
|
case Esd2D:
|
||||||
switch (sampler.ms) {
|
switch ((int)sampler.ms) {
|
||||||
case false: return sampler.arrayed ? GL_UNSIGNED_INT_IMAGE_2D_ARRAY : GL_UNSIGNED_INT_IMAGE_2D;
|
case false: return sampler.arrayed ? GL_UNSIGNED_INT_IMAGE_2D_ARRAY : GL_UNSIGNED_INT_IMAGE_2D;
|
||||||
case true: return sampler.arrayed ? GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY : GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE;
|
case true: return sampler.arrayed ? GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY : GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user