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>
|
|
|
|
|
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();
|
|
|
|
|
2014-10-18 07:32:24 +00:00
|
|
|
void BlitFromTexture(TargetRectangle src, TargetRectangle dst,
|
2014-10-22 11:02:28 +00:00
|
|
|
int src_texture, int src_width, int src_height, int layer) override;
|
2014-07-29 16:47:56 +00:00
|
|
|
void ApplyShader() override;
|
|
|
|
|
|
|
|
private:
|
2014-10-18 07:32:24 +00:00
|
|
|
bool m_initialized;
|
2014-07-29 16:47:56 +00:00
|
|
|
SHADER m_shader;
|
|
|
|
GLuint m_uniform_resolution;
|
2014-10-18 07:32:24 +00:00
|
|
|
GLuint m_uniform_src_rect;
|
2014-07-29 16:47:56 +00:00
|
|
|
GLuint m_uniform_time;
|
2014-10-22 11:02:28 +00:00
|
|
|
GLuint m_uniform_layer;
|
2014-07-29 16:47:56 +00:00
|
|
|
std::string m_glsl_header;
|
|
|
|
|
2014-10-30 01:06:45 +00:00
|
|
|
// These are only used when working around Qualcomm's broken attributeless rendering
|
|
|
|
GLuint m_attribute_vao;
|
|
|
|
GLuint m_attribute_vbo;
|
|
|
|
bool m_attribute_workaround = false;
|
|
|
|
|
2014-07-29 16:47:56 +00:00
|
|
|
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
|