• AlmightySnoo 🐢🇮🇱🇺🇦@lemmy.world
      link
      fedilink
      arrow-up
      67
      arrow-down
      1
      ·
      edit-2
      9 months ago

      Double and triple buffering are techniques in GPU rendering (also used in computing, up to double buffering only though as triple buffering is pointless when headless).

      Without them, if you want to do some number crunching on your GPU and have your data on the host (“CPU”) memory, then you’d basically transfer a chunk of that data from the host to a buffer on the device (GPU) memory and then run your GPU algorithm on it. There’s one big issue here: during the memory transfer, your GPU is idle because you’re waiting for the copy to finish, so you’re wasting precious GPU compute.

      So GPU programmers came up with a trick to try to reduce or even hide that latency: double buffering. As the name suggests, the idea is to have not just one but two buffers of the same size allocated on your GPU. Let’s call them buffer_0 and buffer_1. The idea is that if your algorithm is iterative, and you have a bunch of chunks on your host memory on which you want to apply that same GPU code, then you could for example at the first iteration take a chunk from host memory and send it to buffer_0, then run your GPU code asynchronously on that buffer. While it’s running, your CPU has the control back and it can do something else. Here you prepare immediately for the next iteration, you pick another chunk and send it asynchronously to buffer_1. When the previous asynchronous kernel run is finished, you rerun the same kernel but this time on buffer_1, again asynchronously. Then you copy, asynchronously again, another chunk from the host to buffer_0 this time and you keep swapping the buffers like this for the rest of your loop.

      Now some GPU programmers don’t want to just compute stuff, they also might want to render stuff on the screen. So what happens when they try to copy from one of those buffers to the screen? It depends, if they copy in a synchronous way, we get the initial latency problem back. If they copy asynchronously, the host->GPU copy and/or the GPU kernel will keep overwriting buffers before they finish rendering on the screen, which will cause tearing.

      So those programmers pushed the double buffering idea a bit further: just add an additional buffer to hide the latency from sending stuff to the screen, and that gives us triple buffering. You can guess how this one will work because it’s exactly the same principle.

        • Chewy@discuss.tchncs.deOP
          link
          fedilink
          arrow-up
          8
          ·
          9 months ago

          If the system can’t keep up with the animation of e.g. Gnome’s overview, the fps halfes because of double buffered vsync for a moment. This is perceived as stutter.

          With triple buffer vsync the fps only drop a little (e .g 60 fps -> 55 fps), which isn’t as big of drop of fps, so the stutter isn’t as big (if it’s even noticeable).

        • Biased opinion here as I haven’t used GNOME since they made the switch to version 3 and I dislike it a lot: the animations are so slow that they demand a good GPU to hide that and thus need stuff from game/GPU programming to make GNOME more fluid for users with less beefy cards.

  • AutoTL;DR@lemmings.worldB
    link
    fedilink
    English
    arrow-up
    12
    ·
    9 months ago

    This is the best summary I could come up with:


    It looks like GNOME 46 might finally see the dynamic triple buffering support merged for Mutter to enhance the performance particularly for systems with integrated graphics.

    Ubuntu and Debian have been carrying the GNOME Mutter dynamic triple buffering patches for years that have been maintained by Canonical’s Daniel van Vugt.

    Van Vugt commented this morning in an Ubuntu desktop status update: “Completed a redesign for mutter 46 that should get us closer to merging much sooner than carrying on with unified buffer management…Triple buffering is now out of draft status and ready to merge.”

    He added this week in the merge request: "[KMS unify buffer management for all plane types] has been dropped.

    FTR., I hope to get [Wayland direct scanout for cropped and scaled surfaces] into a mergable state soon and was worrying that would step on your toes here, but now it looks like it should be pretty compatible."

    We’ll see if after 3+ years of work if Mutter dynamic triple buffering is finally ready for upstream in GNOME 46.


    The original article contains 305 words, the summary contains 172 words. Saved 44%. I’m a bot and I’m open source!

    • Chewy@discuss.tchncs.deOP
      link
      fedilink
      arrow-up
      3
      ·
      9 months ago

      There’s a Fedora copr with the triple buffering patches and it did improve the perceived smoothness of Gnome’s animations on my 8th gen Intel CPU.

      It was especially noticeable if the system was limited in power because of running on battery.

  • Kawawete@reddeet.com
    link
    fedilink
    arrow-up
    8
    arrow-down
    2
    ·
    9 months ago

    I genuinely tried Gnome and started to like it but a very minor update broke all of my QoL extensions and only 1/8th of them were updated. It’s lacking so many features that it’s just a bad DE all around : snapping windows in quarters anyone ? Why isn’t it already an option ? GNOME devs need to touch grass and listen to the actual users.

    • Fredol@lemmy.world
      link
      fedilink
      arrow-up
      3
      arrow-down
      1
      ·
      9 months ago

      Gnome devs will never listen to criticism. Even if you do a MR it might get denied because it contraricts with the “Gnome way”. Just use KDE and live an happy life. KDE can be easily modified to look like Gnome and have all the QOLs you need.

      • Kawawete@reddeet.com
        link
        fedilink
        arrow-up
        1
        ·
        9 months ago

        Oh yeah I’m 100% on KDE now, I switched to Gnome for a little while because it had less bugs on Wayland on nvidia cards

    • ⸻ Ban DHMO 🇦🇺 ⸻@aussie.zone
      link
      fedilink
      English
      arrow-up
      1
      ·
      9 months ago

      To be fair the extension developers were given quite a while to update their extensions to use JavaScript modules instead of the custom GNOME solution. This was actually a change for the better and unlikely to happen again which should make extension development easier. As for better tiling look up their mosaic thing which was announced a while ago, though I’m unsure as to how soon that will come out.

      Also try to remember that GNOME is developed mostly by volunteers who frankly owe you nothing