Register a primitive only when it is drawn, and keep the prelude shared
Nothing seeds the registry any more, so a kind's id is decided by the first draw and no order within a layer can be relied on even by accident. A ui that draws no images now pays for no image pipeline, and a layer's list vector only reaches the highest kind that layer draws. The atlas and the sampler are still bound for every draw, but are declared by the two shaders that read them rather than by the prelude, which is now only what every primitive uses. `TexturePrimitive` gets a `From<&TextureHandle>`; `Painter::texture_at` stays because the share of the handle is what keeps the slot from being freed while it is drawn, which a `Pod` primitive cannot hold. Checked on the headless rig that the layers carry the ordering rather than the ids: with a bare text drawn first, so glyph registers before rect, a stacked label still draws over its background. Also re-ran an image alone in a layer, now the only primitive a ui registers, and a four-layer atlas. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
29d390da52
commit
01a9b8633d
6 files changed
+35
-40
No files matched your search
@@ -1,6 +1,12 @@
|
||||
// Matches `GlyphEntry::IS_COLORED`.
|
||||
const COLORED: u32 = 1u;
|
||||
|
||||
// The glyph atlas, whose array layers are its pages.
|
||||
@group(0) @binding(2)
|
||||
var atlas: texture_2d_array<f32>;
|
||||
@group(0) @binding(3)
|
||||
var samp: sampler;
|
||||
|
||||
struct GlyphInfo {
|
||||
uv_min: vec2<f32>,
|
||||
uv_max: vec2<f32>,
|
||||
|
||||
Reference in new issue
Block a user