Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Win32 WSI and SendMessage #2290

Open
konstantinegorov opened this issue Jan 6, 2024 · 2 comments
Open

Win32 WSI and SendMessage #2290

konstantinegorov opened this issue Jan 6, 2024 · 2 comments
Assignees

Comments

@konstantinegorov
Copy link

Some Vulkan functions may call the SendMessage system API when interacting with a VkSurfaceKHR through a VkSwapchainKHR. In a multithreaded environment, calling SendMessage from a thread that is not the thread associated with pCreateInfo::hwnd will block until the application has processed the window message. Thus, applications should either call these Vulkan functions on the message pump thread, or make sure their message pump is actively running. Failing to do so may result in deadlocks.

Is there an example of what win32 window message can be sent when calling vkCreateSwapchainKHR/vkQueuePresentKHR/vkAcquireNextImageKHR... and in what case?

@linyaa-kiwi
Copy link
Contributor

@nvlduc Can you help with this question? I believe it's related to your internal MR 5792, which touched Win32 WSI multithreaded restrictions.

@linyaa-kiwi linyaa-kiwi assigned linyaa-kiwi and nvlduc and unassigned linyaa-kiwi Mar 6, 2024
@nvlduc
Copy link

nvlduc commented Mar 11, 2024

Hi @konstantinegorov,

The main use-case for this change is to allow implementations to safely layer presentation on top of DXGI, which has the same requirements.

Other than that, I expect some implementations would need to tweak some of the window's properties (e.g. extended style) to support a certain set of swapchain features. I cannot really provide specific examples since this is very implementation-specific, and can change from a driver version to the next.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants
@linyaa-kiwi @oddhack @konstantinegorov @nvlduc and others