A user has reported that toggling the cursor can cause exceptions.
Propagate that information upward, so we can reset the capture.
Display capture never needed to call the function in the first place.
Shuffle around window capture code to make a common reset function.
Builds on PR #4663.
Previous fix attempted to place swap_recurse count in gl_data struct,
where it could be unexpectedly memset to 0. Separate member from struct,
and make thread-local for additional safety.
Only auto-select WGC for desktop capture if a battery exists and
multiple GPU adapters are present. May false-positive on desktops with
a smart UPS attached, but we don't know of a better test.
Attempt to schedule shared texture copies against the command queue that
the game's swap chain uses to try to reduce artifacts. The heuristics
for obtaining the queue are not perfect, so provide a toggle to use the
previous behavior.
Add display capture support via winrt_capture_init_monitor. Almost all
of the existing window capture code is reused.
Rename winrt_capture_init to winrt_capture_init_window for symmetry.
For game capture, neither GL nor D3D9 support SRGB shared textures, so
disable linear SRGB support if the texture format doesn't support it.
Similarly, DXGI display capture doesn't work with SRGB at the moment.
Unsure if it will with more work, but disable for now.
Also force linear SRGB off if using GDI-compatible textures.
Modify game capture shared textures to be typeless if they could
potentially need SRGB and non-SRGB views in the future.
These capture APIs have been updated: D3D 10/11/12, Vulkan.
D3D8 capture does not use shared textures.
D3D9 and GL interop do not support typeless textures.
The new game capture DLL should be compatible with old versions of OBS.
Also removed a lot of dead code around pointless SRV/RTV support.
Add explicit casts to convert data pointers to function pointers.
Add references for unused parameters.
Replace accidental BOOL* return values with BOOL.
For game capture, hook DXGI release function to release D3D objects if
the related swap chain is also being destroyed.
An added bonus is that the game capture hook will handle swap chain
recreation for applications that don't use ResizeBuffers.
Rivatuner Statistics Server calls vkGetInstanceProcAddr for
vkCreateDevice with a NULL instance. According to spec, this should
return NULL, but RTSS will dereference this and crash.
This change returns function pointers for every intercepted function
regardless of instance, which is enough to keep RTSS alive.
Because the window capture source updates its data whenever certain
properties are modified, this would cause a race condition because
source updates normally happen in the graphics thread. To solve this
for the time being, put access to that data within a mutex when updating
or updating visibility.
After PR #3074, the following strings are no longer used:
* GameCapture.ForceScaling="Force Scaling"
* GameCapture.ScaleRes="Scale Resolution"
Commits from PR #3074:
* 9497589b1603dcacf07e3b81d2f60291eafb3590
* 63933997586bf88c862159bf5cb20be56b713283
Prevents multiple queues in the same family from racing on frame data.
Removal of vk_family_data also fixes broken capacity calculation. Two
queue families can share the same index if one is "protected-capable"
and the other isn't.