Hacker News new | past | comments | ask | show | jobs | submit login

The author is working on piet-gpu, a library for efficiently rendering 2D graphics on the GPU, for UIs and font editors and things like that. This is very nontrivial (and in fact most 2D graphics you see today are in large part rendered on the CPU).

The goal of piet-gpu is that you just specify the scene graph (blue circle here, red line there, etc) and send it over to the GPU, and the GPU takes care of all the rendering.

GPUs are very good at processing data in the shape of arrays. For example, a pixel shader (or "fragment shader") processes a 2D array of pixels on the screen. piet-gpu needs to sometimes process data that has a tree structure, rather than an array structure, to support clipping (for example to show a shape that represents the intersection between a circle and a square). The stack monoid the article talks about is a way of doing tree-like operations in parallel on the GPU, and the author thinks it will end up being useful for being able to process clipping operations entirely on the GPU.




Thanks for the summary!

Quick question: wouldn't executing partially-ordered sets of operations in a semi-parallel or fully-parallel way already be an existing research topic in Computer Science? Obviously this project is attempting to find a solution for a singular application and not attempting to find a general algorithm, but still there must be some historical precedent.

I would imagine that companies like NVIDIA would have even already contributed to this space?

Are there any existing resources on the topic that perhaps you or the OP knows of?


There are actually some in the linked article "some theory" section[0].

Seems to be some old work based on a parallel memory model that used to be used (PRAM), some stuff from ken iverson's APL book, and some more APL stuff from someone's thesis.

[0] https://raphlinus.github.io/gpu/2021/05/13/stack-monoid-revi...


> and in fact most 2D graphics you see today are in large part rendered on the CPU

This is pretty misleading. Most 2D arbitrary paths are rendered on the CPU but there's a lot more to 2D graphics than that and run on the GPU today already just fine.


You could start a business doing ELI5s of complex topics! Thank you for a wonderful summary!




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

Search: