WIP V2: Experimental: Metal backend #441

Merged
GreemDev merged 369 commits from new-metal into master 2024-12-24 06:55:16 +00:00
Showing only changes of commit c883ebb645 - Show all commits

View File

@ -252,6 +252,13 @@ namespace Ryujinx.Graphics.Metal
float[] colors = [color.Red, color.Green, color.Blue, color.Alpha];
var dst = _encoderStateManager.RenderTarget;
// TODO: Remove workaround for Wonder which has an invalid texture due to unsupported format
if (dst == null)
{
Logger.Warning?.PrintMsg(LogClass.Gpu, "Attempted to clear invalid render target!");
return;
}
_helperShader.ClearColor(index, colors, componentMask, dst.Width, dst.Height);
}
@ -259,6 +266,13 @@ namespace Ryujinx.Graphics.Metal
{
var depthStencil = _encoderStateManager.DepthStencil;
// TODO: Remove workaround for Wonder which has an invalid texture due to unsupported format
if (depthStencil == null)
{
Logger.Warning?.PrintMsg(LogClass.Gpu, "Attempted to clear invalid depth stencil!");
return;
}
_helperShader.ClearDepthStencil(depthValue, depthMask, stencilValue, stencilMask, depthStencil.Width, depthStencil.Height);
}