# RHIRenderPass::GetDepthStencilAttachment 获取深度模板附件描述。 ```cpp virtual const AttachmentDesc* GetDepthStencilAttachment() const = 0; ``` 返回渲染通道初始化时配置的深度模板附件描述。如果渲染通道未配置深度模板附件,返回 `nullptr`。 **返回:** `const AttachmentDesc*` - 深度模板附件描述指针,未配置时返回 `nullptr` **线程安全:** ✅ **注意:** - 返回的指针在渲染通道生命周期内有效 - 不要尝试修改返回的描述数据 **示例:** ```cpp const AttachmentDesc* depthStencil = renderPass->GetDepthStencilAttachment(); if (depthStencil != nullptr) { Format format = depthStencil->format; // 处理深度模板配置 } ```