blob: 667d9e8d22a91d05b5c3b20593d52ab2c80a3f7b [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.com9b5f5442010-03-16 05:43:55 +000015enum
16{
17 HLSL_FRAG_COORD_SEMANTIC = 15 // Semantic index assigned to the gl_FragCoord varying
18};
19
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +000020class OutputHLSL : public TIntermTraverser
21{
22 public:
23 OutputHLSL(TParseContext &context);
24
25 void header();
daniel@transgaming.come78c0c92010-03-28 19:36:06 +000026 void footer();
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +000027
28 protected:
29 void visitSymbol(TIntermSymbol*);
30 void visitConstantUnion(TIntermConstantUnion*);
31 bool visitBinary(Visit visit, TIntermBinary*);
32 bool visitUnary(Visit visit, TIntermUnary*);
33 bool visitSelection(Visit visit, TIntermSelection*);
34 bool visitAggregate(Visit visit, TIntermAggregate*);
35 bool visitLoop(Visit visit, TIntermLoop*);
36 bool visitBranch(Visit visit, TIntermBranch*);
37
38 void outputTriplet(Visit visit, const char *preString, const char *inString, const char *postString);
39
40 static TString typeString(const TType &type);
41 static TString arrayString(const TType &type);
42 static TString initializer(const TType &type);
43
44 TParseContext &context;
45};
46}
47
48#endif // COMPILER_OUTPUTHLSL_H_