Backends: Vulkan: use specified ColorAttachmentFormat when creating a secondary window when enabling UseDynamicRendering. (#6999, #5446, #5037)

This commit is contained in:
Oliver Eriksson 2023-11-11 01:12:07 +01:00 committed by ocornut
parent 0941adc931
commit 6695006bea
2 changed files with 7 additions and 1 deletions

View File

@ -1653,7 +1653,11 @@ static void ImGui_ImplVulkan_CreateWindow(ImGuiViewport* viewport)
}
// Select Surface Format
const VkFormat requestSurfaceImageFormat[] = { VK_FORMAT_B8G8R8A8_UNORM, VK_FORMAT_R8G8B8A8_UNORM, VK_FORMAT_B8G8R8_UNORM, VK_FORMAT_R8G8B8_UNORM };
const VkFormat requestSurfaceImageFormat[] = {
#if defined(IMGUI_IMPL_VULKAN_HAS_DYNAMIC_RENDERING)
v->UseDynamicRendering && v->ColorAttachmentFormat ? v->ColorAttachmentFormat : VK_FORMAT_B8G8R8A8_UNORM,
#endif
VK_FORMAT_B8G8R8A8_UNORM, VK_FORMAT_R8G8B8A8_UNORM, VK_FORMAT_B8G8R8_UNORM, VK_FORMAT_R8G8B8_UNORM };
const VkColorSpaceKHR requestSurfaceColorSpace = VK_COLORSPACE_SRGB_NONLINEAR_KHR;
wd->SurfaceFormat = ImGui_ImplVulkanH_SelectSurfaceFormat(v->PhysicalDevice, wd->Surface, requestSurfaceImageFormat, (size_t)IM_ARRAYSIZE(requestSurfaceImageFormat), requestSurfaceColorSpace);

View File

@ -222,6 +222,8 @@ Other changes:
Fixed leaks, and added ImGui_ImplVulkan_DestroyFontsTexture() (probably no need to call this directly).
(#6943, #6715, #6327, #3743, #4618)
[@helynranta, @thomasherzog, @guybrush77, @albin-johansson, @MiroKaku, @benbatya-fb, @ocornut]
- Backends: Vulkan: use specified ColorAttachmentFormat when creating a secondary window when enabling
UseDynamicRendering option. (#6999, #5446, #5037) [@raaaviol]
- Backends: GLFW: Clear emscripten's MouseWheel callback before shutdown. (#6790, #6096, #4019) [@halx99]
- Backends: GLFW: Added support for F13 to F24 function keys. (#6891)
- Backends: SDL2, SDL3: Added support for F13 to F24 function keys, AppBack, AppForward. (#6891)