graphics-hook: Fix null pointer dereference #11430
Open
+4
−4
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.
Multiple APIs may be setup to capture without being initialized in graphics-hook when multiple threads are sending present calls. This just prevents those invalid captures from completing.
Description
Adds a check for
data.handle
being null, as that currently is one indicator that the data struct has not been initialized.Motivation and Context
In the NVIDIA 555.85 driver, an extra API queue was added when using
VK_PRESENT_MODE_FIFO_KHR
orVK_PRESENT_MODE_FIFO_RELAXED_KHR
present modes. Two separate threads present to each of the queues. The application presents to the Vulkan queue, and the driver presents to the DirectX 12 queue (DXGI). The user-mode driver copies the contents of the vulkan framebuffer into in the the DirectX 12 queue. After that the DX12 queue is the one that is rendered to the window.Fixes #11403
How Has This Been Tested?
Tested under DX12, DX11, OpenGL, and Vulkan to make sure they still capture. (using Dolphin Emulator video backends)
Tested disabling and re-enabling an active capture while using Vulkan and VSync to make sure it doesn't crash.
On Windows 11 23H2 using a NVIDIA GeForce 3080.
Types of changes
Bug fix (non-breaking change which fixes an issue)
Checklist: