summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/OGL/PostProcessing.h
blob: 1c8c8ecf52f27d1274c322b55caa8254e4d724b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Copyright 2008 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.

#pragma once

#include <string>
#include <unordered_map>

#include "Common/GL/GLUtil.h"

#include "VideoBackends/OGL/ProgramShaderCache.h"

#include "VideoCommon/PostProcessing.h"
#include "VideoCommon/VideoCommon.h"

namespace OGL
{
class OpenGLPostProcessing : public PostProcessingShaderImplementation
{
public:
  OpenGLPostProcessing();
  ~OpenGLPostProcessing();

  void BlitFromTexture(TargetRectangle src, TargetRectangle dst, int src_texture, int src_width,
                       int src_height, int layer);
  void ApplyShader();

private:
  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();
  std::string LoadShaderOptions();
};

}  // namespace