summaryrefslogtreecommitdiffstats
path: root/video/out/opengl/video.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-12-19 11:56:19 +0100
committerwm4 <wm4@nowhere>2015-12-19 14:14:12 +0100
commit3394d37b4ea6876c0a4484c51ba23e6b8ed08e5a (patch)
tree95e646d22bb8ca0ffb28e9c5850a1241739da8ec /video/out/opengl/video.c
parentd2baaaa7df87eba9566fb935eeab5bd0af80fe1b (diff)
downloadmpv-3394d37b4ea6876c0a4484c51ba23e6b8ed08e5a.tar.bz2
mpv-3394d37b4ea6876c0a4484c51ba23e6b8ed08e5a.tar.xz
vo_opengl: refactor how framebuffer depth is passed from backends
Store the determined framebuffer depth in struct GL instead of MPGLContext. This means gl_video_set_output_depth() can be removed, and also justifies adding new fields describing framebuffer/backend properties to struct GL instead of having to add more functions just to shovel the information around. Keep in mind that mpgl_load_functions() will wipe struct GL, so the new fields must be set before calling it.
Diffstat (limited to 'video/out/opengl/video.c')
-rw-r--r--video/out/opengl/video.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/video/out/opengl/video.c b/video/out/opengl/video.c
index d2fb4ac38c..a96a95b5c7 100644
--- a/video/out/opengl/video.c
+++ b/video/out/opengl/video.c
@@ -137,7 +137,6 @@ struct gl_video {
struct gl_video_opts opts;
bool gl_debug;
- int depth_g;
int texture_16bit_depth; // actual bits available in 16 bit textures
struct gl_shader_cache *sc;
@@ -1703,7 +1702,7 @@ static void pass_dither(struct gl_video *p)
GL *gl = p->gl;
// Assume 8 bits per component if unknown.
- int dst_depth = p->depth_g ? p->depth_g : 8;
+ int dst_depth = gl->fb_g ? gl->fb_g : 8;
if (p->opts.dither_depth > 0)
dst_depth = p->opts.dither_depth;
@@ -2508,6 +2507,9 @@ static void init_gl(struct gl_video *p)
debug_check_gl(p, "before init_gl");
+ MP_VERBOSE(p, "Reported display depth: R=%d, G=%d, B=%d\n",
+ gl->fb_r, gl->fb_g, gl->fb_b);
+
gl->Disable(GL_DITHER);
gl_vao_init(&p->vao, gl, sizeof(struct vertex), vertex_vao);
@@ -2744,12 +2746,6 @@ void gl_video_config(struct gl_video *p, struct mp_image_params *params)
gl_video_reset_surfaces(p);
}
-void gl_video_set_output_depth(struct gl_video *p, int r, int g, int b)
-{
- MP_VERBOSE(p, "Display depth: R=%d, G=%d, B=%d\n", r, g, b);
- p->depth_g = g;
-}
-
void gl_video_set_osd_source(struct gl_video *p, struct osd_state *osd)
{
mpgl_osd_destroy(p->osd);