Skip to content

Commit 5ea0cab

Browse files
committed
backend (Vulkan): Fix struct compatibility
For platforms not supporting 1.3 and dynamic rendering, the init info struct does not include the VkPipelineRenderingCreateInfoKHR. Easiest solution for now is to ensure the structure is consistent by adding a bogus structure which matches VkPipelineRenderingCreateInfoKHR exactly.
1 parent 66bea44 commit 5ea0cab

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

libs/imgui/backends/imgui_impl_vulkan.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,17 @@
6464
#define IMGUI_IMPL_VULKAN_HAS_DYNAMIC_RENDERING
6565
#endif
6666

67+
// FIX(zig-gamedev) - Match PipelineRenderingCreateInfo structure for compatibility
68+
typedef struct unusedVkPipelineRenderingCreateInfo {
69+
uint32_t sType;
70+
const void* pNext;
71+
uint32_t viewMask;
72+
uint32_t colorAttachmentCount;
73+
const uint32_t* pColorAttachmentFormats;
74+
uint32_t depthAttachmentFormat;
75+
uint32_t stencilAttachmentFormat;
76+
} unusedVkPipelineRenderingCreateInfo;
77+
6778
// Initialization data, for ImGui_ImplVulkan_Init()
6879
// - VkDescriptorPool should be created with VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT,
6980
// and must contain a pool size large enough to hold an ImGui VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER descriptor.
@@ -91,6 +102,8 @@ struct ImGui_ImplVulkan_InitInfo
91102
bool UseDynamicRendering;
92103
#ifdef IMGUI_IMPL_VULKAN_HAS_DYNAMIC_RENDERING
93104
VkPipelineRenderingCreateInfoKHR PipelineRenderingCreateInfo;
105+
#else
106+
unusedVkPipelineRenderingCreateInfo PipelineRenderingCreateInfo;
94107
#endif
95108

96109
// (Optional) Allocation, Debugging

0 commit comments

Comments
 (0)