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 // ProgramImpl.h: Defines the abstract rx::ProgramImpl class. 8 9 #ifndef LIBGLESV2_RENDERER_PROGRAMIMPL_H_ 10 #define LIBGLESV2_RENDERER_PROGRAMIMPL_H_ 11 12 #include "common/angleutils.h" 13 #include "libGLESv2/BinaryStream.h" 14 #include "libGLESv2/Constants.h" 15 #include "libGLESv2/ProgramBinary.h" 16 17 namespace rx 18 { 19 20 class DynamicHLSL; 21 class Renderer; 22 23 class ProgramImpl 24 { 25 public: ~ProgramImpl()26 virtual ~ProgramImpl() { } 27 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; 32 33 virtual GLenum getBinaryFormat() = 0; 34 virtual bool load(gl::InfoLog &infoLog, gl::BinaryInputStream *stream) = 0; 35 virtual bool save(gl::BinaryOutputStream *stream) = 0; 36 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; 45 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; 50 51 virtual void initializeUniformStorage(const std::vector<gl::LinkedUniform*> &uniforms) = 0; 52 53 virtual void reset() = 0; 54 }; 55 56 } 57 58 #endif // LIBGLESV2_RENDERER_PROGRAMIMPL_H_ 59