From e4f45cbf491e9adbc7180da61531da1803a03a96 Mon Sep 17 00:00:00 2001 From: John Kessenich Date: Wed, 13 Nov 2013 20:50:21 +0000 Subject: [PATCH] fix g++ compilation issues git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24043 e7fa87d3-cd2b-0410-9028-fcbf551c1848 --- glslang/MachineIndependent/Makefile | 2 +- glslang/MachineIndependent/ParseHelper.cpp | 11 +++++------ glslang/MachineIndependent/reflection.cpp | 4 +++- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/glslang/MachineIndependent/Makefile b/glslang/MachineIndependent/Makefile index 1f62edea..ac7f356b 100644 --- a/glslang/MachineIndependent/Makefile +++ b/glslang/MachineIndependent/Makefile @@ -147,4 +147,4 @@ Versions.o: ParseHelper.h Versions.h ../Include/ShHandle.h SymbolTable.h locali Constant.o: localintermediate.h ../Include/intermediate.h ../Public/ShaderLang.h SymbolTable.h Versions.h limits.o: ParseHelper.h linkValidate.o: localintermediate.h -reflection.o: ../Include/Common.h reflection.h localintermediate.h +reflection.o: ../Include/Common.h reflection.h localintermediate.h gl_types.h diff --git a/glslang/MachineIndependent/ParseHelper.cpp b/glslang/MachineIndependent/ParseHelper.cpp index 89619b3d..409c5a9d 100644 --- a/glslang/MachineIndependent/ParseHelper.cpp +++ b/glslang/MachineIndependent/ParseHelper.cpp @@ -3082,11 +3082,10 @@ TIntermTyped* TParseContext::addConstructor(TSourceLoc loc, TIntermNode* node, c if (op == EOpConstructStruct) memberTypes = type.getStruct()->begin(); - const TType* elementType; + TType elementType; + elementType.shallowCopy(type); if (type.isArray()) - elementType = &TType(type, 0); // dereferenced type - else - elementType = &type; + elementType.dereference(); bool singleArg; if (aggrNode) { @@ -3102,7 +3101,7 @@ TIntermTyped* TParseContext::addConstructor(TSourceLoc loc, TIntermNode* node, c // If structure constructor or array constructor is being called // for only one parameter inside the structure, we need to call constructStruct function once. if (type.isArray()) - newNode = constructStruct(node, *elementType, 1, node->getLoc()); + newNode = constructStruct(node, elementType, 1, node->getLoc()); else if (op == EOpConstructStruct) newNode = constructStruct(node, *(*memberTypes).type, 1, node->getLoc()); else @@ -3130,7 +3129,7 @@ TIntermTyped* TParseContext::addConstructor(TSourceLoc loc, TIntermNode* node, c for (TIntermSequence::iterator p = sequenceVector.begin(); p != sequenceVector.end(); p++, paramCount++) { if (type.isArray()) - newNode = constructStruct(*p, *elementType, paramCount+1, node->getLoc()); + newNode = constructStruct(*p, elementType, paramCount+1, node->getLoc()); else if (op == EOpConstructStruct) newNode = constructStruct(*p, *(memberTypes[paramCount]).type, paramCount+1, node->getLoc()); else diff --git a/glslang/MachineIndependent/reflection.cpp b/glslang/MachineIndependent/reflection.cpp index aaf51736..4c902f5e 100644 --- a/glslang/MachineIndependent/reflection.cpp +++ b/glslang/MachineIndependent/reflection.cpp @@ -100,7 +100,7 @@ public: } } - static const int baseAlignmentVec4Std140 = 16; + static const int baseAlignmentVec4Std140; // align a value: if 'value' is not aligned to 'alignment', move it up to a multiple of alignment void align(int& value, int alignment) @@ -553,6 +553,8 @@ public: TReflection& reflection; }; +const int TLiveTraverser::baseAlignmentVec4Std140 = 16; + namespace { //