1
0
Fork 0
mirror of https://github.com/Ryujinx/Ryujinx.git synced 2024-12-18 18:32:02 +00:00

Workaround for Wonder

This commit is contained in:
Isaac Marovitz 2024-05-30 13:24:05 +01:00 committed by Isaac Marovitz
parent bb4cb531f2
commit fad653c12e

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