Commit Graph
8 Commits
Author SHA1 Message Date
David Mann 42b17b1836 Merge PR #6923: perf(camera-raw): develop the preview's per-pixel stages on the GPU (#6916) 2026-10-25 10:14:10 +01:00
kotulskyandkotulsky 8d1926433f Reuse filled-shape effect maps while moving styled groups (#8993)
* perf(gpu): reuse filled-shape effect maps during translation

Hash filled-shape outlines in local coordinates so whole-pixel movement can use the existing effect-map translation reuse path. Keep its region-size and exact coverage checks, and invalidate the key when the outline deforms.

Add a shape-key regression and a synchronized styled-shape group benchmark with fresh-render parity verification. On RTX 4070 Laptop, the 1600x1200 fixture improves from 61.336 to 33.120 ms median; a 24 MP full-canvas fixture improves from 223.018 to 184.289 ms. Warm frames rebuild zero effect programs, and the quick fixture matches fresh rendering exactly.

* fix(gpu): stabilize fractional shape effect fingerprints

Quantize only origin-normalized fingerprint coordinates to a 1/65536 pixel grid and canonicalize signed zero. Preserve the render path and exact coverage guard.

Cover fractional anchors and handles, positive and negative integer translations and handle deformation. Exercise fractional origins in the benchmark and document its entry points. All 40 GPU tests, Clippy and WASM checks pass; reused output matches a fresh compositor exactly.

---------

Co-authored-by: kotulsky <7805437+kotulsky@users.noreply.github.com>
2026-10-23 17:37:56 -04:00
David Mann 894351cd6d Integration: merge main (#6923) 2026-10-22 20:30:42 +02:00
fjamespriceandClaude Opus 5.5 4830c326d8 fix(camera-raw): the GPU benchmark stops on a failed develop
bench_camera_raw dropped each GPU develop's Result with .ok(), so a
device fault or a refused size would have been timed and printed as a
GPU figure. try_time returns the first error instead, and main
propagates it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 11:10:13 -04:00
fjamespriceandClaude Opus 5.5 49df3fb921 perf(camera-raw): develop the preview's per-pixel stages on the GPU (#6916)
Step 1 of #6916: one wgpu fragment pass for develop's per-pixel stages
(white balance and exposure, Contrast without Texture or Clarity, Whites
and Blacks, Vibrance and Saturation, tone curves, Color Mixer, Color
Grading, vignette, grain in full-resolution coordinates).

- algo: camera_raw::per_pixel resolves those stages' constants and
  tables; the CPU develop builds its own from the same functions, so its
  output is unchanged bit for bit.
- gpu: CameraRawDevelop (camera_raw.rs, camera_raw.wgsl), curves and
  Whites/Blacks rows in one R32Float table texture, readback for the
  histogram and scopes. Built on demand, not with the compositor (#6419).
- ui-egui: the proxy worker develops on the GPU when the settings have no
  spatial stage; Rendering Mode CPU, no GPU canvas, a software adapter, a
  fault or a failed develop use the CPU develop. The pipeline builds on a
  thread at the first open. describe() reports developMs and
  developBackend.

GPU vs CPU at 8, 16 and 32 bits: at most 2.7e-5 (RTX 5060 Ti, Vulkan and
DX12), 6.7e-6 (WARP); tests hold 1/4096. 858x572 proxy, release: CPU
20.7-28.1 ms, GPU 2.7 ms.

Part of #6916.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 11:10:13 -04:00
Higgs32584andClaude Opus 5.5 6a97837bcb zero_block_probe: pick the adapter by name with adapter=<name>
On a machine with Iris Xe and a discrete GPU the default request can pick
the discrete one, so the probe would not test the affected adapter.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 20:50:26 -04:00
Higgs32584andClaude Opus 5.5 7b32097e2a Intel Iris Xe on DX12: no more red blocks in brush previews and tool icons (#6790)
wgpu-hal 30 creates Iris Xe textures as committed resources (its
gfx-rs/wgpu#3552 workaround) with D3D12_HEAP_FLAG_CREATE_NOT_ZEROED, and
egui-wgpu fills each new texture with a single copy. On this driver the
copy leaves 4x4 blocks of all-zero texels showing stale memory, so the
empty corners of Brush Preset picker strokes and tool icons show freed
textures' pixels (often red).

ui-egui's new texel_guard plugin rewrites fully transparent texels in
each frame's texture uploads as premultiplied (0, 0, 0, 1) before eframe
renders them (under one 8-bit level of difference). The desktop app
installs it only for DX12 on "Iris(R) Xe", the same adapter test wgpu
uses; PHOTOCRAFT_TEXEL_GUARD=1/0 forces it on or off.

The gpu example zero_block_probe reproduces the driver bug without the
UI: 630/1500 egui-style uploads read back wrong, 0/1500 with the guard.
Driving the release app (tool cycling, picker rescaled): 6/40
screenshots with red blocks before, 0/120 after.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 16:40:42 -04:00
a8ad82dd46 GPU composite: reuse unchanged lower-stack chunks for property edits (#1169)
* perf(gpu): reuse unchanged lower-stack composite chunks

* test(gpu): verify half-float composite checkpoint reuse

* docs: record measured GPU composite reuse gains and limits

* perf(gpu): admit whole grid chunks, serve partial damage as sub-rect copies

Cache entries were keyed by the exact damage rectangle, so brush strokes
(a new partial rect every frame) filled the budget with entries that
never hit again. Entries are now whole chunk-aligned, chunk-sized grid
cells: a capture merges into the cell it overlaps at the rectangle's
offset, a read is served as a sub-rect copy of the covered part, and
coverage is tracked per cell so a resume only happens where every pixel
of the requested rectangle is cached. After a full render, any in-bounds
partial rectangle hits.

Regression test: two series of disjoint strokes inside the same chunks
leave composite_cache_bytes unchanged (no entry-per-rectangle growth),
a full refresh still finds its chunks and a top-layer edit afterwards
reuses them. The old partial-damage test now expects the covered-chunk
hit and checks outside-the-document renders admit nothing.

* docs: record the GPU reuse measurement in target-app-parity.md

The honest assessment moved from roadmap.md to target-app-parity.md on
main; keep main's roadmap and add only the dated measurement.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Brandon Thomas <echelon@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 02:07:48 -04:00