obs-studio/plugins/win-capture
jp9000 c4036b18bb win-capture/graphics-hook: Fix D3D10/D3D11 detection
When hooking DXGI-based graphics programs in the hook, the first hook
point is IDXGISwapChain::Present.  To be able to initiate a capture, a
pointer to the device context that created the swap chain is required,
which can be retrieved via IDXGISwapChain::GetDevice.  Determining
whether the device context was D3D10 or D3D11 has always been somewhat
of an issue due to D3D10 and D3D11 being nearly identical, as well as
their interoperability/interchangeability.  The GetDevice function would
first be called with the UUID of ID3D10Device, then if that failed,
the UUID of ID3D11Device.

However, with certain specific D3D11 games, GetDevice would for some
unknown reason succeed with the UUID of ID3D10Device, which would cause
capture to fail.  (Conversely, attempting to call GetDevice with the
UUID of ID3D11Device on a device that's actually ID3D10Device would
always succeed, so reversing the order of the test was not an option).
There were originally three known D3D11 games that would erroneously
succeed when querying a D3D10 device interface:  Call of Duty: Ghosts,
Just Cause 3, and theHunter: Call of the Wild.  All other known D3D11
games would work correctly.  Because it was only these three games, a
hack was originally implemented in the form of an executable exception
list that would force them to capture D3D11.

Unfortunately, Oculus games are now failing under the same circumstance
as well, so a simple hack will no longer work.  To fix this, a more
reliable method of detecting which context it is had to be discovered:
simply check the feature level using ID3D11Device::GetFeatureLevel.  If
the feature level is D3D_FEATURE_LEVEL_11_0 or D3D_FEATURE_LEVEL_11_1,
the device is definitely a D3D11 device.  Otherwise, continue the tests
as they were before.  Successfully tested with many D3D10 games, many
D3D11 games, and especially those three D3D11 games that previously were
detected as D3D10 erroneously.
2017-06-15 03:48:43 -07:00
..
d3d8-api Use _MSC_VER for MSVC-specific pragmas 2015-02-09 03:49:18 -08:00
data/locale Update translations from Crowdin 2017-05-20 10:18:41 +02:00
get-graphics-offsets win-capture: Add missing 32 bit offsets 2017-04-26 21:36:49 +02:00
graphics-hook win-capture/graphics-hook: Fix D3D10/D3D11 detection 2017-06-15 03:48:43 -07:00
inject-helper cmake: Add _CRT_SECURE_NO_WARNINGS to all projects 2016-12-08 03:27:36 -08:00
app-helpers.c win-capture: Add ability to open UWP named kernel objects 2016-12-16 14:05:55 -08:00
app-helpers.h win-capture: Add ability to open UWP named kernel objects 2016-12-16 14:05:55 -08:00
CMakeLists.txt win-capture: Add ability to open UWP named kernel objects 2016-12-16 14:05:55 -08:00
cursor-capture.c win-capture: Cache cursor textures to prevent reallocation 2016-11-03 09:23:25 -07:00
cursor-capture.h win-capture: Cache cursor textures to prevent reallocation 2016-11-03 09:23:25 -07:00
dc-capture.c win-capture: Hide cursor when in background (window capture) 2017-05-11 00:01:33 +02:00
dc-capture.h win-capture: Hide cursor when in background (window capture) 2017-05-11 00:01:33 +02:00
duplicator-monitor-capture.c win-capture: Shut down win8 monitor capture when not showing 2016-05-12 17:59:01 -07:00
funchook.c win-capture: Fix case where hook only captures one frame 2016-04-14 23:45:19 -07:00
funchook.h win-capture: Add 64bit bounce to func_hook 2015-07-03 12:17:25 -07:00
game-capture.c win-capture: Limit OpenProcess flags to prevent A/C issues 2017-05-29 19:30:10 -07:00
graphics-hook-info.h win-capture: Open UWP named objects with helper functions 2016-12-16 14:05:56 -08:00
hook-helpers.h win-capture: Open UWP named objects with helper functions 2016-12-16 14:05:56 -08:00
inject-library.c win-capture: Use MEM_RESERVE to comply with VirtualAllocEx spec 2015-11-06 18:16:29 +01:00
inject-library.h win-capture: Add inject library files 2015-07-05 15:17:06 -07:00
load-graphics-offsets.c cmake: Add _CRT_SECURE_NO_WARNINGS to all projects 2016-12-08 03:27:36 -08:00
monitor-capture.c libobs: Add source output flag OBS_SOURCE_DO_NOT_DUPLICATE 2016-01-26 11:49:50 -08:00
nt-stuff.h win-capture: Don't hook suspended processes 2016-12-16 14:05:58 -08:00
obfuscate.c cmake: Add _CRT_SECURE_NO_WARNINGS to all projects 2016-12-08 03:27:36 -08:00
obfuscate.h win-capture: Add obfuscation functions 2014-12-08 01:53:51 -08:00
plugin-main.c win-capture: Defer hook offset loading to separate thread 2016-11-14 17:34:44 -08:00
window-capture.c win-capture: Hide cursor when in background (window capture) 2017-05-11 00:01:33 +02:00
window-helpers.c win-capture: Fix and clarify window capture prioritization 2017-04-30 00:25:02 -07:00
window-helpers.h win-capture: Fix getting proper UWP window handles 2016-12-16 02:21:05 -08:00