Skip to content

Commit

Permalink
[Fix] Framebuffer clear flags on the Layer were not correctly used (#…
Browse files Browse the repository at this point in the history
…5875)

Co-authored-by: Martin Valigursky <mvaligursky@snapchat.com>
  • Loading branch information
mvaligursky and Martin Valigursky authored Dec 1, 2023
1 parent e89835a commit 993fc6f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/scene/composition/layer-composition.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,9 +314,10 @@ class LayerComposition extends EventHandler {

// clear flags - use camera clear flags in the first render action for each camera,
// or when render target (from layer) was not yet cleared by this camera
const needsClear = cameraFirstRenderAction || !used;
if (needsClear) {
renderAction.setupClears(needsClear ? camera : undefined, layer);
const needsCameraClear = cameraFirstRenderAction || !used;
const needsLayerClear = layer.clearColorBuffer || layer.clearDepthBuffer || layer.clearStencilBuffer;
if (needsCameraClear || needsLayerClear) {
renderAction.setupClears(needsCameraClear ? camera : undefined, layer);
}

return renderAction;
Expand Down

0 comments on commit 993fc6f

Please sign in to comment.