• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //
2 // Copyright (c) 2002-2013 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_INITIALIZE_GL_POSITION_H_
8 #define COMPILER_INITIALIZE_GL_POSITION_H_
9 
10 #include "compiler/intermediate.h"
11 
12 class InitializeGLPosition : public TIntermTraverser
13 {
14 public:
InitializeGLPosition()15     InitializeGLPosition() : mCodeInserted(false) { }
16 
17 protected:
visitBinary(Visit visit,TIntermBinary * node)18     virtual bool visitBinary(Visit visit, TIntermBinary* node) { return false; }
visitUnary(Visit visit,TIntermUnary * node)19     virtual bool visitUnary(Visit visit, TIntermUnary* node) { return false; }
visitSelection(Visit visit,TIntermSelection * node)20     virtual bool visitSelection(Visit visit, TIntermSelection* node) { return false; }
visitLoop(Visit visit,TIntermLoop * node)21     virtual bool visitLoop(Visit visit, TIntermLoop* node) { return false; }
visitBranch(Visit visit,TIntermBranch * node)22     virtual bool visitBranch(Visit visit, TIntermBranch* node) { return false; }
23 
24     virtual bool visitAggregate(Visit visit, TIntermAggregate* node);
25 
26 private:
27     // Insert AST node in the beginning of main() for "gl_Position = vec4(0.0, 0.0, 0.0, 1.0);".
28     void insertCode(TIntermSequence& sequence);
29 
30     bool mCodeInserted;
31 };
32 
33 #endif  // COMPILER_INITIALIZE_GL_POSITION_H_
34