diff options
author | Niklas Haas <git@haasn.xyz> | 2017-07-25 06:31:34 +0200 |
---|---|---|
committer | Niklas Haas <git@haasn.xyz> | 2017-07-25 06:32:29 +0200 |
commit | 62de84cbe3b060792a7d19cf747a8ba5a697e894 (patch) | |
tree | 0d385ad7e84df2d5f2dce7294421095961d1ee87 /video/out/opengl/utils.c | |
parent | d099e037efa2ceaff96c775f5c6f8d1e74650b76 (diff) | |
download | mpv-62de84cbe3b060792a7d19cf747a8ba5a697e894.tar.bz2 mpv-62de84cbe3b060792a7d19cf747a8ba5a697e894.tar.xz |
vo_opengl: kill off FBOTEX_COMPUTE again
The textures not having an FBO actually caused regressions when trying
to render the subtitles on top of this texture (--blend-subtitles),
which still relied on an FBO.
So just kill off the logic entirely. Why worry about a single FBO wasted
when we're allocating like 10 anyway.
Fixes #4657.
Diffstat (limited to 'video/out/opengl/utils.c')
-rw-r--r-- | video/out/opengl/utils.c | 35 |
1 files changed, 15 insertions, 20 deletions
diff --git a/video/out/opengl/utils.c b/video/out/opengl/utils.c index 451010fffa..d6dac42195 100644 --- a/video/out/opengl/utils.c +++ b/video/out/opengl/utils.c @@ -265,11 +265,8 @@ bool fbotex_init(struct fbotex *fbo, GL *gl, struct mp_log *log, int w, int h, // Like fbotex_init(), except it can be called on an already initialized FBO; // and if the parameters are the same as the previous call, do not touch it. -// flags can be 0, or a combination of FBOTEX_FUZZY_W, FBOTEX_FUZZY_H and -// FBOTEX_COMPUTE. +// flags can be 0, or a combination of FBOTEX_FUZZY_W and FBOTEX_FUZZY_H. // Enabling FUZZY for W or H means the w or h does not need to be exact. -// FBOTEX_COMPUTE means that the texture will be written to by a compute shader -// instead of actually being attached to an FBO. bool fbotex_change(struct fbotex *fbo, GL *gl, struct mp_log *log, int w, int h, GLenum iformat, int flags) { @@ -318,6 +315,7 @@ bool fbotex_change(struct fbotex *fbo, GL *gl, struct mp_log *log, int w, int h, .iformat = iformat, }; + gl->GenFramebuffers(1, &fbo->fbo); gl->GenTextures(1, &fbo->texture); gl->BindTexture(GL_TEXTURE_2D, fbo->texture); gl->TexImage2D(GL_TEXTURE_2D, 0, format->internal_format, fbo->rw, fbo->rh, 0, @@ -330,24 +328,21 @@ bool fbotex_change(struct fbotex *fbo, GL *gl, struct mp_log *log, int w, int h, gl_check_error(gl, log, "after creating framebuffer texture"); - bool skip_fbo = flags & FBOTEX_COMPUTE; - if (!skip_fbo) { - gl->GenFramebuffers(1, &fbo->fbo); - gl->BindFramebuffer(GL_FRAMEBUFFER, fbo->fbo); - gl->FramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, - GL_TEXTURE_2D, fbo->texture, 0); - - GLenum err = gl->CheckFramebufferStatus(GL_FRAMEBUFFER); - if (err != GL_FRAMEBUFFER_COMPLETE) { - mp_err(log, "Error: framebuffer completeness check failed (error=%d).\n", - (int)err); - res = false; - } - - gl->BindFramebuffer(GL_FRAMEBUFFER, 0); - gl_check_error(gl, log, "after creating framebuffer"); + gl->BindFramebuffer(GL_FRAMEBUFFER, fbo->fbo); + gl->FramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, + GL_TEXTURE_2D, fbo->texture, 0); + + GLenum err = gl->CheckFramebufferStatus(GL_FRAMEBUFFER); + if (err != GL_FRAMEBUFFER_COMPLETE) { + mp_err(log, "Error: framebuffer completeness check failed (error=%d).\n", + (int)err); + res = false; } + gl->BindFramebuffer(GL_FRAMEBUFFER, 0); + + gl_check_error(gl, log, "after creating framebuffer"); + return res; } |