Skip to content

Commit

Permalink
Merge branch 'fix-depth-texture-recreated'
Browse files Browse the repository at this point in the history
  • Loading branch information
peppy committed Apr 14, 2023
2 parents 09edef8 + 8db539a commit b485e9c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Veldrid/MTL/MTLSwapchainFramebuffer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public void UpdateTextures(CAMetalDrawable drawable, CGSize size)
_colorTexture = new MTLTexture(drawable, size, _colorFormat);
_colorTargets = new[] { new FramebufferAttachment(_colorTexture, 0) };

if (_depthFormat.HasValue)
if (_depthFormat.HasValue && (size.width != _depthTexture?.Width || size.height != _depthTexture?.Height))
RecreateDepthTexture((uint)size.width, (uint)size.height);
}

Expand Down

0 comments on commit b485e9c

Please sign in to comment.