sodium-fabric
sodium-fabric copied to clipboard
Combine draw commands to improve rendering performance
Prerequisite PR: https://github.com/CaffeineMC/sodium-fabric/pull/2352 (built on top of that branch, when that PR is merged this PR will only have one differing commit)
This PR makes it so that draw commands that read from adjacent vertex data are combined. This reduces the number of draw commands by around 30% and improves fps on my system by 16-30% depending on the scene and circumstances. I'm on macOS with a 6900 XT. This performance improvement likely comes, as jellysquid stated on discord, from reduced CPU overhead in the driver and better GPU occupancy.
Please test if this results in a similar improvement or other effect, as it's probably dependent on graphics card, memory bandwidth, and platform (os/driver/vendor etc).
Here's a recording of the number of draw commands per pass: ts on, before: Draw total for pass Solid: 15531 Draw total for pass Cutout: 13277 Draw total for pass Translucent: 2298
ts on, after: Draw total for pass Solid: 9571 Draw total for pass Cutout: 8306 Draw total for pass Translucent: 2298
ts off, before: Draw total for pass Solid: 15531 Draw total for pass Cutout: 13277 Draw total for pass Translucent: 3812
ts off, after: Draw total for pass Solid: 9571 Draw total for pass Cutout: 8306 Draw total for pass Translucent: 3645
Here's some screenshots without and with this patch: