Compare commits

..

4 Commits

Author SHA1 Message Date
121296834a Ava GUI: Several UI Fixes (#3991)
* Fix accessability violations in ListView

* Use accent colour for favourite star

* Hide progress bar when its done

* App Data Formating

- Added space before storage unit
- Changed so minutes have 0 decimals, and hours and days have 1

* Fix theming

* Fix mismatched corner radius

* Fix acceability violations in GridView

* More consistency between Grid and List View

* Fix margin

* Let whitespace defocus controls
2022-12-05 22:04:18 +00:00
bbb24d8c7e Restrict shader storage buffer search when match fails (#4011)
* Restrict storage buffer search when match fails

* Shader cache version bump
2022-12-05 19:11:32 +00:00
4da44e09cb Make structs readonly when applicable (#4002)
* Make all structs readonly when applicable. It should reduce amount of needless defensive copies

* Make structs with trivial boilerplate equality code record structs

* Remove unnecessary readonly modifiers from TextureCreateInfo

* Make BitMap structs readonly too
2022-12-05 14:47:39 +01:00
ae13f0ab4d misc: Fix obsolete warnings in Ryujinx.Graphics.Vulkan (#4020)
Was caused by some merges after the Silk.NET update
2022-12-05 12:57:11 +00:00
168 changed files with 297 additions and 488 deletions

View File

@ -89,6 +89,7 @@ csharp_style_conditional_delegate_call = true:suggestion
# Modifier preferences # Modifier preferences
csharp_prefer_static_local_function = true:suggestion csharp_prefer_static_local_function = true:suggestion
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:silent csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:silent
csharp_style_prefer_readonly_struct = true
# Code-block preferences # Code-block preferences
csharp_prefer_braces = true:silent csharp_prefer_braces = true:silent

View File

@ -1,6 +1,6 @@
namespace ARMeilleure.CodeGen.RegisterAllocators namespace ARMeilleure.CodeGen.RegisterAllocators
{ {
struct AllocationResult readonly struct AllocationResult
{ {
public int IntUsedRegisters { get; } public int IntUsedRegisters { get; }
public int VecUsedRegisters { get; } public int VecUsedRegisters { get; }

View File

@ -11,7 +11,7 @@ namespace ARMeilleure.CodeGen.RegisterAllocators
{ {
private class ParallelCopy private class ParallelCopy
{ {
private struct Copy private readonly struct Copy
{ {
public Register Dest { get; } public Register Dest { get; }
public Register Source { get; } public Register Source { get; }

View File

@ -11,7 +11,7 @@ namespace ARMeilleure.CodeGen.RegisterAllocators
{ {
class HybridAllocator : IRegisterAllocator class HybridAllocator : IRegisterAllocator
{ {
private struct BlockInfo private readonly struct BlockInfo
{ {
public bool HasCall { get; } public bool HasCall { get; }

View File

@ -3,7 +3,7 @@ using System;
namespace ARMeilleure.CodeGen.RegisterAllocators namespace ARMeilleure.CodeGen.RegisterAllocators
{ {
struct RegisterMasks readonly struct RegisterMasks
{ {
public int IntAvailableRegisters { get; } public int IntAvailableRegisters { get; }
public int VecAvailableRegisters { get; } public int VecAvailableRegisters { get; }

View File

@ -1,6 +1,6 @@
namespace ARMeilleure.CodeGen.X86 namespace ARMeilleure.CodeGen.X86
{ {
struct IntrinsicInfo readonly struct IntrinsicInfo
{ {
public X86Instruction Inst { get; } public X86Instruction Inst { get; }
public IntrinsicType Type { get; } public IntrinsicType Type { get; }

View File

@ -2,7 +2,7 @@ using ARMeilleure.Instructions;
namespace ARMeilleure.Decoders namespace ARMeilleure.Decoders
{ {
struct InstDescriptor readonly struct InstDescriptor
{ {
public static InstDescriptor Undefined => new InstDescriptor(InstName.Und, InstEmit.Und); public static InstDescriptor Undefined => new InstDescriptor(InstName.Und, InstEmit.Und);

View File

@ -11,7 +11,7 @@ namespace ARMeilleure.Decoders
private const int FastLookupSize = 0x1000; private const int FastLookupSize = 0x1000;
private struct InstInfo private readonly struct InstInfo
{ {
public int Mask { get; } public int Mask { get; }
public int Value { get; } public int Value { get; }

View File

@ -6,7 +6,7 @@ namespace ARMeilleure.Diagnostics
{ {
static class Symbols static class Symbols
{ {
private struct RangedSymbol private readonly struct RangedSymbol
{ {
public readonly ulong Start; public readonly ulong Start;
public readonly ulong End; public readonly ulong End;

View File

@ -3,7 +3,7 @@ using static ARMeilleure.IntermediateRepresentation.Operand.Factory;
namespace ARMeilleure.IntermediateRepresentation namespace ARMeilleure.IntermediateRepresentation
{ {
struct PhiOperation readonly struct PhiOperation
{ {
private readonly Operation _operation; private readonly Operation _operation;

View File

@ -2,7 +2,7 @@ using System;
namespace ARMeilleure.IntermediateRepresentation namespace ARMeilleure.IntermediateRepresentation
{ {
struct Register : IEquatable<Register> readonly struct Register : IEquatable<Register>
{ {
public int Index { get; } public int Index { get; }

View File

@ -4,7 +4,7 @@ using System.Diagnostics.CodeAnalysis;
namespace ARMeilleure.Translation.Cache namespace ARMeilleure.Translation.Cache
{ {
struct CacheEntry : IComparable<CacheEntry> readonly struct CacheEntry : IComparable<CacheEntry>
{ {
public int Offset { get; } public int Offset { get; }
public int Size { get; } public int Size { get; }

View File

@ -6,7 +6,7 @@ namespace ARMeilleure.Translation.Cache
{ {
class CacheMemoryAllocator class CacheMemoryAllocator
{ {
private struct MemoryBlock : IComparable<MemoryBlock> private readonly struct MemoryBlock : IComparable<MemoryBlock>
{ {
public int Offset { get; } public int Offset { get; }
public int Size { get; } public int Size { get; }

View File

@ -2,7 +2,7 @@ using ARMeilleure.IntermediateRepresentation;
namespace ARMeilleure.Translation namespace ARMeilleure.Translation
{ {
struct CompilerContext readonly struct CompilerContext
{ {
public ControlFlowGraph Cfg { get; } public ControlFlowGraph Cfg { get; }

View File

@ -14,7 +14,7 @@ namespace ARMeilleure.Translation
private const int RegsCount = 32; private const int RegsCount = 32;
private const int RegsMask = RegsCount - 1; private const int RegsMask = RegsCount - 1;
private struct RegisterMask : IEquatable<RegisterMask> private readonly struct RegisterMask : IEquatable<RegisterMask>
{ {
public long IntMask => Mask.GetElement(0); public long IntMask => Mask.GetElement(0);
public long VecMask => Mask.GetElement(1); public long VecMask => Mask.GetElement(1);

View File

@ -293,7 +293,7 @@ namespace ARMeilleure.Translation
} }
} }
private struct Range private readonly struct Range
{ {
public ulong Start { get; } public ulong Start { get; }
public ulong End { get; } public ulong End { get; }

View File

@ -4,7 +4,7 @@ using System.Runtime.InteropServices;
namespace SoundIOSharp namespace SoundIOSharp
{ {
public struct SoundIOChannelLayout public readonly struct SoundIOChannelLayout
{ {
public static int BuiltInCount public static int BuiltInCount
{ {

View File

@ -1,6 +1,6 @@
namespace SoundIOSharp namespace SoundIOSharp
{ {
public struct SoundIOSampleRateRange public readonly struct SoundIOSampleRateRange
{ {
internal SoundIOSampleRateRange(int min, int max) internal SoundIOSampleRateRange(int min, int max)
{ {

View File

@ -58,5 +58,7 @@
<Color x:Key="SystemChromeWhiteColor">#FFFFFFFF</Color> <Color x:Key="SystemChromeWhiteColor">#FFFFFFFF</Color>
<Color x:Key="ThemeForegroundColor">#FFFFFFFF</Color> <Color x:Key="ThemeForegroundColor">#FFFFFFFF</Color>
<Color x:Key="MenuFlyoutPresenterBorderColor">#3D3D3D</Color> <Color x:Key="MenuFlyoutPresenterBorderColor">#3D3D3D</Color>
<Color x:Key="AppListBackgroundColor">#0FFFFFFF</Color>
<Color x:Key="AppListHoverBackgroundColor">#1EFFFFFF</Color>
</Styles.Resources> </Styles.Resources>
</Styles> </Styles>

View File

@ -50,5 +50,7 @@
<Color x:Key="SystemChromeWhiteColor">#FFFFFFFF</Color> <Color x:Key="SystemChromeWhiteColor">#FFFFFFFF</Color>
<Color x:Key="ThemeForegroundColor">#FF000000</Color> <Color x:Key="ThemeForegroundColor">#FF000000</Color>
<Color x:Key="MenuFlyoutPresenterBorderColor">#C1C1C1</Color> <Color x:Key="MenuFlyoutPresenterBorderColor">#C1C1C1</Color>
<Color x:Key="AppListBackgroundColor">#b3ffffff</Color>
<Color x:Key="AppListHoverBackgroundColor">#80cccccc</Color>
</Styles.Resources> </Styles.Resources>
</Styles> </Styles>

View File

@ -11,7 +11,8 @@
Height="340" Height="340"
CanResize="False" CanResize="False"
SizeToContent="Height" SizeToContent="Height"
mc:Ignorable="d"> mc:Ignorable="d"
Focusable="True">
<Grid <Grid
Margin="20" Margin="20"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"

View File

@ -6,7 +6,8 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:window="clr-namespace:Ryujinx.Ava.Ui.Windows" xmlns:window="clr-namespace:Ryujinx.Ava.Ui.Windows"
Width="400" Width="400"
mc:Ignorable="d"> mc:Ignorable="d"
Focusable="True">
<Grid <Grid
Margin="20" Margin="20"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"

View File

@ -10,7 +10,8 @@
xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia" xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
d:DesignHeight="450" d:DesignHeight="450"
d:DesignWidth="800" d:DesignWidth="800"
mc:Ignorable="d"> mc:Ignorable="d"
Focusable="True">
<UserControl.Resources> <UserControl.Resources>
<controls:BitmapArrayValueConverter x:Key="ByteImage" /> <controls:BitmapArrayValueConverter x:Key="ByteImage" />
<MenuFlyout x:Key="GameContextMenu" Opened="MenuBase_OnMenuOpened"> <MenuFlyout x:Key="GameContextMenu" Opened="MenuBase_OnMenuOpened">
@ -113,8 +114,8 @@
<Style Selector="ListBoxItem"> <Style Selector="ListBoxItem">
<Setter Property="Padding" Value="0" /> <Setter Property="Padding" Value="0" />
<Setter Property="Margin" Value="5" /> <Setter Property="Margin" Value="5" />
<Setter Property="CornerRadius" Value="5" /> <Setter Property="CornerRadius" Value="4" />
<Setter Property="Background" Value="{DynamicResource SystemAccentColorDark3}" /> <Setter Property="Background" Value="{DynamicResource AppListBackgroundColor}" />
<Style.Animations> <Style.Animations>
<Animation Duration="0:0:0.7"> <Animation Duration="0:0:0.7">
<KeyFrame Cue="0%"> <KeyFrame Cue="0%">
@ -132,27 +133,18 @@
</Animation> </Animation>
</Style.Animations> </Style.Animations>
</Style> </Style>
<Style Selector="ListBoxItem:selected /template/ ContentPresenter">
<Setter Property="Background" Value="{DynamicResource AppListBackgroundColor}" />
</Style>
<Style Selector="ListBoxItem:pointerover /template/ ContentPresenter">
<Setter Property="Background" Value="{DynamicResource AppListHoverBackgroundColor}" />
</Style>
</ListBox.Styles> </ListBox.Styles>
<ListBox.ItemTemplate> <ListBox.ItemTemplate>
<DataTemplate> <DataTemplate>
<Grid> <Grid>
<Grid.Styles>
<Style Selector="ui|SymbolIcon.small.icon">
<Setter Property="FontSize" Value="15" />
</Style>
<Style Selector="ui|SymbolIcon.normal.icon">
<Setter Property="FontSize" Value="19" />
</Style>
<Style Selector="ui|SymbolIcon.large.icon">
<Setter Property="FontSize" Value="23" />
</Style>
<Style Selector="ui|SymbolIcon.huge.icon">
<Setter Property="FontSize" Value="26" />
</Style>
</Grid.Styles>
<Border <Border
Margin="0" Margin="10"
Padding="{Binding $parent[UserControl].DataContext.GridItemPadding}"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
VerticalAlignment="Stretch" VerticalAlignment="Stretch"
Classes.huge="{Binding $parent[UserControl].DataContext.IsGridHuge}" Classes.huge="{Binding $parent[UserControl].DataContext.IsGridHuge}"
@ -160,57 +152,41 @@
Classes.normal="{Binding $parent[UserControl].DataContext.IsGridMedium}" Classes.normal="{Binding $parent[UserControl].DataContext.IsGridMedium}"
Classes.small="{Binding $parent[UserControl].DataContext.IsGridSmall}" Classes.small="{Binding $parent[UserControl].DataContext.IsGridSmall}"
ClipToBounds="True" ClipToBounds="True"
CornerRadius="5"> CornerRadius="4">
<Grid Margin="0"> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Image <Image
Grid.Row="0" Grid.Row="0"
Margin="0"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
VerticalAlignment="Top" VerticalAlignment="Top"
Source="{Binding Icon, Converter={StaticResource ByteImage}}" /> Source="{Binding Icon, Converter={StaticResource ByteImage}}" />
<StackPanel <Panel
Grid.Row="1" Grid.Row="1"
Height="50" Height="50"
Margin="5" Margin="0 10 0 0"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
VerticalAlignment="Stretch" VerticalAlignment="Stretch"
IsVisible="{Binding $parent[UserControl].DataContext.ShowNames}"> IsVisible="{Binding $parent[UserControl].DataContext.ShowNames}">
<TextBlock <TextBlock
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
VerticalAlignment="Center"
Text="{Binding TitleName}" Text="{Binding TitleName}"
TextAlignment="Center" TextAlignment="Center"
TextWrapping="Wrap" /> TextWrapping="Wrap" />
</StackPanel> </Panel>
</Grid> </Grid>
</Border> </Border>
<ui:SymbolIcon <ui:SymbolIcon
Margin="5" Margin="5,5,0,0"
HorizontalAlignment="Left" HorizontalAlignment="Left"
VerticalAlignment="Top" VerticalAlignment="Top"
Classes.huge="{Binding $parent[UserControl].DataContext.IsGridHuge}" FontSize="16"
Classes.icon="true" Foreground="{DynamicResource SystemAccentColor}"
Classes.large="{Binding $parent[UserControl].DataContext.IsGridLarge}"
Classes.normal="{Binding $parent[UserControl].DataContext.IsGridMedium}"
Classes.small="{Binding $parent[UserControl].DataContext.IsGridSmall}"
Foreground="Yellow"
IsVisible="{Binding Favorite}" IsVisible="{Binding Favorite}"
Symbol="StarFilled" /> Symbol="StarFilled" />
<ui:SymbolIcon
Margin="5"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Classes.huge="{Binding $parent[UserControl].DataContext.IsGridHuge}"
Classes.icon="true"
Classes.large="{Binding $parent[UserControl].DataContext.IsGridLarge}"
Classes.normal="{Binding $parent[UserControl].DataContext.IsGridMedium}"
Classes.small="{Binding $parent[UserControl].DataContext.IsGridSmall}"
Foreground="Black"
IsVisible="{Binding Favorite}"
Symbol="Star" />
</Grid> </Grid>
</DataTemplate> </DataTemplate>
</ListBox.ItemTemplate> </ListBox.ItemTemplate>

View File

@ -10,7 +10,8 @@
xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia" xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
d:DesignHeight="450" d:DesignHeight="450"
d:DesignWidth="800" d:DesignWidth="800"
mc:Ignorable="d"> mc:Ignorable="d"
Focusable="True">
<UserControl.Resources> <UserControl.Resources>
<controls:BitmapArrayValueConverter x:Key="ByteImage" /> <controls:BitmapArrayValueConverter x:Key="ByteImage" />
<MenuFlyout x:Key="GameContextMenu" Opened="MenuBase_OnMenuOpened"> <MenuFlyout x:Key="GameContextMenu" Opened="MenuBase_OnMenuOpened">
@ -115,8 +116,8 @@
<Setter Property="Padding" Value="0" /> <Setter Property="Padding" Value="0" />
<Setter Property="Margin" Value="0" /> <Setter Property="Margin" Value="0" />
<Setter Property="CornerRadius" Value="5" /> <Setter Property="CornerRadius" Value="5" />
<Setter Property="BorderBrush" Value="{DynamicResource SystemAccentColorDark3}" /> <Setter Property="Background" Value="{DynamicResource AppListBackgroundColor}" />
<Setter Property="BorderThickness" Value="2" /> <Setter Property="BorderThickness" Value="2"/>
<Style.Animations> <Style.Animations>
<Animation Duration="0:0:0.7"> <Animation Duration="0:0:0.7">
<KeyFrame Cue="0%"> <KeyFrame Cue="0%">
@ -134,6 +135,12 @@
</Animation> </Animation>
</Style.Animations> </Style.Animations>
</Style> </Style>
<Style Selector="ListBoxItem:selected /template/ ContentPresenter">
<Setter Property="Background" Value="{DynamicResource AppListBackgroundColor}" />
</Style>
<Style Selector="ListBoxItem:pointerover /template/ ContentPresenter">
<Setter Property="Background" Value="{DynamicResource AppListHoverBackgroundColor}" />
</Style>
</ListBox.Styles> </ListBox.Styles>
<ListBox.ItemTemplate> <ListBox.ItemTemplate>
<DataTemplate> <DataTemplate>
@ -152,9 +159,6 @@
<ColumnDefinition Width="*" /> <ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" /> <ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition />
</Grid.RowDefinitions>
<Image <Image
Grid.RowSpan="3" Grid.RowSpan="3"
Grid.Column="0" Grid.Column="0"
@ -169,7 +173,7 @@
HorizontalAlignment="Left" HorizontalAlignment="Left"
VerticalAlignment="Top" VerticalAlignment="Top"
Orientation="Vertical" Orientation="Vertical"
Spacing="5"> Spacing="5" >
<TextBlock <TextBlock
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
Text="{Binding TitleName}" Text="{Binding TitleName}"
@ -214,20 +218,10 @@
Margin="-5,-5,0,0" Margin="-5,-5,0,0"
HorizontalAlignment="Left" HorizontalAlignment="Left"
VerticalAlignment="Top" VerticalAlignment="Top"
FontSize="20" FontSize="16"
Foreground="Yellow" Foreground="{DynamicResource SystemAccentColor}"
IsVisible="{Binding Favorite}" IsVisible="{Binding Favorite}"
Symbol="StarFilled" /> Symbol="StarFilled" />
<ui:SymbolIcon
Grid.Row="0"
Grid.Column="0"
Margin="-5,-5,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Top"
FontSize="20"
Foreground="Black"
IsVisible="{Binding Favorite}"
Symbol="Star" />
</Grid> </Grid>
</Border> </Border>
</Grid> </Grid>

View File

@ -4,7 +4,8 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"> mc:Ignorable="d"
Focusable="True">
<Grid <Grid
Margin="5,10,5,5" Margin="5,10,5,5"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"

View File

@ -4,7 +4,8 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia" xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="Ryujinx.Ava.Ui.Controls.NavigationDialogHost"> x:Class="Ryujinx.Ava.Ui.Controls.NavigationDialogHost"
Focusable="True">
<ui:Frame HorizontalAlignment="Stretch" VerticalAlignment="Stretch" <ui:Frame HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
x:Name="ContentFrame" /> x:Name="ContentFrame" />
</UserControl> </UserControl>

View File

@ -4,7 +4,8 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" mc:Ignorable="d"
xmlns:Locale="clr-namespace:Ryujinx.Ava.Common.Locale" xmlns:Locale="clr-namespace:Ryujinx.Ava.Common.Locale"
x:Class="Ryujinx.Ava.Ui.Controls.ProfileImageSelectionDialog"> x:Class="Ryujinx.Ava.Ui.Controls.ProfileImageSelectionDialog"
Focusable="True">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Center" Margin="5,10,5, 5"> <Grid HorizontalAlignment="Stretch" VerticalAlignment="Center" Margin="5,10,5, 5">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />

View File

@ -3,5 +3,6 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="Ryujinx.Ava.Ui.Controls.RendererHost"> x:Class="Ryujinx.Ava.Ui.Controls.RendererHost"
Focusable="True">
</UserControl> </UserControl>

View File

@ -9,7 +9,8 @@
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
Height="400" Height="400"
Width="550" Width="550"
x:Class="Ryujinx.Ava.Ui.Controls.SaveManager"> x:Class="Ryujinx.Ava.Ui.Controls.SaveManager"
Focusable="True">
<UserControl.Resources> <UserControl.Resources>
<controls:BitmapArrayValueConverter x:Key="ByteImage" /> <controls:BitmapArrayValueConverter x:Key="ByteImage" />
</UserControl.Resources> </UserControl.Resources>

View File

@ -8,7 +8,8 @@
Title="Ryujinx - Waiting" Title="Ryujinx - Waiting"
SizeToContent="WidthAndHeight" SizeToContent="WidthAndHeight"
WindowStartupLocation="CenterOwner" WindowStartupLocation="CenterOwner"
mc:Ignorable="d"> mc:Ignorable="d"
Focusable="True">
<Grid <Grid
Margin="20" Margin="20"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"

View File

@ -12,7 +12,8 @@
Margin="0" Margin="0"
MinWidth="500" MinWidth="500"
Padding="0" Padding="0"
mc:Ignorable="d"> mc:Ignorable="d"
Focusable="True">
<UserControl.Resources> <UserControl.Resources>
<controls:BitmapArrayValueConverter x:Key="ByteImage" /> <controls:BitmapArrayValueConverter x:Key="ByteImage" />
</UserControl.Resources> </UserControl.Resources>

View File

@ -10,7 +10,8 @@
xmlns:Locale="clr-namespace:Ryujinx.Ava.Common.Locale" xmlns:Locale="clr-namespace:Ryujinx.Ava.Common.Locale"
xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia" xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
xmlns:viewModels="clr-namespace:Ryujinx.Ava.Ui.ViewModels" xmlns:viewModels="clr-namespace:Ryujinx.Ava.Ui.ViewModels"
x:Class="Ryujinx.Ava.Ui.Controls.UserRecoverer"> x:Class="Ryujinx.Ava.Ui.Controls.UserRecoverer"
Focusable="True">
<Design.DataContext> <Design.DataContext>
<viewModels:UserProfileViewModel /> <viewModels:UserProfileViewModel />
</Design.DataContext> </Design.DataContext>

View File

@ -12,7 +12,8 @@
d:DesignHeight="450" d:DesignHeight="450"
MinWidth="500" MinWidth="500"
d:DesignWidth="800" d:DesignWidth="800"
mc:Ignorable="d"> mc:Ignorable="d"
Focusable="True">
<UserControl.Resources> <UserControl.Resources>
<controls:BitmapArrayValueConverter x:Key="ByteImage" /> <controls:BitmapArrayValueConverter x:Key="ByteImage" />
</UserControl.Resources> </UserControl.Resources>

View File

@ -436,8 +436,6 @@ namespace Ryujinx.Ava.Ui.ViewModels
} }
} }
public Thickness GridItemPadding => ShowNames ? new Thickness() : new Thickness(5);
public bool ShowMenuAndStatusBar public bool ShowMenuAndStatusBar
{ {
get => _showMenuAndStatusBar; get => _showMenuAndStatusBar;
@ -599,7 +597,6 @@ namespace Ryujinx.Ava.Ui.ViewModels
ConfigurationState.Instance.Ui.ShowNames.Value = value; ConfigurationState.Instance.Ui.ShowNames.Value = value;
OnPropertyChanged(); OnPropertyChanged();
OnPropertyChanged(nameof(GridItemPadding));
OnPropertyChanged(nameof(GridSizeScale)); OnPropertyChanged(nameof(GridSizeScale));
ConfigurationState.Instance.ToFileFormat().SaveConfig(Program.ConfigurationPath); ConfigurationState.Instance.ToFileFormat().SaveConfig(Program.ConfigurationPath);
@ -716,7 +713,6 @@ namespace Ryujinx.Ava.Ui.ViewModels
OnPropertyChanged(nameof(IsGridLarge)); OnPropertyChanged(nameof(IsGridLarge));
OnPropertyChanged(nameof(IsGridHuge)); OnPropertyChanged(nameof(IsGridHuge));
OnPropertyChanged(nameof(ShowNames)); OnPropertyChanged(nameof(ShowNames));
OnPropertyChanged(nameof(GridItemPadding));
ConfigurationState.Instance.ToFileFormat().SaveConfig(Program.ConfigurationPath); ConfigurationState.Instance.ToFileFormat().SaveConfig(Program.ConfigurationPath);
} }
@ -780,6 +776,11 @@ namespace Ryujinx.Ava.Ui.ViewModels
{ {
_owner.LoadProgressBar.IsVisible = false; _owner.LoadProgressBar.IsVisible = false;
} }
if (e.NumAppsLoaded == e.NumAppsFound)
{
_owner.LoadProgressBar.IsVisible = false;
}
}); });
} }

View File

@ -15,7 +15,8 @@
CanResize="False" CanResize="False"
SizeToContent="Width" SizeToContent="Width"
WindowStartupLocation="CenterOwner" WindowStartupLocation="CenterOwner"
mc:Ignorable="d"> mc:Ignorable="d"
Focusable="True">
<Grid <Grid
Margin="15" Margin="15"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"

View File

@ -11,7 +11,8 @@
WindowStartupLocation="CenterOwner" WindowStartupLocation="CenterOwner"
Width="800" MinHeight="650" Height="650" Width="800" MinHeight="650" Height="650"
SizeToContent="Manual" SizeToContent="Manual"
MinWidth="600"> MinWidth="600"
Focusable="True">
<Design.DataContext> <Design.DataContext>
<viewModels:AmiiboWindowViewModel /> <viewModels:AmiiboWindowViewModel />
</Design.DataContext> </Design.DataContext>

View File

@ -11,7 +11,8 @@
xmlns:viewModels="clr-namespace:Ryujinx.Ava.Ui.ViewModels" xmlns:viewModels="clr-namespace:Ryujinx.Ava.Ui.ViewModels"
xmlns:controls="clr-namespace:Ryujinx.Ava.Ui.Controls" xmlns:controls="clr-namespace:Ryujinx.Ava.Ui.Controls"
x:CompileBindings="True" x:CompileBindings="True"
x:DataType="viewModels:AvatarProfileViewModel"> x:DataType="viewModels:AvatarProfileViewModel"
Focusable="True">
<Design.DataContext> <Design.DataContext>
<viewModels:AvatarProfileViewModel /> <viewModels:AvatarProfileViewModel />
</Design.DataContext> </Design.DataContext>

View File

@ -12,7 +12,8 @@
MinWidth="500" MinWidth="500"
MinHeight="500" MinHeight="500"
WindowStartupLocation="CenterOwner" WindowStartupLocation="CenterOwner"
mc:Ignorable="d"> mc:Ignorable="d"
Focusable="True">
<Window.Styles> <Window.Styles>
<Style Selector="TreeViewItem"> <Style Selector="TreeViewItem">
<Setter Property="IsExpanded" Value="True" /> <Setter Property="IsExpanded" Value="True" />

View File

@ -8,7 +8,8 @@
xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia" xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
x:Class="Ryujinx.Ava.Ui.Windows.ContentDialogOverlayWindow" x:Class="Ryujinx.Ava.Ui.Windows.ContentDialogOverlayWindow"
xmlns:window="clr-namespace:Ryujinx.Ava.Ui.Windows" xmlns:window="clr-namespace:Ryujinx.Ava.Ui.Windows"
Title="ContentDialogOverlayWindow"> Title="ContentDialogOverlayWindow"
Focusable="True">
<window:StyleableWindow.Styles> <window:StyleableWindow.Styles>
<Style Selector="ui|ContentDialog /template/ Panel#LayoutRoot"> <Style Selector="ui|ContentDialog /template/ Panel#LayoutRoot">
<Setter Property="Background" <Setter Property="Background"

View File

@ -13,7 +13,8 @@
d:DesignHeight="800" d:DesignHeight="800"
d:DesignWidth="800" d:DesignWidth="800"
x:CompileBindings="False" x:CompileBindings="False"
mc:Ignorable="d"> mc:Ignorable="d"
Focusable="True">
<Design.DataContext> <Design.DataContext>
<viewModels:ControllerSettingsViewModel /> <viewModels:ControllerSettingsViewModel />
</Design.DataContext> </Design.DataContext>

View File

@ -14,7 +14,8 @@
MaxHeight="500" MaxHeight="500"
SizeToContent="Height" SizeToContent="Height"
WindowStartupLocation="CenterOwner" WindowStartupLocation="CenterOwner"
mc:Ignorable="d"> mc:Ignorable="d"
Focusable="True">
<Grid Name="DownloadableContentGrid" Margin="15"> <Grid Name="DownloadableContentGrid" Margin="15">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />

View File

@ -20,7 +20,7 @@ namespace Ryujinx.Ava.Ui.Windows
private const int CutOffLuminosity = 64; private const int CutOffLuminosity = 64;
private struct PaletteColor private readonly struct PaletteColor
{ {
public int Qck { get; } public int Qck { get; }
public byte R { get; } public byte R { get; }

View File

@ -20,7 +20,8 @@
x:CompileBindings="True" x:CompileBindings="True"
x:DataType="viewModels:MainWindowViewModel" x:DataType="viewModels:MainWindowViewModel"
WindowStartupLocation="CenterScreen" WindowStartupLocation="CenterScreen"
mc:Ignorable="d"> mc:Ignorable="d"
Focusable="True">
<Window.Styles> <Window.Styles>
<Style Selector="TitleBar:fullscreen"> <Style Selector="TitleBar:fullscreen">
<Setter Property="Background" Value="#000000" /> <Setter Property="Background" Value="#000000" />

View File

@ -6,7 +6,8 @@
xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia" xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
xmlns:locale="clr-namespace:Ryujinx.Ava.Common.Locale" xmlns:locale="clr-namespace:Ryujinx.Ava.Common.Locale"
mc:Ignorable="d" mc:Ignorable="d"
x:Class="Ryujinx.Ava.Ui.Windows.MotionSettingsWindow"> x:Class="Ryujinx.Ava.Ui.Windows.MotionSettingsWindow"
Focusable="True">
<Grid Margin="10"> <Grid Margin="10">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />

View File

@ -6,7 +6,8 @@
xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia" xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
xmlns:locale="clr-namespace:Ryujinx.Ava.Common.Locale" xmlns:locale="clr-namespace:Ryujinx.Ava.Common.Locale"
mc:Ignorable="d" mc:Ignorable="d"
x:Class="Ryujinx.Ava.Ui.Windows.RumbleSettingsWindow"> x:Class="Ryujinx.Ava.Ui.Windows.RumbleSettingsWindow"
Focusable="True">
<Grid Margin="10"> <Grid Margin="10">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />

View File

@ -18,7 +18,8 @@
WindowStartupLocation="CenterOwner" WindowStartupLocation="CenterOwner"
x:CompileBindings="True" x:CompileBindings="True"
x:DataType="viewModels:SettingsViewModel" x:DataType="viewModels:SettingsViewModel"
mc:Ignorable="d"> mc:Ignorable="d"
Focusable="True">
<Design.DataContext> <Design.DataContext>
<viewModels:SettingsViewModel /> <viewModels:SettingsViewModel />
</Design.DataContext> </Design.DataContext>

View File

@ -14,7 +14,8 @@
MaxHeight="400" MaxHeight="400"
SizeToContent="Height" SizeToContent="Height"
WindowStartupLocation="CenterOwner" WindowStartupLocation="CenterOwner"
mc:Ignorable="d"> mc:Ignorable="d"
Focusable="True">
<Grid Margin="15"> <Grid Margin="15">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />

View File

@ -16,7 +16,7 @@ namespace Ryujinx.Common.Logging
public static event EventHandler<LogEventArgs> Updated; public static event EventHandler<LogEventArgs> Updated;
public struct Log public readonly struct Log
{ {
internal readonly LogLevel Level; internal readonly LogLevel Level;

View File

@ -7,7 +7,7 @@ namespace Ryujinx.Common.Memory
/// This is useful to keep the Array representation when possible to avoid copies. /// This is useful to keep the Array representation when possible to avoid copies.
/// </summary> /// </summary>
/// <typeparam name="T">Element Type</typeparam> /// <typeparam name="T">Element Type</typeparam>
public ref struct SpanOrArray<T> where T : unmanaged public readonly ref struct SpanOrArray<T> where T : unmanaged
{ {
public readonly T[] Array; public readonly T[] Array;
public readonly ReadOnlySpan<T> Span; public readonly ReadOnlySpan<T> Span;

View File

@ -17,7 +17,7 @@ namespace Ryujinx.Cpu
/// <summary> /// <summary>
/// Stores handlers for the various CPU exceptions. /// Stores handlers for the various CPU exceptions.
/// </summary> /// </summary>
public struct ExceptionCallbacks public readonly struct ExceptionCallbacks
{ {
/// <summary> /// <summary>
/// Handler for CPU interrupts triggered using <see cref="IExecutionContext.RequestInterrupt"/>. /// Handler for CPU interrupts triggered using <see cref="IExecutionContext.RequestInterrupt"/>.

View File

@ -2,7 +2,7 @@
namespace Ryujinx.Graphics.Device namespace Ryujinx.Graphics.Device
{ {
public struct RwCallback public readonly struct RwCallback
{ {
public Action<int> Write { get; } public Action<int> Write { get; }
public Func<int> Read { get; } public Func<int> Read { get; }

View File

@ -1,6 +1,6 @@
namespace Ryujinx.Graphics.GAL namespace Ryujinx.Graphics.GAL
{ {
public struct BlendDescriptor public readonly struct BlendDescriptor
{ {
public bool Enable { get; } public bool Enable { get; }

View File

@ -1,6 +1,6 @@
namespace Ryujinx.Graphics.GAL namespace Ryujinx.Graphics.GAL
{ {
public struct BufferAssignment public readonly struct BufferAssignment
{ {
public readonly int Binding; public readonly int Binding;
public readonly BufferRange Range; public readonly BufferRange Range;

View File

@ -1,22 +1,14 @@
using System; using System.Runtime.InteropServices;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.InteropServices;
namespace Ryujinx.Graphics.GAL namespace Ryujinx.Graphics.GAL
{ {
[StructLayout(LayoutKind.Sequential, Size = 8)] [StructLayout(LayoutKind.Sequential, Size = 8)]
public struct BufferHandle : IEquatable<BufferHandle> public readonly record struct BufferHandle
{ {
private readonly ulong _value; private readonly ulong _value;
public static BufferHandle Null => new BufferHandle(0); public static BufferHandle Null => new BufferHandle(0);
private BufferHandle(ulong value) => _value = value; private BufferHandle(ulong value) => _value = value;
public override bool Equals(object obj) => obj is BufferHandle handle && Equals(handle);
public bool Equals([AllowNull] BufferHandle other) => other._value == _value;
public override int GetHashCode() => _value.GetHashCode();
public static bool operator ==(BufferHandle left, BufferHandle right) => left.Equals(right);
public static bool operator !=(BufferHandle left, BufferHandle right) => !(left == right);
} }
} }

View File

@ -1,6 +1,6 @@
namespace Ryujinx.Graphics.GAL namespace Ryujinx.Graphics.GAL
{ {
public struct BufferRange public readonly struct BufferRange
{ {
private static readonly BufferRange _empty = new BufferRange(BufferHandle.Null, 0, 0); private static readonly BufferRange _empty = new BufferRange(BufferHandle.Null, 0, 0);

View File

@ -2,7 +2,7 @@ using Ryujinx.Graphics.Shader.Translation;
namespace Ryujinx.Graphics.GAL namespace Ryujinx.Graphics.GAL
{ {
public struct Capabilities public readonly struct Capabilities
{ {
public readonly TargetApi Api; public readonly TargetApi Api;
public readonly string VendorName; public readonly string VendorName;

View File

@ -1,32 +1,4 @@
using System;
namespace Ryujinx.Graphics.GAL namespace Ryujinx.Graphics.GAL
{ {
public struct ColorF : IEquatable<ColorF> public readonly record struct ColorF(float Red, float Green, float Blue, float Alpha);
{
public float Red { get; }
public float Green { get; }
public float Blue { get; }
public float Alpha { get; }
public ColorF(float red, float green, float blue, float alpha)
{
Red = red;
Green = green;
Blue = blue;
Alpha = alpha;
}
public bool Equals(ColorF color) => Red == color.Red &&
Green == color.Green &&
Blue == color.Blue &&
Alpha == color.Alpha;
public override bool Equals(object obj) => (obj is ColorF color) && Equals(color);
public override int GetHashCode() => HashCode.Combine(Red, Green, Blue, Alpha);
public static bool operator ==(ColorF l, ColorF r) => l.Equals(r);
public static bool operator !=(ColorF l, ColorF r) => !l.Equals(r);
}
} }

View File

@ -1,6 +1,6 @@
namespace Ryujinx.Graphics.GAL namespace Ryujinx.Graphics.GAL
{ {
public struct DepthTestDescriptor public readonly struct DepthTestDescriptor
{ {
public bool TestEnable { get; } public bool TestEnable { get; }
public bool WriteEnable { get; } public bool WriteEnable { get; }

View File

@ -1,6 +1,6 @@
namespace Ryujinx.Graphics.GAL namespace Ryujinx.Graphics.GAL
{ {
public struct DeviceInfo public readonly struct DeviceInfo
{ {
public readonly string Id; public readonly string Id;
public readonly string Vendor; public readonly string Vendor;

View File

@ -2,7 +2,7 @@ using Ryujinx.Common;
namespace Ryujinx.Graphics.GAL namespace Ryujinx.Graphics.GAL
{ {
public struct Extents2D public readonly struct Extents2D
{ {
public int X1 { get; } public int X1 { get; }
public int Y1 { get; } public int Y1 { get; }

View File

@ -1,6 +1,6 @@
namespace Ryujinx.Graphics.GAL namespace Ryujinx.Graphics.GAL
{ {
public struct Extents2DF public readonly struct Extents2DF
{ {
public float X1 { get; } public float X1 { get; }
public float Y1 { get; } public float Y1 { get; }

View File

@ -1,6 +1,6 @@
namespace Ryujinx.Graphics.GAL namespace Ryujinx.Graphics.GAL
{ {
public struct HardwareInfo public readonly struct HardwareInfo
{ {
public string GpuVendor { get; } public string GpuVendor { get; }
public string GpuModel { get; } public string GpuModel { get; }

View File

@ -1,6 +1,6 @@
namespace Ryujinx.Graphics.GAL namespace Ryujinx.Graphics.GAL
{ {
public struct ImageCrop public readonly struct ImageCrop
{ {
public int Left { get; } public int Left { get; }
public int Right { get; } public int Right { get; }

View File

@ -1,6 +1,6 @@
namespace Ryujinx.Graphics.GAL namespace Ryujinx.Graphics.GAL
{ {
public struct MultisampleDescriptor public readonly struct MultisampleDescriptor
{ {
public bool AlphaToCoverageEnable { get; } public bool AlphaToCoverageEnable { get; }
public bool AlphaToCoverageDitherEnable { get; } public bool AlphaToCoverageDitherEnable { get; }

View File

@ -6,7 +6,7 @@ namespace Ryujinx.Graphics.GAL
/// <summary> /// <summary>
/// Descriptor for a pipeline buffer binding. /// Descriptor for a pipeline buffer binding.
/// </summary> /// </summary>
public struct BufferPipelineDescriptor public readonly struct BufferPipelineDescriptor
{ {
public bool Enable { get; } public bool Enable { get; }
public int Stride { get; } public int Stride { get; }

View File

@ -1,6 +1,6 @@
namespace Ryujinx.Graphics.GAL namespace Ryujinx.Graphics.GAL
{ {
public struct Rectangle<T> where T : unmanaged public readonly struct Rectangle<T> where T : unmanaged
{ {
public T X { get; } public T X { get; }
public T Y { get; } public T Y { get; }

View File

@ -1,6 +1,6 @@
namespace Ryujinx.Graphics.GAL namespace Ryujinx.Graphics.GAL
{ {
public struct SamplerCreateInfo public readonly struct SamplerCreateInfo
{ {
public MinFilter MinFilter { get; } public MinFilter MinFilter { get; }
public MagFilter MagFilter { get; } public MagFilter MagFilter { get; }

View File

@ -1,6 +1,6 @@
namespace Ryujinx.Graphics.GAL namespace Ryujinx.Graphics.GAL
{ {
public struct ScreenCaptureImageInfo public readonly struct ScreenCaptureImageInfo
{ {
public ScreenCaptureImageInfo(int width, int height, bool isBgra, byte[] data, bool flipX, bool flipY) public ScreenCaptureImageInfo(int width, int height, bool isBgra, byte[] data, bool flipX, bool flipY)
{ {

View File

@ -2,7 +2,7 @@
namespace Ryujinx.Graphics.GAL namespace Ryujinx.Graphics.GAL
{ {
public struct ShaderBindings public readonly struct ShaderBindings
{ {
public IReadOnlyCollection<int> UniformBufferBindings { get; } public IReadOnlyCollection<int> UniformBufferBindings { get; }
public IReadOnlyCollection<int> StorageBufferBindings { get; } public IReadOnlyCollection<int> StorageBufferBindings { get; }

View File

@ -3,7 +3,7 @@ using Ryujinx.Graphics.Shader.Translation;
namespace Ryujinx.Graphics.GAL namespace Ryujinx.Graphics.GAL
{ {
public struct ShaderSource public readonly struct ShaderSource
{ {
public string Code { get; } public string Code { get; }
public byte[] BinaryCode { get; } public byte[] BinaryCode { get; }

View File

@ -1,6 +1,6 @@
namespace Ryujinx.Graphics.GAL namespace Ryujinx.Graphics.GAL
{ {
public struct StencilTestDescriptor public readonly struct StencilTestDescriptor
{ {
public bool TestEnable { get; } public bool TestEnable { get; }

View File

@ -4,7 +4,7 @@ using System.Numerics;
namespace Ryujinx.Graphics.GAL namespace Ryujinx.Graphics.GAL
{ {
public struct TextureCreateInfo : IEquatable<TextureCreateInfo> public readonly struct TextureCreateInfo : IEquatable<TextureCreateInfo>
{ {
public int Width { get; } public int Width { get; }
public int Height { get; } public int Height { get; }
@ -62,42 +62,42 @@ namespace Ryujinx.Graphics.GAL
SwizzleA = swizzleA; SwizzleA = swizzleA;
} }
public readonly int GetMipSize(int level) public int GetMipSize(int level)
{ {
return GetMipStride(level) * GetLevelHeight(level) * GetLevelDepth(level); return GetMipStride(level) * GetLevelHeight(level) * GetLevelDepth(level);
} }
public readonly int GetMipSize2D(int level) public int GetMipSize2D(int level)
{ {
return GetMipStride(level) * GetLevelHeight(level); return GetMipStride(level) * GetLevelHeight(level);
} }
public readonly int GetMipStride(int level) public int GetMipStride(int level)
{ {
return BitUtils.AlignUp(GetLevelWidth(level) * BytesPerPixel, 4); return BitUtils.AlignUp(GetLevelWidth(level) * BytesPerPixel, 4);
} }
private readonly int GetLevelWidth(int level) private int GetLevelWidth(int level)
{ {
return BitUtils.DivRoundUp(GetLevelSize(Width, level), BlockWidth); return BitUtils.DivRoundUp(GetLevelSize(Width, level), BlockWidth);
} }
private readonly int GetLevelHeight(int level) private int GetLevelHeight(int level)
{ {
return BitUtils.DivRoundUp(GetLevelSize(Height, level), BlockHeight); return BitUtils.DivRoundUp(GetLevelSize(Height, level), BlockHeight);
} }
private readonly int GetLevelDepth(int level) private int GetLevelDepth(int level)
{ {
return Target == Target.Texture3D ? GetLevelSize(Depth, level) : GetLayers(); return Target == Target.Texture3D ? GetLevelSize(Depth, level) : GetLayers();
} }
public readonly int GetDepthOrLayers() public int GetDepthOrLayers()
{ {
return Target == Target.Texture3D ? Depth : GetLayers(); return Target == Target.Texture3D ? Depth : GetLayers();
} }
public readonly int GetLayers() public int GetLayers()
{ {
if (Target == Target.Texture2DArray || if (Target == Target.Texture2DArray ||
Target == Target.Texture2DMultisampleArray || Target == Target.Texture2DMultisampleArray ||
@ -113,7 +113,7 @@ namespace Ryujinx.Graphics.GAL
return 1; return 1;
} }
public readonly int GetLevelsClamped() public int GetLevelsClamped()
{ {
int maxSize = Width; int maxSize = Width;

View File

@ -1,40 +1,4 @@
using System;
namespace Ryujinx.Graphics.GAL namespace Ryujinx.Graphics.GAL
{ {
public struct VertexAttribDescriptor : IEquatable<VertexAttribDescriptor> public readonly record struct VertexAttribDescriptor(int BufferIndex, int Offset, bool IsZero, Format Format);
{
public int BufferIndex { get; }
public int Offset { get; }
public bool IsZero { get; }
public Format Format { get; }
public VertexAttribDescriptor(int bufferIndex, int offset, bool isZero, Format format)
{
BufferIndex = bufferIndex;
Offset = offset;
IsZero = isZero;
Format = format;
}
public override bool Equals(object obj)
{
return obj is VertexAttribDescriptor other && Equals(other);
}
public bool Equals(VertexAttribDescriptor other)
{
return BufferIndex == other.BufferIndex &&
Offset == other.Offset &&
IsZero == other.IsZero &&
Format == other.Format;
}
public override int GetHashCode()
{
return HashCode.Combine(BufferIndex, Offset, IsZero, Format);
}
}
} }

View File

@ -1,6 +1,6 @@
namespace Ryujinx.Graphics.GAL namespace Ryujinx.Graphics.GAL
{ {
public struct VertexBufferDescriptor public readonly struct VertexBufferDescriptor
{ {
public BufferRange Buffer { get; } public BufferRange Buffer { get; }

View File

@ -1,6 +1,6 @@
namespace Ryujinx.Graphics.GAL namespace Ryujinx.Graphics.GAL
{ {
public struct Viewport public readonly struct Viewport
{ {
public Rectangle<float> Region { get; } public Rectangle<float> Region { get; }

View File

@ -7,7 +7,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.MME
/// <summary> /// <summary>
/// FIFO word. /// FIFO word.
/// </summary> /// </summary>
struct FifoWord readonly struct FifoWord
{ {
/// <summary> /// <summary>
/// GPU virtual address where the word is located in memory. /// GPU virtual address where the word is located in memory.

View File

@ -13,7 +13,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.MME
/// <summary> /// <summary>
/// Macroo High-level implementation table entry. /// Macroo High-level implementation table entry.
/// </summary> /// </summary>
struct TableEntry readonly struct TableEntry
{ {
/// <summary> /// <summary>
/// Name of the Macro function. /// Name of the Macro function.

View File

@ -11,7 +11,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
/// <summary> /// <summary>
/// State update callback entry, with the callback function and associated field names. /// State update callback entry, with the callback function and associated field names.
/// </summary> /// </summary>
struct StateUpdateCallbackEntry readonly struct StateUpdateCallbackEntry
{ {
/// <summary> /// <summary>
/// Callback function, to be called if the register was written as the state needs to be updated. /// Callback function, to be called if the register was written as the state needs to be updated.

View File

@ -5,7 +5,7 @@ namespace Ryujinx.Graphics.Gpu.Image
/// <summary> /// <summary>
/// Represents texture format information. /// Represents texture format information.
/// </summary> /// </summary>
struct FormatInfo readonly struct FormatInfo
{ {
/// <summary> /// <summary>
/// A default, generic RGBA8 texture format. /// A default, generic RGBA8 texture format.

View File

@ -7,7 +7,7 @@ namespace Ryujinx.Graphics.Gpu.Image
/// Texture binding information. /// Texture binding information.
/// This is used for textures that needs to be accessed from shaders. /// This is used for textures that needs to be accessed from shaders.
/// </summary> /// </summary>
struct TextureBindingInfo readonly struct TextureBindingInfo
{ {
/// <summary> /// <summary>
/// Shader sampler target type. /// Shader sampler target type.

View File

@ -16,7 +16,7 @@ namespace Ryujinx.Graphics.Gpu.Image
/// </summary> /// </summary>
class TextureCache : IDisposable class TextureCache : IDisposable
{ {
private struct OverlapInfo private readonly struct OverlapInfo
{ {
public TextureViewCompatibility Compatibility { get; } public TextureViewCompatibility Compatibility { get; }
public int FirstLayer { get; } public int FirstLayer { get; }

View File

@ -14,7 +14,7 @@ namespace Ryujinx.Graphics.Gpu.Image
/// <summary> /// <summary>
/// An overlapping texture group with a given view compatibility. /// An overlapping texture group with a given view compatibility.
/// </summary> /// </summary>
struct TextureIncompatibleOverlap readonly struct TextureIncompatibleOverlap
{ {
public readonly TextureGroup Group; public readonly TextureGroup Group;
public readonly TextureViewCompatibility Compatibility; public readonly TextureViewCompatibility Compatibility;

View File

@ -6,7 +6,7 @@ namespace Ryujinx.Graphics.Gpu.Image
/// <summary> /// <summary>
/// Texture information. /// Texture information.
/// </summary> /// </summary>
struct TextureInfo readonly struct TextureInfo
{ {
/// <summary> /// <summary>
/// Address of the texture in GPU mapped memory. /// Address of the texture in GPU mapped memory.

View File

@ -5,7 +5,7 @@ namespace Ryujinx.Graphics.Gpu.Memory
/// <summary> /// <summary>
/// Memory range used for buffers. /// Memory range used for buffers.
/// </summary> /// </summary>
struct BufferBounds readonly struct BufferBounds
{ {
/// <summary> /// <summary>
/// Region virtual address. /// Region virtual address.

View File

@ -7,7 +7,7 @@ namespace Ryujinx.Graphics.Gpu.Memory
/// <summary> /// <summary>
/// A buffer binding to apply to a buffer texture. /// A buffer binding to apply to a buffer texture.
/// </summary> /// </summary>
struct BufferTextureBinding readonly struct BufferTextureBinding
{ {
/// <summary> /// <summary>
/// Shader stage accessing the texture. /// Shader stage accessing the texture.

View File

@ -8,7 +8,7 @@ namespace Ryujinx.Graphics.Gpu.Memory
/// </summary> /// </summary>
class CounterCache class CounterCache
{ {
private struct CounterEntry private readonly struct CounterEntry
{ {
public ulong Address { get; } public ulong Address { get; }
public ICounterEvent Event { get; } public ICounterEvent Event { get; }

View File

@ -24,7 +24,7 @@ namespace Ryujinx.Graphics.Gpu.Shader.DiskCache
/// <summary> /// <summary>
/// Represents an operation to perform on the <see cref="_fileWriterWorkerQueue"/>. /// Represents an operation to perform on the <see cref="_fileWriterWorkerQueue"/>.
/// </summary> /// </summary>
private struct CacheFileOperationTask private readonly struct CacheFileOperationTask
{ {
/// <summary> /// <summary>
/// The type of operation to perform. /// The type of operation to perform.
@ -46,7 +46,7 @@ namespace Ryujinx.Graphics.Gpu.Shader.DiskCache
/// <summary> /// <summary>
/// Background shader cache write information. /// Background shader cache write information.
/// </summary> /// </summary>
private struct AddShaderData private readonly struct AddShaderData
{ {
/// <summary> /// <summary>
/// Cached shader program. /// Cached shader program.

View File

@ -22,7 +22,7 @@ namespace Ryujinx.Graphics.Gpu.Shader.DiskCache
private const ushort FileFormatVersionMajor = 1; private const ushort FileFormatVersionMajor = 1;
private const ushort FileFormatVersionMinor = 2; private const ushort FileFormatVersionMinor = 2;
private const uint FileFormatVersionPacked = ((uint)FileFormatVersionMajor << 16) | FileFormatVersionMinor; private const uint FileFormatVersionPacked = ((uint)FileFormatVersionMajor << 16) | FileFormatVersionMinor;
private const uint CodeGenVersion = 3957; private const uint CodeGenVersion = 4011;
private const string SharedTocFileName = "shared.toc"; private const string SharedTocFileName = "shared.toc";
private const string SharedDataFileName = "shared.data"; private const string SharedDataFileName = "shared.data";

View File

@ -3,7 +3,7 @@ namespace Ryujinx.Graphics.Gpu.Shader.DiskCache
/// <summary> /// <summary>
/// Guest shader code and constant buffer data accessed by the shader. /// Guest shader code and constant buffer data accessed by the shader.
/// </summary> /// </summary>
struct GuestCodeAndCbData readonly struct GuestCodeAndCbData
{ {
/// <summary> /// <summary>
/// Maxwell binary shader code. /// Maxwell binary shader code.

View File

@ -37,7 +37,7 @@ namespace Ryujinx.Graphics.Gpu.Shader.DiskCache
/// <summary> /// <summary>
/// Program validation entry. /// Program validation entry.
/// </summary> /// </summary>
private struct ProgramEntry private readonly struct ProgramEntry
{ {
/// <summary> /// <summary>
/// Cached shader program. /// Cached shader program.
@ -90,7 +90,7 @@ namespace Ryujinx.Graphics.Gpu.Shader.DiskCache
/// <summary> /// <summary>
/// Translated shader compilation entry. /// Translated shader compilation entry.
/// </summary> /// </summary>
private struct ProgramCompilation private readonly struct ProgramCompilation
{ {
/// <summary> /// <summary>
/// Translated shader stages. /// Translated shader stages.
@ -143,7 +143,7 @@ namespace Ryujinx.Graphics.Gpu.Shader.DiskCache
/// <summary> /// <summary>
/// Program translation entry. /// Program translation entry.
/// </summary> /// </summary>
private struct AsyncProgramTranslation private readonly struct AsyncProgramTranslation
{ {
/// <summary> /// <summary>
/// Guest code for each active stage. /// Guest code for each active stage.

View File

@ -3,7 +3,7 @@ namespace Ryujinx.Graphics.Gpu.Shader
/// <summary> /// <summary>
/// State used by the <see cref="GpuAccessor"/>. /// State used by the <see cref="GpuAccessor"/>.
/// </summary> /// </summary>
struct GpuChannelComputeState readonly struct GpuChannelComputeState
{ {
// New fields should be added to the end of the struct to keep disk shader cache compatibility. // New fields should be added to the end of the struct to keep disk shader cache compatibility.

View File

@ -5,7 +5,7 @@ namespace Ryujinx.Graphics.Gpu.Shader
/// <summary> /// <summary>
/// State used by the <see cref="GpuAccessor"/>. /// State used by the <see cref="GpuAccessor"/>.
/// </summary> /// </summary>
struct GpuChannelPoolState : IEquatable<GpuChannelPoolState> readonly struct GpuChannelPoolState : IEquatable<GpuChannelPoolState>
{ {
/// <summary> /// <summary>
/// GPU virtual address of the texture pool. /// GPU virtual address of the texture pool.

View File

@ -13,7 +13,7 @@ namespace Ryujinx.Graphics.Gpu.Shader.HashTable
/// <summary> /// <summary>
/// Entry for a given data size. /// Entry for a given data size.
/// </summary> /// </summary>
private struct SizeEntry private readonly struct SizeEntry
{ {
/// <summary> /// <summary>
/// Size for the data that will be stored on the hash table on this entry. /// Size for the data that will be stored on the hash table on this entry.

View File

@ -26,7 +26,7 @@ namespace Ryujinx.Graphics.Gpu.Shader
/// </summary> /// </summary>
public const TranslationFlags DefaultFlags = TranslationFlags.DebugMode; public const TranslationFlags DefaultFlags = TranslationFlags.DebugMode;
private struct TranslatedShader private readonly struct TranslatedShader
{ {
public readonly CachedShaderStage Shader; public readonly CachedShaderStage Shader;
public readonly ShaderProgram Program; public readonly ShaderProgram Program;
@ -38,7 +38,7 @@ namespace Ryujinx.Graphics.Gpu.Shader
} }
} }
private struct TranslatedShaderVertexPair private readonly struct TranslatedShaderVertexPair
{ {
public readonly CachedShaderStage VertexA; public readonly CachedShaderStage VertexA;
public readonly CachedShaderStage VertexB; public readonly CachedShaderStage VertexB;
@ -59,7 +59,7 @@ namespace Ryujinx.Graphics.Gpu.Shader
private readonly Dictionary<ulong, CachedShaderProgram> _cpPrograms; private readonly Dictionary<ulong, CachedShaderProgram> _cpPrograms;
private readonly Dictionary<ShaderAddresses, CachedShaderProgram> _gpPrograms; private readonly Dictionary<ShaderAddresses, CachedShaderProgram> _gpPrograms;
private struct ProgramToSave private readonly struct ProgramToSave
{ {
public readonly CachedShaderProgram CachedProgram; public readonly CachedShaderProgram CachedProgram;
public readonly IProgram HostProgram; public readonly IProgram HostProgram;

View File

@ -7,7 +7,7 @@ namespace Ryujinx.Graphics.Gpu.Shader
/// <summary> /// <summary>
/// Shader code accessor. /// Shader code accessor.
/// </summary> /// </summary>
struct ShaderCodeAccessor : IDataAccessor readonly struct ShaderCodeAccessor : IDataAccessor
{ {
private readonly MemoryManager _memoryManager; private readonly MemoryManager _memoryManager;
private readonly ulong _baseAddress; private readonly ulong _baseAddress;

View File

@ -5,7 +5,7 @@ namespace Ryujinx.Graphics.Gpu.Shader
/// <summary> /// <summary>
/// Paths where shader code was dumped on disk. /// Paths where shader code was dumped on disk.
/// </summary> /// </summary>
struct ShaderDumpPaths readonly struct ShaderDumpPaths
{ {
/// <summary> /// <summary>
/// Path where the full shader code with header was dumped, or null if not dumped. /// Path where the full shader code with header was dumped, or null if not dumped.

View File

@ -121,7 +121,7 @@ namespace Ryujinx.Graphics.Gpu.Shader
/// <summary> /// <summary>
/// Texture binding information, used to identify each texture accessed by the shader. /// Texture binding information, used to identify each texture accessed by the shader.
/// </summary> /// </summary>
private struct TextureKey : IEquatable<TextureKey> private readonly record struct TextureKey
{ {
// New fields should be added to the end of the struct to keep disk shader cache compatibility. // New fields should be added to the end of the struct to keep disk shader cache compatibility.
@ -152,21 +152,6 @@ namespace Ryujinx.Graphics.Gpu.Shader
Handle = handle; Handle = handle;
CbufSlot = cbufSlot; CbufSlot = cbufSlot;
} }
public override bool Equals(object obj)
{
return obj is TextureKey textureKey && Equals(textureKey);
}
public bool Equals(TextureKey other)
{
return StageIndex == other.StageIndex && Handle == other.Handle && CbufSlot == other.CbufSlot;
}
public override int GetHashCode()
{
return HashCode.Combine(StageIndex, Handle, CbufSlot);
}
} }
private readonly Dictionary<TextureKey, Box<TextureSpecializationState>> _textureSpecialization; private readonly Dictionary<TextureKey, Box<TextureSpecializationState>> _textureSpecialization;

View File

@ -20,7 +20,7 @@ namespace Ryujinx.Graphics.Gpu
/// <summary> /// <summary>
/// Texture presented on the window. /// Texture presented on the window.
/// </summary> /// </summary>
private struct PresentationTexture private readonly struct PresentationTexture
{ {
/// <summary> /// <summary>
/// Texture cache where the texture might be located. /// Texture cache where the texture might be located.

View File

@ -9,7 +9,7 @@ namespace Ryujinx.Graphics.Host1x
{ {
public sealed class Host1xDevice : IDisposable public sealed class Host1xDevice : IDisposable
{ {
private struct Command private readonly struct Command
{ {
public int[] Buffer { get; } public int[] Buffer { get; }
public long ContextId { get; } public long ContextId { get; }

View File

@ -7,7 +7,7 @@ namespace Ryujinx.Graphics.Host1x
{ {
private readonly SynchronizationManager _syncMgr; private readonly SynchronizationManager _syncMgr;
private struct SyncptIncr private readonly struct SyncptIncr
{ {
public uint Id { get; } public uint Id { get; }
public ClassId ClassId { get; } public ClassId ClassId { get; }

Some files were not shown because too many files have changed in this diff Show More