0

I need to capture frame from application that runs in direct mode into D3D11Texture2D. I was performing that by hooking Present() or Present1() commonly, but now some apps (e.g. SteamVR games, OVR games etc) output frames in direct mode (Nvidia and AMD opened this feature for VR).

Does anyone have any ideas?

  • Maybe you should hook the DX12 device. – VuVirt Apr 06 '17 at 07:52
  • Yes, I tried, but there is no Present1() calls and there is no access to swapchain at all. Direct mode gives interface to handle driver-level output and I don't know how to capture the frame texture. – Svyatoslav Krasnitskiy Apr 06 '17 at 08:42
  • Can you try FRAPS to see if it could capture the frames? If it can then there is a way and I'll try to help you further with it. – VuVirt Apr 06 '17 at 09:41
  • Maybe you should try hooking CreateSwapChainForHwnd and take the swapchain's buffer periodically or also hook other methods like ID3D12Fence Signal or SetEventOnCompletion and take the swapchain's backbuffer inside them. – VuVirt Apr 06 '17 at 09:56
  • You can also hook ID3D12GraphicsCommandList methods, like Close or ResourceBarrier to get the render target from there. – VuVirt Apr 06 '17 at 10:13
  • There is no swapchain access. If app uses Direct Mode, it pushes data directly to frontbuffer, but thanks, I'll try hooking ResourceBarrier. – Svyatoslav Krasnitskiy Apr 06 '17 at 12:01
  • Maybe you need to hook both ResourceBarrier and Close. You can take the render target in the call of ResourceBarrier and then copy the buffer in the call of Close. I'll be curious to know if it works when you test it. – VuVirt Apr 06 '17 at 12:04
  • I handled it. I obtained `ID3D11Device` and `ID3D11Context` and caughts render targets. I explored original process' API calls and discovered lots of variants on *OM* stage. Thank you! – Svyatoslav Krasnitskiy Sep 29 '17 at 13:52

1 Answers1

0

To solve the problem I dove into Output-Merger stage in graphics pipeline. I found that all I need is in render target(s). Multiple render targets are possible to implement multi-buffering.