Commit f38f216
committed
VULKAN/HDR: Fix crash when statistics overlay is shown over HDR + custom shader
When HDR is enabled and the active shader chain doesn't emit HDR
natively, vulkan_frame() routes overlay-style content (menu, on-screen
messages, widgets, software overlays) through an offscreen SDR
buffer, then composites it back over the HDR swapchain image. The
gating condition for that detour listed every overlay source except
the statistics overlay.
The result: with HDR on, a non-HDR-emitting shader chain loaded, and
the statistics overlay enabled (with no menu/message/widget visible),
the main render pass was ended after the HDR composite but never
re-begun. The subsequent font_driver_render_msg() call for the stat
text recorded draw commands against a command buffer with no active
render pass.
Most desktop Vulkan drivers tolerate this with a validation error;
MoltenVK on macOS dereferences a null subpass in
MVKCommandEncoder::getSubpass() during vkCmdDrawIndexed encoding and
crashes with SIGSEGV. The HDR-native shaders under slang_shaders/hdr
were unaffected because they avoid the offscreen-buffer detour
entirely (use_offscreen_buffer stays false when the chain emits HDR10
or HDR16).
Add statistics_show to both gating conditions so the begin-redirect
and the matching post-blit composite stay balanced.1 parent a38a638 commit f38f216
1 file changed
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6744 | 6744 | | |
6745 | 6745 | | |
6746 | 6746 | | |
| 6747 | + | |
6747 | 6748 | | |
6748 | 6749 | | |
6749 | 6750 | | |
| |||
6858 | 6859 | | |
6859 | 6860 | | |
6860 | 6861 | | |
| 6862 | + | |
6861 | 6863 | | |
6862 | 6864 | | |
6863 | 6865 | | |
| |||
0 commit comments