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
This commit is contained in:
John Kessenich 2013-10-04 03:05:45 +00:00
Родитель e50441ad94
Коммит c6b7e6350b
9 изменённых файлов: 16 добавлений и 12 удалений

Просмотреть файл

@ -771,7 +771,7 @@ public:
bool operator==(const TType& right) const bool operator==(const TType& right) const
{ {
return sameElementType(right) && return sameElementType(right) &&
(arraySizes == 0 && right.arraySizes == 0 || ((arraySizes == 0 && right.arraySizes == 0) ||
(arraySizes && right.arraySizes && arraySizes->sizes == right.arraySizes->sizes)); (arraySizes && right.arraySizes && arraySizes->sizes == right.arraySizes->sizes));
} }

Просмотреть файл

@ -1654,7 +1654,7 @@ void IdentifyBuiltIns(int version, EProfile profile, EShLanguage language, TSymb
// Set up gl_FragData based on current array size. // Set up gl_FragData based on current array size.
if (version < FirstProfileVersion || profile == ECompatibilityProfile || (! ForwardCompatibility && profile != EEsProfile && version < 420)) { if (version < FirstProfileVersion || profile == ECompatibilityProfile || (! ForwardCompatibility && profile != EEsProfile && version < 420)) {
TPrecisionQualifier pq = profile == EEsProfile ? EpqMedium : EpqNone; TPrecisionQualifier pq = profile == EEsProfile ? EpqMedium : EpqNone;
TType fragData(EbtFloat, EvqFragColor, 4); TType fragData(EbtFloat, EvqFragColor, pq, 4);
TArraySizes* arraySizes = NewPoolTArraySizes(); TArraySizes* arraySizes = NewPoolTArraySizes();
arraySizes->setSize(resources.maxDrawBuffers); arraySizes->setSize(resources.maxDrawBuffers);
fragData.setArraySizes(arraySizes); fragData.setArraySizes(arraySizes);

Просмотреть файл

@ -52,7 +52,7 @@ TParseContext::TParseContext(TSymbolTable& symt, TIntermediate& interm, bool pb,
version(v), profile(p), forwardCompatible(fc), messages(m), version(v), profile(p), forwardCompatible(fc), messages(m),
contextPragma(true, false), loopNestingLevel(0), structNestingLevel(0), contextPragma(true, false), loopNestingLevel(0), structNestingLevel(0),
tokensBeforeEOF(false), tokensBeforeEOF(false),
parsingBuiltins(pb), numErrors(0), afterEOF(false) numErrors(0), parsingBuiltins(pb), afterEOF(false)
{ {
currentLoc.line = 1; currentLoc.line = 1;
currentLoc.string = 0; currentLoc.string = 0;
@ -2073,7 +2073,7 @@ TIntermNode* TParseContext::executeInitializer(TSourceLoc loc, TString& identifi
// //
TStorageQualifier qualifier = variable->getType().getQualifier().storage; TStorageQualifier qualifier = variable->getType().getQualifier().storage;
if (! (qualifier == EvqTemporary || qualifier == EvqGlobal || qualifier == EvqConst || 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(), ""); error(loc, " cannot initialize this type of qualifier ", variable->getType().getStorageQualifierString(), "");
return 0; return 0;
} }
@ -2290,7 +2290,7 @@ TIntermTyped* TParseContext::constructBuiltIn(const TType& type, TOperator op, T
// //
// Otherwise, skip out early. // Otherwise, skip out early.
if (subset || newNode != node && newNode->getType() == type) if (subset || (newNode != node && newNode->getType() == type))
return newNode; return newNode;
// setAggregateOperator will insert a new node for the constructor, as needed. // 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; TIntermTyped* typedNode;
TIntermConstantUnion* tempConstantNode = node->getAsConstantUnion(); TIntermConstantUnion* tempConstantNode = node->getAsConstantUnion();
int arraySize = node->getType().getArraySize();
TType arrayElementType; TType arrayElementType;
arrayElementType.shallowCopy(node->getType()); 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 arrayElementType.dereference(); // TODO: arrays of arrays: shallow copy won't work if sharing same array structure and then doing a dereference

Просмотреть файл

@ -1016,8 +1016,8 @@ fully_specified_type
$$ = $2; $$ = $2;
if (! $$.qualifier.isInterpolation() && if (! $$.qualifier.isInterpolation() &&
(parseContext.language == EShLangVertex && $$.qualifier.storage == EvqVaryingOut || ((parseContext.language == EShLangVertex && $$.qualifier.storage == EvqVaryingOut) ||
parseContext.language == EShLangFragment && $$.qualifier.storage == EvqVaryingIn)) (parseContext.language == EShLangFragment && $$.qualifier.storage == EvqVaryingIn)))
$$.qualifier.smooth = true; $$.qualifier.smooth = true;
} }
; ;

Просмотреть файл

@ -457,7 +457,6 @@ void OutputConstantUnion(TInfoSink& out, const TIntermTyped* node, const TConstU
void OutputConstantUnion(TIntermConstantUnion* node, TIntermTraverser* it) void OutputConstantUnion(TIntermConstantUnion* node, TIntermTraverser* it)
{ {
TOutputTraverser* oit = static_cast<TOutputTraverser*>(it); TOutputTraverser* oit = static_cast<TOutputTraverser*>(it);
TInfoSink& out = oit->infoSink;
OutputTreeText(oit->infoSink, node, oit->depth); OutputTreeText(oit->infoSink, node, oit->depth);
oit->infoSink.debug << "Constant:\n"; oit->infoSink.debug << "Constant:\n";

Просмотреть файл

@ -130,10 +130,9 @@ void ParseConstantUnion(TIntermConstantUnion* node, TIntermTraverser* it)
(oit->index)++; (oit->index)++;
} }
} else { } else {
int size, totalSize, matrixCols, matrixRows; int size, totalSize, matrixRows;
bool isMatrix = false; bool isMatrix = false;
size = oit->size; size = oit->size;
matrixCols = oit->matrixCols;
matrixRows = oit->matrixRows; matrixRows = oit->matrixRows;
isMatrix = oit->isMatrix; isMatrix = oit->isMatrix;
totalSize = oit->index + size; totalSize = oit->index + size;

Просмотреть файл

@ -383,13 +383,17 @@ int FindHashLoc(TPpContext::AtomTable *atable, const char *s)
{ {
int hashloc, hashdelta, count; int hashloc, hashdelta, count;
int FoundEmptySlot = 0; int FoundEmptySlot = 0;
#ifdef DUMP_TABLE
int collision[TPpContext::hashTableMaxCollisions + 1]; int collision[TPpContext::hashTableMaxCollisions + 1];
#endif
hashloc = HashString(s) % atable->htable.size; hashloc = HashString(s) % atable->htable.size;
if (!Empty(&atable->htable, hashloc)) { if (!Empty(&atable->htable, hashloc)) {
if (Match(&atable->htable, &atable->stable, s, hashloc)) if (Match(&atable->htable, &atable->stable, s, hashloc))
return hashloc; return hashloc;
#ifdef DUMP_TABLE
collision[0] = hashloc; collision[0] = hashloc;
#endif
hashdelta = HashString2(s); hashdelta = HashString2(s);
count = 0; count = 0;
while (count < TPpContext::hashTableMaxCollisions) { while (count < TPpContext::hashTableMaxCollisions) {
@ -403,7 +407,9 @@ int FindHashLoc(TPpContext::AtomTable *atable, const char *s)
break; break;
} }
count++; count++;
#ifdef DUMP_TABLE
collision[count] = hashloc; collision[count] = hashloc;
#endif
} }
if (! FoundEmptySlot) { if (! FoundEmptySlot) {

Просмотреть файл

@ -84,7 +84,7 @@ NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
namespace glslang { namespace glslang {
TPpContext::TPpContext(TParseContext& pc) : 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) ScopeList(0), CurrentScope(0), GlobalScope(0)
{ {
InitAtomTable(&atomTable, 0); InitAtomTable(&atomTable, 0);

Просмотреть файл

@ -144,6 +144,7 @@ void ReleaseGlobalLock() { }
void* OS_CreateThread(TThreadEntrypoint entry) void* OS_CreateThread(TThreadEntrypoint entry)
{ {
return 0;
} }
void OS_WaitForAllThreads(void* threads, int numThreads) void OS_WaitForAllThreads(void* threads, int numThreads)