53 lines
1.2 KiB
Markdown
53 lines
1.2 KiB
Markdown
# RenderDocCapture::GetCapture
|
||
|
||
读取指定 capture 的元数据。
|
||
|
||
```cpp
|
||
bool GetCapture(uint32_t index, RenderDocCaptureInfo* info) const;
|
||
```
|
||
|
||
## 行为说明
|
||
|
||
当前实现要求:
|
||
|
||
- RenderDoc 已加载。
|
||
- `info` 非空。
|
||
|
||
满足条件后,它会调用底层 RenderDoc API,把结果写入 `info->filename`、`info->length` 和 `info->timestamp`。如果底层返回值等于 `1`,则方法返回 `true`。
|
||
|
||
注意当前包装层的一个实现细节:
|
||
|
||
- `RenderDocCaptureInfo::filename` 是固定 256 字节数组。
|
||
- XCEngine 直接把这块缓冲区传给 RenderDoc。
|
||
|
||
因此调用方不应假设超长路径总能被完整保留。
|
||
|
||
## 参数
|
||
|
||
- `index` - capture 索引。
|
||
- `info` - 输出缓冲区,成功时会被填充。
|
||
|
||
## 返回值
|
||
|
||
- `bool` - `true` 表示成功读取该 capture 的元数据。
|
||
|
||
## 线程语义
|
||
|
||
- 无显式同步;通常在抓帧结束后的主线程诊断阶段调用。
|
||
|
||
## 示例
|
||
|
||
```cpp
|
||
using namespace XCEngine::Debug;
|
||
|
||
RenderDocCaptureInfo info{};
|
||
if (RenderDocCapture::Get().GetCapture(0, &info)) {
|
||
Logger::Get().Info(LogCategory::RenderDoc, info.filename);
|
||
}
|
||
```
|
||
|
||
## 相关文档
|
||
|
||
- [返回类型总览](RenderDocCapture.md)
|
||
- [GetNumCaptures](GetNumCaptures.md)
|