I want to capture and compress the screen on the GPU. C++ AMP and DXGI Desktop Duplication each work individually, but don't seem to work together.
Example:
This project works great, but adding minimal C++ AMP code near the top of DesktopDuplication.cpp makes it fail:
#include <amp.h>
//void f() { Concurrency::direct3d::create_accelerator_view( nullptr ); }
//void f() { Concurrency::accelerator default_acc; }
void f() { Concurrency::accelerator::get_all(); }
Even though f()
is never called, m_Factory->CreateSwapChainForHwnd(...)
returns E_ACCESSDENIED
. (The commented versions of f()
produce the same result.)
In my own project, IDXGIOutput1::DuplicateOutput()
returns DXGI_ERROR_UNSUPPORTED
when I attempt to use C++ AMP.
What's going on?
Update: In the NVIDIA Control Panel, changing the "Preferred graphics processor" to "Integrated graphics" works. (But, using the NVIDIA card is much preferred.)