0

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.)

Tom Sirgedas
  • 3,208
  • 20
  • 17

1 Answers1

0

MSDN does not state this as a mandatory requirement, however still suggests that you don't use the API across mutlithreaded environment:

An application can use IDXGIOutputDuplication on a separate thread to receive the desktop images and to feed them into their specific image-processing pipeline.

That is, it is suggested that you have a single loop aligned with specific thread that captures the updates, and further on you are free to leverage multithreading of sorts to speed up processing.

Roman R.
  • 68,205
  • 6
  • 94
  • 158