mirror of
https://github.com/love2d/love.git
synced 2026-08-19 12:14:20 +02:00
metal: partial implementation of love.graphics.discard
This commit is contained in:
@@ -1341,7 +1341,25 @@ void Graphics::clear(const std::vector<OptionalColorD> &colors, OptionalInt sten
|
|||||||
void Graphics::discard(const std::vector<bool> &colorbuffers, bool depthstencil)
|
void Graphics::discard(const std::vector<bool> &colorbuffers, bool depthstencil)
|
||||||
{
|
{
|
||||||
flushBatchedDraws();
|
flushBatchedDraws();
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
|
if (renderEncoder != nil)
|
||||||
|
return;
|
||||||
|
|
||||||
|
size_t maxcolor = isRenderTargetActive() ? states.back().renderTargets.colors.size() : 1;
|
||||||
|
size_t ncolor = std::min(maxcolor, colorbuffers.size());
|
||||||
|
|
||||||
|
for (size_t i = 0; i < ncolor; i++)
|
||||||
|
{
|
||||||
|
if (colorbuffers[i])
|
||||||
|
passDesc.colorAttachments[i].loadAction = MTLLoadActionDontCare;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (depthstencil)
|
||||||
|
{
|
||||||
|
passDesc.stencilAttachment.loadAction = MTLLoadActionDontCare;
|
||||||
|
passDesc.depthAttachment.loadAction = MTLLoadActionDontCare;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Graphics::present(void *screenshotCallbackData)
|
void Graphics::present(void *screenshotCallbackData)
|
||||||
|
|||||||
Reference in New Issue
Block a user