fix(rhi): Fix RHI abstraction layer API docs per api-skill.md template
- Rename texture/dtor.md to destructor.md per template spec - Remove duplicate non-hyphenated fence docs (getnativehandle.md, issignaled.md, getcompletedvalue.md) - Fix template field issues: - swap-chain, command-queue: 类型 now uses 'class (abstract)' - sampler: 头文件 now uses full path 'XCEngine/RHI/RHISampler.h' - types: 类型 fixed from 'structs' to 'struct' - enums: 类型 fixed from 'enums' to 'enum class' - Fix include paths in command-queue and pipeline-layout code examples - Create missing constructor/destructor docs for 11 classes: buffer, texture, shader, device, command-list, command-queue, fence, sampler, swap-chain, pipeline-state, pipeline-layout - Update class overview pages to include constructor/destructor entries
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
**命名空间**: `XCEngine::RHI`
|
||||
|
||||
**类型**: `class` (抽象基类)
|
||||
**类型**: `class` (abstract)
|
||||
|
||||
**头文件**: `XCEngine/RHI/RHICommandQueue.h`
|
||||
|
||||
@@ -26,6 +26,8 @@
|
||||
|
||||
| 方法 | 描述 |
|
||||
|------|------|
|
||||
| [`RHICommandQueue`](constructor.md) | 默认构造函数 |
|
||||
| [`~RHICommandQueue`](destructor.md) | 虚析构函数 |
|
||||
| [`Shutdown`](shutdown.md) | 关闭并释放资源 |
|
||||
| [`ExecuteCommandLists`](execute-command-lists.md) | 执行命令列表 |
|
||||
| [`Signal`](signal.md) | 向栅栏发送信号 |
|
||||
@@ -39,10 +41,10 @@
|
||||
## 使用示例
|
||||
|
||||
```cpp
|
||||
#include "RHICommandQueue.h"
|
||||
#include "RHIDevice.h"
|
||||
#include "RHIFence.h"
|
||||
#include "RHICommandList.h"
|
||||
#include <XCEngine/RHI/RHICommandQueue.h>
|
||||
#include <XCEngine/RHI/RHIDevice.h>
|
||||
#include <XCEngine/RHI/RHIFence.h>
|
||||
#include <XCEngine/RHI/RHICommandList.h>
|
||||
|
||||
void RenderLoop(RHIDevice* device, RHICommandQueue* cmdQueue) {
|
||||
CommandQueueDesc queueDesc;
|
||||
|
||||
28
docs/api/rhi/command-queue/constructor.md
Normal file
28
docs/api/rhi/command-queue/constructor.md
Normal file
@@ -0,0 +1,28 @@
|
||||
# RHICommandQueue::RHICommandQueue
|
||||
|
||||
```cpp
|
||||
RHICommandQueue() = default;
|
||||
```
|
||||
|
||||
默认构造函数,创建空的 RHICommandQueue 对象。
|
||||
|
||||
**参数:** 无
|
||||
|
||||
**返回:** 无
|
||||
|
||||
**线程安全:** ✅
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
// 通过设备创建命令队列
|
||||
RHICommandQueue* cmdQueue = device->CreateCommandQueue(desc);
|
||||
// cmdQueue 现在是一个有效的命令队列引用
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [RHICommandQueue 总览](command-queue.md) - 返回类总览
|
||||
- [CreateCommandQueue](../device/create-command-queue.md) - 创建命令队列
|
||||
29
docs/api/rhi/command-queue/destructor.md
Normal file
29
docs/api/rhi/command-queue/destructor.md
Normal file
@@ -0,0 +1,29 @@
|
||||
# RHICommandQueue::~RHICommandQueue
|
||||
|
||||
```cpp
|
||||
virtual ~RHICommandQueue() = default;
|
||||
```
|
||||
|
||||
虚析构函数,确保派生类对象通过基类指针删除时能正确调用析构函数。
|
||||
|
||||
**参数:** 无
|
||||
|
||||
**返回:** 无
|
||||
|
||||
**线程安全:** ✅
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
// 通过基类指针销毁命令队列对象
|
||||
RHICommandQueue* cmdQueue = device->CreateCommandQueue(desc);
|
||||
// ... 使用 cmdQueue ...
|
||||
delete cmdQueue; // 自动调用派生类析构函数
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [RHICommandQueue 总览](command-queue.md) - 返回类总览
|
||||
- [Shutdown](shutdown.md) - 关闭命令队列
|
||||
Reference in New Issue
Block a user