blob: a54e0067328c965c44656db079fdfb545c3914bc [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{
15class 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_