Compare commits

..

2 Commits

Author SHA1 Message Date
jhorv
58207685c0 Perform bounds checking before list indexer to avoid frequent exceptions (#4438)
* Perform bounds checking before list indexer to avoid frequent ArgumentOutOfRangeExceptions

* do a single compare after casting id and .Count to uint
2023-02-25 10:26:39 +00:00
gdkchan
095ad923ad Account for multisample when calculating render target size hint (#4467) 2023-02-23 10:08:54 +01:00
2 changed files with 11 additions and 3 deletions

View File

@@ -439,7 +439,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
int samplesInY = msaaMode.SamplesInY();
var scissor = _state.State.ScreenScissorState;
Size sizeHint = new Size(scissor.X + scissor.Width, scissor.Y + scissor.Height, 1);
Size sizeHint = new Size((scissor.X + scissor.Width) * samplesInX, (scissor.Y + scissor.Height) * samplesInY, 1);
int clipRegionWidth = int.MaxValue;
int clipRegionHeight = int.MaxValue;

View File

@@ -80,8 +80,16 @@ namespace Ryujinx.Graphics.Vulkan
try
{
value = _list[id];
return value != null;
if ((uint)id < (uint)_list.Count)
{
value = _list[id];
return value != null;
}
else
{
value = null;
return false;
}
}
catch (ArgumentOutOfRangeException)
{