mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-29 20:28:56 +00: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:
parent
3a657fe33c
commit
6bdc32c54a
13 changed files with 555 additions and 27 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue