perf: FrustumCullBoundingBox SSE replacement, 1.6x speedup
- silicon_sse: si_frustumCullBBox (0x686000) — inline V4 mat*vec3 transforms, SSE perspective divide, 4-wide horizon buffer scan. Benched 1.6x (117→72 cyc/call). Installed via JMP patch (544 bytes, won't fit in 380-byte original). - bench: add frustumCullBBox benchmark with mapped globals, identity matrices, and horizon buffer test fixture. - Remove patch table entry for frustumCullBBox, install via detour hook instead (allows future A/B testing if needed).
This commit is contained in:
@@ -2089,6 +2089,7 @@ const sse = struct {
|
||||
extern fn si_vec3Dot() callconv(.naked) void;
|
||||
extern fn si_translateBoundingVol(u32, u32) callconv(TC) void;
|
||||
extern fn si_processLinkedListCollision(u32, u32, u32, u32) callconv(FC) u32;
|
||||
extern fn si_frustumCullBBox(u32, u32, u32) callconv(FC) u32;
|
||||
};
|
||||
|
||||
const PatchEntry = struct {
|
||||
@@ -2124,6 +2125,7 @@ fn getPatchTable() []const PatchEntry {
|
||||
// vec3Dot (0x602630): removed — 0.6x regression, x87 is optimal for this ABI
|
||||
.{ .target = 0x686820, .replacement = @intFromPtr(&sse.si_translateBoundingVol), .name = "translateBoundingVol" },
|
||||
.{ .target = 0x6ABC40, .replacement = @intFromPtr(&sse.si_processLinkedListCollision), .name = "processLinkedListCollision" },
|
||||
// frustumCullBBox: A/B tested via detour hook, not patched
|
||||
};
|
||||
return &table;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user