Skip to content

Commit 648db5b

Browse files
Vulkan: Fix HDR blend for widgets/OSD text using gfx_widgets_visible()
Use gfx_widgets_visible() in the Vulkan HDR path so the SDR-to-HDR composition pass also runs when widgets or OSD messages are visible, not just when the menu or overlays are enabled. Fixes text and widget rendering appearing washed out or invisible in Vulkan HDR mode.
1 parent b9337f3 commit 648db5b

1 file changed

Lines changed: 19 additions & 3 deletions

File tree

gfx/drivers/vulkan.c

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5159,8 +5159,19 @@ static bool vulkan_frame(void *data, const void *frame,
51595159
end_main_pass = false;
51605160
}
51615161

5162+
const bool message_visible = !string_is_empty(msg);
5163+
5164+
#ifdef HAVE_GFX_WIDGETS
5165+
const bool widgets_visible = gfx_widgets_visible(video_info);
5166+
#endif
5167+
51625168
if ((vk->context->flags & VK_CTX_FLAG_HDR_ENABLE) &&
5163-
((vk->flags & VK_FLAG_MENU_ENABLE) || (vk->flags & VK_FLAG_OVERLAY_ENABLE)) &&
5169+
((vk->flags & VK_FLAG_MENU_ENABLE) || (vk->flags & VK_FLAG_OVERLAY_ENABLE)
5170+
|| message_visible
5171+
#ifdef HAVE_GFX_WIDGETS
5172+
|| widgets_visible
5173+
#endif
5174+
) &&
51645175
(vk->offscreen_buffer.image != VK_NULL_HANDLE))
51655176
{
51665177
if(end_pass) vkCmdEndRenderPass(vk->cmd);
@@ -5242,7 +5253,7 @@ static bool vulkan_frame(void *data, const void *frame,
52425253
vulkan_render_overlay(vk, video_width, video_height);
52435254
#endif
52445255

5245-
if (!string_is_empty(msg))
5256+
if (message_visible)
52465257
font_driver_render_msg(vk, msg, NULL, NULL);
52475258

52485259
#ifdef HAVE_GFX_WIDGETS
@@ -5256,7 +5267,12 @@ static bool vulkan_frame(void *data, const void *frame,
52565267
#ifdef VULKAN_HDR_SWAPCHAIN
52575268
/* Copy over back buffer to swap chain render targets */
52585269
if ((vk->context->flags & VK_CTX_FLAG_HDR_ENABLE) &&
5259-
((vk->flags & VK_FLAG_MENU_ENABLE) || (vk->flags & VK_FLAG_OVERLAY_ENABLE)) &&
5270+
((vk->flags & VK_FLAG_MENU_ENABLE) || (vk->flags & VK_FLAG_OVERLAY_ENABLE)
5271+
|| message_visible
5272+
#ifdef HAVE_GFX_WIDGETS
5273+
|| widgets_visible
5274+
#endif
5275+
) &&
52605276
(vk->offscreen_buffer.image != VK_NULL_HANDLE))
52615277
{
52625278
backbuffer = &vk->backbuffers[swapchain_index];

0 commit comments

Comments
 (0)