- 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:
parent
8bf009bd89
commit
3401876476
30 changed files with 190 additions and 158 deletions
31
src/hwrenderer/postprocessing/hw_shaderprogram.h
Normal file
31
src/hwrenderer/postprocessing/hw_shaderprogram.h
Normal 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;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue