1.5 KiB
1.5 KiB
RHIDescriptorPool
命名空间: XCEngine::RHI
类型: class (abstract)
头文件: XCEngine/RHI/RHIDescriptorPool.h
描述: GPU 描述符堆池抽象接口,用于管理 GPU 描述符的分配和回收。
概述
RHIDescriptorPool 是 RHI 模块中的抽象类,提供 GPU 描述符堆的统一接口。描述符堆用于存储 GPU 资源视图(如常量缓冲区视图、着色器资源视图、采样器等)。该类管理描述符的分配和回收,支持着色器可见性配置。
公共方法
| 方法 | 描述 |
|---|---|
~RHIDescriptorPool |
虚析构函数 |
Initialize |
初始化描述符池 |
Shutdown |
关闭并释放资源 |
GetNativeHandle |
获取原生句柄 |
GetDescriptorCount |
获取描述符数量 |
GetType |
获取描述符类型 |
使用示例
// 创建描述符池
DescriptorPoolDesc desc;
desc.device = device;
desc.type = DescriptorHeapType::CBV_SRV_UAV;
desc.descriptorCount = 256;
desc.shaderVisible = true;
RHIDescriptorPool* pool = yourFactory->CreateDescriptorPool();
if (pool->Initialize(desc)) {
// 获取描述符数量
uint32_t count = pool->GetDescriptorCount();
// 获取原生句柄
void* handle = pool->GetNativeHandle();
// 使用完后关闭
pool->Shutdown();
}
delete pool;
相关文档
- RHI 模块总览 - RHI 模块总览