Home Artists Posts Import Register

Content

Now the "hello world" example is kind of working.

As you can see in the third and fourth lines, there are some conflicts between threads, causing parts of the text to be garbled. This happened because I didn't make Con_Printf multithread-friendly.

I'll keep doing experiments and polishing my ideas on how to implement multicore rendering. Coarse-grained parallelization (making each thread draw a whole polygon) is usually the first approach that comes to mind, but it's not very efficient because when rendering multiple polygons with different sizes, the threads that renders small polygons will remain idle until the threads rendering big polygons finishes their work.

Retroquad will likely end up using loop level parallelization instead, but with a twist. The usual loop parallelization approach makes each thread process a whole range of indexes, but this is not optimal for scanline-based polygon rasterization because the width of the scanlines can differ a lot between the first ones and the last ones (e.g. a triangle can be very large at the top, and very thin at the bottom). So, I'll implement some sort of interleaved loop parallelization, which will distribute the rasterization workload in a much more evenly way.

Files

Comments

No comments found for this post.