blob: ba0955fdf8e1451e81fdd11358f8ea5aec72bf0e [file] [log] [blame]
Brandon Jonesc9610c52014-08-25 17:02:59 -07001//
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"
Brandon Jones22502d52014-08-29 16:58:36 -070013#include "libGLESv2/BinaryStream.h"
Brandon Jonesc9610c52014-08-25 17:02:59 -070014#include "libGLESv2/Constants.h"
15#include "libGLESv2/ProgramBinary.h"
16
17namespace rx
18{
19
20class DynamicHLSL;
21class Renderer;
22
23class ProgramImpl
24{
25public:
26 virtual ~ProgramImpl() { }
27
28 // TODO: Temporary interfaces to ease migration. Remove soon!
29 virtual Renderer *getRenderer() = 0;
30 virtual DynamicHLSL *getDynamicHLSL() = 0;
Brandon Jones22502d52014-08-29 16:58:36 -070031 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
Brandon Jonesc9610c52014-08-25 17:02:59 -070051 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_