4 ms·
I remember asking a similar question on HN a while back. The response was that 2D graphics, UIs in particular, are mostly computed on the CPU. I have no idea wh
by tenaciousDaniel 6y ago
I remember asking a similar question on HN a while back. The response was that 2D graphics, UIs in particular, are mostly computed on the CPU. I have no idea why this is the case, though.
- raphlinus 6y agoSee this blog, it explains it pretty well imho: https://blog.mecheye.net/2019/05/why-is-2d-graphics-is-harder-than-3d-graphics/ https://blog.mecheye.net/2019/05/why-is-2d-graphics-is-harde... And: historically they've been computed mostly on CPU, but I think it's time for that to change.
- jcelerier 6y ago> And: historically they've been computed mostly on CPU, but I think it's time for that to change. It would be great to wait a bit for OS & GPU power management to evolve before biting the bullet on that. My laptop goes from 6 to 2.something hours of battery as soon as I have a GL context opening somewhere, likely because it seems to power on its discrete GPU automatically in that case.
- Kuinox 6y agoDon't fool yourself, they won't do anything until most of the browser/apps do it. Then they will fix it to sell "longer" battery life.
- zozbot234 6y agoWith most dual-GPU machines you do get a choice whether to power on the discrete GPU or not. It's even supported on GNOME/Wayland as of late.
- raphlinus 6y agoThis is changing. I've been doing power measurements as well (just didn't make the cut of this blog post), and the 1060 is surprisingly power-efficient in its low frequency modes. It's also generally the case that the GPU is always active in its role running the compositor.
- jcelerier 6y ago> and the 1060 is surprisingly power-efficient in its low frequency modes. maybe ? the computer on which this happens is a 1070. But please be aware that series 10 are a very small percentage of people. The average laptop of non-tech people around me is easily 8 years old, often on their 2nd or 3rd battery... and these people won't be able to complain easily to anyone when their new battery's life suddenly is halved because of $SOFTWARE.
- ben-schaaf 6y agoBoth macOS and Windows have ways for applications to specify whether they want to prefer a discrete gpu or integrated.
- nitrogen 6y agoDuring the late 1990s and early 2000s it was a lot more common for GPUs to provide 2D acceleration, and GUIs were drawn using those primitives. I remember the switch to CPU rendering happening, and the subsequent removal of 2D acceleration from GPUs, but I don't remember why. At any rate, the 2D graphics we expect now are a lot more complex than the unantialiased lines, blits, and fills of old.
- ensiferum 6y agoIf you need portable results pixel to pixel on various platforms then CPU based rendering is more straightforward than using the GPU. The various libraries such as freetype for font rastrization only works on CPU. Plenty of work should be done to research and implementation is left to be done in order to use the GPU more widely.
- raphlinus 6y agoThis is an interesting and subtle point about doing "software on GPU compute." You are in complete control over what gets computed, and are not at the mercy of the hardware's fixed function pipeline for stuff like rasterization rules and sampling patterns for antialiasing. So I think portable results pixel to pixel are in fact viable. Of course CPU rendering is always more straightforward than GPU, the higher performance comes at a significant cost in complexity.
- gct 6y agoI've done a fair bit of 2d graphics work (written a rasterizer, etc). Honestly it's because it's 1) tricky to shoehorn 2D graphics onto the APIs that GPUs provide and 2) really not needed. I can easily render eg: a world map with hundreds of thousands of lines at hundreds of frames/second with one core.
- chrismorgan 6y agoPlease don’t use preformatted text to write lists. It’s a pain. Just leave a blank line between the items so that each is a paragraph.
- gct 6y agocool story