Skip to content

Commit ec71f48

Browse files
committed
Update Vulkan SDK to 1.2.176.
Update vcpkg to 2021.04.30. Update ImGUI files to latest version (fix validation error).
1 parent c6422ae commit ec71f48

9 files changed

Lines changed: 156 additions & 28 deletions

File tree

.github/workflows/linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77

88
runs-on: ubuntu-20.04
99
env:
10-
SDK_VERSION: 1.2.170
10+
SDK_VERSION: 1.2.176
1111

1212
steps:
1313
- uses: actions/checkout@v2

.github/workflows/windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77

88
runs-on: windows-latest
99
env:
10-
SDK_VERSION: 1.2.170.0
10+
SDK_VERSION: 1.2.176.1
1111

1212
steps:
1313
- uses: actions/checkout@v2

src/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,4 +166,4 @@ add_dependencies(${exe_name} Assets)
166166
set_target_properties(${exe_name} PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX})
167167
target_include_directories(${exe_name} PRIVATE . ${Boost_INCLUDE_DIRS} ${glfw3_INCLUDE_DIRS} ${glm_INCLUDE_DIRS} ${STB_INCLUDE_DIRS} ${Vulkan_INCLUDE_DIRS})
168168
target_link_directories(${exe_name} PRIVATE ${Vulkan_LIBRARY})
169-
target_link_libraries(${exe_name} PRIVATE ${Boost_LIBRARIES} glfw glm imgui::imgui tinyobjloader::tinyobjloader ${Vulkan_LIBRARIES} ${extra_libs})
169+
target_link_libraries(${exe_name} PRIVATE ${Boost_LIBRARIES} glfw glm::glm imgui::imgui tinyobjloader::tinyobjloader ${Vulkan_LIBRARIES} ${extra_libs})

src/ImGui/imgui_impl_glfw.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// dear imgui: Platform Backend for GLFW
2-
// This needs to be used along with a Renderer (e.g. OpenGL3, Vulkan..)
2+
// This needs to be used along with a Renderer (e.g. OpenGL3, Vulkan, WebGPU..)
33
// (Info: GLFW is a cross-platform general purpose library for handling windows, inputs, OpenGL/Vulkan graphics context creation, etc.)
44
// (Requires: GLFW 3.1+)
55

@@ -149,7 +149,7 @@ static bool ImGui_ImplGlfw_Init(GLFWwindow* window, bool install_callbacks, Glfw
149149
io.BackendFlags |= ImGuiBackendFlags_HasSetMousePos; // We can honor io.WantSetMousePos requests (optional, rarely used)
150150
io.BackendPlatformName = "imgui_impl_glfw";
151151

152-
// Keyboard mapping. ImGui will use those indices to peek into the io.KeysDown[] array.
152+
// Keyboard mapping. Dear ImGui will use those indices to peek into the io.KeysDown[] array.
153153
io.KeyMap[ImGuiKey_Tab] = GLFW_KEY_TAB;
154154
io.KeyMap[ImGuiKey_LeftArrow] = GLFW_KEY_LEFT;
155155
io.KeyMap[ImGuiKey_RightArrow] = GLFW_KEY_RIGHT;
@@ -231,6 +231,11 @@ bool ImGui_ImplGlfw_InitForVulkan(GLFWwindow* window, bool install_callbacks)
231231
return ImGui_ImplGlfw_Init(window, install_callbacks, GlfwClientApi_Vulkan);
232232
}
233233

234+
bool ImGui_ImplGlfw_InitForOther(GLFWwindow* window, bool install_callbacks)
235+
{
236+
return ImGui_ImplGlfw_Init(window, install_callbacks, GlfwClientApi_Unknown);
237+
}
238+
234239
void ImGui_ImplGlfw_Shutdown()
235240
{
236241
if (g_InstalledCallbacks)

src/ImGui/imgui_impl_glfw.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// dear imgui: Platform Backend for GLFW
2-
// This needs to be used along with a Renderer (e.g. OpenGL3, Vulkan..)
2+
// This needs to be used along with a Renderer (e.g. OpenGL3, Vulkan, WebGPU..)
33
// (Info: GLFW is a cross-platform general purpose library for handling windows, inputs, OpenGL/Vulkan graphics context creation, etc.)
44

55
// Implemented features:
@@ -23,6 +23,7 @@ struct GLFWwindow;
2323

2424
IMGUI_IMPL_API bool ImGui_ImplGlfw_InitForOpenGL(GLFWwindow* window, bool install_callbacks);
2525
IMGUI_IMPL_API bool ImGui_ImplGlfw_InitForVulkan(GLFWwindow* window, bool install_callbacks);
26+
IMGUI_IMPL_API bool ImGui_ImplGlfw_InitForOther(GLFWwindow* window, bool install_callbacks);
2627
IMGUI_IMPL_API void ImGui_ImplGlfw_Shutdown();
2728
IMGUI_IMPL_API void ImGui_ImplGlfw_NewFrame();
2829

src/ImGui/imgui_impl_vulkan.cpp

Lines changed: 109 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222

2323
// CHANGELOG
2424
// (minor and older changes stripped away, please see git history for details)
25+
// 2021-03-22: Vulkan: Fix mapped memory validation error when buffer sizes are not multiple of VkPhysicalDeviceLimits::nonCoherentAtomSize.
26+
// 2021-02-18: Vulkan: Change blending equation to preserve alpha in output buffer.
27+
// 2021-01-27: Vulkan: Added support for custom function load and IMGUI_IMPL_VULKAN_NO_PROTOTYPES by using ImGui_ImplVulkan_LoadFunctions().
2528
// 2020-11-11: Vulkan: Added support for specifying which subpass to reference during VkPipeline creation.
2629
// 2020-09-07: Vulkan: Added VkPipeline parameter to ImGui_ImplVulkan_RenderDrawData (default to one passed to ImGui_ImplVulkan_Init).
2730
// 2020-05-04: Vulkan: Fixed crash if initial frame has no vertices.
@@ -48,7 +51,6 @@
4851
// 2016-10-18: Vulkan: Add location decorators & change to use structs as in/out in glsl, update embedded spv (produced with glslangValidator -x). Null the released resources.
4952
// 2016-08-27: Vulkan: Fix Vulkan example for use when a depth buffer is active.
5053

51-
#include "imgui.h"
5254
#include "imgui_impl_vulkan.h"
5355
#include <stdio.h>
5456

@@ -85,6 +87,11 @@ static VkPipeline g_Pipeline = VK_NULL_HANDLE;
8587
static uint32_t g_Subpass = 0;
8688
static VkShaderModule g_ShaderModuleVert;
8789
static VkShaderModule g_ShaderModuleFrag;
90+
#ifdef VK_NO_PROTOTYPES
91+
static bool g_FunctionsLoaded = false;
92+
#else
93+
static bool g_FunctionsLoaded = true;
94+
#endif
8895

8996
// Font data
9097
static VkSampler g_FontSampler = VK_NULL_HANDLE;
@@ -107,6 +114,75 @@ void ImGui_ImplVulkanH_DestroyWindowRenderBuffers(VkDevice device, ImGui_ImplVul
107114
void ImGui_ImplVulkanH_CreateWindowSwapChain(VkPhysicalDevice physical_device, VkDevice device, ImGui_ImplVulkanH_Window* wd, const VkAllocationCallbacks* allocator, int w, int h, uint32_t min_image_count);
108115
void ImGui_ImplVulkanH_CreateWindowCommandBuffers(VkPhysicalDevice physical_device, VkDevice device, ImGui_ImplVulkanH_Window* wd, uint32_t queue_family, const VkAllocationCallbacks* allocator);
109116

117+
// Vulkan prototypes for use with custom loaders
118+
// (see description of IMGUI_IMPL_VULKAN_NO_PROTOTYPES in imgui_impl_vulkan.h
119+
#ifdef VK_NO_PROTOTYPES
120+
#define IMGUI_VULKAN_FUNC_MAP(IMGUI_VULKAN_FUNC_MAP_MACRO) \
121+
IMGUI_VULKAN_FUNC_MAP_MACRO(vkAllocateCommandBuffers) \
122+
IMGUI_VULKAN_FUNC_MAP_MACRO(vkAllocateDescriptorSets) \
123+
IMGUI_VULKAN_FUNC_MAP_MACRO(vkAllocateMemory) \
124+
IMGUI_VULKAN_FUNC_MAP_MACRO(vkBindBufferMemory) \
125+
IMGUI_VULKAN_FUNC_MAP_MACRO(vkBindImageMemory) \
126+
IMGUI_VULKAN_FUNC_MAP_MACRO(vkCmdBindDescriptorSets) \
127+
IMGUI_VULKAN_FUNC_MAP_MACRO(vkCmdBindIndexBuffer) \
128+
IMGUI_VULKAN_FUNC_MAP_MACRO(vkCmdBindPipeline) \
129+
IMGUI_VULKAN_FUNC_MAP_MACRO(vkCmdBindVertexBuffers) \
130+
IMGUI_VULKAN_FUNC_MAP_MACRO(vkCmdCopyBufferToImage) \
131+
IMGUI_VULKAN_FUNC_MAP_MACRO(vkCmdDrawIndexed) \
132+
IMGUI_VULKAN_FUNC_MAP_MACRO(vkCmdPipelineBarrier) \
133+
IMGUI_VULKAN_FUNC_MAP_MACRO(vkCmdPushConstants) \
134+
IMGUI_VULKAN_FUNC_MAP_MACRO(vkCmdSetScissor) \
135+
IMGUI_VULKAN_FUNC_MAP_MACRO(vkCmdSetViewport) \
136+
IMGUI_VULKAN_FUNC_MAP_MACRO(vkCreateBuffer) \
137+
IMGUI_VULKAN_FUNC_MAP_MACRO(vkCreateCommandPool) \
138+
IMGUI_VULKAN_FUNC_MAP_MACRO(vkCreateDescriptorSetLayout) \
139+
IMGUI_VULKAN_FUNC_MAP_MACRO(vkCreateFence) \
140+
IMGUI_VULKAN_FUNC_MAP_MACRO(vkCreateFramebuffer) \
141+
IMGUI_VULKAN_FUNC_MAP_MACRO(vkCreateGraphicsPipelines) \
142+
IMGUI_VULKAN_FUNC_MAP_MACRO(vkCreateImage) \
143+
IMGUI_VULKAN_FUNC_MAP_MACRO(vkCreateImageView) \
144+
IMGUI_VULKAN_FUNC_MAP_MACRO(vkCreatePipelineLayout) \
145+
IMGUI_VULKAN_FUNC_MAP_MACRO(vkCreateRenderPass) \
146+
IMGUI_VULKAN_FUNC_MAP_MACRO(vkCreateSampler) \
147+
IMGUI_VULKAN_FUNC_MAP_MACRO(vkCreateSemaphore) \
148+
IMGUI_VULKAN_FUNC_MAP_MACRO(vkCreateShaderModule) \
149+
IMGUI_VULKAN_FUNC_MAP_MACRO(vkCreateSwapchainKHR) \
150+
IMGUI_VULKAN_FUNC_MAP_MACRO(vkDestroyBuffer) \
151+
IMGUI_VULKAN_FUNC_MAP_MACRO(vkDestroyCommandPool) \
152+
IMGUI_VULKAN_FUNC_MAP_MACRO(vkDestroyDescriptorSetLayout) \
153+
IMGUI_VULKAN_FUNC_MAP_MACRO(vkDestroyFence) \
154+
IMGUI_VULKAN_FUNC_MAP_MACRO(vkDestroyFramebuffer) \
155+
IMGUI_VULKAN_FUNC_MAP_MACRO(vkDestroyImage) \
156+
IMGUI_VULKAN_FUNC_MAP_MACRO(vkDestroyImageView) \
157+
IMGUI_VULKAN_FUNC_MAP_MACRO(vkDestroyPipeline) \
158+
IMGUI_VULKAN_FUNC_MAP_MACRO(vkDestroyPipelineLayout) \
159+
IMGUI_VULKAN_FUNC_MAP_MACRO(vkDestroyRenderPass) \
160+
IMGUI_VULKAN_FUNC_MAP_MACRO(vkDestroySampler) \
161+
IMGUI_VULKAN_FUNC_MAP_MACRO(vkDestroySemaphore) \
162+
IMGUI_VULKAN_FUNC_MAP_MACRO(vkDestroyShaderModule) \
163+
IMGUI_VULKAN_FUNC_MAP_MACRO(vkDestroySurfaceKHR) \
164+
IMGUI_VULKAN_FUNC_MAP_MACRO(vkDestroySwapchainKHR) \
165+
IMGUI_VULKAN_FUNC_MAP_MACRO(vkDeviceWaitIdle) \
166+
IMGUI_VULKAN_FUNC_MAP_MACRO(vkFlushMappedMemoryRanges) \
167+
IMGUI_VULKAN_FUNC_MAP_MACRO(vkFreeCommandBuffers) \
168+
IMGUI_VULKAN_FUNC_MAP_MACRO(vkFreeMemory) \
169+
IMGUI_VULKAN_FUNC_MAP_MACRO(vkGetBufferMemoryRequirements) \
170+
IMGUI_VULKAN_FUNC_MAP_MACRO(vkGetImageMemoryRequirements) \
171+
IMGUI_VULKAN_FUNC_MAP_MACRO(vkGetPhysicalDeviceMemoryProperties) \
172+
IMGUI_VULKAN_FUNC_MAP_MACRO(vkGetPhysicalDeviceSurfaceCapabilitiesKHR) \
173+
IMGUI_VULKAN_FUNC_MAP_MACRO(vkGetPhysicalDeviceSurfaceFormatsKHR) \
174+
IMGUI_VULKAN_FUNC_MAP_MACRO(vkGetPhysicalDeviceSurfacePresentModesKHR) \
175+
IMGUI_VULKAN_FUNC_MAP_MACRO(vkGetSwapchainImagesKHR) \
176+
IMGUI_VULKAN_FUNC_MAP_MACRO(vkMapMemory) \
177+
IMGUI_VULKAN_FUNC_MAP_MACRO(vkUnmapMemory) \
178+
IMGUI_VULKAN_FUNC_MAP_MACRO(vkUpdateDescriptorSets)
179+
180+
// Define function pointers
181+
#define IMGUI_VULKAN_FUNC_DEF(func) static PFN_##func func;
182+
IMGUI_VULKAN_FUNC_MAP(IMGUI_VULKAN_FUNC_DEF)
183+
#undef IMGUI_VULKAN_FUNC_DEF
184+
#endif // VK_NO_PROTOTYPES
185+
110186
//-----------------------------------------------------------------------------
111187
// SHADERS
112188
//-----------------------------------------------------------------------------
@@ -268,7 +344,7 @@ static void CreateOrResizeBuffer(VkBuffer& buffer, VkDeviceMemory& buffer_memory
268344

269345
err = vkBindBufferMemory(v->Device, buffer, buffer_memory, 0);
270346
check_vk_result(err);
271-
p_buffer_size = new_size;
347+
p_buffer_size = req.size;
272348
}
273349

274350
static void ImGui_ImplVulkan_SetupRenderState(ImDrawData* draw_data, VkPipeline pipeline, VkCommandBuffer command_buffer, ImGui_ImplVulkanH_FrameRenderBuffers* rb, int fb_width, int fb_height)
@@ -354,9 +430,9 @@ void ImGui_ImplVulkan_RenderDrawData(ImDrawData* draw_data, VkCommandBuffer comm
354430
// Upload vertex/index data into a single contiguous GPU buffer
355431
ImDrawVert* vtx_dst = NULL;
356432
ImDrawIdx* idx_dst = NULL;
357-
VkResult err = vkMapMemory(v->Device, rb->VertexBufferMemory, 0, vertex_size, 0, (void**)(&vtx_dst));
433+
VkResult err = vkMapMemory(v->Device, rb->VertexBufferMemory, 0, rb->VertexBufferSize, 0, (void**)(&vtx_dst));
358434
check_vk_result(err);
359-
err = vkMapMemory(v->Device, rb->IndexBufferMemory, 0, index_size, 0, (void**)(&idx_dst));
435+
err = vkMapMemory(v->Device, rb->IndexBufferMemory, 0, rb->IndexBufferSize, 0, (void**)(&idx_dst));
360436
check_vk_result(err);
361437
for (int n = 0; n < draw_data->CmdListsCount; n++)
362438
{
@@ -587,7 +663,7 @@ bool ImGui_ImplVulkan_CreateFontsTexture(VkCommandBuffer command_buffer)
587663
}
588664

589665
// Store our identifier
590-
io.Fonts->TexID = (ImTextureID)(intptr_t)g_FontImage;
666+
io.Fonts->SetTexID((ImTextureID)(intptr_t)g_FontImage);
591667

592668
return true;
593669
}
@@ -741,8 +817,8 @@ static void ImGui_ImplVulkan_CreatePipeline(VkDevice device, const VkAllocationC
741817
color_attachment[0].srcColorBlendFactor = VK_BLEND_FACTOR_SRC_ALPHA;
742818
color_attachment[0].dstColorBlendFactor = VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA;
743819
color_attachment[0].colorBlendOp = VK_BLEND_OP_ADD;
744-
color_attachment[0].srcAlphaBlendFactor = VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA;
745-
color_attachment[0].dstAlphaBlendFactor = VK_BLEND_FACTOR_ZERO;
820+
color_attachment[0].srcAlphaBlendFactor = VK_BLEND_FACTOR_ONE;
821+
color_attachment[0].dstAlphaBlendFactor = VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA;
746822
color_attachment[0].alphaBlendOp = VK_BLEND_OP_ADD;
747823
color_attachment[0].colorWriteMask = VK_COLOR_COMPONENT_R_BIT | VK_COLOR_COMPONENT_G_BIT | VK_COLOR_COMPONENT_B_BIT | VK_COLOR_COMPONENT_A_BIT;
748824

@@ -886,8 +962,31 @@ void ImGui_ImplVulkan_DestroyDeviceObjects()
886962
if (g_Pipeline) { vkDestroyPipeline(v->Device, g_Pipeline, v->Allocator); g_Pipeline = VK_NULL_HANDLE; }
887963
}
888964

965+
bool ImGui_ImplVulkan_LoadFunctions(PFN_vkVoidFunction(*loader_func)(const char* function_name, void* user_data), void* user_data)
966+
{
967+
// Load function pointers
968+
// You can use the default Vulkan loader using:
969+
// ImGui_ImplVulkan_LoadFunctions([](const char* function_name, void*) { return vkGetInstanceProcAddr(your_vk_isntance, function_name); });
970+
// But this would be equivalent to not setting VK_NO_PROTOTYPES.
971+
#ifdef VK_NO_PROTOTYPES
972+
#define IMGUI_VULKAN_FUNC_LOAD(func) \
973+
func = reinterpret_cast<decltype(func)>(loader_func(#func, user_data)); \
974+
if (func == NULL) \
975+
return false;
976+
IMGUI_VULKAN_FUNC_MAP(IMGUI_VULKAN_FUNC_LOAD)
977+
#undef IMGUI_VULKAN_FUNC_LOAD
978+
#else
979+
IM_UNUSED(loader_func);
980+
IM_UNUSED(user_data);
981+
#endif
982+
g_FunctionsLoaded = true;
983+
return true;
984+
}
985+
889986
bool ImGui_ImplVulkan_Init(ImGui_ImplVulkan_InitInfo* info, VkRenderPass render_pass)
890987
{
988+
IM_ASSERT(g_FunctionsLoaded && "Need to call ImGui_ImplVulkan_LoadFunctions() if IMGUI_IMPL_VULKAN_NO_PROTOTYPES or VK_NO_PROTOTYPES are set!");
989+
891990
// Setup backend capabilities flags
892991
ImGuiIO& io = ImGui::GetIO();
893992
io.BackendRendererName = "imgui_impl_vulkan";
@@ -952,6 +1051,7 @@ void ImGui_ImplVulkan_SetMinImageCount(uint32_t min_image_count)
9521051

9531052
VkSurfaceFormatKHR ImGui_ImplVulkanH_SelectSurfaceFormat(VkPhysicalDevice physical_device, VkSurfaceKHR surface, const VkFormat* request_formats, int request_formats_count, VkColorSpaceKHR request_color_space)
9541053
{
1054+
IM_ASSERT(g_FunctionsLoaded && "Need to call ImGui_ImplVulkan_LoadFunctions() if IMGUI_IMPL_VULKAN_NO_PROTOTYPES or VK_NO_PROTOTYPES are set!");
9551055
IM_ASSERT(request_formats != NULL);
9561056
IM_ASSERT(request_formats_count > 0);
9571057

@@ -996,6 +1096,7 @@ VkSurfaceFormatKHR ImGui_ImplVulkanH_SelectSurfaceFormat(VkPhysicalDevice physic
9961096

9971097
VkPresentModeKHR ImGui_ImplVulkanH_SelectPresentMode(VkPhysicalDevice physical_device, VkSurfaceKHR surface, const VkPresentModeKHR* request_modes, int request_modes_count)
9981098
{
1099+
IM_ASSERT(g_FunctionsLoaded && "Need to call ImGui_ImplVulkan_LoadFunctions() if IMGUI_IMPL_VULKAN_NO_PROTOTYPES or VK_NO_PROTOTYPES are set!");
9991100
IM_ASSERT(request_modes != NULL);
10001101
IM_ASSERT(request_modes_count > 0);
10011102

@@ -1246,6 +1347,7 @@ void ImGui_ImplVulkanH_CreateWindowSwapChain(VkPhysicalDevice physical_device, V
12461347
// Create or resize window
12471348
void ImGui_ImplVulkanH_CreateOrResizeWindow(VkInstance instance, VkPhysicalDevice physical_device, VkDevice device, ImGui_ImplVulkanH_Window* wd, uint32_t queue_family, const VkAllocationCallbacks* allocator, int width, int height, uint32_t min_image_count)
12481349
{
1350+
IM_ASSERT(g_FunctionsLoaded && "Need to call ImGui_ImplVulkan_LoadFunctions() if IMGUI_IMPL_VULKAN_NO_PROTOTYPES or VK_NO_PROTOTYPES are set!");
12491351
(void)instance;
12501352
ImGui_ImplVulkanH_CreateWindowSwapChain(physical_device, device, wd, allocator, width, height, min_image_count);
12511353
ImGui_ImplVulkanH_CreateWindowCommandBuffers(physical_device, device, wd, queue_family, allocator);

src/ImGui/imgui_impl_vulkan.h

Lines changed: 33 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,25 +22,42 @@
2222

2323
#pragma once
2424
#include "imgui.h" // IMGUI_IMPL_API
25+
26+
// [Configuration] in order to use a custom Vulkan function loader:
27+
// (1) You'll need to disable default Vulkan function prototypes.
28+
// We provide a '#define IMGUI_IMPL_VULKAN_NO_PROTOTYPES' convenience configuration flag.
29+
// In order to make sure this is visible from the imgui_impl_vulkan.cpp compilation unit:
30+
// - Add '#define IMGUI_IMPL_VULKAN_NO_PROTOTYPES' in your imconfig.h file
31+
// - Or as a compilation flag in your build system
32+
// - Or uncomment here (not recommended because you'd be modifying imgui sources!)
33+
// - Do not simply add it in a .cpp file!
34+
// (2) Call ImGui_ImplVulkan_LoadFunctions() before ImGui_ImplVulkan_Init() with your custom function.
35+
// If you have no idea what this is, leave it alone!
36+
//#define IMGUI_IMPL_VULKAN_NO_PROTOTYPES
37+
38+
// Vulkan includes
39+
#if defined(IMGUI_IMPL_VULKAN_NO_PROTOTYPES) && !defined(VK_NO_PROTOTYPES)
40+
#define VK_NO_PROTOTYPES
41+
#endif
2542
#include <vulkan/vulkan.h>
2643

2744
// Initialization data, for ImGui_ImplVulkan_Init()
2845
// [Please zero-clear before use!]
2946
struct ImGui_ImplVulkan_InitInfo
3047
{
31-
VkInstance Instance;
32-
VkPhysicalDevice PhysicalDevice;
33-
VkDevice Device;
34-
uint32_t QueueFamily;
35-
VkQueue Queue;
36-
VkPipelineCache PipelineCache;
37-
VkDescriptorPool DescriptorPool;
38-
uint32_t Subpass;
39-
uint32_t MinImageCount; // >= 2
40-
uint32_t ImageCount; // >= MinImageCount
41-
VkSampleCountFlagBits MSAASamples; // >= VK_SAMPLE_COUNT_1_BIT
42-
const VkAllocationCallbacks* Allocator;
43-
void (*CheckVkResultFn)(VkResult err);
48+
VkInstance Instance;
49+
VkPhysicalDevice PhysicalDevice;
50+
VkDevice Device;
51+
uint32_t QueueFamily;
52+
VkQueue Queue;
53+
VkPipelineCache PipelineCache;
54+
VkDescriptorPool DescriptorPool;
55+
uint32_t Subpass;
56+
uint32_t MinImageCount; // >= 2
57+
uint32_t ImageCount; // >= MinImageCount
58+
VkSampleCountFlagBits MSAASamples; // >= VK_SAMPLE_COUNT_1_BIT
59+
const VkAllocationCallbacks* Allocator;
60+
void (*CheckVkResultFn)(VkResult err);
4461
};
4562

4663
// Called by user code
@@ -52,6 +69,9 @@ IMGUI_IMPL_API bool ImGui_ImplVulkan_CreateFontsTexture(VkCommandBuffer comm
5269
IMGUI_IMPL_API void ImGui_ImplVulkan_DestroyFontUploadObjects();
5370
IMGUI_IMPL_API void ImGui_ImplVulkan_SetMinImageCount(uint32_t min_image_count); // To override MinImageCount after initialization (e.g. if swap chain is recreated)
5471

72+
// Optional: load Vulkan functions with a custom function loader
73+
// This is only useful with IMGUI_IMPL_VULKAN_NO_PROTOTYPES / VK_NO_PROTOTYPES
74+
IMGUI_IMPL_API bool ImGui_ImplVulkan_LoadFunctions(PFN_vkVoidFunction(*loader_func)(const char* function_name, void* user_data), void* user_data = NULL);
5575

5676
//-------------------------------------------------------------------------
5777
// Internal / Miscellaneous Vulkan Helpers

vcpkg_linux.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ mkdir -p build
55
cd build
66
git clone https://github.com/Microsoft/vcpkg.git vcpkg.linux
77
cd vcpkg.linux
8-
git checkout 2020.11-1
8+
git checkout 2021.04.30
99
./bootstrap-vcpkg.sh
1010

1111
./vcpkg install \

vcpkg_windows.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ mkdir build
22
cd build || goto :error
33
git clone https://github.com/Microsoft/vcpkg.git vcpkg.windows || goto :error
44
cd vcpkg.windows || goto :error
5-
git checkout 2020.11-1 || goto :error
5+
git checkout 2021.04.30 || goto :error
66
call bootstrap-vcpkg.bat || goto :error
77

88
vcpkg.exe install ^

0 commit comments

Comments
 (0)