Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 执行时间:GetFrontBufferData、GetBackBuffer、GetRenderTargetData_C++_Windows_Winapi_Directx 9 - Fatal编程技术网

C++ 执行时间:GetFrontBufferData、GetBackBuffer、GetRenderTargetData

C++ 执行时间:GetFrontBufferData、GetBackBuffer、GetRenderTargetData,c++,windows,winapi,directx-9,C++,Windows,Winapi,Directx 9,我正在尝试几种使用DirectX捕获屏幕的方法,到目前为止,我已经想出了3种方法: -平均执行时间: GetFrontBufferData():0.83598 s D3DXSaveSurfaceToFile():0.0036 s 总数:0.83958秒 -平均执行时间: GetBackBuffer():0 s您所指的过程称为“readback”,它涉及将数据从GPU视频RAM复制回来。除了一些特定的统一内存体系结构(如Xbox 360),回读是一个缓慢的过程 根据您的操作系统和其他设置,

我正在尝试几种使用DirectX捕获屏幕的方法,到目前为止,我已经想出了3种方法:

  • -平均执行时间:
    • GetFrontBufferData()
      :0.83598 s
    • D3DXSaveSurfaceToFile()
      :0.0036 s
    • 总数:0.83958秒
  • -平均执行时间:

    • GetBackBuffer()
      :0 s您所指的过程称为“readback”,它涉及将数据从GPU视频RAM复制回来。除了一些特定的统一内存体系结构(如Xbox 360),回读是一个缓慢的过程

      根据您的操作系统和其他设置,前缓冲区和后缓冲区可能都只是VRAM中的“屏幕外”纹理。当您停止渲染以捕获屏幕快照时,还涉及各种锁和GPU管道暂停

      你可能会发现这个(现在相当古老)很有用


      请注意,Direct3D 10/11提供了许多功能,主要是通过允许算法将数据保留在GPU上来克服GPU“回读”的固有缓慢性。

      GetBackBuffer的快速运行可能是因为它不传输任何数据,它只给你一个指向后台缓冲区接口的指针。是的,这可能就是原因。那么
      D3DXSaveSurfaceToFile()
      处理“锁”(或其他)部分?没有人能回答其他问题?