Hacker News new | ask | show | jobs
by ryu2k2 2689 days ago
Why do we need the power of GPUs meant for fast and complex 3D graphics applications to draw 2D text, lines and icons?
6 comments

Wayland doesn't require you to use GPUs. Only wl_shm is in the core protocol, you can build a software-only Wayland compositor without any hacks, with shared memory.

By the way, Wayland has nothing to do with drawing text, lines and icons. You just give Wayland a bunch of pixels.

That said, using the GPU for compositing is often better for performance and battery savings. It doesn't require anything fancy, GLESv2 is used by many Wayland compositors and is widely available, even on old hardware. It doesn't require proprietary blobs.

If one turns off special effects (compositing) and uses low resolution, even the cheapest mainstream gpu is sufficient to draw 2D text, lines and icons with 60Hz framerate. However, people expect to get more in graphics output than 10-20 years ago, so they buy high-res displays or turn on additional graphics effects in graphics environment - and then, we do need powerful GPUs, because those resolutions and effects require high computing power that is best to provide in a powerful GPU, not powerful CPU.
Because 3D is just an extra dimension for the same calculations?

The GPU does not accelerate 3D, but the computations (so 3D can be much faster).

Many graphics cards/chipsets/etc. do accelerate 2D operations, unfortunately there's no feasible unified model of a "2D hardware accelerator" the way there is with 3D, so there's no unified support for it in kernel, either. The whole thing is inherently hardware-dependent.
Not anymore; at least not like they used to in 90's and 2000's. Today, they expose some overlays (and some limitations, how they can be used) and that's it.

There is a Nvidia OpenGL extension NV_path_rendering that was intended for accelerating 2d, but it wasn't widely adopted.

Because people want their desktop to look nice like Android with smooth animations and not like Windows 3.1 with grey rectangular windows and buttons.
And some people want both nice smooth animations and grey rectangular windows and buttons.
As mentioned by others, you don't actually need a GPU. Weston, the reference compositor implementation, will run in software rendering.
To get that load off the CPU mostly.
Also, I think today CPUs, even if fully dedicated to graphics, can't really compete with today high-end GPUs. Graphics processing and output is a highly parallelizable problem which GPU are designed for, but today CPUs are not .