Simple Odin software rasterizer
https://github.com/Bigfoot71/rsoft.git
A small unpretentious software rasterizer written in Odin, just for fun.
NOTE: The pipeline only supports 4D floating-point vectors. This includes buffers, varyings, uniforms, and framebuffers.
Performance isn't "wow", but for a triangle in a 400Γ225 box on my Ryzen 3600, here are the 10 second averages:
With shader indirection:
Clear: 101.81 Β΅s (9.8%)
Render: 92.15 Β΅s (8.9%)
Blit: 269.04 Β΅s (26.0%)
Present: 572.09 Β΅s (55.3%)
Without shader indirection:
Clear: 114.07 Β΅s (11.3%)
Render: 58.12 Β΅s (5.7%)
Blit: 269.47 Β΅s (26.6%)
Present: 569.83 Β΅s (56.3%)
Render is the part that rasterizes the triangle (~90k pixels).
Blit, because the rendering is done in an internal framebuffer where each component is stored as vectors of 8 floats (SoA), and then needs to be converted to an RGBA8 buffer.
Compilation flags used:
-o:speed -microarch:native
So these tests are rough and I'm not aiming for maximum performance. This is mainly for fun, and if it allows cool offline renders that's more than enough :D