Skip to content

test(render): benchmark the perspective lightmapped fill (hot path) - #19

Merged
tannevaled merged 1 commit into
mainfrom
bench-lightmapped-fill
Jul 6, 2026
Merged

test(render): benchmark the perspective lightmapped fill (hot path)#19
tannevaled merged 1 commit into
mainfrom
bench-lightmapped-fill

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

Adds a benchmark for FillPerspectiveLightmappedPolygon — the per-pixel perspective-correct textured + lightmapped rasterizer the software renderer spends most of a world frame in. It fills a large (~250k px), depth-tilted, lightmapped quad so the 1/z subdivision, texture wrap, and bilinear lightmap sampler all run for real (0 allocs).

Baseline on this machine: ~1.0 ms/quad (~4 ns/px).

Establishes a fixed reference for the renderer perf work. A fixed-point rewrite of the inner bilinear was tried and measured as a 16% regression (math.Floor compiles to a ROUNDSD intrinsic and native float64 is already fast), so the lever is architectural (overdraw reduction / surface cache), not the per-pixel arithmetic.

🤖 Generated with Claude Code

Adds a benchmark for FillPerspectiveLightmappedPolygon -- the per-pixel
perspective-correct textured + lightmapped rasterizer the software renderer
spends most of a world frame in. It fills a large (~250k px), depth-tilted,
lightmapped quad so the 1/z subdivision, texture wrap, and bilinear lightmap
sampler all run for real (0 allocs).

Baseline on this machine: ~1.0 ms/quad (~4 ns/px). Establishes a fixed
reference for the renderer perf work: a fixed-point rewrite of the inner
bilinear was tried and MEASURED as a 16% regression (math.Floor is a ROUNDSD
intrinsic and native float64 is already fast), so the lever is architectural
(overdraw reduction / surface cache), not the per-pixel arithmetic.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit 12500ae into main Jul 6, 2026
7 checks passed
@tannevaled
tannevaled deleted the bench-lightmapped-fill branch July 6, 2026 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant