Record the primitive render dispatch and how it was measured

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
irisandClaude Opus 5 committed 2026-09-13 18:30:52 -04:00
1 parent 912602d52b
commit 64d8042f52
1 file changed
+11 -7
+11 -7
View File
@@ -5,8 +5,8 @@ Not a decisions log; delete it when the extraction is done.
## Read this first
**Pull request #11 has been reviewed seven times; the seventh is answered in
`79dcc15` and an eighth has not arrived.** Check for one before doing anything
**Pull request #11 has been reviewed seven times; the last answer is `b9c4856`
and an eighth review has not arrived.** Check for one before doing anything
else:
```sh
@@ -39,7 +39,7 @@ packing images into arrays like atlas pages, and a bindless `binding_array`
- Agent fork: `git@git.arirex.me:iris-ai/iris.git`. The bot cannot push
canonical; work in the fork and open PRs into `iris/iris:main`.
- **#11** `split/11-texture-bindings`, worktree `/home/bob/repos/iris-pr11`,
head `79dcc15`, fourteen commits on top of `0f6a28b`. Reviewed seven times,
head `b9c4856`, fifteen commits on top of `0f6a28b`. Reviewed seven times,
all answered.
- **#12** `split/12-pointer-routing`, worktree `/home/bob/repos/iris-pr12`,
head `028521b`. A scroll falling through a hovered button. Not reviewed as
@@ -67,10 +67,14 @@ shape:
for a trait object.
- **The shared group is what every pipeline gets**: the window and the masks.
A mask texture would go here too.
- **`Primitive::SAMPLES` says what a primitive samples and how often it binds**
-- `Atlas` once for a list, `Image(fn)` for one instance alone, defaulted to
nothing. That is group 2, so a rect's pipeline has no texture or sampler in
its layout. Both cases share one layout builder and one group builder.
- **Each primitive records its own draws.** `Primitive::render` makes a
`PrimitiveRender` that states the layout its shader reads, uploads what it
owns, and records its draws: `GlyphRender` owns the atlas and binds it once
per list, `ImageRender` owns the images and binds one per instance, the
default owns nothing. The renderer knows nothing about textures.
**Measured**, because dispatch per list was the objection: 6 instructions
per list, 0.1% of a frame at 256 and at 1024 layers, against the ~5,400
wgpu spends recording one. `tests/draw_cost.rs` is that measurement.
- **`shader.wgsl` became `shader/prelude.wgsl` plus one file per primitive**,
because one module cannot declare two types at the same binding. The prelude
carries only what every primitive uses -- window, masks, vertex shader,