Workaround for Wonder

This commit is contained in:
Isaac Marovitz 2024-05-30 13:24:05 +01:00
parent 0c351a6caa
commit 8e2e6c48de
No known key found for this signature in database
GPG Key ID: 97250B2B09A132E1
1 changed files with 14 additions and 0 deletions

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);
}