blob: 2be9a8672584b1b0294e9f1689c2998b4d702338 [file] [log] [blame]
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +00001//
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
13namespace sh
14{
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +000015class OutputHLSL : public TIntermTraverser
16{
17 public:
18 OutputHLSL(TParseContext &context);
19
20 void header();
daniel@transgaming.come78c0c92010-03-28 19:36:06 +000021 void footer();
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +000022
23 protected:
24 void visitSymbol(TIntermSymbol*);
25 void visitConstantUnion(TIntermConstantUnion*);
26 bool visitBinary(Visit visit, TIntermBinary*);
27 bool visitUnary(Visit visit, TIntermUnary*);
28 bool visitSelection(Visit visit, TIntermSelection*);
29 bool visitAggregate(Visit visit, TIntermAggregate*);
30 bool visitLoop(Visit visit, TIntermLoop*);
31 bool visitBranch(Visit visit, TIntermBranch*);
32
33 void outputTriplet(Visit visit, const char *preString, const char *inString, const char *postString);
34
35 static TString typeString(const TType &type);
36 static TString arrayString(const TType &type);
37 static TString initializer(const TType &type);
38
39 TParseContext &context;
40};
41}
42
43#endif // COMPILER_OUTPUTHLSL_H_