- 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
54 lines
1.7 KiB
Markdown
54 lines
1.7 KiB
Markdown
# RHIPipelineLayout
|
||
|
||
**命名空间**: `XCEngine::RHI`
|
||
|
||
**类型**: `class` (abstract)
|
||
|
||
**头文件**: `XCEngine/RHI/RHIPipelineLayout.h`
|
||
|
||
**描述**: GPU 渲染管线布局抽象接口,用于定义着色器资源的绑定布局。
|
||
|
||
## 概述
|
||
|
||
`RHIPipelineLayout` 是 RHI(Rendering Hardware Interface)模块的核心类之一,负责描述GPU渲染管线中着色器资源的绑定布局。它定义了管线中使用的常量缓冲区、纹理采样器和无序访问视图的数量和配置。作为抽象基类,`RHIPipelineLayout` 需要由具体的图形API实现(如 D3D12、OpenGL)提供具体实现。
|
||
|
||
## 公共方法
|
||
|
||
| 方法 | 描述 |
|
||
|------|------|
|
||
| [`RHIPipelineLayout`](constructor.md) | 默认构造函数 |
|
||
| [`~RHIPipelineLayout`](destructor.md) | 虚析构函数 |
|
||
| [`Initialize`](initialize.md) | 初始化管线布局 |
|
||
| [`Shutdown`](shutdown.md) | 关闭并释放资源 |
|
||
| [`GetNativeHandle`](get-native-handle.md) | 获取原生句柄 |
|
||
|
||
## 使用示例
|
||
|
||
```cpp
|
||
#include <XCEngine/RHI/RHIPipelineLayout.h>
|
||
#include <XCEngine/RHI/RHIDevice.h>
|
||
|
||
// 创建设备后创建管线布局
|
||
RHIPipelineLayoutDesc layoutDesc;
|
||
layoutDesc.constantBufferCount = 2;
|
||
layoutDesc.textureCount = 4;
|
||
layoutDesc.samplerCount = 2;
|
||
layoutDesc.uavCount = 1;
|
||
|
||
RHIPipelineLayout* pipelineLayout = device->CreatePipelineLayout(layoutDesc);
|
||
if (pipelineLayout->Initialize(layoutDesc)) {
|
||
// 管线布局初始化成功
|
||
void* nativeHandle = pipelineLayout->GetNativeHandle();
|
||
|
||
// 使用原生句柄进行绑定...
|
||
|
||
pipelineLayout->Shutdown();
|
||
}
|
||
delete pipelineLayout;
|
||
```
|
||
|
||
## 相关文档
|
||
|
||
- [../rhi.md](../rhi.md) - RHI 模块总览
|
||
- [RHIDevice](../device/device.md) - 创建设备
|