makepad/libs/render_material
Admin 53e0e85b92 draw and widgets: Slug text everywhere, no blank glyphs, slimmer widgets
All outline text draws with Slug curves on every platform (SDF/MSDF stays
selectable per size); a frame never presents a blank glyph and retained draw
lists keep theirs. One coverage model for vector feathering, widget families
split out of the core crate, fewer steady-state allocations, video keeps its
aspect (Contain/Cover), render and SSAO pass unification.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-13 12:26:21 +02:00
..
src draw and widgets: Slug text everywhere, no blank glyphs, slimmer widgets 2026-10-13 12:26:21 +02:00
Cargo.toml platform: shader packs -- draw shaders compiled ahead of time for the web. Recording (native): cx.record_shader_pack(true) makes every draw shader that is applied also run the WebGL2 backend's GLSL ES compile and keep its code plus the compiler's own reflection (io with pod types, samplers, uniform-buffer bindings, scope uniforms, table constants); take_shader_pack() serialises them into versioned bytes keyed by a hash of the shader's source. Use: cx.install_shader_pack(&'static [u8]) indexes the pack (entries deserialise on first lookup); the web draw-shader compile looks the key up first and builds the mapping from the entry exactly as from a compile (CxDrawShaderMapping::from_desc; DrawShaderReflection::from_desc), so the layouts are still computed for the target. Built with --cfg makepad_precompiled_shaders the web build leaves the shader compiler out (shader compile natives and render_material's front-end check too); a miss is logged as "not in pack: draw shader X (file:line), add the widget that creates it to a scan: list" and draws nothing, otherwise it compiles at run time. The key names a shader by what its code is made of (pipeline state, fields along the prototype chain, every function by its tokens via the new ScriptVm::fn_tokens, the functions they resolve to, transitively), never by heap indices, so it is the same in every process and load order. Checked: cargo test --release -p makepad-draw --test shader_pack (4: library shaders round-trip through a pack, keys independent of load order, keys follow the helpers a shader calls, a recorded pack installs by key), -p makepad-render-graph --test shader_pack (the kits' passes round-trip), -p makepad-platform --lib shader_pack. 2026-10-01 11:13:06 +02:00