feat(render3d): HDR calibration; fix the HDR toggle crash and yellow reading as red
r3d_hdr_calibrate(peak, paper, black) feeds the tonemap's and the overlay's HDR10 variants and the display's HDR metadata; ov_hdr_nits draws a calibration patch at a number of nits. gpu_caps_probe asks the running Vulkan renderer's instance instead of making and destroying a second one under Streamline's interposer, which left the next swapchain rebuild calling address 0. The overlay gets an HDR10 variant, and the tonemap brightens HDR highlights by one factor rather than per channel. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
d80786e99a
commit
65c1b9ca5c
10 changed files with 124 additions and 19 deletions
|
|
@ -327,6 +327,10 @@ function post_tonemap(color_tex: int) -> void {
|
|||
u_f3(gpu_uniform(prog, "u_wb"), fl(1.02), F_ONE, fl(0.97))
|
||||
u_f3(gpu_uniform(prog, "u_lift"), fl(0.004), fl(0.004), fl(0.012))
|
||||
u_f3(gpu_uniform(prog, "u_gain"), fl(0.99), fl(0.995), fl(1.0))
|
||||
# the HDR10 variant's display calibration (the SDR program has none of these, and -1 sets nothing)
|
||||
u_f(gpu_uniform(prog, "u_hdr_peak"), r3d_hdr_peak_nits())
|
||||
u_f(gpu_uniform(prog, "u_hdr_paper"), r3d_hdr_paper_nits())
|
||||
u_f(gpu_uniform(prog, "u_hdr_black"), r3d_hdr_black_nits())
|
||||
mesh_draw(post_fs)
|
||||
# sharpen + grain onto the screen
|
||||
gpu_fb_bind(gpu_screen_fb())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue