WIP: feat(vk): PsychoV35's wide gamut, and the game's AA off as RenoDX's zelda-oot-oz advises #1394

Draft
LRF17 wants to merge 2 commits from LRF17/Longshot:psychov35-wide-aa into main
First-time contributor

Type: feat · Risk: medium · Tested on: Windows 11, RTX 4090 (driver 610.47) · Needs: AMD or Intel (the game's network and the TAAU stand-in); Linux

Why

PsychoV35 fits colours into BT.2020, but the scene is clipped at 0 in BT.709 because the game's AA takes square roots:
every colour outside BT.709 (fire, magic, saturated light) loses its hue, and the most saturated oranges turn yellow.
And the game's AA softens the scene before DLSS or FSR, which anti-alias it again. RenoDX's zelda-oot-oz works its AA
in BT.2020, writes the reconstruction back in BT.709, and has an AA Strength its author advises at 0. Stacked on
#1393 (its commit shows here until that one merges).

What changed

The scene stays signed; the game's AA and its edge analysis read it in BT.2020; whatever upscales the picture writes
it back in BT.709. And with PsychoV35 the game's AA is off, as the mod's author advises: the upscaler anti-aliases the
scene alone.

  • wide gamut: new ir_opt/working_gamut_pass.h: on the AA's two programs (26fe0c70ab9fc547 the edge analysis,
    5363e57b5646599d the AA, found in the IR as the mod's aa_prepare and aa) the scene texture's reads to BT.2020, at most
    0; on the gameplay networks each image write back to BT.709. Both read kSettingWorkingGamut (1 with PsychoV35):
    these compute programs are not keyed by the tone mapper, and with Vanilla they are the game's.
  • vk_shader.cpp: the passes run on those programs after translation (WorkingGamutRoleOf, AaStrengthProgram).
  • stand-ins: shaders/dlss_out.comp and shaders/taau_upscale.comp, their RGBA16F (PsychoV35-only) builds, write
    BT.709; SPIR-V headers regenerated, the R11G11B10F builds unchanged.
  • psychov35.h: the scene signed (Exposure 0 still black).
  • AA strength: new ir_opt/aa_strength_pass.h on the AA, after the working gamut: two pixels a thread, each channel
    the bits of a square root plus a constant; the root's argument becomes lerp(scene, AA, strength), the scene from the
    pixel's own fetch (x and x + 8, as the writes); 1 selects the AA's value untouched, 0 writes the scene as it is.
    kSettingAaStrength is 0 with PsychoV35 (the mod's AA Strength at 0, its author's advice; the mod's code defaults to
    100) and 1 without it; no menu row.

Measurements

Verdict: no measurable cost: the GPU time a frame is the same as main's within the log's 0.1 ms, PsychoV35 on and off, and the fps too.

Hardware: Windows 11 Pro, RTX 4090 (driver 610.47), 64 GB RAM, 16 threads; the picture streamed at 120 Hz while measured
Scene: Hyrule Castle Town at night, child Link standing still in front of the stables; 3840x2160, Native HDR, DLSS Quality (2560x1440, preset K), frame generation off, frame rate uncapped, V-Sync off
Method: the GPU time a frame from longshot_log.txt (vk: GPU time ... ms a frame, every 120 presents): the median of the last ~60 lines of 2 minutes standing still; runs interleaved (main, this PR, main, this PR) after a warm-up run of each, the same build toolchain (v3.0.0-rc.7) for both sides and the options pinned with HOS_OPTIONS_FILE; fps alongside, bound by the stream's presentation (~91)
How to reproduce: a save in Castle Town at night; the settings above; each run 2 minutes standing still once in place

Before: main @ 544229a2 After: this PR @ 6ee92f93
GPU time a frame, PsychoV35 on (two runs; median) 7.3, 7.3; 7.3 ms 7.2, 7.3; 7.25 ms
GPU time a frame, PsychoV35 off (Vanilla) 7.2, 7.2; 7.2 ms 7.2, 7.2; 7.2 ms
fps, PsychoV35 on 90.6, 91.1 91.4, 91.5
fps, PsychoV35 off 91.8, 91.6 91.5, 91.8
(main, on)  vk: GPU time 7.3 ms a frame (the longest submission 4.1 ms); 0.0 textures made a frame
(PR, on)    vk: GPU time 7.2 ms a frame (the longest submission 4.0 ms); 0.0 textures made a frame
(main, off) vk: GPU time 7.2 ms a frame (the longest submission 4.3 ms); 0.0 textures made a frame
(PR, off)   vk: GPU time 7.2 ms a frame (the longest submission 4.1 ms); 0.0 textures made a frame
vk: program 26fe0c70ab9fc547: the AA's scene reads in BT.2020 with PsychoV35
vk: program 5363e57b5646599d: the AA's scene reads in BT.2020 with PsychoV35
vk: program 5363e57b5646599d: AA Strength from the bank
vk: PsychoV35 DLSS: RGBA16F linear route; scene format 122, network input 97, output 97

Flags and settings

None (no switch, no row: with PsychoV35 the game's AA is off, as the mod's author advises; with Vanilla it is the game's).

Testing

Tested: python -I -B tests/run_all.py on Windows 11: the same 68 failures as on main @ 544229a2 (listed below),
nothing new; tests/working_gamut_ir.cpp checks both passes against
RenoDX's matrices, on and off; tests/aa_strength_ir.cpp checks the AA strength against lerp in both bases; the
reference in tests/test_psychov35.py is signed. In the game (RTX 4090, Windows 11), Native HDR, PsychoV35, DLSS: the
log lines above; the AA's IR with exactly the scene's six reads converted and the direction texture's two left, and
its six strength reads with the fetch/write order checked; SDR (Vanilla): nothing converted, the picture unchanged.
Side by side with #1393 alone, PsychoV35 saturation at 100, Hyrule Castle Town at night: the torches' and
lanterns' orange stays orange here where it turns yellow there, as the mod's. The AA at the mod's 0 and 100 (a test
row, since removed): with DLSS hardly any difference, 0 the sharper picture (DLSS anti-aliases again); with the Upscaler
Off the AA's smoothing shows at 100 and is gone at 0.

Every upscaler this RTX 4090 offers, switched live at the same spot against DLSS: Game's own, NVIDIA DLAA, AMD FSR 3.1,
Intel XeSS and Off: the same colours, no cast over the picture.

The 68 checks that fail on main @ 544229a2 and here alike (this PC's environment: a compiler name it lacks, a CRLF checkout, tools not installed)

nx2/test_mesh_first_types.py, tests/test_alt_enter.py, tests/test_audio_deadline.py, tests/test_audio_output_errors.py, tests/test_audio_wave_buffer_release.py, tests/test_bc_levels.py, tests/test_bind_memo.py, tests/test_capture_copy_helpers.py, tests/test_collect_wide.py, tests/test_cpu_report.py, tests/test_dlss_actor.py, tests/test_dlss_checks.py, tests/test_dlss_math.py, tests/test_draw_binds.py, tests/test_env_file.py, tests/test_failed_compile_keeps_objects.py, tests/test_finish_output.py, tests/test_fps_overlay_order.py, tests/test_fps_rate.py, tests/test_fps_stats.py, tests/test_framegen_auto.py, tests/test_framegen_gate.py, tests/test_fsr3_math.py, tests/test_gpu_choice.py, tests/test_hd_rumble.py, tests/test_import_span.py, tests/test_job_queue.py, tests/test_jobs_wait_runs_queued.py, tests/test_menu_mouse_scroll.py, tests/test_mirror_inherit.py, tests/test_missing_nup.py, tests/test_movie_upscale_policy.py, tests/test_nvn_texture_handle.py, tests/test_oot_jitter.py, tests/test_pass_hazard.py, tests/test_pool_span.py, tests/test_present_ahead.py, tests/test_present_thread.py, tests/test_prof_clock.py, tests/test_profiling_mode.py, tests/test_prompt_auto_face.py, tests/test_push_state.py, tests/test_quick_pipelines.py, tests/test_report_words.py, tests/test_rt_pool_minimum.py, tests/test_rumble_mapping.py, tests/test_rumble_menu.py, tests/test_rumble_refresh.py, tests/test_run_all_changed.py, tests/test_same_bind.py, tests/test_same_draw.py, tests/test_same_dyn.py, tests/test_seed_reader.py, tests/test_skip_code.py, tests/test_slow_frames.py, tests/test_status_line.py, tests/test_submitted_page.py, tests/test_table_track.py, tests/test_target_image_pool.py, tests/test_tested_configurations.py, tests/test_tex_spans_once_a_present.py, tests/test_texture_layout_sizes.py, tests/test_ub_gap.py, tests/test_upscale_independent.py, tests/test_upscale_label.py, tests/test_vertex_bind.py, tests/test_vk_swapchain_compat.py, tests/test_wb_pages.py

Not tested: AMD FSR 4 and its native AA (AMD RDNA 4 only), the game's network on AMD and Intel GPUs, Linux.

Must be tested:

  • AMD (RDNA 4 for FSR 4), Windows or Linux: Native HDR, PsychoV35, Upscaler on the game's own, then FSR 3.1, FSR 4 and
    Off, expecting the same colours on each and no cast over the picture (Test Farm: @Beanstalk amd, PsychoV35 colours with
    each upscaler)

Risks

What could break: a cast over the whole picture on an upscale path that writes the network's output without going
back to BT.709 (the passes and stand-ins above cover the ones known); the AA's output with PsychoV35 if the AA program
changed shape (the passes check it and log why they leave it).

With #620 (DLSS 5 Neural Rendering over Native HDR, WIP): its post-upscaler pass reads the network's output before
dlss_out.comp's RGBA16F build takes it back to BT.709, so with PsychoV35 it would get BT.2020 light where it expects
BT.709 (its proxy and BT.709 luminance): the model would see paler colours and its edits would land slightly off, the
highlights kept. Whichever of the two lands second converts around that pass (BT.2020 to BT.709 before, back after).
Found by reading both, not run: no NR runtime here.

Turning it off: the HDR tone mapper row on Vanilla; else revert the commit.

Compatibility: the AA, network and scene programs are translated again once; with PsychoV35 the game's AA is off
(the upscaler anti-aliases alone; without an upscaler, Upscaler Off, edges are not smoothed).

Checklist

Everyone

  • One topic.
  • The title is a Conventional Commit (type(scope): description) of the status line's type.
  • Why gives the reason plainly and links the issues that fit (the tracker searched).
  • Tested on my own PC where it runs (in the game, for a change the game runs), as Testing's Tested says; what
    can't be run by hand is in Testing's Not testable by hand, with why.
  • Measurements has a verdict, or one line saying why there is nothing to measure.
  • Nothing gets worse that I know of: any cost (speed, latency, memory, a setup that worked before) is measured and
    in Risks. Not ticked yet: Risks says the interaction with #620 would shift colours, found by reading and not run.
  • Testing names what was tested, what wasn't, and what must still be tested, where and how.
  • Rebased on current main.
  • python -I -B tests/run_all.py passes (any failure that also fails on main is named).
  • No game files, dumps, build output or generated files.
  • third_party/ untouched (a new folder with a PROVENANCE.md instead).
  • The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled.

When it applies

  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.
  • Numbers from the same PC, scene and settings, at least 2 interleaved runs each, the median reported.
  • Screenshots of the same spot, captioned like the Measurements columns, for a change that shows on screen.
  • The SPIR-V headers regenerated with glslang (a shader changed).
  • A check under tests/ that reads changed source updated in this PR, not weakened.
  • Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths.

Made and published with the help of Claude Opus 5.5

**Type:** feat · **Risk:** medium · **Tested on:** Windows 11, RTX 4090 (driver 610.47) · **Needs:** AMD or Intel (the game's network and the TAAU stand-in); Linux ## Why PsychoV35 fits colours into BT.2020, but the scene is clipped at 0 in BT.709 because the game's AA takes square roots: every colour outside BT.709 (fire, magic, saturated light) loses its hue, and the most saturated oranges turn yellow. And the game's AA softens the scene before DLSS or FSR, which anti-alias it again. RenoDX's zelda-oot-oz works its AA in BT.2020, writes the reconstruction back in BT.709, and has an AA Strength its author advises at 0. Stacked on #1393 (its commit shows here until that one merges). ## What changed The scene stays signed; the game's AA and its edge analysis read it in BT.2020; whatever upscales the picture writes it back in BT.709. And with PsychoV35 the game's AA is off, as the mod's author advises: the upscaler anti-aliases the scene alone. - wide gamut: new `ir_opt/working_gamut_pass.h`: on the AA's two programs (26fe0c70ab9fc547 the edge analysis, 5363e57b5646599d the AA, found in the IR as the mod's aa_prepare and aa) the scene texture's reads to BT.2020, at most 0; on the gameplay networks each image write back to BT.709. Both read `kSettingWorkingGamut` (1 with PsychoV35): these compute programs are not keyed by the tone mapper, and with Vanilla they are the game's. - `vk_shader.cpp`: the passes run on those programs after translation (`WorkingGamutRoleOf`, `AaStrengthProgram`). - stand-ins: `shaders/dlss_out.comp` and `shaders/taau_upscale.comp`, their RGBA16F (PsychoV35-only) builds, write BT.709; SPIR-V headers regenerated, the R11G11B10F builds unchanged. - `psychov35.h`: the scene signed (Exposure 0 still black). - AA strength: new `ir_opt/aa_strength_pass.h` on the AA, after the working gamut: two pixels a thread, each channel the bits of a square root plus a constant; the root's argument becomes lerp(scene, AA, strength), the scene from the pixel's own fetch (x and x + 8, as the writes); 1 selects the AA's value untouched, 0 writes the scene as it is. `kSettingAaStrength` is 0 with PsychoV35 (the mod's AA Strength at 0, its author's advice; the mod's code defaults to 100) and 1 without it; no menu row. ## Measurements **Verdict:** no measurable cost: the GPU time a frame is the same as main's within the log's 0.1 ms, PsychoV35 on and off, and the fps too. Hardware: Windows 11 Pro, RTX 4090 (driver 610.47), 64 GB RAM, 16 threads; the picture streamed at 120 Hz while measured Scene: Hyrule Castle Town at night, child Link standing still in front of the stables; 3840x2160, Native HDR, DLSS Quality (2560x1440, preset K), frame generation off, frame rate uncapped, V-Sync off Method: the GPU time a frame from `longshot_log.txt` (`vk: GPU time ... ms a frame`, every 120 presents): the median of the last ~60 lines of 2 minutes standing still; runs interleaved (main, this PR, main, this PR) after a warm-up run of each, the same build toolchain (v3.0.0-rc.7) for both sides and the options pinned with `HOS_OPTIONS_FILE`; fps alongside, bound by the stream's presentation (~91) How to reproduce: a save in Castle Town at night; the settings above; each run 2 minutes standing still once in place | | Before: main @ 544229a2 | After: this PR @ 6ee92f93 | |---|---|---| | GPU time a frame, PsychoV35 on (two runs; median) | 7.3, 7.3; 7.3 ms | 7.2, 7.3; 7.25 ms | | GPU time a frame, PsychoV35 off (Vanilla) | 7.2, 7.2; 7.2 ms | 7.2, 7.2; 7.2 ms | | fps, PsychoV35 on | 90.6, 91.1 | 91.4, 91.5 | | fps, PsychoV35 off | 91.8, 91.6 | 91.5, 91.8 | ``` (main, on) vk: GPU time 7.3 ms a frame (the longest submission 4.1 ms); 0.0 textures made a frame (PR, on) vk: GPU time 7.2 ms a frame (the longest submission 4.0 ms); 0.0 textures made a frame (main, off) vk: GPU time 7.2 ms a frame (the longest submission 4.3 ms); 0.0 textures made a frame (PR, off) vk: GPU time 7.2 ms a frame (the longest submission 4.1 ms); 0.0 textures made a frame vk: program 26fe0c70ab9fc547: the AA's scene reads in BT.2020 with PsychoV35 vk: program 5363e57b5646599d: the AA's scene reads in BT.2020 with PsychoV35 vk: program 5363e57b5646599d: AA Strength from the bank vk: PsychoV35 DLSS: RGBA16F linear route; scene format 122, network input 97, output 97 ``` ### Flags and settings None (no switch, no row: with PsychoV35 the game's AA is off, as the mod's author advises; with Vanilla it is the game's). ## Testing **Tested:** `python -I -B tests/run_all.py` on Windows 11: the same 68 failures as on `main @ 544229a2` (listed below), nothing new; `tests/working_gamut_ir.cpp` checks both passes against RenoDX's matrices, on and off; `tests/aa_strength_ir.cpp` checks the AA strength against lerp in both bases; the reference in `tests/test_psychov35.py` is signed. In the game (RTX 4090, Windows 11), Native HDR, PsychoV35, DLSS: the log lines above; the AA's IR with exactly the scene's six reads converted and the direction texture's two left, and its six strength reads with the fetch/write order checked; SDR (Vanilla): nothing converted, the picture unchanged. Side by side with #1393 alone, PsychoV35 saturation at 100, Hyrule Castle Town at night: the torches' and lanterns' orange stays orange here where it turns yellow there, as the mod's. The AA at the mod's 0 and 100 (a test row, since removed): with DLSS hardly any difference, 0 the sharper picture (DLSS anti-aliases again); with the Upscaler Off the AA's smoothing shows at 100 and is gone at 0. Every upscaler this RTX 4090 offers, switched live at the same spot against DLSS: Game's own, NVIDIA DLAA, AMD FSR 3.1, Intel XeSS and Off: the same colours, no cast over the picture. <details><summary>The 68 checks that fail on main @ 544229a2 and here alike (this PC's environment: a compiler name it lacks, a CRLF checkout, tools not installed)</summary> `nx2/test_mesh_first_types.py`, `tests/test_alt_enter.py`, `tests/test_audio_deadline.py`, `tests/test_audio_output_errors.py`, `tests/test_audio_wave_buffer_release.py`, `tests/test_bc_levels.py`, `tests/test_bind_memo.py`, `tests/test_capture_copy_helpers.py`, `tests/test_collect_wide.py`, `tests/test_cpu_report.py`, `tests/test_dlss_actor.py`, `tests/test_dlss_checks.py`, `tests/test_dlss_math.py`, `tests/test_draw_binds.py`, `tests/test_env_file.py`, `tests/test_failed_compile_keeps_objects.py`, `tests/test_finish_output.py`, `tests/test_fps_overlay_order.py`, `tests/test_fps_rate.py`, `tests/test_fps_stats.py`, `tests/test_framegen_auto.py`, `tests/test_framegen_gate.py`, `tests/test_fsr3_math.py`, `tests/test_gpu_choice.py`, `tests/test_hd_rumble.py`, `tests/test_import_span.py`, `tests/test_job_queue.py`, `tests/test_jobs_wait_runs_queued.py`, `tests/test_menu_mouse_scroll.py`, `tests/test_mirror_inherit.py`, `tests/test_missing_nup.py`, `tests/test_movie_upscale_policy.py`, `tests/test_nvn_texture_handle.py`, `tests/test_oot_jitter.py`, `tests/test_pass_hazard.py`, `tests/test_pool_span.py`, `tests/test_present_ahead.py`, `tests/test_present_thread.py`, `tests/test_prof_clock.py`, `tests/test_profiling_mode.py`, `tests/test_prompt_auto_face.py`, `tests/test_push_state.py`, `tests/test_quick_pipelines.py`, `tests/test_report_words.py`, `tests/test_rt_pool_minimum.py`, `tests/test_rumble_mapping.py`, `tests/test_rumble_menu.py`, `tests/test_rumble_refresh.py`, `tests/test_run_all_changed.py`, `tests/test_same_bind.py`, `tests/test_same_draw.py`, `tests/test_same_dyn.py`, `tests/test_seed_reader.py`, `tests/test_skip_code.py`, `tests/test_slow_frames.py`, `tests/test_status_line.py`, `tests/test_submitted_page.py`, `tests/test_table_track.py`, `tests/test_target_image_pool.py`, `tests/test_tested_configurations.py`, `tests/test_tex_spans_once_a_present.py`, `tests/test_texture_layout_sizes.py`, `tests/test_ub_gap.py`, `tests/test_upscale_independent.py`, `tests/test_upscale_label.py`, `tests/test_vertex_bind.py`, `tests/test_vk_swapchain_compat.py`, `tests/test_wb_pages.py` </details> **Not tested:** AMD FSR 4 and its native AA (AMD RDNA 4 only), the game's network on AMD and Intel GPUs, Linux. **Must be tested:** - AMD (RDNA 4 for FSR 4), Windows or Linux: Native HDR, PsychoV35, Upscaler on the game's own, then FSR 3.1, FSR 4 and Off, expecting the same colours on each and no cast over the picture (Test Farm: @Beanstalk amd, PsychoV35 colours with each upscaler) ## Risks **What could break:** a cast over the whole picture on an upscale path that writes the network's output without going back to BT.709 (the passes and stand-ins above cover the ones known); the AA's output with PsychoV35 if the AA program changed shape (the passes check it and log why they leave it). **With #620 (DLSS 5 Neural Rendering over Native HDR, WIP):** its post-upscaler pass reads the network's output before `dlss_out.comp`'s RGBA16F build takes it back to BT.709, so with PsychoV35 it would get BT.2020 light where it expects BT.709 (its proxy and BT.709 luminance): the model would see paler colours and its edits would land slightly off, the highlights kept. Whichever of the two lands second converts around that pass (BT.2020 to BT.709 before, back after). Found by reading both, not run: no NR runtime here. **Turning it off:** the HDR tone mapper row on Vanilla; else revert the commit. **Compatibility:** the AA, network and scene programs are translated again once; with PsychoV35 the game's AA is off (the upscaler anti-aliases alone; without an upscaler, Upscaler Off, edges are not smoothed). ## Checklist ### Everyone - [x] One topic. - [x] The title is a Conventional Commit (`type(scope): description`) of the status line's type. - [x] Why gives the reason plainly and links the issues that fit (the tracker searched). - [x] Tested on my own PC where it runs (in the game, for a change the game runs), as Testing's Tested says; what can't be run by hand is in Testing's Not testable by hand, with why. - [x] Measurements has a verdict, or one line saying why there is nothing to measure. - [ ] Nothing gets worse that I know of: any cost (speed, latency, memory, a setup that worked before) is measured and in Risks. Not ticked yet: Risks says the interaction with #620 would shift colours, found by reading and not run. - [x] Testing names what was tested, what wasn't, and what must still be tested, where and how. - [x] Rebased on current `main`. - [x] `python -I -B tests/run_all.py` passes (any failure that also fails on `main` is named). - [x] No game files, dumps, build output or generated files. - [x] `third_party/` untouched (a new folder with a `PROVENANCE.md` instead). - [x] The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled. ### When it applies - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. - [x] Numbers from the same PC, scene and settings, at least 2 interleaved runs each, the median reported. - [ ] Screenshots of the same spot, captioned like the Measurements columns, for a change that shows on screen. - [x] The SPIR-V headers regenerated with glslang (a shader changed). - [x] A check under `tests/` that reads changed source updated in this PR, not weakened. - [ ] Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths. Made and published with the help of Claude Opus 5.5
feat(vk): PsychoV35 as RenoDX's zelda-oot-oz has it: its settings, its scene and its HDR output
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 7s
79a34381cf
With the HDR tone mapper on PsychoV35, the picture was RenoDX's zelda-oot-oz mod at its defaults, with
none of its settings, a scene that still differed from the mod's, a UI as bright as the paper white
(#843) and the game's own encoder matrix. Now the mod's, found in the translated IR (nothing of the
game's code is kept), its settings read live from a constant bank the renderer owns.

Settings (ir_opt/psychov35.h, scene_tonemap_pass.h; vk_menu.cpp, vk_draw.cpp uniform_range):
- the mod's rows in the Graphics tab, under HDR, in its order, as sliders, shown with Native HDR
  and PsychoV35: UI brightness, color space, midgray, match tone slope, tone slope, hue clip
  emulation, exposure, highlights, shadows, contrast, saturation, bloom, and "reset all";
- read at each draw from bank 19 (PsychoV35::kSettingsBank; MAX_CBUFS 18 -> 20): a change shows
  at once, nothing is translated again; the HDR contrast row hidden with PsychoV35 (its own
  Contrast grades the scene) and vk_framegen.cpp no longer grades the picture a second time.

Scene, as the mod's 0x09EB4538 and 0xED732BB7 with a custom tone mapper:
- the adapted permutation's local exposure left out and its blue times the exposure once more
  (the mod's native gain (g, g, g*g));
- the bloom term scaled by Bloom; the peak the HDR peak over the paper white;
- the scene in the UI's white (times the paper white over it).

HDR output, as the mod's output_0x92D6F81D (new ir_opt/output_encode_pass.h):
- the game's HDR10 encoder, found by PQ's constants and its 1e-4 in its code (vk_shader.cpp
  Code::pq_fit) and keyed with PsychoV35's programs, writes the chosen colour space's BT.2020
  light (Vanilla: the game's matrix over its white; BT.709, the default, and DCI-P3: RenoDX's
  matrices) times the UI's white, then PQ.

Tests: tests/test_psychov35.py (the header against RenoDX's path), tests/scene_tonemap_ir.cpp
(the bank, the adapted gain, bloom, the scene's scale), tests/output_encode_ir.cpp (the encoder
in each colour space against RenoDX's in double), the menu and README checks.

Fixes #843

Assisted-by: Claude Code (Claude Opus 5.5)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
feat(vk): PsychoV35's wide gamut, and the game's AA off as RenoDX's zelda-oot-oz advises
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 8s
6ee92f936b
PsychoV35 fits colours into BT.2020, but the scene was clipped at 0 in BT.709 because the game's
AA takes square roots: a colour outside BT.709 (fire, magic, saturated light) lost its hue, its
oranges turning yellow. And the game's AA softened the scene before DLSS or FSR, which anti-alias
it again. RenoDX's zelda-oot-oz works its AA in BT.2020, writes the reconstruction back in BT.709,
and has an AA Strength its author advises at 0. Here the same, found in the IR.

Wide gamut (new ir_opt/working_gamut_pass.h):
- the scene stays signed BT.709 (psychov35.h);
- the AA's two programs (26fe0c70ab9fc547 the edge analysis, 5363e57b5646599d the AA, found as the
  mod's aa_prepare and aa) read the scene texture in BT.2020, at most 0;
- the gameplay upscale networks write back in BT.709, signed; and so do the renderer's stand-ins,
  shaders/dlss_out.comp and taau_upscale.comp in their RGBA16F (PsychoV35-only) builds (SPIR-V
  regenerated; the R11G11B10F builds unchanged);
- both passes read kSettingWorkingGamut, 1 with PsychoV35: these compute programs are not keyed by
  the tone mapper, and with Vanilla they are the game's.

The game's AA off with PsychoV35 (new ir_opt/aa_strength_pass.h), after the working gamut on the AA:
- the mod's AA Strength: each pixel's anti-aliased colour mixed back towards its own scene colour
  before the AA's square root, lerp(scene, AA, strength); 1 the AA's own value exactly, 0 the scene
  as it is, its output still in the encoding the upscalers read;
- the bank's kSettingAaStrength is 0 with PsychoV35, as the mod's author advises (the mod's code
  defaults to 100), and 1 without it: no menu row, the upscaler anti-aliases the scene alone.

Tests: tests/working_gamut_ir.cpp (both passes against RenoDX's matrices, on and off),
tests/aa_strength_ir.cpp (lerp in both bases), the reference in tests/test_psychov35.py signed.

Assisted-by: Claude Code (Claude Opus 5.5)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
First-time contributor

Tested in game: RTX 4090, driver 610.47, Windows 11, Native HDR, PsychoV35: saturated oranges stay orange (yellow without it); the same colours with Game's own, DLSS, DLAA, FSR 3.1, XeSS and Off; no GPU cost

Tested in game: RTX 4090, driver 610.47, Windows 11, Native HDR, PsychoV35: saturated oranges stay orange (yellow without it); the same colours with Game's own, DLSS, DLAA, FSR 3.1, XeSS and Off; no GPU cost
Owner

Brought up to the ready-for-review standard (#1454): the checklist's Everyone list has two new boxes, added here from what this PR's description and comments show (please check they match what you know).

  • Tested on my own PC: ticked: Testing's Tested: the author's own in-game run on Windows 11 with an RTX 4090 across each upscaler.
  • Nothing gets worse that I know of: not ticked: Risks says the interaction with #620 would shift colours, found by reading and not run. Measure that cost and state it in Risks, then tick it.
Brought up to the [ready-for-review standard](https://git.magicbean.dev/MagicBeanDev/Longshot/src/branch/main/CONTRIBUTING.md#ready-for-review-out-of-wip) (#1454): the checklist's Everyone list has two new boxes, added here from what this PR's description and comments show (please check they match what you know). - *Tested on my own PC*: ticked: Testing's Tested: the author's own in-game run on Windows 11 with an RTX 4090 across each upscaler. - *Nothing gets worse that I know of*: not ticked: Risks says the interaction with #620 would shift colours, found by reading and not run. Measure that cost and state it in Risks, then tick it.
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 8s
This pull request is marked as a work in progress.
Some workflows are waiting to be reviewed.
This branch is out-of-date with the base branch
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'psychov35-wide-aa:LRF17-psychov35-wide-aa'
git switch 'LRF17-psychov35-wide-aa'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!1394
No description provided.