5 ms·
I've been wondering, is there any reason to use GPU rendering for a terminal emulator ?
by ranguna 5y ago
I've been wondering, is there any reason to use GPU rendering for a terminal emulator ?
- vidarh 5y agoFor speed, it's marginal at best. Very few non-GPU terminals are anywhere near peak performance anyway, because once you get past a certain point the only noticeable difference tends to be what happens when you accidentally dump a huge chunk of text to the terminal. But it does allow fun stuff like shaders. E.g. I added some outlines in the shaders for my version of Kitty (not public anywhere - my hacky shaders are a mess) to let me use more transparent windows without making things unreadable.
- MayeulC 5y agoIt should help on low-power devices, and with power consumption. In theory at least. Moreover, it's a must if you want image support (I saw this terminal emulator supported sixels, opened an issue about the kitty protocol).
- vidarh 5y agoI don't see why it'd make a positive impact on power consumption or low power devices. Most of the time terminals consume very little processing power. You get brief bursts while scrolling lots of text, but that tends to be a tiny proportion of usage. Image support and sixel support exists on any number of terminals with no GPU support. A majority of the ones I've used w/sixel support in fact are totally oblivious to GPUs. Keep in mind sixel originated on terminals a few orders of magnitude slower than even modern mobile devices. For most uses you'll not even benefit from more than a basic 1980's era blitter in terms of acceleration, but given the data volumes even that will not make much difference with a well written terminal app (which will minimize copying to start with)
- ranguna 5y agoSo it benefits only from the rare case where my whole terminal is full of text? Like "cat"ing a binary file? Still not worth it it me, I try to keep my gpu usage as low as possible to save on battery life, and this just sounds overkill.
- vidarh 5y agoYeah, unless you want shaders, that's pretty much it. The irony is that most of the GPU based terminals takes little to no advantage of doing anything fancy with shaders which would be the main other thing they can offer. But even there CPU based rendering can be fast enough for most things. E.g. I hacked xst to add outlines by just crudely rendering things three times, and that was more than fast enough still on CPU only. The current glow I add with shaders on Kitty would be hard to do fast enough, but a close approximation with cached glyphs would not be hard.