3 ms·
I have lots of experience, created several font renderers in the CPU and GPU. No, doing CPU drawing is too inefficient. Without too much trouble you get 50x mo
by bumbada 6y ago
I have lots of experience, created several font renderers in the CPU and GPU.
No, doing CPU drawing is too inefficient. Without too much trouble you get 50x more efficiency in the GPU, that is, you can draw 50frames per every frame in the CPU, using the same amount of energy and time.
If you go deeper, low level with Vulkan-Metal and specially control the GPU memory, you can get 200x, being way harder to program.
CPU drawing is very useful for testing: You create the reference you compare the GPU stuff with.
CPU drawing is the past, not the future.
- slmjkdbtl 6y agoThanks for the write up. Yeah i can see the huge performance difference, one thing that GPU bothers me is now every vendor provides a different set of API, you kinda have to use a hardware abstraction layer to use the GPU if you really want cross platform, and that's often a huge effort or dependency and hard to do right, even in OpenGL days it's easy because you only have to deal with one API instead of three vulkan/metal/d3d. With CPU if ignore the performance lack it's just a plain pixel array that can be easily displayed on any environment and you have control over any bits of it, I just can't get over the lightness and elegance difference between the two..
- bumbada 6y agoVulkan/metal/d3d give you control to do things you could not do with OpenGL, and they are very similar. All my code works first in Vulkan and Metal, but d3d is not hard when you have your vulkan code working. OpenGL was designed by committee and politics(like not giving you the option to compile shaders for a long time while d3d could do it). The hard part is thinking in term extreme parallelism. That is super hard. Once you have something working in the GPU, you can translate it to electronics like using FPGAs. The difference in efficiency is so big, that most GPU approaches do not really work. They are really approximations that fail with certain glyphs. Designers create a model that works with most glyphs, and sometimes they have a fallback, inefficient method for them. With the CPU you can calculate the area under a pixel exactly.
- pjmlp 6y ago> OpenGL was designed by committee and politics Vulkan is exactly designed the same way, by the same people. I already lost track of the extensions, and the joke it is post Vulkan 1.0 to configure everything, to the point a graphical configuration tool is required to ease the process.