contador web Saltar al contenido

GTK 4 gets better Vulkan compatibility

THE GTK It is a multiplatform toolkit for creating graphical interfaces. If you use the main version of Ubuntu, or distros like Fedora, Linux Mint, Elementary OS, Endless OS and Pop1_OS in their major versions. GTK that makes up the graphical interfaces of these systems. Contrary to popular belief, apps for other platforms, such as Windows, can be written in GTK. Currently the version supported on most systems is GTK 3.

gtk4-vulcan-mutter-gnome-apps-linux-open-source-free software-api-graphics-opengl

When it comes to GTK, frequent releases are not common, and there is always that old quarrel with Qt. This is also used to draw graphical interfaces. Deepin and KDE are just good examples. I don't want to get into the merit of who better or worse, most importantly that software built with these technologies meet their goals.

Earlier this year I wrote a GTK 4 post, and that its launch may be closer and closer. If you would like to see some of the changes from the current GTK 3 to GTK 4, please visit the post mentioned above and see the advantages of this new version.

Improved use of Vulkan in GTK4

If you are a gamer, you should already know the Vulkan. This graphical API has been demonstrating significant improvements in gaming performance on Linux, and even on Windows. GTK 4 currently supports OpenGL and also supports Vulkan.

Using an API such as Vulkan or OpenGL, applications can perform better. They can alleviate the use of GPUs when rendering graphics. Using a dedicated GPU to work gives greater processor autonomy. After all, instead of worrying about graphic tasks, it can focus on more important processes.

When you open an application on your system, an astonishing amount of pixels draw everything you're seeing on screen. For comparative purposes, a full hd monitor has 2 million pixels of screen. Of course, modern GPUs can handle this amount of information, however each time a simple detail is changed while using the application, for example clicking a small button, it is necessary to redraw it all over again.

Imagine this process being done every moment, every time you make use of something in the system. To get around this, window composers use a very clever technique: just redraw the part that actually had some modified detail.

Thus GTK tracks which parts of the window it has changed, sends this information to the window composer so that the composer himself can redraw only the new content. By using the EGL (an interface between the rendering APIs, OpenGL, OpenGL ES or OpenVG), everything was already well optimized, however with Vulkan problems were occurring. gtk4-vulcan-mutter-gnome-apps-linux-open-source-free software-api-graphics-opengl You can see from the image above that the result was not the best. Georges Stavracas, Gnome developer, after doing a lot of research and testing managed to solve the problem. For those unaware, Georges is a Brazilian developer and has been performing an exquisite work on GNOME. Thanks to him, the drag and drop icons to group them in the GNOME Shell menu has come true (without the use of third party extensions). The discovery of the problem was during the development of the GNOME To Do, a program that the Brazilian has been keeping, and be amazed, you already use GTK 4. By default the Vulkan renderer in GTK 4 always sends every window to the composer. The GPU is in charge of the whole process, but it is still an inelegant solution. However through a function of Vulkan, VK_KHR_incremental_present, rendering can be optimized and only new details will be redrawn in the window. gtk4-vulcan-mutter-gnome-apps-linux-open-source-free software-api-graphics-opengl

It seems that the GTK 4 is actually very close, with better performance and making use of technologies like Vulkan, the technology promises to make a leap in comparison to GTK 2 and GTK 3. Adding Wayland in the equation, and who knows its Compatibility with proprietary NVIDIA drivers (given that AMD's open drivers already perform quite well with Wayland) the performance is even higher. Of course, compatibility of NVIDIA proprietary drivers is not the responsibility of the community. After all, how to implement something without the science of its actual operation? Reverse engineering is extremely complex and it would be much simpler for NVIDIA to cooperate with the project.

Looking forward to the GTK 4? I know many are hoping that it will give up on application and GNOME Shell performance. Will by 2020 we see GTK 4 finally being used on a large scale?

See you in the next post Diolinux blog, SYSTEMATICALLY!

_____________________________________________________________________________ See any errors or would you like to add any suggestions to this article? Collaborate, click here.