Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions UniversalHookX/src/hooks/backend/vulkan/hook_vulkan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,8 @@ static void CreateRenderTarget(VkDevice device, VkSwapchainKHR swapchain) {
info.renderPass = g_RenderPass;
info.attachmentCount = 1;
info.pAttachments = attachment;
info.width = g_ImageExtent.width;
info.height = g_ImageExtent.height;
info.layers = 1;

for (uint32_t i = 0; i < uImageCount; ++i) {
Expand Down Expand Up @@ -419,6 +421,15 @@ static void RenderImGui_Vulkan(VkQueue queue, const VkPresentInfoKHR* pPresentIn
if (!g_Device || H::bShuttingDown)
return;

if (g_ImageExtent.width == 0 || g_ImageExtent.height == 0) {
// We don't know the window size the first time so we just query the window handle.
RECT rect{ };
GetClientRect(g_Hwnd, &rect);

g_ImageExtent.width = rect.right - rect.left;
g_ImageExtent.height = rect.bottom - rect.top;
}

VkQueue graphicQueue = VK_NULL_HANDLE;
const bool queueSupportsGraphic = DoesQueueSupportGraphic(queue, &graphicQueue);

Expand Down Expand Up @@ -536,8 +547,8 @@ static void RenderImGui_Vulkan(VkQueue queue, const VkPresentInfoKHR* pPresentIn
info.waitSemaphoreCount = waitSemaphoresCount;
info.pWaitSemaphores = pPresentInfo->pWaitSemaphores;

info.signalSemaphoreCount = 1;
info.pSignalSemaphores = &fsd->ImageAcquiredSemaphore;
info.signalSemaphoreCount = waitSemaphoresCount;
info.pSignalSemaphores = pPresentInfo->pWaitSemaphores;

vkQueueSubmit(graphicQueue, 1, &info, fd->Fence);
}
Expand Down