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) ...@@ -243,6 +243,7 @@ bool TCompiler::InitBuiltInSymbolTable(const ShBuiltInResources& resources)
{ {
TBuiltIns builtIns; TBuiltIns builtIns;
compileResources = resources;
builtIns.initialize(shaderType, shaderSpec, resources); builtIns.initialize(shaderType, shaderSpec, resources);
return InitializeSymbolTable(builtIns.getBuiltInStrings(), return InitializeSymbolTable(builtIns.getBuiltInStrings(),
shaderType, shaderSpec, resources, infoSink, symbolTable); shaderType, shaderSpec, resources, infoSink, symbolTable);
...@@ -363,6 +364,11 @@ const TExtensionBehavior& TCompiler::getExtensionBehavior() const ...@@ -363,6 +364,11 @@ const TExtensionBehavior& TCompiler::getExtensionBehavior() const
return extensionBehavior; return extensionBehavior;
} }
const ShBuiltInResources& TCompiler::getResources() const
{
return compileResources;
}
const ArrayBoundsClamper& TCompiler::getArrayBoundsClamper() const const ArrayBoundsClamper& TCompiler::getArrayBoundsClamper() const
{ {
return arrayBoundsClamper; return arrayBoundsClamper;
......
...@@ -27,7 +27,7 @@ TString str(int i) ...@@ -27,7 +27,7 @@ TString str(int i)
return buffer; 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) : TIntermTraverser(true, true, true), mContext(context), mOutputType(outputType)
{ {
mUnfoldShortCircuit = new UnfoldShortCircuit(context, this); mUnfoldShortCircuit = new UnfoldShortCircuit(context, this);
......
...@@ -25,7 +25,7 @@ class UnfoldShortCircuit; ...@@ -25,7 +25,7 @@ class UnfoldShortCircuit;
class OutputHLSL : public TIntermTraverser class OutputHLSL : public TIntermTraverser
{ {
public: public:
OutputHLSL(TParseContext &context, ShShaderOutput outputType); OutputHLSL(TParseContext &context, const ShBuiltInResources& resources, ShShaderOutput outputType);
~OutputHLSL(); ~OutputHLSL();
void output(); void output();
......
...@@ -108,6 +108,8 @@ protected: ...@@ -108,6 +108,8 @@ protected:
bool enforceFragmentShaderTimingRestrictions(const TDependencyGraph& graph); bool enforceFragmentShaderTimingRestrictions(const TDependencyGraph& graph);
// Get built-in extensions with default behavior. // Get built-in extensions with default behavior.
const TExtensionBehavior& getExtensionBehavior() const; const TExtensionBehavior& getExtensionBehavior() const;
// Get the resources set by InitBuiltInSymbolTable
const ShBuiltInResources& getResources() const;
const ArrayBoundsClamper& getArrayBoundsClamper() const; const ArrayBoundsClamper& getArrayBoundsClamper() const;
ShArrayIndexClampingStrategy getArrayIndexClampingStrategy() const; ShArrayIndexClampingStrategy getArrayIndexClampingStrategy() const;
...@@ -119,6 +121,8 @@ private: ...@@ -119,6 +121,8 @@ private:
int maxUniformVectors; int maxUniformVectors;
ShBuiltInResources compileResources;
// Built-in symbol table for the given language, spec, and resources. // Built-in symbol table for the given language, spec, and resources.
// It is preserved from compile-to-compile. // It is preserved from compile-to-compile.
TSymbolTable symbolTable; TSymbolTable symbolTable;
......
...@@ -17,7 +17,7 @@ TranslatorHLSL::TranslatorHLSL(ShShaderType type, ShShaderSpec spec, ShShaderOut ...@@ -17,7 +17,7 @@ TranslatorHLSL::TranslatorHLSL(ShShaderType type, ShShaderSpec spec, ShShaderOut
void TranslatorHLSL::translate(TIntermNode *root) void TranslatorHLSL::translate(TIntermNode *root)
{ {
TParseContext& parseContext = *GetGlobalParseContext(); TParseContext& parseContext = *GetGlobalParseContext();
sh::OutputHLSL outputHLSL(parseContext, mOutputType); sh::OutputHLSL outputHLSL(parseContext, getResources(), mOutputType);
outputHLSL.output(); outputHLSL.output();
mActiveUniforms = outputHLSL.getUniforms(); 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