News for hackers. Stuff that matters.
Re:WezTerm is a GPU-accelerated cross-platform terminal emul... by adastra22 on Monday March 13, 2023 @03:05PM (#35140798)
Isn't that literally what GPUs were designed to do?
Re:WezTerm is a GPU-accelerated cross-platform terminal emul... by layer8 on Monday March 13, 2023 @04:49PM (#35142344)
The term GPU is primarily associated with 3D graphics, and most of what GPUs do is designed for that. Hardware acceleration of 2D graphics existed long before 3D hardware acceleration became common for PCs, but wasn’t called GPU, instead it was simply referred to as a graphics card.
Re:WezTerm is a GPU-accelerated cross-platform terminal emul... by adastra22 on Monday March 13, 2023 @05:18PM (#35142842)
Texture blitting is a very important part of 3D graphics, and is essentially what is required here.
Re:WezTerm is a GPU-accelerated cross-platform terminal emul... by layer8 on Monday March 13, 2023 @05:27PM (#35143012)
The difference is that applying textures to a 3D object is almost never a pixel-perfect operation, in the sense of texture pixels mapping 1:1 to final screen pixels, whereas for text rendering that’s exactly what you want. Either those are different APIs, or you have to take extra care to ensure the 1:1 mapping is achieved.
Re:WezTerm is a GPU-accelerated cross-platform terminal emul... by jlokier on Monday March 13, 2023 @05:38PM (#35143186)
The transforms are specified so you can position things perfectly these days, when aligned with screen pixels.

Think of the compositing of layers of translucent windows used in modern 2d window managers, while dragging them around. Or even scrolling in a browser. Those rely on the GPU for fast compositing.

Even for 3d, think of the screen-space techniques used in games, where it's necessary to draw a scene in layers combined with each other in various interesting logical ways (for shadows, lighting, surface texture, etc), with the pixels of each layer matching up in a reliable way.

Re:WezTerm is a GPU-accelerated cross-platform terminal emul... by adastra22 on Monday March 13, 2023 @06:27PM (#35143945)
There are ways to configure the texture blitter to be precisely 1:1. This is written into the GL/Vulkan standards for exactly this reason, and all hardware supports/special cases it. It is how pretty much every GUI subsystem out there handles windowing.
Re:WezTerm is a GPU-accelerated cross-platform terminal emul... by layer8 on Monday March 13, 2023 @10:55PM (#35146793)
Yes, my point is that this is a special case separate from normal 3D graphics.
Re:WezTerm is a GPU-accelerated cross-platform terminal emul... by incrudible on Tuesday March 14, 2023 @05:26AM (#35149037)
…so why are GPUs not the way to do this, when GPUs are in fact the way it is commonly done?
Re:WezTerm is a GPU-accelerated cross-platform terminal emul... by rowanG077 on Monday March 13, 2023 @05:16PM (#35142813)
If you can to the number crunching for 3D graphics, you see as hell can do it for 2D graphics.
Re:WezTerm is a GPU-accelerated cross-platform terminal emul... by layer8 on Monday March 13, 2023 @05:20PM (#35142893)
It’s a different set of operations for the most part, when you look into it. Drawing a 2D line or blitting a 2D sprite is quite different from texture-shading a 3D polygon. It’s not generic “number crunching”.
Re:WezTerm is a GPU-accelerated cross-platform terminal emul... by imtringued on Monday March 13, 2023 @05:59PM (#35143544)
Ok but just because operations aren't perfectly identical doesn't mean you can't do it and it certainly doesn't mean it will be slow. I have had great success with SDL_gpu.
Re:WezTerm is a GPU-accelerated cross-platform terminal emul... by rowanG077 on Monday March 13, 2023 @06:43PM (#35144173)
It's tensor ops all the way down
Re:WezTerm is a GPU-accelerated cross-platform terminal emul... by flohofwoe on Tuesday March 14, 2023 @09:01AM (#35150770)
Most of what a GPU does is drawing pixels though (even in 3D games), and that's as 2D as it gets.