shabby wrote: ↑
Sat Jul 04, 2020 3:35 pm
Youlean wrote: ↑
Sat Jul 04, 2020 10:37 am
I think you would be surprised to know how many plugins and hosts are using software rasterisation, and that doesn't mean that graphics performance is bad or it looks like win 3.1
Also, gpu rasterisation will use CPU too.
Your never going to get large fancy alpha blended 60fps UI's with software rasterization - without burning up some CPU . Think something along the lines of FabFilter - multiple alpha blended graphs and AA lines/edges - that would be an almost criminal waste of CPU time.
Actually it's not quite so simple. I'm not sure what they use right now, but I believe Skia at least used to (and unless they've done something new recently, it's probably what they still do) basically rasterize complex polygon paths on the CPU, then upload the resulting coverage mask as texture to the GPU for painting and blending, because as soon as you want better AA than what you get out of hardware MSAA (ie. you can't just stencil-and-cover), rasterizing on the CPU can actually end up the fastest approach, especially for the complicated cases.
The actual painting/blending is pretty cheap on either GPU or CPU though, so it's mostly a matter of optimizing texture bandwidth (ie. one channel coverage vs. 4-channel RGBA) if you're going to do the final composition on the GPU anyway. If you have a bunch of layers all rendered on the CPU, then it might well be faster to just blend them there as well and only upload the final image.
The thing to keep in mind though is that naive
software rendering is quite slow. Even if your core rasterizer is fast, it still makes sense to keep track of things like dirty regions, tight clipping bounds and intelligent caching. It is quite easy to end up spending 90% of the rendering time just blending fully transparent regions and repainting stuff that didn't change from the last frame and this is obviously not competitive with anything.
ps. I should probably explicitly point out that I'm not trying to claim CPU is always faster. Rather I'm trying to point out that "it depends" and the answer is not always obvious, because some 2D rendering tasks are actually really easy on the CPU and really hard on the GPU and the CPU can end up being the bottleneck even in a seemingly GPU based solution.
Please just let me die.