-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
area: corecore/* packagecore/* packageeffort: 13Epic, 2+ weeksEpic, 2+ weekspriority: lowBacklog, nice to haveBacklog, nice to havetype: enhancementImprove existing featureImprove existing feature
Description
Summary
Tracking issue for AA (Anti-Aliasing) rasterization improvements in gg. Created after deep investigation of #95 and comprehensive AA architecture audit.
Current State (v0.31.0)
Production CPU path works correctly after two bug fixes (#95):
AdvanceX()drift removed — edges no longer expand toward bottom of shapescoverageToRuns()maxValue bug fixed — vertex pixels get correct partial coverage- 4 regression tests added
Vello 9-stage GPU compute pipeline (v0.30.0–v0.31.0):
- CPU reference implementation in
internal/gpu/tilecompute/ - 9 WGSL shaders written and dispatched via GPU compute
- Fixed:
fine.wgsly_edge sign,coarse.wgslZ-order - Full demo scene (6 paths, transparency, EvenOdd) — 0% pixel diff GPU=CPU
- v0.31.0: Tier 5 scene accumulation wired into rendering cascade (GG-COMPUTE-008)
- v0.31.0: PipelineMode wiring —
Context.SetPipelineMode()propagates to GPU accelerator (GG-COMPUTE-006) - v0.31.0: Removed 2 naga WGSL workarounds from
path_tiling.wgsl(see tracking: remaining naga SPIR-V workarounds in compute shaders #139 for remaining 3)
Remaining pixel-level differences vs fogleman/gg (max 7-8/255) are inherent algorithmic differences, not bugs — confirmed by mathematical proof (trapezoidal area vs 4x4 supersampling).
Architecture (5 rendering systems)
| System | Status | Description |
|---|---|---|
| AnalyticFiller (Vello) + EdgeBuilder (tiny-skia) | Production | Scanline AA with trapezoidal coverage, FDot16 fixed-point |
| CPU SDF | Production | Smoothstep SDF for circles/rects/rrects |
| GPU 5-Tier Pipeline | Production | SDF + convex + stencil-then-cover + MSDF text + Vello compute |
| TileRasterizer (Vello 16×16) | Validation | CPU reference for GPU compute golden tests |
| GPU Compute Pipeline (9-stage) | Production (v0.31.0) | 9 WGSL shaders, VelloAccelerator dispatches via hal.Queue |
Current rendering cascade (automatic per-draw fallback via ErrFallbackToCPU):
GPU 5-Tier → CPU SDF → AnalyticFiller
Improvement Tasks
Quality (v0.32.0+):
- GG-AA-018: Native curve evaluation — eliminate Bezier flattening for CPU path (P1)
- GG-AA-020: Float32 pipeline — remove FDot16 quantization noise (P2)
- GG-AA-019: Configurable AA quality — hint-based API (P3)
Integration (completed):
- GG-AA-016: TileRasterizer validation — CPU reference + golden test suite for GPU compute ✅ v0.30.0
- GG-AA-017: GPU Compute Pipeline — 9 WGSL shaders written, CPU reference complete ✅ v0.30.0
- GG-COMPUTE-008: Tier 5 scene accumulation — VelloAccelerator accumulates paths during FillPath/StrokePath, dispatches via compute on Flush ✅ v0.31.0
- GG-COMPUTE-006: PipelineMode wiring — Context.SetPipelineMode() propagates to GPU accelerator, SDFAccelerator routes to compute when active ✅ v0.31.0
Shader cleanup:
- Removed
span()inlining workaround frompath_tiling.wgsl✅ v0.31.0 - Removed
varreassignment workaround frompath_tiling.wgsl✅ v0.31.0 - 3 naga SPIR-V workarounds remain — tracked in tracking: remaining naga SPIR-V workarounds in compute shaders #139
Testing:
- GG-AA-015: Visual AA comparison test suite — automated quality metrics (P2)
Related Issues
- Pattern result is strange #95 — Pattern rendering AA quality (fixed in v0.29.4)
- tracking: remaining naga SPIR-V workarounds in compute shaders #139 — naga SPIR-V workarounds tracking (3 remaining)
help wanted: Bottom circle artifact in Vello tile rasterizer #72 — Circle bottom artifact(closed — resolved by GPU compute pipeline, v0.30.0)feat: Vello-style tile-based analytic anti-aliasing #50 — Vello tile-based analytic AA(closed — implemented in v0.30.0)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area: corecore/* packagecore/* packageeffort: 13Epic, 2+ weeksEpic, 2+ weekspriority: lowBacklog, nice to haveBacklog, nice to havetype: enhancementImprove existing featureImprove existing feature