video_out: HDR support (#2381)

* Initial HDR support

* fix for crashes when debug tools used
This commit is contained in:
psucien 2025-02-09 15:54:54 +01:00 committed by GitHub
parent fb0871dbc8
commit 8f2883a388
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 186 additions and 16 deletions

View file

@ -1265,4 +1265,20 @@ void Shutdown() {
IM_DELETE(bd);
}
void OnSurfaceFormatChange(vk::Format surface_format) {
VkData* bd = GetBackendData();
const InitInfo& v = bd->init_info;
auto& pl_format = const_cast<vk::Format&>(
bd->init_info.pipeline_rendering_create_info.pColorAttachmentFormats[0]);
if (pl_format != surface_format) {
pl_format = surface_format;
if (bd->pipeline) {
v.device.destroyPipeline(bd->pipeline, v.allocator);
bd->pipeline = VK_NULL_HANDLE;
CreatePipeline(v.device, v.allocator, v.pipeline_cache, nullptr, &bd->pipeline,
v.subpass);
}
}
}
} // namespace ImGui::Vulkan