- use FShaderProgram through an abstract interface and remove all dependencies on the GL renderer from the shader definition source files.

This commit is contained in:
Christoph Oelckers 2018-06-13 22:08:55 +02:00
commit 3401876476
30 changed files with 190 additions and 158 deletions

View file

@ -0,0 +1,31 @@
#pragma once
#include "hwrenderer/data/shaderuniforms.h"
class IRenderQueue;
class IShaderProgram
{
public:
IShaderProgram() {}
virtual ~IShaderProgram() {}
enum ShaderType
{
Vertex,
Fragment,
NumShaderTypes
};
virtual void Compile(ShaderType type, const char *lumpName, const char *defines, int maxGlslVersion) = 0;
virtual void Compile(ShaderType type, const char *name, const FString &code, const char *defines, int maxGlslVersion) = 0;
virtual void Link(const char *name) = 0;
virtual void SetUniformBufferLocation(int index, const char *name) = 0;
virtual void Bind(IRenderQueue *q) = 0; // the parameter here is just a preparation for Vulkan
private:
IShaderProgram(const IShaderProgram &) = delete;
IShaderProgram &operator=(const IShaderProgram &) = delete;
};