From: John Kessenich Date: Fri, 4 Oct 2013 03:05:45 +0000 (+0000) Subject: Make ES 100 gl_FragData be a mediump, and fix some warnings from g++. X-Git-Tag: upstream/0.1~905 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c6b7e6350b7be12e39f9ce49242021377ca69dbc;p=platform%2Fupstream%2Fglslang.git Make ES 100 gl_FragData be a mediump, and fix some warnings from g++. git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23380 e7fa87d3-cd2b-0410-9028-fcbf551c1848 --- diff --git a/glslang/Include/Types.h b/glslang/Include/Types.h index 7199a5b..5a2c9c6 100644 --- a/glslang/Include/Types.h +++ b/glslang/Include/Types.h @@ -771,7 +771,7 @@ public: bool operator==(const TType& right) const { return sameElementType(right) && - (arraySizes == 0 && right.arraySizes == 0 || + ((arraySizes == 0 && right.arraySizes == 0) || (arraySizes && right.arraySizes && arraySizes->sizes == right.arraySizes->sizes)); } diff --git a/glslang/MachineIndependent/Initialize.cpp b/glslang/MachineIndependent/Initialize.cpp index 188f053..f26dc31 100644 --- a/glslang/MachineIndependent/Initialize.cpp +++ b/glslang/MachineIndependent/Initialize.cpp @@ -1654,7 +1654,7 @@ void IdentifyBuiltIns(int version, EProfile profile, EShLanguage language, TSymb // Set up gl_FragData based on current array size. if (version < FirstProfileVersion || profile == ECompatibilityProfile || (! ForwardCompatibility && profile != EEsProfile && version < 420)) { TPrecisionQualifier pq = profile == EEsProfile ? EpqMedium : EpqNone; - TType fragData(EbtFloat, EvqFragColor, 4); + TType fragData(EbtFloat, EvqFragColor, pq, 4); TArraySizes* arraySizes = NewPoolTArraySizes(); arraySizes->setSize(resources.maxDrawBuffers); fragData.setArraySizes(arraySizes); diff --git a/glslang/MachineIndependent/ParseHelper.cpp b/glslang/MachineIndependent/ParseHelper.cpp index caf8583..fe884bf 100644 --- a/glslang/MachineIndependent/ParseHelper.cpp +++ b/glslang/MachineIndependent/ParseHelper.cpp @@ -52,7 +52,7 @@ TParseContext::TParseContext(TSymbolTable& symt, TIntermediate& interm, bool pb, version(v), profile(p), forwardCompatible(fc), messages(m), contextPragma(true, false), loopNestingLevel(0), structNestingLevel(0), tokensBeforeEOF(false), - parsingBuiltins(pb), numErrors(0), afterEOF(false) + numErrors(0), parsingBuiltins(pb), afterEOF(false) { currentLoc.line = 1; currentLoc.string = 0; @@ -2073,7 +2073,7 @@ TIntermNode* TParseContext::executeInitializer(TSourceLoc loc, TString& identifi // TStorageQualifier qualifier = variable->getType().getQualifier().storage; if (! (qualifier == EvqTemporary || qualifier == EvqGlobal || qualifier == EvqConst || - qualifier == EvqUniform && profile != EEsProfile && version >= 120)) { + (qualifier == EvqUniform && profile != EEsProfile && version >= 120))) { error(loc, " cannot initialize this type of qualifier ", variable->getType().getStorageQualifierString(), ""); return 0; } @@ -2290,7 +2290,7 @@ TIntermTyped* TParseContext::constructBuiltIn(const TType& type, TOperator op, T // // Otherwise, skip out early. - if (subset || newNode != node && newNode->getType() == type) + if (subset || (newNode != node && newNode->getType() == type)) return newNode; // setAggregateOperator will insert a new node for the constructor, as needed. @@ -2672,7 +2672,6 @@ TIntermTyped* TParseContext::addConstArrayNode(int index, TIntermTyped* node, TS { TIntermTyped* typedNode; TIntermConstantUnion* tempConstantNode = node->getAsConstantUnion(); - int arraySize = node->getType().getArraySize(); TType arrayElementType; arrayElementType.shallowCopy(node->getType()); arrayElementType.dereference(); // TODO: arrays of arrays: shallow copy won't work if sharing same array structure and then doing a dereference diff --git a/glslang/MachineIndependent/glslang.y b/glslang/MachineIndependent/glslang.y index 0d33552..9496e27 100644 --- a/glslang/MachineIndependent/glslang.y +++ b/glslang/MachineIndependent/glslang.y @@ -1016,8 +1016,8 @@ fully_specified_type $$ = $2; if (! $$.qualifier.isInterpolation() && - (parseContext.language == EShLangVertex && $$.qualifier.storage == EvqVaryingOut || - parseContext.language == EShLangFragment && $$.qualifier.storage == EvqVaryingIn)) + ((parseContext.language == EShLangVertex && $$.qualifier.storage == EvqVaryingOut) || + (parseContext.language == EShLangFragment && $$.qualifier.storage == EvqVaryingIn))) $$.qualifier.smooth = true; } ; diff --git a/glslang/MachineIndependent/intermOut.cpp b/glslang/MachineIndependent/intermOut.cpp index b2fe2d5..5bb81d2 100644 --- a/glslang/MachineIndependent/intermOut.cpp +++ b/glslang/MachineIndependent/intermOut.cpp @@ -457,7 +457,6 @@ void OutputConstantUnion(TInfoSink& out, const TIntermTyped* node, const TConstU void OutputConstantUnion(TIntermConstantUnion* node, TIntermTraverser* it) { TOutputTraverser* oit = static_cast(it); - TInfoSink& out = oit->infoSink; OutputTreeText(oit->infoSink, node, oit->depth); oit->infoSink.debug << "Constant:\n"; diff --git a/glslang/MachineIndependent/parseConst.cpp b/glslang/MachineIndependent/parseConst.cpp index a5280db..e77b96f 100644 --- a/glslang/MachineIndependent/parseConst.cpp +++ b/glslang/MachineIndependent/parseConst.cpp @@ -130,10 +130,9 @@ void ParseConstantUnion(TIntermConstantUnion* node, TIntermTraverser* it) (oit->index)++; } } else { - int size, totalSize, matrixCols, matrixRows; + int size, totalSize, matrixRows; bool isMatrix = false; size = oit->size; - matrixCols = oit->matrixCols; matrixRows = oit->matrixRows; isMatrix = oit->isMatrix; totalSize = oit->index + size; diff --git a/glslang/MachineIndependent/preprocessor/PpAtom.cpp b/glslang/MachineIndependent/preprocessor/PpAtom.cpp index bb3502f..5132f84 100644 --- a/glslang/MachineIndependent/preprocessor/PpAtom.cpp +++ b/glslang/MachineIndependent/preprocessor/PpAtom.cpp @@ -383,13 +383,17 @@ int FindHashLoc(TPpContext::AtomTable *atable, const char *s) { int hashloc, hashdelta, count; int FoundEmptySlot = 0; +#ifdef DUMP_TABLE int collision[TPpContext::hashTableMaxCollisions + 1]; +#endif hashloc = HashString(s) % atable->htable.size; if (!Empty(&atable->htable, hashloc)) { if (Match(&atable->htable, &atable->stable, s, hashloc)) return hashloc; +#ifdef DUMP_TABLE collision[0] = hashloc; +#endif hashdelta = HashString2(s); count = 0; while (count < TPpContext::hashTableMaxCollisions) { @@ -403,7 +407,9 @@ int FindHashLoc(TPpContext::AtomTable *atable, const char *s) break; } count++; +#ifdef DUMP_TABLE collision[count] = hashloc; +#endif } if (! FoundEmptySlot) { diff --git a/glslang/MachineIndependent/preprocessor/PpContext.cpp b/glslang/MachineIndependent/preprocessor/PpContext.cpp index 20f24ff..693a2d3 100644 --- a/glslang/MachineIndependent/preprocessor/PpContext.cpp +++ b/glslang/MachineIndependent/preprocessor/PpContext.cpp @@ -84,7 +84,7 @@ NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. namespace glslang { TPpContext::TPpContext(TParseContext& pc) : - parseContext(pc), preamble(0), strings(0), notAVersionToken(false), + preamble(0), strings(0), notAVersionToken(false), parseContext(pc), ScopeList(0), CurrentScope(0), GlobalScope(0) { InitAtomTable(&atomTable, 0); diff --git a/glslang/OSDependent/Linux/ossource.cpp b/glslang/OSDependent/Linux/ossource.cpp index f439ddd..03e7b05 100644 --- a/glslang/OSDependent/Linux/ossource.cpp +++ b/glslang/OSDependent/Linux/ossource.cpp @@ -144,6 +144,7 @@ void ReleaseGlobalLock() { } void* OS_CreateThread(TThreadEntrypoint entry) { + return 0; } void OS_WaitForAllThreads(void* threads, int numThreads)