Files
XCEngine/docs/api/XCEngine/RHI/OpenGL/OpenGLFramebuffer/ClearDepthStencil.md

574 B

OpenGLFramebuffer::ClearDepthStencil()

void ClearDepthStencil(float depth, uint8_t stencil);

作用

同时清除深度和模板缓冲。

当前实现行为

  • 绑定 m_framebuffer
  • 调用 glClearDepth(depth)
  • 调用 glClearStencil(stencil)
  • 最后执行 glClear(GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT)
  • 不恢复旧绑定

设计说明

把深度与模板打包清除是很常见的 FBO 操作,尤其适合与 DepthStencil 附件语义对应。

相关文档