blob: 4dde653778c39bd5b06a219a638b9dae9b9c918c [file] [log] [blame]
alokp@chromium.org76b82082010-03-24 17:59:39 +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 CROSSCOMPILERGLSL_OUTPUTGLSL_H_
8#define CROSSCOMPILERGLSL_OUTPUTGLSL_H_
9
daniel@transgaming.combbf56f72010-04-20 18:52:13 +000010#include "compiler/intermediate.h"
11#include "compiler/ParseHelper.h"
alokp@chromium.org76b82082010-03-24 17:59:39 +000012
13class TOutputGLSL : public TIntermTraverser
14{
15public:
16 TOutputGLSL(TParseContext &context);
17
18 void header();
19
20protected:
21 TInfoSinkBase& objSink() { return parseContext.infoSink.obj; }
22 void writeTriplet(Visit visit, const char* preStr, const char* inStr, const char* postStr);
23
24 virtual void visitSymbol(TIntermSymbol* node);
25 virtual void visitConstantUnion(TIntermConstantUnion* node);
26 virtual bool visitBinary(Visit visit, TIntermBinary* node);
27 virtual bool visitUnary(Visit visit, TIntermUnary* node);
28 virtual bool visitSelection(Visit visit, TIntermSelection* node);
29 virtual bool visitAggregate(Visit visit, TIntermAggregate* node);
30 virtual bool visitLoop(Visit visit, TIntermLoop* node);
31 virtual bool visitBranch(Visit visit, TIntermBranch* node);
32
33private:
34 bool writeFullSymbol;
35 TParseContext &parseContext;
36};
37
38#endif // CROSSCOMPILERGLSL_OUTPUTGLSL_H_