mirror of https://github.com/mpv-player/mpv
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.
This commit is contained in:
parent
631ec3cc33
commit
4681e7f49f
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue