Skip to content

Commit

Permalink
Backends: Vulkan: use specified ColorAttachmentFormat when creating a…
Browse files Browse the repository at this point in the history
… secondary window when enabling UseDynamicRendering. (#6999, #5446, #5037)
  • Loading branch information
raaavioli authored and ocornut committed Nov 15, 2023
1 parent 0941adc commit 6695006
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion backends/imgui_impl_vulkan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 2 additions & 0 deletions docs/CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 6695006

Please sign in to comment.