summaryrefslogtreecommitdiffstats
path: root/video/out/opengl/video.h
diff options
context:
space:
mode:
authorNiklas Haas <git@nand.wakku.to>2015-09-05 14:03:00 +0200
committerwm4 <wm4@nowhere>2015-09-09 18:17:44 +0200
commiteb56807b414229a00cd2bee5e74beae5a01e8fb1 (patch)
tree7d2c22371b50208e989c35932b511e5271a83946 /video/out/opengl/video.h
parent7929e36e9329c842790193389000e968f5a57426 (diff)
downloadmpv-eb56807b414229a00cd2bee5e74beae5a01e8fb1.tar.bz2
mpv-eb56807b414229a00cd2bee5e74beae5a01e8fb1.tar.xz
vo_opengl: move self-contained shader routines to a separate file
This is mostly to cut down somewhat on the amount of code bloat in video.c by moving out helper functions (including scaler kernels and color management routines) to a separate file. It would certainly be possible to move out more functions (eg. dithering or CMS code) with some extra effort/refactoring, but this is a start. Signed-off-by: wm4 <wm4@nowhere>
Diffstat (limited to 'video/out/opengl/video.h')
-rw-r--r--video/out/opengl/video.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/video/out/opengl/video.h b/video/out/opengl/video.h
index a52f35c424..65fdb6c3ab 100644
--- a/video/out/opengl/video.h
+++ b/video/out/opengl/video.h
@@ -22,6 +22,16 @@
#include "options/m_option.h"
#include "sub/osd.h"
#include "common.h"
+#include "utils.h"
+#include "video/out/filter_kernels.h"
+
+// Texture units 0-5 are used by the video, and for free use by the passes
+#define TEXUNIT_VIDEO_NUM 6
+
+// Other texture units are reserved for specific purposes
+#define TEXUNIT_SCALERS TEXUNIT_VIDEO_NUM
+#define TEXUNIT_3DLUT (TEXUNIT_SCALERS+4)
+#define TEXUNIT_DITHER (TEXUNIT_3DLUT+1)
struct lut3d {
uint16_t *data;
@@ -42,6 +52,21 @@ struct scaler_config {
int clamp;
};
+struct scaler {
+ int index;
+ struct scaler_config conf;
+ double scale_factor;
+ bool initialized;
+ struct filter_kernel *kernel;
+ GLuint gl_lut;
+ GLenum gl_target;
+ struct fbotex sep_fbo;
+ bool insufficient;
+
+ // kernel points here
+ struct filter_kernel kernel_storage;
+};
+
struct gl_video_opts {
int dumb_mode;
struct scaler_config scaler[4];