gfx/angle/src/libGLESv2/renderer/ShaderExecutable.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gfx/angle/src/libGLESv2/renderer/ShaderExecutable.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,51 @@
     1.4 +//
     1.5 +// Copyright (c) 2012 The ANGLE Project Authors. All rights reserved.
     1.6 +// Use of this source code is governed by a BSD-style license that can be
     1.7 +// found in the LICENSE file.
     1.8 +//
     1.9 +
    1.10 +// ShaderExecutable.h: Defines a renderer-agnostic class to contain shader
    1.11 +// executable implementation details.
    1.12 +
    1.13 +#ifndef LIBGLESV2_RENDERER_SHADEREXECUTABLE_H_
    1.14 +#define LIBGLESV2_RENDERER_SHADEREXECUTABLE_H_
    1.15 +
    1.16 +#include "common/angleutils.h"
    1.17 +
    1.18 +namespace rx
    1.19 +{
    1.20 +
    1.21 +class ShaderExecutable
    1.22 +{
    1.23 +  public:
    1.24 +    ShaderExecutable(const void *function, size_t length) : mLength(length)
    1.25 +    {
    1.26 +        mFunction = new char[length];
    1.27 +        memcpy(mFunction, function, length);
    1.28 +    }
    1.29 +    
    1.30 +    virtual ~ShaderExecutable()
    1.31 +    {
    1.32 +        delete[] mFunction;
    1.33 +    }
    1.34 +
    1.35 +    void *getFunction() const
    1.36 +    {
    1.37 +        return mFunction;
    1.38 +    }
    1.39 +
    1.40 +    size_t getLength() const
    1.41 +    {
    1.42 +        return mLength;
    1.43 +    }
    1.44 +
    1.45 +  private:
    1.46 +    DISALLOW_COPY_AND_ASSIGN(ShaderExecutable);
    1.47 +
    1.48 +    void *mFunction;
    1.49 +    const size_t mLength;
    1.50 +};
    1.51 +
    1.52 +}
    1.53 +
    1.54 +#endif // LIBGLESV2_RENDERER_SHADEREXECUTABLE9_H_

mercurial