diff options
Diffstat (limited to 'src/3rdparty/angle/src/compiler/translator/Compiler.h')
-rw-r--r-- | src/3rdparty/angle/src/compiler/translator/Compiler.h | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/src/3rdparty/angle/src/compiler/translator/Compiler.h b/src/3rdparty/angle/src/compiler/translator/Compiler.h index b6c9d13ed0..bcdb0d4c9d 100644 --- a/src/3rdparty/angle/src/compiler/translator/Compiler.h +++ b/src/3rdparty/angle/src/compiler/translator/Compiler.h @@ -4,8 +4,8 @@ // found in the LICENSE file. // -#ifndef _SHHANDLE_INCLUDED_ -#define _SHHANDLE_INCLUDED_ +#ifndef COMPILER_TRANSLATOR_COMPILER_H_ +#define COMPILER_TRANSLATOR_COMPILER_H_ // // Machine independent part of the compiler private objects @@ -25,7 +25,9 @@ class TCompiler; class TDependencyGraph; +#ifdef ANGLE_ENABLE_HLSL class TranslatorHLSL; +#endif // ANGLE_ENABLE_HLSL // // Helper function to identify specs that are based on the WebGL spec, @@ -41,7 +43,9 @@ public: TShHandleBase(); virtual ~TShHandleBase(); virtual TCompiler* getAsCompiler() { return 0; } +#ifdef ANGLE_ENABLE_HLSL virtual TranslatorHLSL* getAsTranslatorHLSL() { return 0; } +#endif // ANGLE_ENABLE_HLSL protected: // Memory allocator. Allocates and tracks memory required by the compiler. @@ -61,9 +65,15 @@ class TCompiler : public TShHandleBase virtual TCompiler* getAsCompiler() { return this; } bool Init(const ShBuiltInResources& resources); + + // compileTreeForTesting should be used only when tests require access to + // the AST. Users of this function need to manually manage the global pool + // allocator. Returns NULL whenever there are compilation errors. + TIntermNode *compileTreeForTesting(const char* const shaderStrings[], + size_t numStrings, int compileOptions); + bool compile(const char* const shaderStrings[], - size_t numStrings, - int compileOptions); + size_t numStrings, int compileOptions); // Get results of the last compilation. int getShaderVersion() const { return shaderVersion; } @@ -104,8 +114,10 @@ class TCompiler : public TShHandleBase bool validateLimitations(TIntermNode* root); // Collect info for all attribs, uniforms, varyings. void collectVariables(TIntermNode* root); + // Add emulated functions to the built-in function emulator. + virtual void initBuiltInFunctionEmulator(BuiltInFunctionEmulator *emu, int compileOptions) {}; // Translate to object code. - virtual void translate(TIntermNode* root) = 0; + virtual void translate(TIntermNode *root, int compileOptions) = 0; // Returns true if, after applying the packing rules in the GLSL 1.017 spec // Appendix A, section 7, the shader does not use too many uniforms. bool enforcePackingRestrictions(); @@ -130,6 +142,7 @@ class TCompiler : public TShHandleBase bool limitExpressionComplexity(TIntermNode* root); // Get built-in extensions with default behavior. const TExtensionBehavior& getExtensionBehavior() const; + const char *getSourcePath() const; const TPragma& getPragma() const { return mPragma; } void writePragma(); @@ -145,6 +158,9 @@ class TCompiler : public TShHandleBase std::vector<sh::InterfaceBlock> interfaceBlocks; private: + TIntermNode *compileTreeImpl(const char* const shaderStrings[], + size_t numStrings, int compileOptions); + sh::GLenum shaderType; ShShaderSpec shaderSpec; ShShaderOutput outputType; @@ -170,6 +186,7 @@ class TCompiler : public TShHandleBase // Results of compilation. int shaderVersion; TInfoSink infoSink; // Output sink. + const char *mSourcePath; // Path of source file or NULL // name hashing. ShHashFunction64 hashFunction; @@ -191,4 +208,4 @@ TCompiler* ConstructCompiler( sh::GLenum type, ShShaderSpec spec, ShShaderOutput output); void DeleteCompiler(TCompiler*); -#endif // _SHHANDLE_INCLUDED_ +#endif // COMPILER_TRANSLATOR_COMPILER_H_ |