I'm using Desktop Duplication to copy the contents of the screen to a bitmap in memory. I receive desktop texture, then create a staging texture, use CopyResource
to copy the Desktop Texture into the Staging Texture, finally call ID3D11DeviceContext::Map
to access the staging texture bits and copy them. Pretty much the same way as described here: https://stackoverflow.com/a/27283837/825318
The problem is that Map
call takes a lot of time - for large display resolutions such as 4K it can take up to a 100ms per call, which is unacceptably high as I need to ensure 30 fps speed.
Is there any way to get the content of the texture faster? If not, is there any way to supply my own mapping address pointer so the system copies the texture data there? Thanks