Home | History | Annotate | Download | only in renderer
      1 //
      2 // Copyright 2014 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 // ShaderImpl.h: Defines the abstract rx::ShaderImpl class.
      8 
      9 #ifndef LIBGLESV2_RENDERER_SHADERIMPL_H_
     10 #define LIBGLESV2_RENDERER_SHADERIMPL_H_
     11 
     12 #include <vector>
     13 
     14 #include "common/angleutils.h"
     15 #include "libGLESv2/Shader.h"
     16 
     17 namespace rx
     18 {
     19 
     20 class ShaderImpl
     21 {
     22   public:
     23     ShaderImpl() { }
     24     virtual ~ShaderImpl() { }
     25 
     26     virtual bool compile(const std::string &source) = 0;
     27     virtual const std::string &getInfoLog() const = 0;
     28     virtual const std::string &getTranslatedSource() const = 0;
     29 
     30     const std::vector<gl::PackedVarying> &getVaryings() const { return mVaryings; }
     31     const std::vector<sh::Uniform> &getUniforms() const { return mUniforms; }
     32     const std::vector<sh::InterfaceBlock> &getInterfaceBlocks() const  { return mInterfaceBlocks; }
     33     const std::vector<sh::Attribute> &getActiveAttributes() const { return mActiveAttributes; }
     34     const std::vector<sh::Attribute> &getActiveOutputVariables() const { return mActiveOutputVariables; }
     35 
     36     std::vector<gl::PackedVarying> &getVaryings() { return mVaryings; }
     37     std::vector<sh::Uniform> &getUniforms() { return mUniforms; }
     38     std::vector<sh::InterfaceBlock> &getInterfaceBlocks() { return mInterfaceBlocks; }
     39     std::vector<sh::Attribute> &getActiveAttributes() { return mActiveAttributes; }
     40     std::vector<sh::Attribute> &getActiveOutputVariables() { return mActiveOutputVariables; }
     41 
     42   protected:
     43     DISALLOW_COPY_AND_ASSIGN(ShaderImpl);
     44 
     45     std::vector<gl::PackedVarying> mVaryings;
     46     std::vector<sh::Uniform> mUniforms;
     47     std::vector<sh::InterfaceBlock> mInterfaceBlocks;
     48     std::vector<sh::Attribute> mActiveAttributes;
     49     std::vector<sh::Attribute> mActiveOutputVariables;
     50 };
     51 
     52 }
     53 
     54 #endif // LIBGLESV2_RENDERER_SHADERIMPL_H_
     55