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]; float[] colors = [color.Red, color.Green, color.Blue, color.Alpha];
var dst = _encoderStateManager.RenderTarget; 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); _helperShader.ClearColor(index, colors, componentMask, dst.Width, dst.Height);
} }
@ -259,6 +266,13 @@ namespace Ryujinx.Graphics.Metal
{ {
var depthStencil = _encoderStateManager.DepthStencil; 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); _helperShader.ClearDepthStencil(depthValue, depthMask, stencilValue, stencilMask, depthStencil.Width, depthStencil.Height);
} }