916 B
916 B
OpenGLRenderPass::GetDepthStencilAttachment
const AttachmentDesc* GetDepthStencilAttachment() const override;
作用
返回深度/模板附件的描述信息。
返回值
- 如果初始化时提供了
depthStencilAttachment,返回内部保存对象的地址。 - 如果没有深度/模板附件,返回
nullptr。
当前实现行为
- 返回值受
m_hasDepthStencil控制,而不是根据格式字段动态推断。 Initialize()会复制一份AttachmentDesc,因此不依赖外部描述结构体的存活时间。Shutdown()会把m_hasDepthStencil复位为false,之后该方法重新返回nullptr。
使用建议
- 使用前应始终判空。
- 当前 OpenGL 后端主要把这里的
loadOp/stencilLoadOp用于BeginRenderPass()的清除逻辑。