Skip to content

fix(transparency): meter the picture box of an uncropped slide on the CPU - #1589

Merged
marcinz606 merged 3 commits into
marcinz606:mainfrom
thetalkingdrum:fix/slide-meter-rect-cpu
Nov 1, 2026
Merged

marcinz606 merged 3 commits into
marcinz606:mainfrom
thetalkingdrum:fix/slide-meter-rect-cpu

Conversation

@thetalkingdrum

Copy link
Copy Markdown
Contributor

On a slide in a holder, the CPU metered the whole frame, while the GPU and the print path metered only the picture box (meter_rect). So Cast Removal's neutral axis, Auto Density and Auto Grade gave different results on the two engines. On one NORAD slide the CPU midtone was (-1.032, -1.073, -1.004) and the GPU's (-0.670, -0.904, -1.107). Thumbnails and the contact sheet render on the CPU, so they did not match the preview. Scan clip fractions also ignored a freehand Analysis Rect on the CPU.

The slide path now reads the same region as the GPU, and THUMBNAIL_RENDER_VERSION goes to 30. The PR also lets ShaderLoader recompile when the GPU device changes. Without this, the new GPU test gets a shader from a released device in the full suite. In the app this only matters after shutdown.

… CPU

TransparencyBaseProcessor ignored process.meter_rect, which the GPU engine
and the print path honour. On a slide in a holder the CPU metered the whole
frame and the GPU only the picture box, so Cast Removal's neutral axis and
Auto Density/Grade's meters differed between engines. On 106-21 with marcinz606#1581
the CPU mid ref was (-1.032, -1.073, -1.004), the GPU (-0.670, -0.904,
-1.107); both now read the GPU's. Scan clip fractions read the same region.

ShaderLoader kept modules compiled on a device that destroy_singleton had
released, so any GPUEngine built after controller.cleanup() failed to
compile its pipelines. The cache now empties when the device changes.
…eck clipping

The ShaderLoader device fix moves to fix/shader-loader-new-device.

The test fixture adds clipped red outside the picture box and clipped
blue inside it, so the clip-fraction checks fail without the fix: the
CPU now reads them from the metering region, a freehand Analysis Rect
included, as the GPU and the print path do. With clipped pixels outside
an Analysis Rect the CPU read (0.043, 0.037, 0.037), the GPU (0.040, 0,
0). The red-over-blue midtone check passed without the fix and goes.
The ShaderLoader fix stays in this PR: in the full suite an earlier test
calls destroy_singleton, and without it the new GPU meter test gets a
module from the released device ("Device of ShaderModule doesn't match
Device"). The cache now empties when the device changes. The app builds
no engine after cleanup, so only tests that tear the device down see it.
@marcinz606
marcinz606 merged commit 61e42cc into marcinz606:main Nov 1, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants