Commit Graph

390 Commits (e5151ec4a95f4603d4e94884cb4d494951ba351a)

Author SHA1 Message Date
Jim 5728df6cef
Merge pull request #3149 from jpark37/vulkan-32bit
win-capture Fix 32-bit Vulkan capture
2020-07-10 20:39:13 -07:00
Jim 97ecf23df0
Merge pull request #3121 from jpark37/chrome-window-priority
win-capture: Don't use Chrome classes for priority
2020-07-10 20:20:26 -07:00
Jim 6c37f6faea
Merge pull request #3113 from jpark37/vulkan-swap-decouple
win-capture: Decouple swap and frame indices
2020-07-10 20:15:38 -07:00
jpark37 7772a56a97 win-capture: Fix 32-bit Vulkan capture
Vulkan loader needs pure name, which needs manual fix-up on 32-bit.
2020-07-09 22:10:34 -07:00
jpark37 4ec9081f3a win-capture: Don't use Chrome classes for priority
Avoids accidental fallback to Discord for example.
2020-07-03 00:12:21 -07:00
jpark37 3ac17d11c4 win-capture: Decouple swap and frame indices
The swap image index may not be a rotating value, so manage a separate
index to avoid reusing frame data early and stalling.
2020-06-30 08:22:34 -07:00
jpark37 6393399758 win-capture: Remove game capture scaling
The performance save is not worth accidental usage support.

Also remove unnecessary copies from the shmem paths.
2020-06-22 15:07:07 -07:00
Jim 088a72129a
Merge pull request #3061 from jpark37/vulkan-best-practices
win-capture: Reset command pool rather than buffer
2020-06-21 11:21:33 -07:00
Jim 76ea0336ad
Merge pull request #2882 from RytoEX/log-window-capture-method
win-capture: Log window capture method
2020-06-21 07:00:36 -07:00
jpark37 cdd912b162 win-capture: Reset command pool rather than buffer
Reorganize data to avoid best practices layer warning. Sort of a false
positive in our case because we only have one buffer per pool now, but
implicit layers should be clean citizens.
2020-06-21 06:47:22 -07:00
Jim 9c107738f6
Merge pull request #3015 from jpark37/vulkan-external-fixes
win-capture: Improve Vulkan synchronization
2020-06-21 05:02:20 -07:00
jpark37 a7813c9f87 win-capture: Remove dead VkResult values 2020-06-07 15:22:13 -07:00
jpark37 83dd9c8540 win-capture: Improve Vulkan synchronization
Use general layout and 0 access masks for external synchronization as
specified in the spec.

Also set pipeline stages for maximum synchronization just in case
because it doesn't seem like the pipeline stages are specified.

"Vulkan-incompatible APIs will require the image to be in the GENERAL
layout whenever they are accessing them."

"Whilst it is not invalid to provide destination or source access masks
for memory barriers used for release or acquire operations,
respectively, they have no practical effect. Access after a release
operation has undefined results, and so visibility for those accesses
has no practical effect. Similarly, write access before an acquire
operation will produce undefined results for future access, so
availability of those writes has no practical use. In an earlier version
of the specification, these were required to match on both sides - but
this was subsequently relaxed. These masks should be set to 0."
2020-05-31 22:31:39 -07:00
Richard Stanway 50e1d17615 win-capture: Better matching of internal UWP windows
All strings were treated as partial matches before, which caused a
false positive with any executable beginning with "time", notably
affecting the game "Timelie" which used Timelie.exe.
2020-05-23 01:50:38 +02:00
Jim 665180350d
Merge pull request #2657 from hselasky/improvement
libobs: Implement and use better scaling function for 64-bit integers
2020-05-21 18:07:53 -07:00
Jim ad919b47ea
Merge pull request #2921 from jpark37/vulkan-format-fail
win-capture: Fail on unsupported Vulkan formats
2020-05-21 17:29:57 -07:00
Jim c5187aef16
Merge pull request #2908 from jpark37/wgc-minimize
Fix WGC minimize handling
2020-05-21 17:29:04 -07:00
Jim cb98f456eb
Merge pull request #2595 from jpark37/vulkan-cleanup
Vulkan hook COM clean up, and extension check
2020-05-20 18:20:05 -07:00
Jim 23ee7aebc6
Merge pull request #2589 from jpark37/vulkan-alloc
win-capture: Use VkAllocationCallbacks
2020-05-20 18:17:20 -07:00
jpark37 e933e20b7c win-capture: Ignore cloaked windows
Fixes issue where there are two window handles for minimized Calculator,
and OBS picks the wrong one.
2020-05-17 10:45:10 -07:00
jpark37 477f90620d win-capture: Reset WGC fail flag for new window
WGC will give up on a window that it fails to capture, but that
shouldn't stop it from attempting to capture new windows.

Fixes #2928.
2020-05-13 07:54:41 -07:00
jp9000 7993179466 cmake: Add cmake folders 2020-05-13 06:52:37 -07:00
jpark37 30f6870b23 win-capture: Fail on unsupported Vulkan formats
Don't allow unsupported Vulkan formats to fall back to B8G8R8A8.
Probably better to fail completely than do an illegal copy.

Also remove bad conversion for VK_FORMAT_A2R10G10B10_UNORM_PACK32.
Red and blue channels were reversed, and there's no DXGI equivalent.

Addresses #2796. We can do more later if justified.
2020-05-12 12:06:03 -07:00
Ryan Foster 0a89446ba4 win-capture: Log window capture method 2020-05-08 04:16:28 -04:00
jpark37 097ea77488 libobs-winrt: win-capture: Detect GraphicsCaptureItem closure
Make WGC window capture recover from GraphicsCaptureItem closure, which
can occur when following links in fullscreen Chrome for example.
2020-05-06 21:42:26 -07:00
Hans Petter Selasky 0e4ea14ba1 libobs: Implement and use better scaling function for 64-bit integers
As os_gettime_ns() gets large the current scaling methods, mostly by casting
to uint64_t, may lead to numerical overflows. Sweep the code and use
util_mul_div64() where applicable.

Signed-off-by: Hans Petter Selasky <hps@selasky.org>
2020-04-05 20:27:28 +02:00
jp9000 83991a1345 win-capture: Update graphics hook version to 1.1.4 2020-04-05 03:48:34 -07:00
jpark37 8987fc6c81 win-capture: Verify VK_KHR_external_memory_win32 support
Good practice to verify necessary extensions exist. We'll probably need
keyed mutex extension in the future to support Intel.
2020-03-29 10:08:03 -07:00
jpark37 21dc1f573b win-capture: Cleaner COM usage
Remove hard-coded GUIDs, call correct functions, and clean up
unnecessary casts.
2020-03-29 10:00:36 -07:00
jpark37 348fcd5b00 win-capture: Fix crash if GPU can't Vulkan capture 2020-03-28 09:01:26 -07:00
jpark37 e1739707d0 win-capture: Use VkAllocationCallbacks 2020-03-27 23:59:37 -07:00
jp9000 8ecfb405ce Revert "win-capture, libobs: Show names of displays in Display Capture"
This reverts commit 9931f22ff4.
2020-03-19 06:43:57 -07:00
jp9000 b3ca1bd059 win-capture: Retry with last known window if first fails
This fixes a bug where games like "Don't Starve Together" wouldn't
capture because their actual render window is a completely different
window than their actual window on the screen.

So, because we already have the hook info by this point with the last
known window handle available, instead of using 0 here, we can just use
the window handle provided by the shared memory.  And we didn't even
have to change the hook!  That's nice.
2020-03-18 07:53:21 -07:00
jpark37 e4e96c5cef libobs-winrt: win-capture: Clean up error handling
Use proper check to fix false positive on 1809, and rework error spew to
remove output parameters from winrt_capture_init.
2020-03-18 00:33:12 -07:00
jp9000 327a6f599e win-capture: Fix potential crash due to unhandled exceptions 2020-03-17 12:22:20 -07:00
Gol-D-Ace d74fc65047 Update translations from Crowdin 2020-03-16 20:14:50 +01:00
jp9000 6209bea371 win-capture: Destroy winrt in graphics thread 2020-03-14 10:54:37 -07:00
jp9000 59351b27ae win-capture/graphics-hook: Separate some debugging stuff
Reduces debugging spam when debugging Vulkan capture is needed in the
hook.
2020-03-13 06:57:16 -07:00
jpark37 9f15514c1a win-capture: Vulkan surface refactor
Make sure HWND tracking is cleaned up when Vulkan surfaces are
destroyed. Also use unbounded linked list to fix games that leak
surfaces on Alt+Tab like Doom.

Also replace CRITICAL_SECTION with SRWLOCK, both for claimed speed
benefit, and to remove initialization code.
2020-03-13 04:36:19 -07:00
jp9000 98c1ac2f80 win-capture/graphics-hook: Add a bit of logging
Just makes sure to be explicit when a device isn't valid.
2020-03-11 02:00:42 -07:00
jpark37 421f97e68d win-capture: Handle vkCreateSwapchainKHR errors
Fixes behavior for an application reported by AMD.
2020-03-10 21:31:40 -07:00
jp9000 f1cb1a42cc win-capture: Try window handle 0 if actual handle fails
Certain UWP programs can't obtain a normal window handle from their API
for whatever reason (this was observed with minecraft win10 edition), so
if the normal window handle on the map fails, try window handle 0
instead.
2020-03-10 07:13:58 -07:00
jp9000 c76426c5bd win-capture: Use full app obj name for keepalive mutex
Ensures that the UWP program can open the keepalive mutex to check to
see whether OBS is still alive.  Fixes a bug where UWP programs wouldn't
capture.
2020-03-10 07:13:58 -07:00
jp9000 428a19edd6 win-capture/graphics-hook: Make vulkan layer all capital 2020-03-09 10:44:04 -07:00
Jim 519b3096aa
Merge pull request #2474 from WizardCM/named-display-monitors
Show friendly monitor names on Display Capture on Windows & Projectors
2020-03-09 06:26:52 -07:00
jp9000 6b7d38adfd win-capture: Increment graphics hook version 2020-03-09 02:51:52 -07:00
jp9000 229f8d37cb win-capture/graphics-hook: Fix reacquire bug
Sometimes the width/height would initially be at 0x0 when the swap chain
was alt-tabbing, causing the capture to fail full-stop when trying to
reacquire.
2020-03-09 02:50:34 -07:00
jp9000 e9b41e5fc5 win-capture: Always copy file when debugging
Helps ensure that the hook can be debugged for things like vulkan
capture.
2020-03-09 02:49:46 -07:00
jp9000 30e3ef3b49 win-capture/graphics-hook: Log vulkan capture dimensions 2020-03-09 02:34:33 -07:00
Matt Gajownik 9931f22ff4 win-capture, libobs: Show names of displays in Display Capture 2020-03-09 11:13:59 +11:00