Repository navigation
Conversation
cera.BandSurface is a Surface that several goroutines draw onto at once: Bands(n) hands out one compositor per worker. RenderSurface draws a list onto one in bands, by up to Workers goroutines as Render does, when the list needs nothing but drawing: no transparency groups or soft masks, whose layers are read, written or flushed mid-band, and no blending with the background. Other lists are drawn in one pass as before. The region is filled once before the bands start; a worker's part of the surface refuses the surface's other operations. gpu.Surface implements Bands with gpu.Recorders of its target, kept across renders and closed with the surface. Tests: the core module draws scenes in four bands onto an image surface, whole and onto a region, against Render, also under the race detector; the GPU module draws them in four bands, twice onto one surface, within 2/255 of the CPU, race-free. BenchmarkRenderSurface (A3, 150 dpi, readback, Apple M4): bands are two to three times faster than one pass. Refs #157 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Step 2 of ADR 0011 (#157), after #241.
cera.BandSurfaceis aSurfacethat several goroutines draw onto at once.Bands(n)hands out one compositor per worker.When bands are used:
RenderSurfacedraws a list in bands, by up toWorkersgoroutines asRenderdoes, only if the list needs nothing but drawing:Other lists are drawn in one pass, as in step 1.
Filling and isolation: the region is filled once before the bands start. A worker's part of the surface refuses the surface's other operations.
gpu.Surface.Bands: usesgpu.Recorders of the target, kept across renders and closed with the surface.Tests
Render, also under-race.Benchmark —
BenchmarkRenderSurface: A3 at 150 dpi, readback included, Apple M4 with 10 cores. CPU isRenderwith all workers.Bands make the GPU path two to three times faster than one pass. It is still slower than the CPU on all cores, partly because of reading back 17 MB per page. A viewer presents the target without readback; the 4K benchmark from the ADR still has to measure that case.
🤖 Generated with Claude Code