4ccfda6b8ea38f24cbc3ba78d701c6e96349c6b6
3
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
cc8148cbec |
deps: every crate to its latest version, wgpu 28 -> 30
`cargo upgrade --incompatible` in each of the nine workspaces here, then `cargo update`. Most of it is version numbers only -- log, winit, bytemuck, image, tokio, libc, android_logger, proc-macro2/quote, and syn 2 -> 3 with no source change. The wg-app-link submodule's twelve dependencies were already at their latest majors, so that shared repository needs no commit. wgpu 28 -> 30 (and pollster 0.4 -> 1.0) is the part with API in it: bind-group and vertex-buffer slots are optional now, `Instance::new` takes an owned `InstanceDescriptor` carrying the platform's display handle (the desktop passes winit's, since wgpu wants it for a GLES surface presented on Wayland -- which is what this machine's fallback produces; Android passes none), `RequestAdapterOptions` and `SurfaceConfiguration` each gained a field kept at its historical value, `get_current_texture` answers with an enum instead of a Result, and `present` moved onto the queue. The one that would not have failed at compile time: naga now requires `@interpolate(flat)` on integer varyings, so `shader.wgsl`'s three u32 outputs were rejected at `create_shader_module` -- an abort on the device rather than a build error. Flat is the only interpolation an integer can have, so this states what the hardware already did. Checked: build, clippy, fmt and tests in all nine workspaces (iris 196, server 160); layer 2 screenshots on Vulkan and on force-gles, identical; the arm64 release APK builds and the x86_64 bench ran a full fling/stream/type/keyboard cycle on the emulator's GLES adapter. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> |
||
|
|
38bf6309cb |
iris: a mask is a shape, not a rectangle -- .masked_by, and touch obeys it
Iris, on the code fence: "the code block scrolling currently masks in an
inner rectangle. Ideally masks should have a shape associated with them,
rounded rectangle being one of them ... so that the mask becomes the
parent container with rounded edges. Make sure alpha works properly with
it, eg. on the corners where alpha should be decreased / multiplied."
`Mask` is now `{ primitive, parent }` -- the slot of a primitive already
written, plus the mask this one nests inside. The fragment stage
evaluates that primitive's own coverage at the masked pixel, through the
same `rounded_rect_coverage` a drawn rect goes through, and multiplies it
into the alpha along the whole `parent` chain. Nothing about the shape is
copied, so a rounded container's corner and its children's clipped corner
are one piece of arithmetic and cannot drift; two nested feathers dim a
pixel twice, which is the multiply she asked for.
`.masked()` is unchanged for callers: it writes an undrawn rect
(`Drawn::No`/`NOT_DRAWN` -- owned, moved, resized and freed like any
other primitive, simply never rasterized) and points at that, so square
clipping is the same mechanism rather than a special case. New
`.masked_by(shape)` draws `shape` behind the content in its own layer and
clips to the first primitive it drew, with no radius written twice; it
replaces `.masked().background(w)`, which drew both and clipped to the
box. `transcript-ui`'s `BlockFrame::Verbatim` is the first caller.
Hit-testing applies the shape (`SensorUi::run_sensors` ->
`UiRenderState::mask_admits`, coverage above one half, which is where the
drawn edge is), as well as the widget's own box -- the two ask different
questions and both have to hold. `primitive_corners` is a floor-for-floor
transliteration of the shader's `corners_of`, not `region.to_px()`: the
phone's 2.55 density puts nothing on a whole pixel, and skipping the
rounding disagrees with the pixels by up to one along each edge.
A mask's shape must be a rect, asserted by name in `set_mask_to`. A glyph
would need a CPU-side alpha plane before the hit test could agree with
the shader, and a standalone image a bind-group switch the fragment stage
cannot make. So no texture mask exists; the branch where one would go is
in both copies of `mask_coverage`. docs/LAYOUT.md's section end lists this
and the three other places the code is narrower than the design.
Tests. Layer 1, `layout_tests.rs`: the child's coverage swept across the
container's corner arc equals the container's own exactly; nested masks
multiply rather than intersect, asserted where both feathers are partial,
which is the only place the two differ; a press in a rounded-away corner
misses while one inside the curve and one on a straight edge hit; and
`a_plain_mask_still_clips_to_a_square_box`, the half this had no reason to
touch. The first version of the corner test swept the straight chord
between the arc's ends, which lies inside the circle everywhere -- it
proved nothing and said so, which is why it counts both sides now.
`iris/tests/mask_sdf.rs` is the only test here that needs a GPU: it lifts
`distance_from_rect` and `rounded_rect_coverage` out of
`iris_core::SHAPE_SHADER` by name -- lifted, not copied, since a copy
would be edited alongside the shader -- and runs them in a compute pass
over ~200k points at five radii against `iris_core::rounded_rect_coverage`.
Worst disagreement under 1e-5; the negative control (`+ 0.01` inside the
shader's smoothstep) fails it at 0.03.
Layer 2 for looking: `./run-headless.sh phone --phone --shot /tmp/mask.png
--seconds 6 -- -p transcript-fixture` draws the fixture's horizontally
scrolled code fence clipped on the curve at both top corners.
Two things found on the way and fixed here:
- The winit backend had the defect the Android one was fixed for in
|
||
|
|
4ab26f068e |
Vendor iris, the in-house UI library, at iris/
Iris's decision: it lives in this repository for now, included by path, with its history left in the iris/iris repository on the gitea remote (this is its main at 7b54aaf, byte-identical to the public GitHub copy). It gets its own repository back once it has proved itself here. RUST.md's I0 records the decision and what the first build said: the tree does not compile on the current nightly because const_trait_impl now requires traits to be declared 'const trait', which is the first item of I0b. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> |