blob: 9af794225647830ead0aa85803be9c84826f28c8 [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();
26
27 protected:
28 void visitSymbol(TIntermSymbol*);
29 void visitConstantUnion(TIntermConstantUnion*);
30 bool visitBinary(Visit visit, TIntermBinary*);
31 bool visitUnary(Visit visit, TIntermUnary*);
32 bool visitSelection(Visit visit, TIntermSelection*);
33 bool visitAggregate(Visit visit, TIntermAggregate*);
34 bool visitLoop(Visit visit, TIntermLoop*);
35 bool visitBranch(Visit visit, TIntermBranch*);
36
37 void outputTriplet(Visit visit, const char *preString, const char *inString, const char *postString);
38
39 static TString typeString(const TType &type);
40 static TString arrayString(const TType &type);
41 static TString initializer(const TType &type);
42
43 TParseContext &context;
44};
45}
46
47#endif // COMPILER_OUTPUTHLSL_H_