自动化帧捕获
使用自动化帧捕获将对 Intel® GPA 接口的调用直接包括在应用程序中,可自动化捕获帧。这样,您就能够精准捕获所关注的帧,简化调试和分析过程。例如,发生一个特定事件时,您可能希望捕获一个帧,或希望捕获多个帧。
备注
自动化帧捕获不可用于基于 DirectX* 12 的应用程序。
要将自动化帧捕获链接至应用程序:
- 在 Microsoft Visual Studio* 中打开应用程序项目。
- 更新项目Properties如下:
- 在Linker > Input > Additional Dependencies之下,添加sdk.lib。
- 在Linker > General > Additional Library Directories下,添加“C:\Program Files\IntelSWTools\GPA\sdk\lib\x64 or lib\x86”。
- 在C/C++ > General > Additional Include Directories下,添加“C:\Program Files\IntelSWTools\GPA\sdk\include”。
- 在应用程序的源代码中:
- 将 GpaSdk.h 加到源代码中:#include <GPASDK.h>
- 获取 Intel® GPA 接口:IGPA* gpa_interface = GetGPAInterface();
- 希望用帧捕获每个事件之前,将对CaptureFrame函数的调用插入源代码:// If GPA is attachedif (gpa_interface){const char* frame_filename = "Example.gpa_frame"; // You can also use nullptr and the name will be generated automaticallyIGPA::Result capture_result = gpa_interface->CaptureFrame(frame_filename);if (capture_result != IGPA::Result::Ok){// Capture failed}}
- 编译并构建应用程序。
要捕获帧,只需如常从 Graphics Monitor 运行该应用程序。Intel® GPA 按源代码中的指定自动捕获帧。