Isolate most of the softgpu specialization code to RasterizerRectangle. #12452
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Admittedly, the Darkstalkers code from #12443 is pretty ugly and somewhat intrusive. This isolates the required code into its own file, RasterizerRectangle.cpp - the impact to Rasterizer.cpp and TransformUnit.cpp is now very minimal.
If a fully JIT-ed part is added, I'd expect us to also keep around the non-JITed path so that the SW rasterizer can still function on non-JIT-ed platforms. In such a scenario the maintenance cost for keeping this around is very very low (just don't implement this stuff in the JITed path).
I do think the idea of detecting rectangles and drawing them with a different path has merit even for a future fully JIT-ed software renderer - it can eliminate quite a bit of CPU work at no cost to accuracy.
That said, the current rectangle specialization does need a little work with regards to pixel rounding/raster position.