Home | History | Annotate | Download | only in compiler
      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:
     15     InitializeGLPosition() : mCodeInserted(false) { }
     16 
     17 protected:
     18     virtual bool visitBinary(Visit visit, TIntermBinary* node) { return false; }
     19     virtual bool visitUnary(Visit visit, TIntermUnary* node) { return false; }
     20     virtual bool visitSelection(Visit visit, TIntermSelection* node) { return false; }
     21     virtual bool visitLoop(Visit visit, TIntermLoop* node) { return false; }
     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