From 4681e7f49f63ec7f69689e8f30fa60cf4d01794c Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 17 Dec 2014 21:35:05 +0100 Subject: vo_opengl: switch default FBO format to rgba, use GL_RGBA I'm hoping this is generally more compatible, and it works with GLES. This probably has not much of an effect on desktop GL. It also switches only the default format for --vo=opengl, not --vo=opengl-hq. "-hq" already uses GL_RGBA16, though since it's a sized format, the story is a bit different, and it won't work on GLES either. --- DOCS/man/vo.rst | 2 +- video/out/gl_video.c | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/DOCS/man/vo.rst b/DOCS/man/vo.rst index f133c04d76..c6158b6a10 100644 --- a/DOCS/man/vo.rst +++ b/DOCS/man/vo.rst @@ -507,7 +507,7 @@ Available video output drivers are: always used, and typically only when using extended scalers.) ``fmt`` can be one of: rgb, rgba, rgb8, rgb10, rgb10_a2, rgb16, rgb16f, rgb32f, rgba12, rgba16, rgba16f, rgba32f. - Default: rgb. + Default: rgba. ``gamma=<0.0..10.0>`` Set a gamma value. If gamma is adjusted in other ways (like with diff --git a/video/out/gl_video.c b/video/out/gl_video.c index f37c715356..c7b05a9551 100644 --- a/video/out/gl_video.c +++ b/video/out/gl_video.c @@ -295,7 +295,7 @@ const struct gl_video_opts gl_video_opts_def = { .npot = 1, .dither_depth = -1, .dither_size = 6, - .fbo_format = GL_RGB, + .fbo_format = GL_RGBA, .scale_sep = 1, .scalers = { "bilinear", "bilinear" }, .scaler_params = {{NAN, NAN}, {NAN, NAN}}, @@ -525,8 +525,11 @@ static bool fbotex_init(struct gl_video *p, struct fbotex *fbo, int w, int h, gl->BindTexture(p->gl_target, fbo->texture); gl->TexImage2D(p->gl_target, 0, iformat, fbo->tex_w, fbo->tex_h, 0, - GL_RGB, GL_UNSIGNED_BYTE, NULL); + GL_RGBA, GL_UNSIGNED_BYTE, NULL); default_tex_params(gl, p->gl_target, GL_LINEAR); + + debug_check_gl(p, "after creating framebuffer texture"); + gl->BindFramebuffer(GL_FRAMEBUFFER, fbo->fbo); gl->FramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, p->gl_target, fbo->texture, 0); @@ -540,7 +543,7 @@ static bool fbotex_init(struct gl_video *p, struct fbotex *fbo, int w, int h, gl->BindFramebuffer(GL_FRAMEBUFFER, 0); - debug_check_gl(p, "after creating framebuffer & associated texture"); + debug_check_gl(p, "after creating framebuffer"); return res; } -- cgit v1.2.3