2013-04-18 03:29:41 +00:00
|
|
|
// Copyright 2013 Dolphin Emulator Project
|
|
|
|
// Licensed under GPLv2
|
|
|
|
// Refer to the license.txt file included.
|
2009-07-06 02:10:26 +00:00
|
|
|
|
2014-02-10 18:54:46 +00:00
|
|
|
#pragma once
|
2009-07-06 02:10:26 +00:00
|
|
|
|
2014-07-29 16:47:56 +00:00
|
|
|
#include <string>
|
|
|
|
#include <unordered_map>
|
|
|
|
|
2014-02-17 10:18:15 +00:00
|
|
|
#include "VideoBackends/OGL/GLUtil.h"
|
2014-10-21 06:01:38 +00:00
|
|
|
#include "VideoBackends/OGL/ProgramShaderCache.h"
|
2014-07-29 16:57:02 +00:00
|
|
|
|
|
|
|
#include "VideoCommon/PostProcessing.h"
|
2014-02-17 10:18:15 +00:00
|
|
|
#include "VideoCommon/VideoCommon.h"
|
2009-07-06 02:10:26 +00:00
|
|
|
|
2011-01-29 20:16:51 +00:00
|
|
|
namespace OGL
|
|
|
|
{
|
|
|
|
|
2014-07-29 16:47:56 +00:00
|
|
|
class OpenGLPostProcessing : public PostProcessingShaderImplementation
|
2009-07-06 02:10:26 +00:00
|
|
|
{
|
2014-07-29 16:47:56 +00:00
|
|
|
public:
|
|
|
|
OpenGLPostProcessing();
|
|
|
|
~OpenGLPostProcessing();
|
|
|
|
|
|
|
|
void BindTargetFramebuffer() override;
|
|
|
|
void BlitToScreen() override;
|
|
|
|
void Update(u32 width, u32 height) override;
|
|
|
|
void ApplyShader() override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
GLuint m_fbo;
|
|
|
|
GLuint m_texture;
|
|
|
|
SHADER m_shader;
|
|
|
|
GLuint m_uniform_resolution;
|
|
|
|
GLuint m_uniform_time;
|
|
|
|
std::string m_glsl_header;
|
|
|
|
|
|
|
|
std::unordered_map<std::string, GLuint> m_uniform_bindings;
|
|
|
|
|
|
|
|
void CreateHeader();
|
|
|
|
std::string LoadShaderOptions(const std::string& code);
|
|
|
|
};
|
2009-07-06 02:10:26 +00:00
|
|
|
|
2011-01-29 20:16:51 +00:00
|
|
|
} // namespace
|