D25904: [libkwineffects] Set original backend framebuffer for render targets

Roman Gilg noreply at phabricator.kde.org
Wed Dec 11 21:04:52 GMT 2019


romangg added a comment.


  In D25904#575817 <https://phabricator.kde.org/D25904#575817>, @zzag wrote:
  
  > If we need to render something into a texture, a GLRenderTarget must be pushed on a stack, e.g.
  >
  >   GLRenderTarget::push(target);
  >  
  >   // Draw
  >  
  >   GLRenderTarget::pop();
  >
  >
  > But it's worth to mention that a couple of methods don't play along very nice with this design, namely GLRenderTarget::blitFramebuffer(). It just binds the default framebuffer object to GL_READ_FRAMEBUFFER, it doesn't care whether there is a GLRenderTarget on the stack, etc. I recommend to fix these methods instead. I don't think that we need to change the value of the default framebuffer object.
  
  
  The use case is a bit different here. The change is meant for allowing internal post-processing steps to be applied as in D25907 <https://phabricator.kde.org/D25907> after the Scene rendering is done. But `GlRenderTarget` is meant for being used in the main Scene rendering.
  
  For example it assumes the viewport to be of the same size as the texture it renders to and at position (0, 0). But for our final rendering we need the viewport to be of different nature because of scaling and since we "cut out" a piece of the overall screen geometry.
  
  I'm not saying it is impossible to reuse `GlRenderTarget` for post-processing after Scene rendering has concluded but it was not designed for that and adapting it might become a hassle. But if in the future we find more use cases for post-processing besides rotation in aforementioned patch (I think of Night Color in case hardware gamma manipulation is not possible or not desirable) it might make sense to extend the API around it.

REPOSITORY
  R108 KWin

REVISION DETAIL
  https://phabricator.kde.org/D25904

To: romangg, #kwin
Cc: zzag, kwin, LeGast00n, The-Feren-OS-Dev, sbergeron, jraleigh, fbampaloukas, GB_2, mkulinski, ragreen, jackyalcine, iodelay, crozbo, bwowk, ZrenBot, ngraham, alexeymin, himcesjf, lesliezhai, ali-mohamed, hardening, romangg, jensreuterberg, abetts, sebas, apol, ahiemstra, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kwin/attachments/20191211/8af5faaa/attachment.html>


More information about the kwin mailing list