提交 229f8d37 编写于 作者: J jp9000

win-capture/graphics-hook: Fix reacquire bug

Sometimes the width/height would initially be at 0x0 when the swap chain
was alt-tabbing, causing the capture to fail full-stop when trying to
reacquire.
上级 e9b41e5f
......@@ -935,6 +935,11 @@ static inline HWND get_swap_window(struct vk_swap_data *swap)
return NULL;
}
static inline bool valid_rect(struct vk_swap_data *swap)
{
return !!swap->image_extent.width && !!swap->image_extent.height;
}
static void vk_capture(struct vk_data *data, VkQueue queue,
const VkPresentInfoKHR *info)
{
......@@ -965,7 +970,7 @@ static void vk_capture(struct vk_data *data, VkQueue queue,
vk_shtex_free(data);
}
if (capture_should_init()) {
if (!vk_shtex_init(data, window, swap)) {
if (valid_rect(swap) && !vk_shtex_init(data, window, swap)) {
vk_shtex_free(data);
data->valid = false;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册