refacto(exporter): re-organize rasterizer object and simply layer workflow #69

Merged
Superkooka merged 22 commits from refactor/rasterizer into main 2026-10-21 17:04:28 +00:00
Owner
No description provided.
feat(benchmarks): scenarios for each object pass
All checks were successful
/ docs (push) Successful in 4s
/ format (push) Successful in 1m14s
/ test (push) Successful in 1m37s
Benchmarks / compare (pull_request) Successful in 14m32s
c708839784
Superkooka changed title from refacto(exporter): rasterizer to refacto(exporter): re-organize rasterizer object and simply layer workflow 2026-10-17 01:40:22 +00:00

Benchmarks

Base 673048fc against head 01944f65, alternating over 5 rounds on the same runner.
Times are per operation, the fastest round of each side. A change counts only when every round shows it beyond the error margins of both runs; otherwise it is marked as noise.
A shared runner is noisy: trust the allocations more than the times, and confirm a time on an idle machine.

Benchmark Parameters Base Head Change Rounds Base allocated Head allocated
LandscapeRasterizerBenchmarks.Draw Kernel=bicubic - 21.56 ns new - - 1 B
LandscapeRasterizerBenchmarks.Draw Kernel=bicubic 21.23 ns - removed - 1 B -
LandscapeRasterizerBenchmarks.Draw Kernel=bilinear - 18.09 ns new - - 1 B
LandscapeRasterizerBenchmarks.Draw Kernel=bilinear 18.21 ns - removed - 1 B -
ObjectRasterizerBenchmarks.Draw 16.94 ns - removed - 0 B -
ObjectRasterizerBenchmarks.Draw Scenario=texture - 22.47 ns new - - 0 B
ObjectRasterizerBenchmarks.Draw Scenario=texture-blended - 44.83 ns new - - 24 B
ObjectRasterizerBenchmarks.Draw Scenario=texture-cut - 14.24 ns new - - 0 B
ObjectRasterizerBenchmarks.Draw Scenario=texture-hillshaded - 31.71 ns new - - 0 B
ObjectRasterizerBenchmarks.Draw Scenario=wireframe - 8.14 ns new - - 0 B
ObjectTextureBenchmarks.Sample Kernel=bicubic 101.75 ns - removed - 0 B -
ObjectTextureBenchmarks.Sample Kernel=bicubic - 102.9 ns new - - 0 B
ObjectTextureBenchmarks.Sample Kernel=bilinear 56.67 ns - removed - 0 B -
ObjectTextureBenchmarks.Sample Kernel=bilinear - 59.44 ns new - - 0 B
PngEncoderBenchmarks.Encode 89.57 ns 85.5 ns -4.54 % (noise), allocations changed -6.28 % to +2.68 % 8 B 4 B
All benchmarks (15)
Benchmark Parameters Base Head Change Rounds Base allocated Head allocated
LandscapeRasterizerBenchmarks.Draw Kernel=bicubic - 21.56 ns new - - 1 B
LandscapeRasterizerBenchmarks.Draw Kernel=bicubic 21.23 ns - removed - 1 B -
LandscapeRasterizerBenchmarks.Draw Kernel=bilinear - 18.09 ns new - - 1 B
LandscapeRasterizerBenchmarks.Draw Kernel=bilinear 18.21 ns - removed - 1 B -
ObjectRasterizerBenchmarks.Draw 16.94 ns - removed - 0 B -
ObjectRasterizerBenchmarks.Draw Scenario=texture - 22.47 ns new - - 0 B
ObjectRasterizerBenchmarks.Draw Scenario=texture-blended - 44.83 ns new - - 24 B
ObjectRasterizerBenchmarks.Draw Scenario=texture-cut - 14.24 ns new - - 0 B
ObjectRasterizerBenchmarks.Draw Scenario=texture-hillshaded - 31.71 ns new - - 0 B
ObjectRasterizerBenchmarks.Draw Scenario=wireframe - 8.14 ns new - - 0 B
ObjectTextureBenchmarks.Sample Kernel=bicubic 101.75 ns - removed - 0 B -
ObjectTextureBenchmarks.Sample Kernel=bicubic - 102.9 ns new - - 0 B
ObjectTextureBenchmarks.Sample Kernel=bilinear 56.67 ns - removed - 0 B -
ObjectTextureBenchmarks.Sample Kernel=bilinear - 59.44 ns new - - 0 B
PngEncoderBenchmarks.Encode 89.57 ns 85.5 ns -4.54 % (noise), allocations changed -6.28 % to +2.68 % 8 B 4 B
<!-- benchmark-report --> ### Benchmarks Base `673048fc` against head `01944f65`, alternating over 5 rounds on the same runner. Times are per operation, the fastest round of each side. A change counts only when every round shows it beyond the error margins of both runs; otherwise it is marked as noise. A shared runner is noisy: trust the allocations more than the times, and confirm a time on an idle machine. | Benchmark | Parameters | Base | Head | Change | Rounds | Base allocated | Head allocated | |---|---|---|---|---|---|---|---| | `LandscapeRasterizerBenchmarks.Draw` | Kernel=bicubic | - | 21.56 ns | new | - | - | 1 B | | `LandscapeRasterizerBenchmarks.Draw` | Kernel=bicubic | 21.23 ns | - | removed | - | 1 B | - | | `LandscapeRasterizerBenchmarks.Draw` | Kernel=bilinear | - | 18.09 ns | new | - | - | 1 B | | `LandscapeRasterizerBenchmarks.Draw` | Kernel=bilinear | 18.21 ns | - | removed | - | 1 B | - | | `ObjectRasterizerBenchmarks.Draw` | | 16.94 ns | - | removed | - | 0 B | - | | `ObjectRasterizerBenchmarks.Draw` | Scenario=texture | - | 22.47 ns | new | - | - | 0 B | | `ObjectRasterizerBenchmarks.Draw` | Scenario=texture-blended | - | 44.83 ns | new | - | - | 24 B | | `ObjectRasterizerBenchmarks.Draw` | Scenario=texture-cut | - | 14.24 ns | new | - | - | 0 B | | `ObjectRasterizerBenchmarks.Draw` | Scenario=texture-hillshaded | - | 31.71 ns | new | - | - | 0 B | | `ObjectRasterizerBenchmarks.Draw` | Scenario=wireframe | - | 8.14 ns | new | - | - | 0 B | | `ObjectTextureBenchmarks.Sample` | Kernel=bicubic | 101.75 ns | - | removed | - | 0 B | - | | `ObjectTextureBenchmarks.Sample` | Kernel=bicubic | - | 102.9 ns | new | - | - | 0 B | | `ObjectTextureBenchmarks.Sample` | Kernel=bilinear | 56.67 ns | - | removed | - | 0 B | - | | `ObjectTextureBenchmarks.Sample` | Kernel=bilinear | - | 59.44 ns | new | - | - | 0 B | | `PngEncoderBenchmarks.Encode` | | 89.57 ns | 85.5 ns | -4.54 % (noise), allocations changed | -6.28 % to +2.68 % | 8 B | 4 B | <details> <summary>All benchmarks (15)</summary> | Benchmark | Parameters | Base | Head | Change | Rounds | Base allocated | Head allocated | |---|---|---|---|---|---|---|---| | `LandscapeRasterizerBenchmarks.Draw` | Kernel=bicubic | - | 21.56 ns | new | - | - | 1 B | | `LandscapeRasterizerBenchmarks.Draw` | Kernel=bicubic | 21.23 ns | - | removed | - | 1 B | - | | `LandscapeRasterizerBenchmarks.Draw` | Kernel=bilinear | - | 18.09 ns | new | - | - | 1 B | | `LandscapeRasterizerBenchmarks.Draw` | Kernel=bilinear | 18.21 ns | - | removed | - | 1 B | - | | `ObjectRasterizerBenchmarks.Draw` | | 16.94 ns | - | removed | - | 0 B | - | | `ObjectRasterizerBenchmarks.Draw` | Scenario=texture | - | 22.47 ns | new | - | - | 0 B | | `ObjectRasterizerBenchmarks.Draw` | Scenario=texture-blended | - | 44.83 ns | new | - | - | 24 B | | `ObjectRasterizerBenchmarks.Draw` | Scenario=texture-cut | - | 14.24 ns | new | - | - | 0 B | | `ObjectRasterizerBenchmarks.Draw` | Scenario=texture-hillshaded | - | 31.71 ns | new | - | - | 0 B | | `ObjectRasterizerBenchmarks.Draw` | Scenario=wireframe | - | 8.14 ns | new | - | - | 0 B | | `ObjectTextureBenchmarks.Sample` | Kernel=bicubic | 101.75 ns | - | removed | - | 0 B | - | | `ObjectTextureBenchmarks.Sample` | Kernel=bicubic | - | 102.9 ns | new | - | - | 0 B | | `ObjectTextureBenchmarks.Sample` | Kernel=bilinear | 56.67 ns | - | removed | - | 0 B | - | | `ObjectTextureBenchmarks.Sample` | Kernel=bilinear | - | 59.44 ns | new | - | - | 0 B | | `PngEncoderBenchmarks.Encode` | | 89.57 ns | 85.5 ns | -4.54 % (noise), allocations changed | -6.28 % to +2.68 % | 8 B | 4 B | </details>
refactor(exporter): split the frame, target, lighting and post passes out of ObjectRasterizer
Some checks failed
/ docs (push) Successful in 4s
/ format (push) Successful in 1m31s
/ test (push) Successful in 2m0s
Benchmarks / compare (pull_request) Failing after 10m52s
78d2080cb8
refactor(exporter): one triangle traversal for faces, water and height samples
Some checks failed
/ docs (push) Successful in 5s
/ format (push) Successful in 1m31s
/ test (push) Successful in 1m56s
Benchmarks / compare (pull_request) Failing after 10m52s
fe6326fcf0
refactor(exporter): resolve each object shape's material once per map
Some checks failed
/ docs (push) Successful in 4s
/ format (push) Successful in 1m31s
/ test (push) Successful in 1m57s
Benchmarks / compare (pull_request) Has been cancelled
6a26ae3f54
fix(benchmarks): run each side from its own source tree
Some checks failed
/ format (push) Successful in 3s
/ docs (push) Successful in 4s
/ test (push) Successful in 1m36s
Benchmarks / compare (pull_request) Failing after 17m14s
5dea2a66cd
BenchmarkDotNet resolves the project its generated runner references
from the current directory. benchmark-rounds.sh ran both sides from the
head, so the base was built from the head's source: the comparisons
since #55 measured the head against itself, and a benchmark moved to
another namespace broke the base build. The report then subtracted the
null mean of the failed runs.

Each side now runs from its own tree, and the report leaves out rounds
without statistics and marks a benchmark with no result on one side as
failed.
ObjectRasterizer now picks the passes of a band once: opaque then
blended, or depth then edges in wireframe. BandDrawer hands each pass
the triangles of the shapes it draws, and each pass fills them with its
own writer. FaceShader computes a face's shade, falloff and mip level
once and its color per pixel, shared by the opaque and blended writers.
The wireframe edges and their tolerances move to WireframeEdges, and the
ground shade, cut and deferred blending become ObjectDrawOptions. A
water or wireframe shape no longer reads vertex attributes it doesn't
paint. The output is the same bit for bit.
Superkooka force-pushed refactor/rasterizer from 6fececb870
Some checks failed
Benchmarks / compare (pull_request) Has been cancelled
/ docs (push) Has been cancelled
/ format (push) Has been cancelled
/ test (push) Has been cancelled
to 3340c7ef97
All checks were successful
/ format (push) Successful in 1m45s
/ docs (push) Successful in 2m0s
/ test (push) Successful in 2m23s
Benchmarks / compare (pull_request) Successful in 14m31s
2026-10-17 04:13:16 +00:00
Compare
A MapLayer record is now the layer as the options ask for it. Its
PrepareAsync returns an ILayerRun, whose ForMapAsync returns the
ILayerDrawer that draws the map's regions, so a value computed for the
run or for a map exists only once its stage has run: no nullable state
and no call-order exception left in the layers. StatelessLayer and
PerMapLayer cover the layers without run state; the objects layer has
ObjectsRun and ObjectsDrawer. MapLayers.PrepareAsync prepares the run's
layers for the pipeline and the renderer. The output is the same bit
for bit.
refactor(exporter): pass the region buffers between layers as declared planes
All checks were successful
/ docs (push) Successful in 4s
/ format (push) Successful in 1m31s
/ test (push) Successful in 1m58s
Benchmarks / compare (pull_request) Successful in 15m8s
3361616557
perf(exporter): pool the region buffers of the objects layer
All checks were successful
/ docs (push) Successful in 5s
/ format (push) Successful in 1m34s
/ test (push) Successful in 1m58s
Benchmarks / compare (pull_request) Successful in 15m13s
5ab82a397d
perf(exporter): inline the triangle traversal and vectorize the swatch rows
All checks were successful
/ docs (push) Successful in 4s
/ format (push) Successful in 1m33s
/ test (push) Successful in 1m58s
Benchmarks / compare (pull_request) Successful in 15m19s
fbec7e680c
perf(exporter): defer background color painting until after covering layers
All checks were successful
/ docs (push) Successful in 5s
/ format (push) Successful in 1m33s
/ test (push) Successful in 2m2s
Benchmarks / compare (pull_request) Successful in 15m5s
f50112be40
Skip background color pixels where object layers cover without reading them.
Adds a Covered plane to track painted pixels and DrawDeferred / BackgroundColors
to paint background colors only where layers expose them.
Merge branch 'main' into refactor/rasterizer
All checks were successful
/ docs (push) Successful in 5s
/ format (push) Successful in 1m24s
/ test (push) Successful in 1m44s
Benchmarks / compare (pull_request) Successful in 14m12s
7c2ad10225
# Conflicts:
#	BookAtlas.Exporter/Pipelines/Maps/MapPipeline.cs
refactor(exporter): group the maps pipeline by role, rename Records to Landscape
All checks were successful
/ docs (push) Successful in 4s
/ format (push) Successful in 1m22s
/ test (push) Successful in 1m45s
Benchmarks / compare (pull_request) Successful in 14m15s
f2c1db75fd
Planning, Geometry, Surface and Style take the files that sat at the
root of Pipelines/Maps, and Backgrounds holds the Lod and Landscape
backgrounds (Landscape was Records, with Terrain, Textures and Grass
inside). RecordsBackground and RecordsOptions become LandscapeBackground
and LandscapeOptions. Files that held several types are split, tests
and benchmarks follow the folders. The exports are identical byte for
byte.
refactor(exporter): prepare a background into a typed run, as the layers are
All checks were successful
/ docs (push) Successful in 5s
/ format (push) Successful in 1m23s
/ test (push) Successful in 1m47s
Benchmarks / compare (pull_request) Successful in 14m14s
b19d988de8
refactor(benchmarks): drop the colormap-blended scenario, it shares the blended writers with texture-blended
All checks were successful
/ docs (push) Successful in 4s
/ format (push) Successful in 1m22s
/ test (push) Successful in 1m43s
Benchmarks / compare (pull_request) Successful in 13m59s
01944f6573
Superkooka deleted branch refactor/rasterizer 2026-10-21 17:04:28 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Superkooka/SkyrimSourceExporter!69
No description provided.