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:
@@ -16,6 +16,8 @@
|
||||
|
||||
| 方法 | 描述 |
|
||||
|------|------|
|
||||
| [`RHIBuffer`](constructor.md) | 默认构造函数 |
|
||||
| [`~RHIBuffer`](destructor.md) | 虚析构函数 |
|
||||
| [`Map`](map.md) | 映射缓冲区到 CPU 可访问内存 |
|
||||
| [`Unmap`](unmap.md) | 取消映射 |
|
||||
| [`SetData`](set-data.md) | 设置缓冲区数据 |
|
||||
|
||||
28
docs/api/rhi/buffer/constructor.md
Normal file
28
docs/api/rhi/buffer/constructor.md
Normal file
@@ -0,0 +1,28 @@
|
||||
# RHIBuffer::RHIBuffer
|
||||
|
||||
```cpp
|
||||
RHIBuffer() = default;
|
||||
```
|
||||
|
||||
默认构造函数,创建空的 RHIBuffer 对象。
|
||||
|
||||
**参数:** 无
|
||||
|
||||
**返回:** 无
|
||||
|
||||
**线程安全:** ✅
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
// 创建空的缓冲区对象
|
||||
RHIBuffer* buffer = device->CreateBuffer(desc);
|
||||
// buffer 现在是一个有效的缓冲区引用
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [RHIBuffer 总览](buffer.md) - 返回类总览
|
||||
- [CreateBuffer](../device/create-buffer.md) - 创建设备
|
||||
29
docs/api/rhi/buffer/destructor.md
Normal file
29
docs/api/rhi/buffer/destructor.md
Normal file
@@ -0,0 +1,29 @@
|
||||
# RHIBuffer::~RHIBuffer
|
||||
|
||||
```cpp
|
||||
virtual ~RHIBuffer() = default;
|
||||
```
|
||||
|
||||
虚析构函数,确保派生类对象通过基类指针删除时能正确调用析构函数。
|
||||
|
||||
**参数:** 无
|
||||
|
||||
**返回:** 无
|
||||
|
||||
**线程安全:** ✅
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
// 通过基类指针销毁缓冲区对象
|
||||
RHIBuffer* buffer = device->CreateBuffer(desc);
|
||||
// ... 使用 buffer ...
|
||||
delete buffer; // 自动调用派生类析构函数
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [RHIBuffer 总览](buffer.md) - 返回类总览
|
||||
- [Shutdown](shutdown.md) - 关闭缓冲区
|
||||
@@ -23,6 +23,8 @@
|
||||
|
||||
| 方法 | 描述 |
|
||||
|------|------|
|
||||
| [`RHICommandList`](constructor.md) | 默认构造函数 |
|
||||
| [`~RHICommandList`](destructor.md) | 虚析构函数 |
|
||||
| [`Shutdown`](shutdown.md) | 关闭命令列表并释放资源 |
|
||||
| [`Reset`](reset.md) | 重置命令列表 |
|
||||
| [`Close`](close.md) | 关闭命令列表 |
|
||||
|
||||
28
docs/api/rhi/command-list/constructor.md
Normal file
28
docs/api/rhi/command-list/constructor.md
Normal file
@@ -0,0 +1,28 @@
|
||||
# RHICommandList::RHICommandList
|
||||
|
||||
```cpp
|
||||
RHICommandList() = default;
|
||||
```
|
||||
|
||||
默认构造函数,创建空的 RHICommandList 对象。
|
||||
|
||||
**参数:** 无
|
||||
|
||||
**返回:** 无
|
||||
|
||||
**线程安全:** ✅
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
// 通过设备创建命令列表
|
||||
RHICommandList* cmdList = device->CreateCommandList(desc);
|
||||
// cmdList 现在是一个有效的命令列表引用
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [RHICommandList 总览](command-list.md) - 返回类总览
|
||||
- [CreateCommandList](../device/create-command-list.md) - 创建命令列表
|
||||
29
docs/api/rhi/command-list/destructor.md
Normal file
29
docs/api/rhi/command-list/destructor.md
Normal file
@@ -0,0 +1,29 @@
|
||||
# RHICommandList::~RHICommandList
|
||||
|
||||
```cpp
|
||||
virtual ~RHICommandList() = default;
|
||||
```
|
||||
|
||||
虚析构函数,确保派生类对象通过基类指针删除时能正确调用析构函数。
|
||||
|
||||
**参数:** 无
|
||||
|
||||
**返回:** 无
|
||||
|
||||
**线程安全:** ✅
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
// 通过基类指针销毁命令列表对象
|
||||
RHICommandList* cmdList = device->CreateCommandList(desc);
|
||||
// ... 使用 cmdList ...
|
||||
delete cmdList; // 自动调用派生类析构函数
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [RHICommandList 总览](command-list.md) - 返回类总览
|
||||
- [Shutdown](shutdown.md) - 关闭命令列表
|
||||
@@ -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) - 关闭命令队列
|
||||
30
docs/api/rhi/device/constructor.md
Normal file
30
docs/api/rhi/device/constructor.md
Normal file
@@ -0,0 +1,30 @@
|
||||
# RHIDevice::RHIDevice
|
||||
|
||||
```cpp
|
||||
RHIDevice() = default;
|
||||
```
|
||||
|
||||
默认构造函数,创建空的 RHIDevice 对象。
|
||||
|
||||
**参数:** 无
|
||||
|
||||
**返回:** 无
|
||||
|
||||
**线程安全:** ✅
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
// 通过工厂创建设备
|
||||
RHIDevice* device = RHIFactory::CreateRHIDevice(RHIType::D3D12);
|
||||
if (device->Initialize(desc)) {
|
||||
// 设备初始化成功
|
||||
}
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [RHIDevice 总览](device.md) - 返回类总览
|
||||
- [RHIFactory](../factory/factory.md) - 设备工厂
|
||||
29
docs/api/rhi/device/destructor.md
Normal file
29
docs/api/rhi/device/destructor.md
Normal file
@@ -0,0 +1,29 @@
|
||||
# RHIDevice::~RHIDevice
|
||||
|
||||
```cpp
|
||||
virtual ~RHIDevice() = default;
|
||||
```
|
||||
|
||||
虚析构函数,确保派生类对象通过基类指针删除时能正确调用析构函数。
|
||||
|
||||
**参数:** 无
|
||||
|
||||
**返回:** 无
|
||||
|
||||
**线程安全:** ✅
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
// 通过基类指针销毁设备对象
|
||||
RHIDevice* device = RHIFactory::CreateRHIDevice(RHIType::D3D12);
|
||||
// ... 使用 device ...
|
||||
delete device; // 自动调用派生类析构函数
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [RHIDevice 总览](device.md) - 返回类总览
|
||||
- [Shutdown](shutdown.md) - 关闭设备
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
| 方法 | 描述 |
|
||||
|------|------|
|
||||
| [`RHIDevice`](constructor.md) | 默认构造函数 |
|
||||
| [`~RHIDevice`](destructor.md) | 虚析构函数 |
|
||||
| [`Initialize`](initialize.md) | 初始化设备 |
|
||||
| [`Shutdown`](shutdown.md) | 关闭设备 |
|
||||
| [`CreateBuffer`](create-buffer.md) | 创建缓冲区 |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
**命名空间**: `XCEngine::RHI`
|
||||
|
||||
**类型**: `enums`
|
||||
**类型**: `enum class`
|
||||
|
||||
**头文件**: `XCEngine/RHI/RHIEnums.h`
|
||||
|
||||
|
||||
29
docs/api/rhi/factory/destructor.md
Normal file
29
docs/api/rhi/factory/destructor.md
Normal file
@@ -0,0 +1,29 @@
|
||||
# RHIFactory::~RHIFactory
|
||||
|
||||
```cpp
|
||||
virtual ~RHIFactory() = default;
|
||||
```
|
||||
|
||||
虚析构函数,确保派生类对象通过基类指针删除时能正确调用析构函数。
|
||||
|
||||
**参数:** 无
|
||||
|
||||
**返回:** 无
|
||||
|
||||
**线程安全:** ✅
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
// RHIFactory 是静态工厂类,通常不需要直接销毁
|
||||
// 但如果存在派生类,可以通过基类指针删除
|
||||
RHIFactory* factory = /* 某些情况下获取的派生类实例 */;
|
||||
delete factory; // 正确调用析构函数
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [RHIFactory 总览](factory.md) - 返回类总览
|
||||
- [CreateRHIDevice](create-rhi-device-type.md) - 创建设备
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
| 方法 | 描述 |
|
||||
|------|------|
|
||||
| [`~RHIFactory`](destructor.md) | 虚析构函数 |
|
||||
| [`CreateRHIDevice(RHIType)`](create-rhi-device-type.md) | 使用枚举类型创建 RHI 设备 |
|
||||
| [`CreateRHIDevice(std::string)`](create-rhi-device-string.md) | 使用字符串创建 RHI 设备 |
|
||||
|
||||
|
||||
28
docs/api/rhi/fence/constructor.md
Normal file
28
docs/api/rhi/fence/constructor.md
Normal file
@@ -0,0 +1,28 @@
|
||||
# RHIFence::RHIFence
|
||||
|
||||
```cpp
|
||||
RHIFence() = default;
|
||||
```
|
||||
|
||||
默认构造函数,创建空的 RHIFence 对象。
|
||||
|
||||
**参数:** 无
|
||||
|
||||
**返回:** 无
|
||||
|
||||
**线程安全:** ✅
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
// 通过设备创建围栏
|
||||
RHIFence* fence = device->CreateFence(desc);
|
||||
// fence 现在是一个有效的围栏引用
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [RHIFence 总览](fence.md) - 返回类总览
|
||||
- [CreateFence](../device/create-fence.md) - 创建围栏
|
||||
29
docs/api/rhi/fence/destructor.md
Normal file
29
docs/api/rhi/fence/destructor.md
Normal file
@@ -0,0 +1,29 @@
|
||||
# RHIFence::~RHIFence
|
||||
|
||||
```cpp
|
||||
virtual ~RHIFence() = default;
|
||||
```
|
||||
|
||||
虚析构函数,确保派生类对象通过基类指针删除时能正确调用析构函数。
|
||||
|
||||
**参数:** 无
|
||||
|
||||
**返回:** 无
|
||||
|
||||
**线程安全:** ✅
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
// 通过基类指针销毁围栏对象
|
||||
RHIFence* fence = device->CreateFence(desc);
|
||||
// ... 使用 fence ...
|
||||
delete fence; // 自动调用派生类析构函数
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [RHIFence 总览](fence.md) - 返回类总览
|
||||
- [Shutdown](shutdown.md) - 关闭围栏
|
||||
@@ -18,13 +18,15 @@ RHIFence 是 RHI(Render Hardware Interface)子系统中的围栏抽象接口
|
||||
|
||||
| 方法 | 描述 |
|
||||
|------|------|
|
||||
| [`RHIFence`](constructor.md) | 默认构造函数 |
|
||||
| [`~RHIFence`](destructor.md) | 虚析构函数 |
|
||||
| [`Shutdown`](shutdown.md) | 关闭围栏并释放资源 |
|
||||
| [`Signal`](signal.md) | 发送信号(无参数版本) |
|
||||
| [`Signal`](signal-value.md) | 发送信号(带值版本) |
|
||||
| [`Wait`](wait.md) | 等待围栏达到指定值 |
|
||||
| [`GetCompletedValue`](getcompletedvalue.md) | 获取已完成的值 |
|
||||
| [`IsSignaled`](issignaled.md) | 检查围栏是否已发出信号 |
|
||||
| [`GetNativeHandle`](getnativehandle.md) | 获取原生句柄 |
|
||||
| [`GetCompletedValue`](get-completed-value.md) | 获取已完成的值 |
|
||||
| [`IsSignaled`](is-signaled.md) | 检查围栏是否已发出信号 |
|
||||
| [`GetNativeHandle`](get-native-handle.md) | 获取原生句柄 |
|
||||
|
||||
## 使用示例
|
||||
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
# RHIFence::GetCompletedValue
|
||||
|
||||
```cpp
|
||||
virtual uint64_t GetCompletedValue() const = 0;
|
||||
```
|
||||
|
||||
获取围栏已完成的最大值。该值表示 GPU 已完成的所有信号操作中的最高值。
|
||||
|
||||
**参数:** 无
|
||||
|
||||
**返回:** 已完成的围栏值(`uint64_t`)
|
||||
|
||||
**线程安全**:✅
|
||||
|
||||
**复杂度**:O(1)
|
||||
|
||||
**示例**:
|
||||
|
||||
```cpp
|
||||
RHIFence* fence = device->CreateFence();
|
||||
|
||||
fence->Signal(100ULL);
|
||||
|
||||
uint64_t completed = fence->GetCompletedValue();
|
||||
// completed >= 100 表示 GPU 已完成该信号
|
||||
|
||||
if (completed >= 100) {
|
||||
// GPU 已完成 100 之前的所有工作
|
||||
}
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [RHIFence](fence.md) - 返回类总览
|
||||
@@ -1,32 +0,0 @@
|
||||
# RHIFence::GetNativeHandle
|
||||
|
||||
```cpp
|
||||
virtual void* GetNativeHandle() = 0;
|
||||
```
|
||||
|
||||
获取围栏的原生句柄,用于平台特定的图形 API 操作。返回的句柄类型取决于具体的 RHI 实现:
|
||||
- DirectX 12:`ID3D12Fence*`
|
||||
- Vulkan:`VkFence`
|
||||
|
||||
**参数:** 无
|
||||
|
||||
**返回:** 原生句柄指针(`void*`)
|
||||
|
||||
**线程安全**:❌
|
||||
|
||||
**复杂度**:O(1)
|
||||
|
||||
**示例**:
|
||||
|
||||
```cpp
|
||||
RHIFence* fence = device->CreateFence();
|
||||
|
||||
void* nativeHandle = fence->GetNativeHandle();
|
||||
|
||||
// 平台特定用法示例(DirectX 12)
|
||||
// ID3D12Fence* dxFence = static_cast<ID3D12Fence*>(nativeHandle);
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [RHIFence](fence.md) - 返回类总览
|
||||
@@ -1,35 +0,0 @@
|
||||
# RHIFence::IsSignaled
|
||||
|
||||
```cpp
|
||||
virtual bool IsSignaled() const = 0;
|
||||
```
|
||||
|
||||
检查围栏是否已发出信号。如果返回 `true`,表示围栏的当前值已达到或超过其初始信号值。
|
||||
|
||||
**参数:** 无
|
||||
|
||||
**返回:** 如果围栏已发出信号返回 `true`,否则返回 `false`
|
||||
|
||||
**线程安全**:✅
|
||||
|
||||
**复杂度**:O(1)
|
||||
|
||||
**示例**:
|
||||
|
||||
```cpp
|
||||
RHIFence* fence = device->CreateFence();
|
||||
|
||||
fence->Signal();
|
||||
|
||||
// 非阻塞检查围栏状态
|
||||
while (!fence->IsSignaled()) {
|
||||
// 执行其他任务或短暂等待
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(1));
|
||||
}
|
||||
|
||||
// 围栏已发出信号,继续处理
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [RHIFence](fence.md) - 返回类总览
|
||||
27
docs/api/rhi/pipeline-layout/constructor.md
Normal file
27
docs/api/rhi/pipeline-layout/constructor.md
Normal file
@@ -0,0 +1,27 @@
|
||||
# RHIPipelineLayout::RHIPipelineLayout
|
||||
|
||||
```cpp
|
||||
RHIPipelineLayout() = default;
|
||||
```
|
||||
|
||||
默认构造函数,创建空的 RHIPipelineLayout 对象。
|
||||
|
||||
**参数:** 无
|
||||
|
||||
**返回:** 无
|
||||
|
||||
**线程安全:** ✅
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
// 通过设备创建管线布局
|
||||
RHIPipelineLayout* layout = device->CreatePipelineLayout(desc);
|
||||
// layout 现在是一个有效的管线布局引用
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [RHIPipelineLayout 总览](pipeline-layout.md) - 返回类总览
|
||||
29
docs/api/rhi/pipeline-layout/destructor.md
Normal file
29
docs/api/rhi/pipeline-layout/destructor.md
Normal file
@@ -0,0 +1,29 @@
|
||||
# RHIPipelineLayout::~RHIPipelineLayout
|
||||
|
||||
```cpp
|
||||
virtual ~RHIPipelineLayout() = default;
|
||||
```
|
||||
|
||||
虚析构函数,确保派生类对象通过基类指针删除时能正确调用析构函数。
|
||||
|
||||
**参数:** 无
|
||||
|
||||
**返回:** 无
|
||||
|
||||
**线程安全:** ✅
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
// 通过基类指针销毁管线布局对象
|
||||
RHIPipelineLayout* layout = device->CreatePipelineLayout(desc);
|
||||
// ... 使用 layout ...
|
||||
delete layout; // 自动调用派生类析构函数
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [RHIPipelineLayout 总览](pipeline-layout.md) - 返回类总览
|
||||
- [Shutdown](shutdown.md) - 关闭管线布局
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
| 方法 | 描述 |
|
||||
|------|------|
|
||||
| [`RHIPipelineLayout`](constructor.md) | 默认构造函数 |
|
||||
| [`~RHIPipelineLayout`](destructor.md) | 虚析构函数 |
|
||||
| [`Initialize`](initialize.md) | 初始化管线布局 |
|
||||
| [`Shutdown`](shutdown.md) | 关闭并释放资源 |
|
||||
| [`GetNativeHandle`](get-native-handle.md) | 获取原生句柄 |
|
||||
@@ -23,8 +25,8 @@
|
||||
## 使用示例
|
||||
|
||||
```cpp
|
||||
#include "RHI/RHIPipelineLayout.h"
|
||||
#include "RHI/RHIDevice.h"
|
||||
#include <XCEngine/RHI/RHIPipelineLayout.h>
|
||||
#include <XCEngine/RHI/RHIDevice.h>
|
||||
|
||||
// 创建设备后创建管线布局
|
||||
RHIPipelineLayoutDesc layoutDesc;
|
||||
|
||||
28
docs/api/rhi/pipeline-state/constructor.md
Normal file
28
docs/api/rhi/pipeline-state/constructor.md
Normal file
@@ -0,0 +1,28 @@
|
||||
# RHIPipelineState::RHIPipelineState
|
||||
|
||||
```cpp
|
||||
RHIPipelineState() = default;
|
||||
```
|
||||
|
||||
默认构造函数,创建空的 RHIPipelineState 对象。
|
||||
|
||||
**参数:** 无
|
||||
|
||||
**返回:** 无
|
||||
|
||||
**线程安全:** ✅
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
// 通过设备创建管线状态
|
||||
RHIPipelineState* pipelineState = device->CreatePipelineState(desc);
|
||||
// pipelineState 现在是一个有效的管线状态引用
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [RHIPipelineState 总览](pipeline-state.md) - 返回类总览
|
||||
- [CreatePipelineState](../device/create-pipeline-state.md) - 创建管线状态
|
||||
29
docs/api/rhi/pipeline-state/destructor.md
Normal file
29
docs/api/rhi/pipeline-state/destructor.md
Normal file
@@ -0,0 +1,29 @@
|
||||
# RHIPipelineState::~RHIPipelineState
|
||||
|
||||
```cpp
|
||||
virtual ~RHIPipelineState() = default;
|
||||
```
|
||||
|
||||
虚析构函数,确保派生类对象通过基类指针删除时能正确调用析构函数。
|
||||
|
||||
**参数:** 无
|
||||
|
||||
**返回:** 无
|
||||
|
||||
**线程安全:** ✅
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
// 通过基类指针销毁管线状态对象
|
||||
RHIPipelineState* pipelineState = device->CreatePipelineState(desc);
|
||||
// ... 使用 pipelineState ...
|
||||
delete pipelineState; // 自动调用派生类析构函数
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [RHIPipelineState 总览](pipeline-state.md) - 返回类总览
|
||||
- [Shutdown](shutdown.md) - 关闭管线状态
|
||||
@@ -21,6 +21,8 @@
|
||||
|
||||
| 方法 | 描述 |
|
||||
|------|------|
|
||||
| [`RHIPipelineState`](constructor.md) | 默认构造函数 |
|
||||
| [`~RHIPipelineState`](destructor.md) | 虚析构函数 |
|
||||
| [`Shutdown`](shutdown.md) | 关闭并释放管线状态资源 |
|
||||
| [`Bind`](bind.md) | 将管线状态绑定到渲染上下文 |
|
||||
| [`Unbind`](unbind.md) | 将管线状态从渲染上下文解绑 |
|
||||
|
||||
28
docs/api/rhi/sampler/constructor.md
Normal file
28
docs/api/rhi/sampler/constructor.md
Normal file
@@ -0,0 +1,28 @@
|
||||
# RHISampler::RHISampler
|
||||
|
||||
```cpp
|
||||
RHISampler() = default;
|
||||
```
|
||||
|
||||
默认构造函数,创建空的 RHISampler 对象。
|
||||
|
||||
**参数:** 无
|
||||
|
||||
**返回:** 无
|
||||
|
||||
**线程安全:** ✅
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
// 通过设备创建采样器
|
||||
RHISampler* sampler = device->CreateSampler(desc);
|
||||
// sampler 现在是一个有效的采样器引用
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [RHISampler 总览](sampler.md) - 返回类总览
|
||||
- [CreateSampler](../device/create-sampler.md) - 创建采样器
|
||||
29
docs/api/rhi/sampler/destructor.md
Normal file
29
docs/api/rhi/sampler/destructor.md
Normal file
@@ -0,0 +1,29 @@
|
||||
# RHISampler::~RHISampler
|
||||
|
||||
```cpp
|
||||
virtual ~RHISampler() = default;
|
||||
```
|
||||
|
||||
虚析构函数,确保派生类对象通过基类指针删除时能正确调用析构函数。
|
||||
|
||||
**参数:** 无
|
||||
|
||||
**返回:** 无
|
||||
|
||||
**线程安全:** ✅
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
// 通过基类指针销毁采样器对象
|
||||
RHISampler* sampler = device->CreateSampler(desc);
|
||||
// ... 使用 sampler ...
|
||||
delete sampler; // 自动调用派生类析构函数
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [RHISampler 总览](sampler.md) - 返回类总览
|
||||
- [Shutdown](shutdown.md) - 关闭采样器
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
**类型**: `class` (abstract)
|
||||
|
||||
**头文件**: `RHISampler.h`
|
||||
**头文件**: `XCEngine/RHI/RHISampler.h`
|
||||
|
||||
**描述**: GPU 纹理采样器抽象接口,用于配置纹理过滤和寻址模式。采样器定义了如何对纹理进行采样,包括过滤模式、寻址模式和各向异性级别等参数。
|
||||
|
||||
@@ -21,6 +21,8 @@
|
||||
|
||||
| 方法 | 描述 |
|
||||
|------|------|
|
||||
| [`RHISampler`](constructor.md) | 默认构造函数 |
|
||||
| [`~RHISampler`](destructor.md) | 虚析构函数 |
|
||||
| [`Shutdown`](shutdown.md) | 关闭并释放资源 |
|
||||
| [`Bind`](bind.md) | 绑定采样器到纹理单元 |
|
||||
| [`Unbind`](unbind.md) | 解绑采样器 |
|
||||
|
||||
30
docs/api/rhi/shader/constructor.md
Normal file
30
docs/api/rhi/shader/constructor.md
Normal file
@@ -0,0 +1,30 @@
|
||||
# RHIShader::RHIShader
|
||||
|
||||
```cpp
|
||||
RHIShader() = default;
|
||||
```
|
||||
|
||||
默认构造函数,创建空的 RHIShader 对象。
|
||||
|
||||
**参数:** 无
|
||||
|
||||
**返回:** 无
|
||||
|
||||
**线程安全:** ✅
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
// 通过设备编译着色器
|
||||
RHIShader* shader = device->CompileShader(desc);
|
||||
if (shader && shader->IsValid()) {
|
||||
shader->Bind();
|
||||
}
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [RHIShader 总览](shader.md) - 返回类总览
|
||||
- [CompileShader](../device/compile-shader.md) - 编译着色器
|
||||
29
docs/api/rhi/shader/destructor.md
Normal file
29
docs/api/rhi/shader/destructor.md
Normal file
@@ -0,0 +1,29 @@
|
||||
# RHIShader::~RHIShader
|
||||
|
||||
```cpp
|
||||
virtual ~RHIShader() = default;
|
||||
```
|
||||
|
||||
虚析构函数,确保派生类对象通过基类指针删除时能正确调用析构函数。
|
||||
|
||||
**参数:** 无
|
||||
|
||||
**返回:** 无
|
||||
|
||||
**线程安全:** ✅
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
// 通过基类指针销毁着色器对象
|
||||
RHIShader* shader = device->CompileShader(desc);
|
||||
// ... 使用 shader ...
|
||||
delete shader; // 自动调用派生类析构函数
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [RHIShader 总览](shader.md) - 返回类总览
|
||||
- [Shutdown](shutdown.md) - 关闭着色器
|
||||
@@ -21,6 +21,8 @@
|
||||
|
||||
| 方法 | 描述 |
|
||||
|------|------|
|
||||
| [`RHIShader`](constructor.md) | 默认构造函数 |
|
||||
| [`~RHIShader`](destructor.md) | 虚析构函数 |
|
||||
| [`CompileFromFile`](compile-from-file.md) | 从文件编译着色器 |
|
||||
| [`Compile`](compile.md) | 从内存数据编译着色器 |
|
||||
| [`GetType`](get-type.md) | 获取着色器类型 |
|
||||
|
||||
28
docs/api/rhi/swap-chain/constructor.md
Normal file
28
docs/api/rhi/swap-chain/constructor.md
Normal file
@@ -0,0 +1,28 @@
|
||||
# RHISwapChain::RHISwapChain
|
||||
|
||||
```cpp
|
||||
RHISwapChain() = default;
|
||||
```
|
||||
|
||||
默认构造函数,创建空的 RHISwapChain 对象。
|
||||
|
||||
**参数:** 无
|
||||
|
||||
**返回:** 无
|
||||
|
||||
**线程安全:** ✅
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
// 通过设备创建交换链
|
||||
RHISwapChain* swapChain = device->CreateSwapChain(desc);
|
||||
// swapChain 现在是一个有效的交换链引用
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [RHISwapChain 总览](swap-chain.md) - 返回类总览
|
||||
- [CreateSwapChain](../device/create-swap-chain.md) - 创建交换链
|
||||
29
docs/api/rhi/swap-chain/destructor.md
Normal file
29
docs/api/rhi/swap-chain/destructor.md
Normal file
@@ -0,0 +1,29 @@
|
||||
# RHISwapChain::~RHISwapChain
|
||||
|
||||
```cpp
|
||||
virtual ~RHISwapChain() = default;
|
||||
```
|
||||
|
||||
虚析构函数,确保派生类对象通过基类指针删除时能正确调用析构函数。
|
||||
|
||||
**参数:** 无
|
||||
|
||||
**返回:** 无
|
||||
|
||||
**线程安全:** ✅
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
// 通过基类指针销毁交换链对象
|
||||
RHISwapChain* swapChain = device->CreateSwapChain(desc);
|
||||
// ... 使用 swapChain ...
|
||||
delete swapChain; // 自动调用派生类析构函数
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [RHISwapChain 总览](swap-chain.md) - 返回类总览
|
||||
- [Shutdown](shutdown.md) - 关闭交换链
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
**命名空间**: `XCEngine::RHI`
|
||||
|
||||
**类型**: `class` (抽象基类)
|
||||
**类型**: `class` (abstract)
|
||||
|
||||
**头文件**: `XCEngine/RHI/RHISwapChain.h`
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
|
||||
| 方法 | 描述 |
|
||||
|------|------|
|
||||
| [`RHISwapChain`](constructor.md) | 默认构造函数 |
|
||||
| [`~RHISwapChain`](destructor.md) | 虚析构函数 |
|
||||
| [`Shutdown`](shutdown.md) | 关闭并释放资源 |
|
||||
| [`GetCurrentBackBufferIndex`](get-current-back-buffer-index.md) | 获取当前后台缓冲区索引 |
|
||||
| [`GetCurrentBackBuffer`](get-current-back-buffer.md) | 获取当前后台缓冲区 |
|
||||
|
||||
28
docs/api/rhi/texture/constructor.md
Normal file
28
docs/api/rhi/texture/constructor.md
Normal file
@@ -0,0 +1,28 @@
|
||||
# RHITexture::RHITexture
|
||||
|
||||
```cpp
|
||||
RHITexture() = default;
|
||||
```
|
||||
|
||||
默认构造函数,创建空的 RHITexture 对象。
|
||||
|
||||
**参数:** 无
|
||||
|
||||
**返回:** 无
|
||||
|
||||
**线程安全:** ✅
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
// 创建空的纹理对象
|
||||
RHITexture* texture = device->CreateTexture(desc);
|
||||
// texture 现在是一个有效的纹理引用
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [RHITexture 总览](texture.md) - 返回类总览
|
||||
- [CreateTexture](../device/create-texture.md) - 创建纹理
|
||||
@@ -16,7 +16,8 @@
|
||||
|
||||
| 方法 | 描述 |
|
||||
|------|------|
|
||||
| [`~RHITexture`](dtor.md) | 虚析构函数 |
|
||||
| [`RHITexture`](constructor.md) | 默认构造函数 |
|
||||
| [`~RHITexture`](destructor.md) | 虚析构函数 |
|
||||
| [`GetWidth`](get-width.md) | 获取纹理宽度 |
|
||||
| [`GetHeight`](get-height.md) | 获取纹理高度 |
|
||||
| [`GetDepth`](get-depth.md) | 获取纹理深度 |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
**命名空间**: `XCEngine::RHI`
|
||||
|
||||
**类型**: `structs`
|
||||
**类型**: `struct`
|
||||
|
||||
**头文件**: `XCEngine/RHI/RHITypes.h`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user