Software Renderer: Implement Column buffering system #205

Merged
alufolie91 merged 44 commits from dsdacol into Saturn-Next 2025-10-15 20:52:45 +02:00
alufolie91 commented 2025-10-12 22:28:00 +02:00 (Migrated from github.com)

This brings over eternity engine´s former column buffering system (also used in DSDA-Doom)
This speeds up column drawing quite significantly in some cases
While the maximum gains are not quite as significant as transposing the whole "backbuffer", this does not introduce performance regressions (performance improvements range from 5-60(!) FPS, tested on a Ryzen 5 5600 CPU on 2560x1440 resolution, mileage may vary)
To try and explain it as simply as i can.
Instead of directly drawing our columns to the screen buffer, we draw up to 8 columns in a temporary buffer (with a special layout, storing the columns side by side)
If the buffer is full by 8 columns (or the column type changes), then they will be "flushed" to the screen in one go, significantly improving cpu cache utilization
Due to strict ordering which would result in alot of flushing without accumilating a good "batch" resulting in more overhead than directly writing to screen, columns that are drawn during the masked list step, will not be buffered (Sky "plane" will also not use buffering due to multithreading) note that i suck at explaining everything lulul

This brings over [eternity engine´s](https://github.com/team-eternity/eternity) former column buffering system (also used in DSDA-Doom) This speeds up column drawing quite significantly in some cases While the maximum gains are not quite as significant as transposing the whole "backbuffer", this does not introduce performance regressions (performance improvements range from 5-60(!) FPS, tested on a Ryzen 5 5600 CPU on 2560x1440 resolution, mileage may vary) To try and explain it as simply as i can. Instead of directly drawing our columns to the screen buffer, we draw up to 8 columns in a temporary buffer (with a special layout, storing the columns side by side) If the buffer is full by 8 columns (or the column type changes), then they will be "flushed" to the screen in one go, significantly improving cpu cache utilization Due to strict ordering which would result in alot of flushing without accumilating a good "batch" resulting in more overhead than directly writing to screen, columns that are drawn during the masked list step, will not be buffered (Sky "plane" will also not use buffering due to multithreading) ~~note that i suck at explaining everything lulul~~
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: saturn/SRB2Kart-Saturn#205