Store the BuildInResources in the Compiler class so the draw buffer data can be…

Store the BuildInResources in the Compiler class so the draw buffer data can be read during shader output. TRAC #22668 Signed-off-by: Jamie Madill Signed-off-by: Shannon Woods Author: Geoff Lang git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@2020 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 05337ea7
......@@ -243,6 +243,7 @@ bool TCompiler::InitBuiltInSymbolTable(const ShBuiltInResources& resources)
{
TBuiltIns builtIns;
compileResources = resources;
builtIns.initialize(shaderType, shaderSpec, resources);
return InitializeSymbolTable(builtIns.getBuiltInStrings(),
shaderType, shaderSpec, resources, infoSink, symbolTable);
......@@ -363,6 +364,11 @@ const TExtensionBehavior& TCompiler::getExtensionBehavior() const
return extensionBehavior;
}
const ShBuiltInResources& TCompiler::getResources() const
{
return compileResources;
}
const ArrayBoundsClamper& TCompiler::getArrayBoundsClamper() const
{
return arrayBoundsClamper;
......
......@@ -27,7 +27,7 @@ TString str(int i)
return buffer;
}
OutputHLSL::OutputHLSL(TParseContext &context, ShShaderOutput outputType)
OutputHLSL::OutputHLSL(TParseContext &context, const ShBuiltInResources& resources, ShShaderOutput outputType)
: TIntermTraverser(true, true, true), mContext(context), mOutputType(outputType)
{
mUnfoldShortCircuit = new UnfoldShortCircuit(context, this);
......
......@@ -25,7 +25,7 @@ class UnfoldShortCircuit;
class OutputHLSL : public TIntermTraverser
{
public:
OutputHLSL(TParseContext &context, ShShaderOutput outputType);
OutputHLSL(TParseContext &context, const ShBuiltInResources& resources, ShShaderOutput outputType);
~OutputHLSL();
void output();
......
......@@ -108,6 +108,8 @@ protected:
bool enforceFragmentShaderTimingRestrictions(const TDependencyGraph& graph);
// Get built-in extensions with default behavior.
const TExtensionBehavior& getExtensionBehavior() const;
// Get the resources set by InitBuiltInSymbolTable
const ShBuiltInResources& getResources() const;
const ArrayBoundsClamper& getArrayBoundsClamper() const;
ShArrayIndexClampingStrategy getArrayIndexClampingStrategy() const;
......@@ -119,6 +121,8 @@ private:
int maxUniformVectors;
ShBuiltInResources compileResources;
// Built-in symbol table for the given language, spec, and resources.
// It is preserved from compile-to-compile.
TSymbolTable symbolTable;
......
......@@ -17,7 +17,7 @@ TranslatorHLSL::TranslatorHLSL(ShShaderType type, ShShaderSpec spec, ShShaderOut
void TranslatorHLSL::translate(TIntermNode *root)
{
TParseContext& parseContext = *GetGlobalParseContext();
sh::OutputHLSL outputHLSL(parseContext, mOutputType);
sh::OutputHLSL outputHLSL(parseContext, getResources(), mOutputType);
outputHLSL.output();
mActiveUniforms = outputHLSL.getUniforms();
......
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