Compare commits

..

3 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
Isaac Marovitz
f07ae7d53f Fix Title Update Manager not selecting right update (#4452) 2023-02-22 17:58:32 -03:00
3 changed files with 14 additions and 6 deletions

View File

@@ -105,13 +105,13 @@ public class TitleUpdateViewModel : BaseModel
AddUpdate(path); AddUpdate(path);
} }
// NOTE: Save the list again to remove leftovers.
Save();
TitleUpdateModel selected = TitleUpdates.FirstOrDefault(x => x.Path == _titleUpdateWindowData.Selected, null); TitleUpdateModel selected = TitleUpdates.FirstOrDefault(x => x.Path == _titleUpdateWindowData.Selected, null);
SelectedUpdate = selected; SelectedUpdate = selected;
// NOTE: Save the list again to remove leftovers.
Save();
SortUpdates(); SortUpdates();
} }

View File

@@ -439,7 +439,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
int samplesInY = msaaMode.SamplesInY(); int samplesInY = msaaMode.SamplesInY();
var scissor = _state.State.ScreenScissorState; 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 clipRegionWidth = int.MaxValue;
int clipRegionHeight = int.MaxValue; int clipRegionHeight = int.MaxValue;

View File

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