Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Isn't that literally what GPUs were designed to do?


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.


Texture blitting is a very important part of 3D graphics, and is essentially what is required here.


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.


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.


Yes, my point is that this is a special case separate from normal 3D graphics.


…so why are GPUs not the way to do this, when GPUs are in fact the way it is commonly done?


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.


Most of what a GPU does is drawing pixels though (even in 3D games), and that's as 2D as it gets.


If you can to the number crunching for 3D graphics, you see as hell can do it for 2D graphics.


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”.


It's tensor ops all the way down


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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: