2015-05-24 04:55:12 +00:00
|
|
|
// Copyright 2008 Dolphin Emulator Project
|
2015-05-17 23:08:10 +00:00
|
|
|
// Licensed under GPLv2+
|
2013-04-18 03:29:41 +00:00
|
|
|
// 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>
|
|
|
|
|
2015-09-18 16:40:00 +00:00
|
|
|
#include "Common/GL/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:
|
2016-06-24 08:43:46 +00:00
|
|
|
OpenGLPostProcessing();
|
|
|
|
~OpenGLPostProcessing();
|
2014-07-29 16:47:56 +00:00
|
|
|
|
2016-06-24 08:43:46 +00:00
|
|
|
void BlitFromTexture(TargetRectangle src, TargetRectangle dst, int src_texture, int src_width,
|
|
|
|
int src_height, int layer) override;
|
|
|
|
void ApplyShader() override;
|
2014-07-29 16:47:56 +00:00
|
|
|
|
|
|
|
private:
|
2016-06-24 08:43:46 +00:00
|
|
|
bool m_initialized;
|
|
|
|
SHADER m_shader;
|
|
|
|
GLuint m_uniform_resolution;
|
|
|
|
GLuint m_uniform_src_rect;
|
|
|
|
GLuint m_uniform_time;
|
|
|
|
GLuint m_uniform_layer;
|
|
|
|
std::string m_glsl_header;
|
|
|
|
|
|
|
|
std::unordered_map<std::string, GLuint> m_uniform_bindings;
|
|
|
|
|
|
|
|
void CreateHeader();
|
2017-04-16 03:17:10 +00:00
|
|
|
std::string LoadShaderOptions();
|
2014-07-29 16:47:56 +00:00
|
|
|
};
|
2009-07-06 02:10:26 +00:00
|
|
|
|
2011-01-29 20:16:51 +00:00
|
|
|
} // namespace
|