graphics-hook: Fix crash with Vulkan DirectDisplay #11583
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Vulkan Direct Display uses extensions:
VK_KHR_display/VK_EXT_direct_mode_display
This workflow allows creating swapchains that arn't active on the desktop, so they don't have HWNDs.
Avoid trying to create swap_data when a HWND can't be found.
Fixes #11581
Description
VK_KHR_display/VK_EXT_direct_mode_display extensions created swapchains without HWND handles.
Avoid trying to work with HWND when they can't be found.
Motivation and Context
The old behavior causes crashes when applications using Direct Display.
How Has This Been Tested?
The only thing I tested was that the crash doesn't occur. If avoiding filling the
swap_data
hasgreater ramifications, then I'll need feedback from devs more familiar with OBS.
Types of changes
Checklist: