Commit 5328e7e
blur: bridge SDR/PQ in blend shader and FP16-back saved_pixels on HDR
Two HDR-output regressions surfaced after the zero-copy bypass and
luminance multiplier work, both rooted in blur's two-input pipeline.
1. blend shader was super bright on HDR. wp comes from inner_content
(EXT_LINEAR / SDR-relative linear, 1.0 == SDR reference white).
bp comes from sampling the blurred copy of target_fb's bound FBO,
which on HDR is PQ-linear (1.0 == 10000 nits). The blend then
wrote into target_fb in PQ-linear without bridging the wp side, so
SDR window content landed at 1.0 PQ-linear and showed as 10000-nit
white. Add a luminance_multiplier uniform to the blur_blend
fragment shader, scale wp.rgb by it, and have wf_blur_base::render
compute the factor with wf::compute_luminance_multiplier(EXT_LINEAR,
target_fb.get_output_transfer_function()) — 1.0 on SDR, 0.0203 on
HDR.
2. White rectangles on the padded regions around blurred windows.
schedule_instructions glBlitFramebuffers a snippet of target's
bound FBO into saved_pixels->pixels, which was allocated as 8-bit
RGBA. With the linear two-pass pipeline target's FBO is FP16, and
on HDR it carries PQ-linear values that can exceed 1.0 for HDR
sources. Blitting to RGBA8 clamped those to 1.0 == peak HDR white;
on the way back into target's FBO they painted as solid bright
white over the padding. Allocate saved_pixels with hdr_linear hint
when target's transfer function is PQ so the snapshot is FP16 and
round-trips losslessly.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent b57b921 commit 5328e7e
2 files changed
Lines changed: 17 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| |||
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
55 | 59 | | |
56 | 60 | | |
57 | 61 | | |
| |||
277 | 281 | | |
278 | 282 | | |
279 | 283 | | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
280 | 288 | | |
281 | 289 | | |
282 | 290 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
177 | | - | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
178 | 186 | | |
179 | 187 | | |
180 | 188 | | |
| |||
0 commit comments