Files
XCEngine/docs/api/rhi/pipeline-layout/pipeline-layout.md
ssdfasd d83ed56177 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
2026-03-22 03:07:41 +08:00

1.7 KiB
Raw Blame History

RHIPipelineLayout

命名空间: XCEngine::RHI

类型: class (abstract)

头文件: XCEngine/RHI/RHIPipelineLayout.h

描述: GPU 渲染管线布局抽象接口,用于定义着色器资源的绑定布局。

概述

RHIPipelineLayout 是 RHIRendering Hardware Interface模块的核心类之一负责描述GPU渲染管线中着色器资源的绑定布局。它定义了管线中使用的常量缓冲区、纹理采样器和无序访问视图的数量和配置。作为抽象基类RHIPipelineLayout 需要由具体的图形API实现如 D3D12、OpenGL提供具体实现。

公共方法

方法 描述
RHIPipelineLayout 默认构造函数
~RHIPipelineLayout 虚析构函数
Initialize 初始化管线布局
Shutdown 关闭并释放资源
GetNativeHandle 获取原生句柄

使用示例

#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;

相关文档