Directx 11 Front Buffer

我们两清 提交于 2019-12-04 16:57:25

You need to use the IDXGISwapChain::GetBuffer API to retrieve a swap chain surface ( use the uuid ID3D11Texture2D for the result type ).

Now, the swap chain buffers are not mapable, so you need to copy it to a staging resource.

  • Use ID3D11Texture2D::GetDesc to retrieve the surface description
  • Patch it with a D3D11_USAGE_STAGING usage and a cpu access flag of D3D11_CPU_ACCESS_READ
  • Create a temporary surface ID3D11Device::CreateTexture2D
  • Copy to the staging surface ID3D11DeviceContext::CopyResource

You now have a ID3D11Texture2D with the content of your swap chain buffer that allow you to use the ID3D11DeviceContext::Map API to read it on the CPU

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!