alokp@chromium.org | 8b851c6 | 2012-06-15 16:25:11 +0000 | [diff] [blame] | 1 | // |
| 2 | // Copyright (c) 2012 The ANGLE Project Authors. All rights reserved. |
| 3 | // Use of this source code is governed by a BSD-style license that can be |
| 4 | // found in the LICENSE file. |
| 5 | // |
| 6 | |
Geoff Lang | 0a73dd8 | 2014-11-19 16:18:08 -0500 | [diff] [blame] | 7 | #ifndef COMPILER_TRANSLATOR_DIRECTIVEHANDLER_H_ |
| 8 | #define COMPILER_TRANSLATOR_DIRECTIVEHANDLER_H_ |
alokp@chromium.org | 8b851c6 | 2012-06-15 16:25:11 +0000 | [diff] [blame] | 9 | |
Jamie Madill | 80d934b | 2015-02-19 10:16:12 -0500 | [diff] [blame] | 10 | #include "common/angleutils.h" |
Geoff Lang | 1773282 | 2013-08-29 13:46:49 -0400 | [diff] [blame] | 11 | #include "compiler/translator/ExtensionBehavior.h" |
| 12 | #include "compiler/translator/Pragma.h" |
daniel@transgaming.com | b3077d0 | 2013-01-11 04:12:09 +0000 | [diff] [blame] | 13 | #include "compiler/preprocessor/DirectiveHandlerBase.h" |
alokp@chromium.org | 8b851c6 | 2012-06-15 16:25:11 +0000 | [diff] [blame] | 14 | |
| 15 | class TDiagnostics; |
| 16 | |
Jamie Madill | f0d10f8 | 2015-03-31 12:56:52 -0400 | [diff] [blame^] | 17 | class TDirectiveHandler : public pp::DirectiveHandler, angle::NonCopyable |
alokp@chromium.org | 8b851c6 | 2012-06-15 16:25:11 +0000 | [diff] [blame] | 18 | { |
| 19 | public: |
| 20 | TDirectiveHandler(TExtensionBehavior& extBehavior, |
shannon.woods%transgaming.com@gtempaccount.com | 5524db0 | 2013-04-13 03:38:16 +0000 | [diff] [blame] | 21 | TDiagnostics& diagnostics, |
Olli Etuaho | 853dc1a | 2014-11-06 17:25:48 +0200 | [diff] [blame] | 22 | int& shaderVersion, |
| 23 | bool debugShaderPrecisionSupported); |
alokp@chromium.org | 8b851c6 | 2012-06-15 16:25:11 +0000 | [diff] [blame] | 24 | virtual ~TDirectiveHandler(); |
| 25 | |
| 26 | const TPragma& pragma() const { return mPragma; } |
alokp@chromium.org | 73bc298 | 2012-06-19 18:48:05 +0000 | [diff] [blame] | 27 | const TExtensionBehavior& extensionBehavior() const { return mExtensionBehavior; } |
alokp@chromium.org | 8b851c6 | 2012-06-15 16:25:11 +0000 | [diff] [blame] | 28 | |
| 29 | virtual void handleError(const pp::SourceLocation& loc, |
| 30 | const std::string& msg); |
| 31 | |
| 32 | virtual void handlePragma(const pp::SourceLocation& loc, |
| 33 | const std::string& name, |
Zhenyao Mo | 94ac7b7 | 2014-10-15 18:22:08 -0700 | [diff] [blame] | 34 | const std::string& value, |
| 35 | bool stdgl); |
alokp@chromium.org | 8b851c6 | 2012-06-15 16:25:11 +0000 | [diff] [blame] | 36 | |
| 37 | virtual void handleExtension(const pp::SourceLocation& loc, |
| 38 | const std::string& name, |
| 39 | const std::string& behavior); |
| 40 | |
| 41 | virtual void handleVersion(const pp::SourceLocation& loc, |
| 42 | int version); |
| 43 | |
| 44 | private: |
| 45 | TPragma mPragma; |
alokp@chromium.org | 73bc298 | 2012-06-19 18:48:05 +0000 | [diff] [blame] | 46 | TExtensionBehavior& mExtensionBehavior; |
alokp@chromium.org | 8b851c6 | 2012-06-15 16:25:11 +0000 | [diff] [blame] | 47 | TDiagnostics& mDiagnostics; |
shannon.woods%transgaming.com@gtempaccount.com | 5524db0 | 2013-04-13 03:38:16 +0000 | [diff] [blame] | 48 | int& mShaderVersion; |
Olli Etuaho | 853dc1a | 2014-11-06 17:25:48 +0200 | [diff] [blame] | 49 | bool mDebugShaderPrecisionSupported; |
alokp@chromium.org | 8b851c6 | 2012-06-15 16:25:11 +0000 | [diff] [blame] | 50 | }; |
| 51 | |
Geoff Lang | 0a73dd8 | 2014-11-19 16:18:08 -0500 | [diff] [blame] | 52 | #endif // COMPILER_TRANSLATOR_DIRECTIVEHANDLER_H_ |