From 8838b589eccf26ee223be2860f13b6af0257b19a Mon Sep 17 00:00:00 2001 From: vinsentli Date: Mon, 4 Nov 2024 19:15:32 +0800 Subject: [PATCH] LoadAction::Clear --- src/igl/opengl/Framebuffer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/igl/opengl/Framebuffer.cpp b/src/igl/opengl/Framebuffer.cpp index b378cc4b95..e6631e1cc4 100644 --- a/src/igl/opengl/Framebuffer.cpp +++ b/src/igl/opengl/Framebuffer.cpp @@ -879,18 +879,18 @@ void CurrentFramebuffer::bind(const RenderPassDesc& renderPass) const { // clear the buffers if we're not loading previous contents GLbitfield clearMask = 0; - if (renderPass.colorAttachments[0].loadAction != LoadAction::Load) { + if (renderPass.colorAttachments[0].loadAction == LoadAction::Clear) { clearMask |= GL_COLOR_BUFFER_BIT; auto clearColor = renderPass.colorAttachments[0].clearColor; getContext().colorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); getContext().clearColor(clearColor.r, clearColor.g, clearColor.b, clearColor.a); } - if (renderPass.depthAttachment.loadAction != LoadAction::Load) { + if (renderPass.depthAttachment.loadAction == LoadAction::Clear) { clearMask |= GL_DEPTH_BUFFER_BIT; getContext().depthMask(GL_TRUE); getContext().clearDepthf(renderPass.depthAttachment.clearDepth); } - if (renderPass.stencilAttachment.loadAction != LoadAction::Load) { + if (renderPass.stencilAttachment.loadAction == LoadAction::Clear) { clearMask |= GL_STENCIL_BUFFER_BIT; getContext().stencilMask(0xFF); getContext().clearStencil(renderPass.stencilAttachment.clearStencil);