mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Add the VideoCommon PostProcessing class.
This class loads all the common PP shader configuration options and passes those options through to a inherited class that OpenGL or D3D will have. Makes it so all the common code for PP shaders is in VideoCommon instead of duplicating the code across each backend.
This commit is contained in:
@ -4,26 +4,38 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
|
||||
#include "VideoBackends/OGL/GLUtil.h"
|
||||
#include "VideoCommon/VideoCommon.h"
|
||||
|
||||
namespace OGL
|
||||
{
|
||||
|
||||
namespace PostProcessing
|
||||
class OpenGLPostProcessing : public PostProcessingShaderImplementation
|
||||
{
|
||||
public:
|
||||
OpenGLPostProcessing();
|
||||
~OpenGLPostProcessing();
|
||||
|
||||
void Init();
|
||||
void Shutdown();
|
||||
void BindTargetFramebuffer() override;
|
||||
void BlitToScreen() override;
|
||||
void Update(u32 width, u32 height) override;
|
||||
void ApplyShader() override;
|
||||
|
||||
void BindTargetFramebuffer();
|
||||
void BlitToScreen();
|
||||
void Update(u32 width, u32 height);
|
||||
private:
|
||||
GLuint m_fbo;
|
||||
GLuint m_texture;
|
||||
SHADER m_shader;
|
||||
GLuint m_uniform_resolution;
|
||||
GLuint m_uniform_time;
|
||||
std::string m_glsl_header;
|
||||
|
||||
void ReloadShader();
|
||||
std::unordered_map<std::string, GLuint> m_uniform_bindings;
|
||||
|
||||
void ApplyShader();
|
||||
|
||||
} // namespace
|
||||
void CreateHeader();
|
||||
std::string LoadShaderOptions(const std::string& code);
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
Reference in New Issue
Block a user