docs: update RHI API docs
This commit is contained in:
45
docs/api/rhi/descriptor-pool/initialize.md
Normal file
45
docs/api/rhi/descriptor-pool/initialize.md
Normal file
@@ -0,0 +1,45 @@
|
||||
# RHIDescriptorPool::Initialize
|
||||
|
||||
初始化描述符池。
|
||||
|
||||
## 方法签名
|
||||
|
||||
```cpp
|
||||
virtual bool Initialize(const DescriptorPoolDesc& desc) = 0;
|
||||
```
|
||||
|
||||
## 详细描述
|
||||
|
||||
使用指定的描述符池描述初始化描述符池。分配 GPU 描述符堆资源,使其可以分配描述符。
|
||||
|
||||
## 参数列表
|
||||
|
||||
| 参数 | 类型 | 描述 |
|
||||
|------|------|------|
|
||||
| `desc` | `const DescriptorPoolDesc&` | 描述符池配置,包含设备指针、堆类型、描述符数量和着色器可见性 |
|
||||
|
||||
## 返回值
|
||||
|
||||
`bool` - 初始化成功返回 `true`,失败返回 `false`
|
||||
|
||||
## 示例代码
|
||||
|
||||
```cpp
|
||||
DescriptorPoolDesc desc;
|
||||
desc.device = device;
|
||||
desc.type = DescriptorHeapType::CBV_SRV_UAV;
|
||||
desc.descriptorCount = 256;
|
||||
desc.shaderVisible = true;
|
||||
|
||||
if (descriptorPool->Initialize(desc)) {
|
||||
// 初始化成功
|
||||
} else {
|
||||
// 初始化失败
|
||||
}
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [RHIDescriptorPool 总览](descriptor-pool.md) - 返回类总览
|
||||
- [Shutdown](shutdown.md) - 关闭描述符池
|
||||
- [GetDescriptorCount](get-descriptor-count.md) - 获取描述符数量
|
||||
Reference in New Issue
Block a user