Home | History | Annotate | Download | only in renderer
      1 //
      2 // Copyright (c) 2012 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 // ShaderExecutable.h: Defines a renderer-agnostic class to contain shader
      8 // executable implementation details.
      9 
     10 #ifndef LIBGLESV2_RENDERER_SHADEREXECUTABLE_H_
     11 #define LIBGLESV2_RENDERER_SHADEREXECUTABLE_H_
     12 
     13 #include "common/angleutils.h"
     14 
     15 namespace rx
     16 {
     17 
     18 class ShaderExecutable
     19 {
     20   public:
     21     ShaderExecutable(const void *function, size_t length) : mLength(length)
     22     {
     23         mFunction = new char[length];
     24         memcpy(mFunction, function, length);
     25     }
     26 
     27     virtual ~ShaderExecutable()
     28     {
     29         delete[] mFunction;
     30     }
     31 
     32     void *getFunction() const
     33     {
     34         return mFunction;
     35     }
     36 
     37     size_t getLength() const
     38     {
     39         return mLength;
     40     }
     41 
     42   private:
     43     DISALLOW_COPY_AND_ASSIGN(ShaderExecutable);
     44 
     45     void *mFunction;
     46     const size_t mLength;
     47 };
     48 
     49 }
     50 
     51 #endif // LIBGLESV2_RENDERER_SHADEREXECUTABLE9_H_
     52