docs: rebuild Debug API content
This commit is contained in:
@@ -1,32 +1,52 @@
|
||||
# RenderDocCapture::GetCapture
|
||||
|
||||
获取相关状态或对象。
|
||||
读取指定 capture 的元数据。
|
||||
|
||||
```cpp
|
||||
bool GetCapture(uint32_t index, RenderDocCaptureInfo* info) const;
|
||||
```
|
||||
|
||||
该方法声明于 `XCEngine/Debug/RenderDocCapture.h`,当前页面用于固定 `RenderDocCapture` 类目录下的方法级 canonical 路径。
|
||||
## 行为说明
|
||||
|
||||
**参数:**
|
||||
- `index` - 参数语义详见头文件声明。
|
||||
- `info` - 参数语义详见头文件声明。
|
||||
当前实现要求:
|
||||
|
||||
**返回:** `bool` - 返回值语义详见头文件声明。
|
||||
- RenderDoc 已加载。
|
||||
- `info` 非空。
|
||||
|
||||
**示例:**
|
||||
满足条件后,它会调用底层 RenderDoc API,把结果写入 `info->filename`、`info->length` 和 `info->timestamp`。如果底层返回值等于 `1`,则方法返回 `true`。
|
||||
|
||||
注意当前包装层的一个实现细节:
|
||||
|
||||
- `RenderDocCaptureInfo::filename` 是固定 256 字节数组。
|
||||
- XCEngine 直接把这块缓冲区传给 RenderDoc。
|
||||
|
||||
因此调用方不应假设超长路径总能被完整保留。
|
||||
|
||||
## 参数
|
||||
|
||||
- `index` - capture 索引。
|
||||
- `info` - 输出缓冲区,成功时会被填充。
|
||||
|
||||
## 返回值
|
||||
|
||||
- `bool` - `true` 表示成功读取该 capture 的元数据。
|
||||
|
||||
## 线程语义
|
||||
|
||||
- 无显式同步;通常在抓帧结束后的主线程诊断阶段调用。
|
||||
|
||||
## 示例
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Debug/RenderDocCapture.h>
|
||||
using namespace XCEngine::Debug;
|
||||
|
||||
void Example() {
|
||||
XCEngine::Debug::RenderDocCapture object;
|
||||
// 根据上下文补齐参数后调用 RenderDocCapture::GetCapture(...)。
|
||||
(void)object;
|
||||
RenderDocCaptureInfo info{};
|
||||
if (RenderDocCapture::Get().GetCapture(0, &info)) {
|
||||
Logger::Get().Info(LogCategory::RenderDoc, info.filename);
|
||||
}
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [返回类总览](RenderDocCapture.md)
|
||||
- [返回模块目录](../Debug.md)
|
||||
- [返回类型总览](RenderDocCapture.md)
|
||||
- [GetNumCaptures](GetNumCaptures.md)
|
||||
|
||||
Reference in New Issue
Block a user