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:
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) | 解绑采样器 |
|
||||
|
||||
Reference in New Issue
Block a user