Skip to content

Commit bb17e10

Browse files
committed
Fix the vulkan-glfw backend
1 parent ccc38b5 commit bb17e10

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/backend_glfw_vulkan.zig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ pub fn init(init_info: ImGui_ImplVulkan_InitInfo, window: *const anyopaque) void
1212
}
1313

1414
pub fn loadFunctions(
15+
api_version: u32,
1516
loader: fn (function_name: [*:0]const u8, user_data: ?*anyopaque) callconv(.c) ?*anyopaque,
1617
user_data: ?*anyopaque,
1718
) bool {
18-
return backend_vulkan.loadFunctions(loader, user_data);
19+
return backend_vulkan.loadFunctions(api_version, loader, user_data);
1920
}
2021

2122
pub fn deinit() void {

src/backend_vulkan.zig

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ pub const VkPipelineRenderingCreateInfo = extern struct {
1313
};
1414

1515
pub const ImGui_ImplVulkan_InitInfo = extern struct {
16+
api_version: u32,
1617
instance: VkHandle, // VkInstance
1718
physical_device: VkHandle, // VkPhysicalDevice
1819
device: VkHandle, // VkDevice
@@ -42,18 +43,17 @@ pub fn init(init_info: ImGui_ImplVulkan_InitInfo) void {
4243
if (!ImGui_ImplVulkan_Init(&vk_init)) {
4344
@panic("failed to init Vulkan for ImGui");
4445
}
45-
ImGui_ImplVulkan_CreateFontsTexture();
4646
}
4747

4848
pub fn loadFunctions(
49+
api_version: u32,
4950
loader: fn (function_name: [*:0]const u8, user_data: ?*anyopaque) callconv(.c) ?*anyopaque,
5051
user_data: ?*anyopaque,
5152
) bool {
52-
return ImGui_ImplVulkan_LoadFunctions(loader, user_data);
53+
return ImGui_ImplVulkan_LoadFunctions(api_version, loader, user_data);
5354
}
5455

5556
pub fn deinit() void {
56-
ImGui_ImplVulkan_DestroyFontsTexture();
5757
ImGui_ImplVulkan_Shutdown();
5858
}
5959

@@ -82,10 +82,9 @@ extern fn ImGui_ImplVulkan_RenderDrawData(
8282
command_buffer: VkHandle, // VkCommandBuffer
8383
pipeline: VkHandle,
8484
) void;
85-
extern fn ImGui_ImplVulkan_CreateFontsTexture() void;
86-
extern fn ImGui_ImplVulkan_DestroyFontsTexture() void;
8785
extern fn ImGui_ImplVulkan_SetMinImageCount(min_image_count: u32) void;
8886
extern fn ImGui_ImplVulkan_LoadFunctions(
87+
api_version: u32,
8988
loader_func: *const fn (function_name: [*:0]const u8, user_data: ?*anyopaque) callconv(.c) ?*anyopaque,
9089
user_data: ?*anyopaque,
9190
) bool;

0 commit comments

Comments
 (0)