- 修复opengl/下13个文件对overview.md的错误引用,改为opengl.md - 修复opengl/shader/下2处get-native-handle.md的错误路径引用 - 修复rhi.md中rhifactory路径错误 - 修复opengl.md中对d3d12.md的错误引用 - 修复opengl/README.md中的overview.md引用 - 新增RHIFramebuffer完整文档(7个文件) - 新增RHIRenderPass完整文档(7个文件) - 更新rhi.md总览页,添加RHIFramebuffer和RHIRenderPass分类
1.2 KiB
1.2 KiB
RHIRenderPass::Initialize
初始化渲染通道对象。
virtual bool Initialize(
uint32_t colorAttachmentCount,
const AttachmentDesc* colorAttachments,
const AttachmentDesc* depthStencilAttachment
) = 0;
根据指定的附件配置创建并初始化渲染通道对象。
参数:
colorAttachmentCount- 颜色附件数量colorAttachments- 颜色附件描述数组,长度必须等于colorAttachmentCountdepthStencilAttachment- 深度模板附件描述,可为nullptr(如果不需要深度模板)
返回: bool - 初始化成功返回 true,失败返回 false
线程安全: ❌
注意:
colorAttachmentCount必须大于 0- 每个
AttachmentDesc的format必须指定为有效的Format枚举值 - 渲染通道创建后不可修改其配置
示例:
AttachmentDesc colorDesc;
colorDesc.format = Format::RGBA8_UNORM;
colorDesc.loadOp = LoadAction::Clear;
colorDesc.storeOp = StoreAction::Store;
AttachmentDesc depthDesc;
depthDesc.format = Format::D24_UNORM_S8_UINT;
depthDesc.loadOp = LoadAction::Clear;
depthDesc.storeOp = StoreAction::Store;
RHIRenderPass* pass = device->CreateRenderPass(1, &colorDesc, &depthDesc);