Fix bug that could cause depth buffer to be missing after clear (#3067)
This commit is contained in:
parent
0dddcd012c
commit
b944941733
2 changed files with 9 additions and 8 deletions
|
@ -369,14 +369,14 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
|
||||||
|
|
||||||
if (color != null)
|
if (color != null)
|
||||||
{
|
{
|
||||||
if (clipRegionWidth > color.Width)
|
if (clipRegionWidth > color.Width / samplesInX)
|
||||||
{
|
{
|
||||||
clipRegionWidth = color.Width;
|
clipRegionWidth = color.Width / samplesInX;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (clipRegionHeight > color.Height)
|
if (clipRegionHeight > color.Height / samplesInY)
|
||||||
{
|
{
|
||||||
clipRegionHeight = color.Height;
|
clipRegionHeight = color.Height / samplesInY;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -400,14 +400,14 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
|
||||||
|
|
||||||
if (depthStencil != null)
|
if (depthStencil != null)
|
||||||
{
|
{
|
||||||
if (clipRegionWidth > depthStencil.Width)
|
if (clipRegionWidth > depthStencil.Width / samplesInX)
|
||||||
{
|
{
|
||||||
clipRegionWidth = depthStencil.Width;
|
clipRegionWidth = depthStencil.Width / samplesInX;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (clipRegionHeight > depthStencil.Height)
|
if (clipRegionHeight > depthStencil.Height / samplesInY)
|
||||||
{
|
{
|
||||||
clipRegionHeight = depthStencil.Height;
|
clipRegionHeight = depthStencil.Height / samplesInY;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -434,6 +434,7 @@ namespace Ryujinx.Graphics.Gpu.Image
|
||||||
{
|
{
|
||||||
new Span<ITexture>(_rtHostColors).Fill(null);
|
new Span<ITexture>(_rtHostColors).Fill(null);
|
||||||
_rtHostColors[index] = _rtColors[index]?.HostTexture;
|
_rtHostColors[index] = _rtColors[index]?.HostTexture;
|
||||||
|
_rtHostDs = null;
|
||||||
|
|
||||||
_context.Renderer.Pipeline.SetRenderTargets(_rtHostColors, null);
|
_context.Renderer.Pipeline.SetRenderTargets(_rtHostColors, null);
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue