Commit 02f20dd8 by Jamie Madill

Fix compile error regressions in OutputGLSL and OutputESSL.

These were broken back with the symbol table changes. TRAC #23857 Signed-off-by: Nicolas Capens Signed-off-by: Shannon Woods
parent 88f18f45
//
// Copyright (c) 2002-2011 The ANGLE Project Authors. All rights reserved.
// Copyright (c) 2002-2013 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
......@@ -10,8 +10,9 @@ TOutputESSL::TOutputESSL(TInfoSinkBase& objSink,
ShArrayIndexClampingStrategy clampingStrategy,
ShHashFunction64 hashFunction,
NameMap& nameMap,
TSymbolTable& symbolTable)
: TOutputGLSLBase(objSink, clampingStrategy, hashFunction, nameMap, symbolTable)
TSymbolTable& symbolTable,
int shaderVersion)
: TOutputGLSLBase(objSink, clampingStrategy, hashFunction, nameMap, symbolTable, shaderVersion)
{
}
......
//
// Copyright (c) 2002-2011 The ANGLE Project Authors. All rights reserved.
// Copyright (c) 2002-2013 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
......@@ -16,7 +16,8 @@ public:
ShArrayIndexClampingStrategy clampingStrategy,
ShHashFunction64 hashFunction,
NameMap& nameMap,
TSymbolTable& symbolTable);
TSymbolTable& symbolTable,
int shaderVersion);
protected:
virtual bool writeVariablePrecision(TPrecision precision);
......
//
// Copyright (c) 2002-2011 The ANGLE Project Authors. All rights reserved.
// Copyright (c) 2002-2013 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
......@@ -10,8 +10,9 @@ TOutputGLSL::TOutputGLSL(TInfoSinkBase& objSink,
ShArrayIndexClampingStrategy clampingStrategy,
ShHashFunction64 hashFunction,
NameMap& nameMap,
TSymbolTable& symbolTable)
: TOutputGLSLBase(objSink, clampingStrategy, hashFunction, nameMap, symbolTable)
TSymbolTable& symbolTable,
int shaderVersion)
: TOutputGLSLBase(objSink, clampingStrategy, hashFunction, nameMap, symbolTable, shaderVersion)
{
}
......
//
// Copyright (c) 2002-2011 The ANGLE Project Authors. All rights reserved.
// Copyright (c) 2002-2013 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
......@@ -16,11 +16,12 @@ public:
ShArrayIndexClampingStrategy clampingStrategy,
ShHashFunction64 hashFunction,
NameMap& nameMap,
TSymbolTable& symbolTable);
TSymbolTable& symbolTable,
int shaderVersion);
protected:
virtual bool writeVariablePrecision(TPrecision);
virtual bool visitSymbol(TIntermSymbol* node);
virtual void visitSymbol(TIntermSymbol* node);
};
#endif // CROSSCOMPILERGLSL_OUTPUTGLSL_H_
//
// Copyright (c) 2002-2011 The ANGLE Project Authors. All rights reserved.
// Copyright (c) 2002-2013 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
......@@ -43,14 +43,16 @@ TOutputGLSLBase::TOutputGLSLBase(TInfoSinkBase& objSink,
ShArrayIndexClampingStrategy clampingStrategy,
ShHashFunction64 hashFunction,
NameMap& nameMap,
TSymbolTable& symbolTable)
TSymbolTable& symbolTable,
int shaderVersion)
: TIntermTraverser(true, true, true),
mObjSink(objSink),
mDeclaringVariables(false),
mClampingStrategy(clampingStrategy),
mHashFunction(hashFunction),
mNameMap(nameMap),
mSymbolTable(symbolTable)
mSymbolTable(symbolTable),
mShaderVersion(shaderVersion)
{
}
......@@ -256,7 +258,7 @@ bool TOutputGLSLBase::visitBinary(Visit visit, TIntermBinary* node)
const TField* field = structure->fields()[index->getIConst(0)];
TString fieldName = field->name();
if (!mSymbolTable.findBuiltIn(structure->name()))
if (!mSymbolTable.findBuiltIn(structure->name(), mShaderVersion))
fieldName = hashName(fieldName);
out << fieldName;
......@@ -777,7 +779,7 @@ TString TOutputGLSLBase::hashName(const TString& name)
TString TOutputGLSLBase::hashVariableName(const TString& name)
{
if (mSymbolTable.findBuiltIn(name) != NULL)
if (mSymbolTable.findBuiltIn(name, mShaderVersion) != NULL)
return name;
return hashName(name);
}
......@@ -785,7 +787,7 @@ TString TOutputGLSLBase::hashVariableName(const TString& name)
TString TOutputGLSLBase::hashFunctionName(const TString& mangled_name)
{
TString name = TFunction::unmangleName(mangled_name);
if (mSymbolTable.findBuiltIn(mangled_name) != NULL || name == "main")
if (mSymbolTable.findBuiltIn(mangled_name, mShaderVersion) != NULL || name == "main")
return name;
return hashName(name);
}
......
//
// Copyright (c) 2002-2011 The ANGLE Project Authors. All rights reserved.
// Copyright (c) 2002-2013 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
......@@ -20,7 +20,8 @@ public:
ShArrayIndexClampingStrategy clampingStrategy,
ShHashFunction64 hashFunction,
NameMap& nameMap,
TSymbolTable& symbolTable);
TSymbolTable& symbolTable,
int shaderVersion);
protected:
TInfoSinkBase& objSink() { return mObjSink; }
......@@ -74,6 +75,8 @@ private:
NameMap& mNameMap;
TSymbolTable& mSymbolTable;
const int mShaderVersion;
};
#endif // CROSSCOMPILERGLSL_OUTPUTGLSLBASE_H_
//
// Copyright (c) 2002-2011 The ANGLE Project Authors. All rights reserved.
// Copyright (c) 2002-2013 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
......@@ -26,7 +26,7 @@ void TranslatorESSL::translate(TIntermNode* root) {
getArrayBoundsClamper().OutputClampingFunctionDefinition(sink);
// Write translated shader.
TOutputESSL outputESSL(sink, getArrayIndexClampingStrategy(), getHashFunction(), getNameMap(), getSymbolTable());
TOutputESSL outputESSL(sink, getArrayIndexClampingStrategy(), getHashFunction(), getNameMap(), getSymbolTable(), getShaderVersion());
root->traverse(&outputESSL);
}
......
//
// Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved.
// Copyright (c) 2002-2013 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
......@@ -39,6 +39,6 @@ void TranslatorGLSL::translate(TIntermNode* root) {
getArrayBoundsClamper().OutputClampingFunctionDefinition(sink);
// Write translated shader.
TOutputGLSL outputGLSL(sink, getArrayIndexClampingStrategy(), getHashFunction(), getNameMap(), getSymbolTable());
TOutputGLSL outputGLSL(sink, getArrayIndexClampingStrategy(), getHashFunction(), getNameMap(), getSymbolTable(), getShaderVersion());
root->traverse(&outputGLSL);
}
//
// Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved.
// Copyright (c) 2002-2013 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
......@@ -24,6 +24,7 @@
// - matrix constructors taking matrix as argument.
// - array as "out" function parameters
//
// TODO: ES3 equivalent versions of GLSL
class TVersionGLSL : public TIntermTraverser {
public:
TVersionGLSL(ShShaderType type);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment