daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame^] | 1 | // |
| 2 | // Copyright (c) 2002-2010 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 | |
| 7 | #ifndef COMPILER_OUTPUTHLSL_H_ |
| 8 | #define COMPILER_OUTPUTHLSL_H_ |
| 9 | |
| 10 | #include "intermediate.h" |
| 11 | #include "ParseHelper.h" |
| 12 | |
| 13 | namespace sh |
| 14 | { |
| 15 | class OutputHLSL : public TIntermTraverser |
| 16 | { |
| 17 | public: |
| 18 | OutputHLSL(TParseContext &context); |
| 19 | |
| 20 | void header(); |
| 21 | |
| 22 | protected: |
| 23 | void visitSymbol(TIntermSymbol*); |
| 24 | void visitConstantUnion(TIntermConstantUnion*); |
| 25 | bool visitBinary(Visit visit, TIntermBinary*); |
| 26 | bool visitUnary(Visit visit, TIntermUnary*); |
| 27 | bool visitSelection(Visit visit, TIntermSelection*); |
| 28 | bool visitAggregate(Visit visit, TIntermAggregate*); |
| 29 | bool visitLoop(Visit visit, TIntermLoop*); |
| 30 | bool visitBranch(Visit visit, TIntermBranch*); |
| 31 | |
| 32 | void outputTriplet(Visit visit, const char *preString, const char *inString, const char *postString); |
| 33 | |
| 34 | static TString typeString(const TType &type); |
| 35 | static TString arrayString(const TType &type); |
| 36 | static TString initializer(const TType &type); |
| 37 | |
| 38 | TParseContext &context; |
| 39 | }; |
| 40 | } |
| 41 | |
| 42 | #endif // COMPILER_OUTPUTHLSL_H_ |