diff --git a/src/Ryujinx.Graphics.Metal/Pipeline.cs b/src/Ryujinx.Graphics.Metal/Pipeline.cs index 912a28ac0..7cdc2c6d8 100644 --- a/src/Ryujinx.Graphics.Metal/Pipeline.cs +++ b/src/Ryujinx.Graphics.Metal/Pipeline.cs @@ -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); }