mirror of
https://github.com/love2d/love.git
synced 2026-08-17 19:23:38 +02:00
metal: fix backbuffer discarding its contents in some situations.
fixes #1975.
This commit is contained in:
@@ -1459,10 +1459,15 @@ void Graphics::setRenderTargetsInternal(const RenderTargets &rts, int /*pixelw*/
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (size_t i = rts.colors.size(); i < MAX_COLOR_RENDER_TARGETS; i++)
|
for (size_t i = rts.colors.size(); i < MAX_COLOR_RENDER_TARGETS; i++)
|
||||||
|
{
|
||||||
passDesc.colorAttachments[i] = nil;
|
passDesc.colorAttachments[i] = nil;
|
||||||
|
passDesc.colorAttachments[i].loadAction = MTLLoadActionLoad;
|
||||||
|
}
|
||||||
|
|
||||||
passDesc.depthAttachment = nil;
|
passDesc.depthAttachment = nil;
|
||||||
|
passDesc.depthAttachment.loadAction = MTLLoadActionLoad;
|
||||||
passDesc.stencilAttachment = nil;
|
passDesc.stencilAttachment = nil;
|
||||||
|
passDesc.stencilAttachment.loadAction = MTLLoadActionLoad;
|
||||||
|
|
||||||
auto ds = rts.depthStencil.texture;
|
auto ds = rts.depthStencil.texture;
|
||||||
if (isbackbuffer && ds == nullptr)
|
if (isbackbuffer && ds == nullptr)
|
||||||
|
|||||||
Reference in New Issue
Block a user