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.
7 // ProgramImpl.h: Defines the abstract rx::ProgramImpl class.
9 #ifndef LIBGLESV2_RENDERER_PROGRAMIMPL_H_
10 #define LIBGLESV2_RENDERER_PROGRAMIMPL_H_
12 #include "common/angleutils.h"
13 #include "libGLESv2/BinaryStream.h"
14 #include "libGLESv2/Constants.h"
15 #include "libGLESv2/ProgramBinary.h"
26 virtual ~ProgramImpl() { }
28 // TODO: Temporary interfaces to ease migration. Remove soon!
29 virtual Renderer *getRenderer() = 0;
30 virtual DynamicHLSL *getDynamicHLSL() = 0;
31 virtual const std::vector<rx::PixelShaderOutputVariable> &getPixelShaderKey() = 0;
33 virtual GLenum getBinaryFormat() = 0;
34 virtual bool load(gl::InfoLog &infoLog, gl::BinaryInputStream *stream) = 0;
35 virtual bool save(gl::BinaryOutputStream *stream) = 0;
37 virtual rx::ShaderExecutable *getPixelExecutableForOutputLayout(gl::InfoLog &infoLog, const std::vector<GLenum> &outputSignature,
38 const std::vector<gl::LinkedVarying> &transformFeedbackLinkedVaryings,
39 bool separatedOutputBuffers) = 0;
40 virtual rx::ShaderExecutable *getVertexExecutableForInputLayout(gl::InfoLog &infoLog,
41 const gl::VertexFormat inputLayout[gl::MAX_VERTEX_ATTRIBS],
42 const sh::Attribute shaderAttributes[],
43 const std::vector<gl::LinkedVarying> &transformFeedbackLinkedVaryings,
44 bool separatedOutputBuffers) = 0;
46 virtual bool link(gl::InfoLog &infoLog, gl::Shader *fragmentShader, gl::Shader *vertexShader,
47 const std::vector<std::string> &transformFeedbackVaryings, int *registers,
48 std::vector<gl::LinkedVarying> *linkedVaryings, std::map<int,
49 gl::VariableLocation> *outputVariables) = 0;
51 virtual void initializeUniformStorage(const std::vector<gl::LinkedUniform*> &uniforms) = 0;
53 virtual void reset() = 0;
58 #endif // LIBGLESV2_RENDERER_PROGRAMIMPL_H_