Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
2c9715acf6 | ||
|
274af65f69 | ||
|
4ca78eded5 | ||
|
6cb6b15612 | ||
|
2725e40838 | ||
|
c2e4c8f98e | ||
|
b53e7ffd46 | ||
|
ac66643346 |
4
.github/workflows/release.yml
vendored
4
.github/workflows/release.yml
vendored
@@ -33,7 +33,7 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Create tag
|
- name: Create tag
|
||||||
uses: actions/github-script@v5
|
uses: actions/github-script@v6
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
github.rest.git.createRef({
|
github.rest.git.createRef({
|
||||||
@@ -207,4 +207,4 @@ jobs:
|
|||||||
needs: release
|
needs: release
|
||||||
with:
|
with:
|
||||||
ryujinx_version: "1.1.${{ github.run_number }}"
|
ryujinx_version: "1.1.${{ github.run_number }}"
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
@@ -216,26 +216,17 @@
|
|||||||
"ControllerSettingsDPadDown": "Down",
|
"ControllerSettingsDPadDown": "Down",
|
||||||
"ControllerSettingsDPadLeft": "Left",
|
"ControllerSettingsDPadLeft": "Left",
|
||||||
"ControllerSettingsDPadRight": "Right",
|
"ControllerSettingsDPadRight": "Right",
|
||||||
|
"ControllerSettingsStickButton": "Button",
|
||||||
|
"ControllerSettingsStickUp": "Up",
|
||||||
|
"ControllerSettingsStickDown": "Down",
|
||||||
|
"ControllerSettingsStickLeft": "Left",
|
||||||
|
"ControllerSettingsStickRight": "Right",
|
||||||
|
"ControllerSettingsStickStick": "Stick",
|
||||||
|
"ControllerSettingsStickInvertXAxis": "Invert Stick X",
|
||||||
|
"ControllerSettingsStickInvertYAxis": "Invert Stick Y",
|
||||||
|
"ControllerSettingsStickDeadzone": "Deadzone:",
|
||||||
"ControllerSettingsLStick": "Left Stick",
|
"ControllerSettingsLStick": "Left Stick",
|
||||||
"ControllerSettingsLStickButton": "Button",
|
|
||||||
"ControllerSettingsLStickUp": "Up",
|
|
||||||
"ControllerSettingsLStickDown": "Down",
|
|
||||||
"ControllerSettingsLStickLeft": "Left",
|
|
||||||
"ControllerSettingsLStickRight": "Right",
|
|
||||||
"ControllerSettingsLStickStick": "Stick",
|
|
||||||
"ControllerSettingsLStickInvertXAxis": "Invert Stick X",
|
|
||||||
"ControllerSettingsLStickInvertYAxis": "Invert Stick Y",
|
|
||||||
"ControllerSettingsLStickDeadzone": "Deadzone:",
|
|
||||||
"ControllerSettingsRStick": "Right Stick",
|
"ControllerSettingsRStick": "Right Stick",
|
||||||
"ControllerSettingsRStickButton": "Button",
|
|
||||||
"ControllerSettingsRStickUp": "Up",
|
|
||||||
"ControllerSettingsRStickDown": "Down",
|
|
||||||
"ControllerSettingsRStickLeft": "Left",
|
|
||||||
"ControllerSettingsRStickRight": "Right",
|
|
||||||
"ControllerSettingsRStickStick": "Stick",
|
|
||||||
"ControllerSettingsRStickInvertXAxis": "Invert Stick X",
|
|
||||||
"ControllerSettingsRStickInvertYAxis": "Invert Stick Y",
|
|
||||||
"ControllerSettingsRStickDeadzone": "Deadzone:",
|
|
||||||
"ControllerSettingsTriggersLeft": "Triggers Left",
|
"ControllerSettingsTriggersLeft": "Triggers Left",
|
||||||
"ControllerSettingsTriggersRight": "Triggers Right",
|
"ControllerSettingsTriggersRight": "Triggers Right",
|
||||||
"ControllerSettingsTriggersButtonsLeft": "Trigger Buttons Left",
|
"ControllerSettingsTriggersButtonsLeft": "Trigger Buttons Left",
|
||||||
@@ -647,4 +638,4 @@
|
|||||||
"NetworkInterfaceTooltip": "The network interface used for LAN features",
|
"NetworkInterfaceTooltip": "The network interface used for LAN features",
|
||||||
"NetworkInterfaceDefault": "Default",
|
"NetworkInterfaceDefault": "Default",
|
||||||
"PackagingShaders": "Packaging Shaders"
|
"PackagingShaders": "Packaging Shaders"
|
||||||
}
|
}
|
@@ -7,6 +7,7 @@ using Ryujinx.Ava.Common.Locale;
|
|||||||
using Ryujinx.Ava.Input;
|
using Ryujinx.Ava.Input;
|
||||||
using Ryujinx.Ava.UI.Helpers;
|
using Ryujinx.Ava.UI.Helpers;
|
||||||
using Ryujinx.Ava.UI.Models;
|
using Ryujinx.Ava.UI.Models;
|
||||||
|
using Ryujinx.Ava.UI.Views.Input;
|
||||||
using Ryujinx.Ava.UI.Windows;
|
using Ryujinx.Ava.UI.Windows;
|
||||||
using Ryujinx.Common;
|
using Ryujinx.Common;
|
||||||
using Ryujinx.Common.Configuration;
|
using Ryujinx.Common.Configuration;
|
||||||
@@ -30,7 +31,7 @@ using Key = Ryujinx.Common.Configuration.Hid.Key;
|
|||||||
|
|
||||||
namespace Ryujinx.Ava.UI.ViewModels
|
namespace Ryujinx.Ava.UI.ViewModels
|
||||||
{
|
{
|
||||||
public class ControllerSettingsViewModel : BaseModel, IDisposable
|
public class ControllerInputViewModel : BaseModel, IDisposable
|
||||||
{
|
{
|
||||||
private const string Disabled = "disabled";
|
private const string Disabled = "disabled";
|
||||||
private const string ProControllerResource = "Ryujinx.Ui.Common/Resources/Controller_ProCon.svg";
|
private const string ProControllerResource = "Ryujinx.Ui.Common/Resources/Controller_ProCon.svg";
|
||||||
@@ -231,7 +232,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||||||
|
|
||||||
public InputConfig Config { get; set; }
|
public InputConfig Config { get; set; }
|
||||||
|
|
||||||
public ControllerSettingsViewModel(UserControl owner) : this()
|
public ControllerInputViewModel(UserControl owner) : this()
|
||||||
{
|
{
|
||||||
_owner = owner;
|
_owner = owner;
|
||||||
|
|
||||||
@@ -258,7 +259,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public ControllerSettingsViewModel()
|
public ControllerInputViewModel()
|
||||||
{
|
{
|
||||||
PlayerIndexes = new ObservableCollection<PlayerModel>();
|
PlayerIndexes = new ObservableCollection<PlayerModel>();
|
||||||
Controllers = new ObservableCollection<ControllerModel>();
|
Controllers = new ObservableCollection<ControllerModel>();
|
||||||
@@ -328,12 +329,12 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||||||
|
|
||||||
public async void ShowMotionConfig()
|
public async void ShowMotionConfig()
|
||||||
{
|
{
|
||||||
await MotionSettingsWindow.Show(this);
|
await MotionInputView.Show(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async void ShowRumbleConfig()
|
public async void ShowRumbleConfig()
|
||||||
{
|
{
|
||||||
await RumbleSettingsWindow.Show(this);
|
await RumbleInputView.Show(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void LoadInputDriver()
|
private void LoadInputDriver()
|
93
src/Ryujinx.Ava/UI/ViewModels/MotionInputViewModel.cs
Normal file
93
src/Ryujinx.Ava/UI/ViewModels/MotionInputViewModel.cs
Normal file
@@ -0,0 +1,93 @@
|
|||||||
|
namespace Ryujinx.Ava.UI.ViewModels
|
||||||
|
{
|
||||||
|
public class MotionInputViewModel : BaseModel
|
||||||
|
{
|
||||||
|
private int _slot;
|
||||||
|
public int Slot
|
||||||
|
{
|
||||||
|
get => _slot;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_slot = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private int _altSlot;
|
||||||
|
public int AltSlot
|
||||||
|
{
|
||||||
|
get => _altSlot;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_altSlot = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private string _dsuServerHost;
|
||||||
|
public string DsuServerHost
|
||||||
|
{
|
||||||
|
get => _dsuServerHost;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_dsuServerHost = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private int _dsuServerPort;
|
||||||
|
public int DsuServerPort
|
||||||
|
{
|
||||||
|
get => _dsuServerPort;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_dsuServerPort = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool _mirrorInput;
|
||||||
|
public bool MirrorInput
|
||||||
|
{
|
||||||
|
get => _mirrorInput;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_mirrorInput = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private int _sensitivity;
|
||||||
|
public int Sensitivity
|
||||||
|
{
|
||||||
|
get => _sensitivity;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_sensitivity = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private double _gryoDeadzone;
|
||||||
|
public double GyroDeadzone
|
||||||
|
{
|
||||||
|
get => _gryoDeadzone;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_gryoDeadzone = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool _enableCemuHookMotion;
|
||||||
|
public bool EnableCemuHookMotion
|
||||||
|
{
|
||||||
|
get => _enableCemuHookMotion;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_enableCemuHookMotion = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
27
src/Ryujinx.Ava/UI/ViewModels/RumbleInputViewModel.cs
Normal file
27
src/Ryujinx.Ava/UI/ViewModels/RumbleInputViewModel.cs
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
namespace Ryujinx.Ava.UI.ViewModels
|
||||||
|
{
|
||||||
|
public class RumbleInputViewModel : BaseModel
|
||||||
|
{
|
||||||
|
private float _strongRumble;
|
||||||
|
public float StrongRumble
|
||||||
|
{
|
||||||
|
get => _strongRumble;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_strongRumble = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private float _weakRumble;
|
||||||
|
public float WeakRumble
|
||||||
|
{
|
||||||
|
get => _weakRumble;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_weakRumble = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -311,7 +311,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||||||
{
|
{
|
||||||
_gpuIds = new List<string>();
|
_gpuIds = new List<string>();
|
||||||
List<string> names = new();
|
List<string> names = new();
|
||||||
var devices = VulkanRenderer.GetPhysicalDevices(Vk.GetApi());
|
var devices = VulkanRenderer.GetPhysicalDevices();
|
||||||
|
|
||||||
if (devices.Length == 0)
|
if (devices.Length == 0)
|
||||||
{
|
{
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -4,7 +4,6 @@ using Avalonia.Input;
|
|||||||
using Avalonia.Interactivity;
|
using Avalonia.Interactivity;
|
||||||
using Avalonia.LogicalTree;
|
using Avalonia.LogicalTree;
|
||||||
using Ryujinx.Ava.Common.Locale;
|
using Ryujinx.Ava.Common.Locale;
|
||||||
using Ryujinx.Ava.UI.Controls;
|
|
||||||
using Ryujinx.Ava.UI.Helpers;
|
using Ryujinx.Ava.UI.Helpers;
|
||||||
using Ryujinx.Ava.UI.Models;
|
using Ryujinx.Ava.UI.Models;
|
||||||
using Ryujinx.Ava.UI.ViewModels;
|
using Ryujinx.Ava.UI.ViewModels;
|
||||||
@@ -13,18 +12,18 @@ using Ryujinx.Input;
|
|||||||
using Ryujinx.Input.Assigner;
|
using Ryujinx.Input.Assigner;
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace Ryujinx.Ava.UI.Windows
|
namespace Ryujinx.Ava.UI.Views.Input
|
||||||
{
|
{
|
||||||
public partial class ControllerSettingsWindow : UserControl
|
public partial class ControllerInputView : UserControl
|
||||||
{
|
{
|
||||||
private bool _dialogOpen;
|
private bool _dialogOpen;
|
||||||
|
|
||||||
private ButtonKeyAssigner _currentAssigner;
|
private ButtonKeyAssigner _currentAssigner;
|
||||||
internal ControllerSettingsViewModel ViewModel { get; set; }
|
internal ControllerInputViewModel ViewModel { get; set; }
|
||||||
|
|
||||||
public ControllerSettingsWindow()
|
public ControllerInputView()
|
||||||
{
|
{
|
||||||
DataContext = ViewModel = new ControllerSettingsViewModel(this);
|
DataContext = ViewModel = new ControllerInputViewModel(this);
|
||||||
|
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
@@ -1,12 +1,15 @@
|
|||||||
<UserControl
|
<UserControl
|
||||||
xmlns="https://github.com/avaloniaui"
|
xmlns="https://github.com/avaloniaui"
|
||||||
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"
|
||||||
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"
|
||||||
|
xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
x:Class="Ryujinx.Ava.UI.Windows.MotionSettingsWindow"
|
x:Class="Ryujinx.Ava.UI.Views.Input.MotionInputView"
|
||||||
|
x:CompileBindings="True"
|
||||||
|
x:DataType="viewModels:MotionInputViewModel"
|
||||||
Focusable="True">
|
Focusable="True">
|
||||||
<Grid Margin="10">
|
<Grid Margin="10">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
@@ -14,7 +17,9 @@
|
|||||||
<RowDefinition />
|
<RowDefinition />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<StackPanel Orientation="Vertical">
|
<StackPanel Orientation="Vertical">
|
||||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
|
<StackPanel
|
||||||
|
Orientation="Horizontal"
|
||||||
|
HorizontalAlignment="Center">
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Margin="0"
|
Margin="0"
|
||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
@@ -28,11 +33,14 @@
|
|||||||
Maximum="100"
|
Maximum="100"
|
||||||
Minimum="0"
|
Minimum="0"
|
||||||
Value="{Binding Sensitivity, Mode=TwoWay}" />
|
Value="{Binding Sensitivity, Mode=TwoWay}" />
|
||||||
<TextBlock HorizontalAlignment="Center"
|
<TextBlock
|
||||||
Margin="5, 0"
|
HorizontalAlignment="Center"
|
||||||
Text="{Binding Sensitivity, StringFormat=\{0:0\}%}" />
|
Margin="5, 0"
|
||||||
|
Text="{Binding Sensitivity, StringFormat=\{0:0\}%}" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
|
<StackPanel
|
||||||
|
Orientation="Horizontal"
|
||||||
|
HorizontalAlignment="Center">
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Margin="0"
|
Margin="0"
|
||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
@@ -51,17 +59,25 @@
|
|||||||
Margin="5, 0"
|
Margin="5, 0"
|
||||||
Text="{Binding GyroDeadzone, StringFormat=\{0:0.00\}}" />
|
Text="{Binding GyroDeadzone, StringFormat=\{0:0.00\}}" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<Separator Height="1" Margin="0,5" />
|
<Separator
|
||||||
<CheckBox Margin="5" IsChecked="{Binding EnableCemuHookMotion}">
|
Height="1"
|
||||||
<TextBlock Margin="0,3,0,0" VerticalAlignment="Center"
|
Margin="0,5" />
|
||||||
Text="{locale:Locale ControllerSettingsMotionUseCemuhookCompatibleMotion}" />
|
<CheckBox
|
||||||
|
Margin="5"
|
||||||
|
IsChecked="{Binding EnableCemuHookMotion}">
|
||||||
|
<TextBlock
|
||||||
|
Margin="0,3,0,0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="{locale:Locale ControllerSettingsMotionUseCemuhookCompatibleMotion}" />
|
||||||
</CheckBox>
|
</CheckBox>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<Border Grid.Row="1"
|
<Border
|
||||||
Padding="20,5"
|
Grid.Row="1"
|
||||||
BorderBrush="{DynamicResource ThemeControlBorderColor}"
|
Padding="20,5"
|
||||||
BorderThickness="1"
|
BorderBrush="{DynamicResource ThemeControlBorderColor}"
|
||||||
HorizontalAlignment="Stretch">
|
BorderThickness="1"
|
||||||
|
CornerRadius="5"
|
||||||
|
HorizontalAlignment="Stretch">
|
||||||
<Grid VerticalAlignment="Top">
|
<Grid VerticalAlignment="Top">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
@@ -109,30 +125,42 @@
|
|||||||
<ColumnDefinition />
|
<ColumnDefinition />
|
||||||
<ColumnDefinition />
|
<ColumnDefinition />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<TextBlock Margin="0,10,0,0" VerticalAlignment="Center"
|
<TextBlock
|
||||||
Text="{locale:Locale ControllerSettingsMotionControllerSlot}" />
|
Margin="0,10,0,0"
|
||||||
<ui:NumberBox Grid.Row="0" Grid.Column="1"
|
VerticalAlignment="Center"
|
||||||
Name="CemuHookSlotUpDown"
|
Text="{locale:Locale ControllerSettingsMotionControllerSlot}" />
|
||||||
SmallChange="1"
|
<ui:NumberBox
|
||||||
LargeChange="1"
|
Grid.Row="0"
|
||||||
Maximum="4"
|
Grid.Column="1"
|
||||||
Minimum="0"
|
Name="CemuHookSlotUpDown"
|
||||||
Value="{Binding Slot}" />
|
SmallChange="1"
|
||||||
<TextBlock Margin="0,10,0,0" Grid.Row="1" Grid.Column="0" VerticalAlignment="Center"
|
LargeChange="1"
|
||||||
Text="{locale:Locale ControllerSettingsMotionRightJoyConSlot}" />
|
Maximum="4"
|
||||||
<ui:NumberBox Grid.Row="1" Grid.Column="1"
|
Minimum="0"
|
||||||
Name="CemuHookRightJoyConSlotUpDown"
|
Value="{Binding Slot}" />
|
||||||
SmallChange="1"
|
<TextBlock
|
||||||
LargeChange="1"
|
Margin="0,10,0,0"
|
||||||
Maximum="4"
|
Grid.Row="1"
|
||||||
Minimum="0"
|
Grid.Column="0"
|
||||||
Value="{Binding AltSlot}" />
|
VerticalAlignment="Center"
|
||||||
|
Text="{locale:Locale ControllerSettingsMotionRightJoyConSlot}" />
|
||||||
|
<ui:NumberBox
|
||||||
|
Grid.Row="1"
|
||||||
|
Grid.Column="1"
|
||||||
|
Name="CemuHookRightJoyConSlotUpDown"
|
||||||
|
SmallChange="1"
|
||||||
|
LargeChange="1"
|
||||||
|
Maximum="4"
|
||||||
|
Minimum="0"
|
||||||
|
Value="{Binding AltSlot}" />
|
||||||
</Grid>
|
</Grid>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<CheckBox HorizontalAlignment="Center"
|
<CheckBox
|
||||||
IsChecked="{Binding MirrorInput, Mode=TwoWay}">
|
HorizontalAlignment="Center"
|
||||||
<TextBlock HorizontalAlignment="Center"
|
IsChecked="{Binding MirrorInput, Mode=TwoWay}">
|
||||||
Text="{locale:Locale ControllerSettingsMotionMirrorInput}" />
|
<TextBlock
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
Text="{locale:Locale ControllerSettingsMotionMirrorInput}" />
|
||||||
</CheckBox>
|
</CheckBox>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Grid>
|
</Grid>
|
@@ -6,44 +6,42 @@ using Ryujinx.Ava.UI.ViewModels;
|
|||||||
using Ryujinx.Common.Configuration.Hid.Controller;
|
using Ryujinx.Common.Configuration.Hid.Controller;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Ryujinx.Ava.UI.Windows
|
namespace Ryujinx.Ava.UI.Views.Input
|
||||||
{
|
{
|
||||||
public partial class MotionSettingsWindow : UserControl
|
public partial class MotionInputView : UserControl
|
||||||
{
|
{
|
||||||
private readonly InputConfiguration<GamepadInputId, StickInputId> _viewmodel;
|
private MotionInputViewModel _viewModel;
|
||||||
|
|
||||||
public MotionSettingsWindow()
|
public MotionInputView()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
DataContext = _viewmodel;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public MotionSettingsWindow(ControllerSettingsViewModel viewmodel)
|
public MotionInputView(ControllerInputViewModel viewModel)
|
||||||
{
|
{
|
||||||
var config = viewmodel.Configuration as InputConfiguration<GamepadInputId, StickInputId>;
|
var config = viewModel.Configuration as InputConfiguration<GamepadInputId, StickInputId>;
|
||||||
|
|
||||||
_viewmodel = new InputConfiguration<GamepadInputId, StickInputId>()
|
_viewModel = new MotionInputViewModel
|
||||||
{
|
{
|
||||||
Slot = config.Slot,
|
Slot = config.Slot,
|
||||||
AltSlot = config.AltSlot,
|
AltSlot = config.AltSlot,
|
||||||
DsuServerHost = config.DsuServerHost,
|
DsuServerHost = config.DsuServerHost,
|
||||||
DsuServerPort = config.DsuServerPort,
|
DsuServerPort = config.DsuServerPort,
|
||||||
MirrorInput = config.MirrorInput,
|
MirrorInput = config.MirrorInput,
|
||||||
EnableMotion = config.EnableMotion,
|
|
||||||
Sensitivity = config.Sensitivity,
|
Sensitivity = config.Sensitivity,
|
||||||
GyroDeadzone = config.GyroDeadzone,
|
GyroDeadzone = config.GyroDeadzone,
|
||||||
EnableCemuHookMotion = config.EnableCemuHookMotion
|
EnableCemuHookMotion = config.EnableCemuHookMotion
|
||||||
};
|
};
|
||||||
|
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
DataContext = _viewmodel;
|
DataContext = _viewModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async Task Show(ControllerSettingsViewModel viewmodel)
|
public static async Task Show(ControllerInputViewModel viewModel)
|
||||||
{
|
{
|
||||||
MotionSettingsWindow content = new MotionSettingsWindow(viewmodel);
|
MotionInputView content = new(viewModel);
|
||||||
|
|
||||||
ContentDialog contentDialog = new ContentDialog
|
ContentDialog contentDialog = new()
|
||||||
{
|
{
|
||||||
Title = LocaleManager.Instance[LocaleKeys.ControllerMotionTitle],
|
Title = LocaleManager.Instance[LocaleKeys.ControllerMotionTitle],
|
||||||
PrimaryButtonText = LocaleManager.Instance[LocaleKeys.ControllerSettingsSave],
|
PrimaryButtonText = LocaleManager.Instance[LocaleKeys.ControllerSettingsSave],
|
||||||
@@ -53,16 +51,15 @@ namespace Ryujinx.Ava.UI.Windows
|
|||||||
};
|
};
|
||||||
contentDialog.PrimaryButtonClick += (sender, args) =>
|
contentDialog.PrimaryButtonClick += (sender, args) =>
|
||||||
{
|
{
|
||||||
var config = viewmodel.Configuration as InputConfiguration<GamepadInputId, StickInputId>;
|
var config = viewModel.Configuration as InputConfiguration<GamepadInputId, StickInputId>;
|
||||||
config.Slot = content._viewmodel.Slot;
|
config.Slot = content._viewModel.Slot;
|
||||||
config.EnableMotion = content._viewmodel.EnableMotion;
|
config.Sensitivity = content._viewModel.Sensitivity;
|
||||||
config.Sensitivity = content._viewmodel.Sensitivity;
|
config.GyroDeadzone = content._viewModel.GyroDeadzone;
|
||||||
config.GyroDeadzone = content._viewmodel.GyroDeadzone;
|
config.AltSlot = content._viewModel.AltSlot;
|
||||||
config.AltSlot = content._viewmodel.AltSlot;
|
config.DsuServerHost = content._viewModel.DsuServerHost;
|
||||||
config.DsuServerHost = content._viewmodel.DsuServerHost;
|
config.DsuServerPort = content._viewModel.DsuServerPort;
|
||||||
config.DsuServerPort = content._viewmodel.DsuServerPort;
|
config.EnableCemuHookMotion = content._viewModel.EnableCemuHookMotion;
|
||||||
config.EnableCemuHookMotion = content._viewmodel.EnableCemuHookMotion;
|
config.MirrorInput = content._viewModel.MirrorInput;
|
||||||
config.MirrorInput = content._viewmodel.MirrorInput;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
await contentDialog.ShowAsync();
|
await contentDialog.ShowAsync();
|
@@ -1,11 +1,14 @@
|
|||||||
<UserControl
|
<UserControl
|
||||||
xmlns="https://github.com/avaloniaui"
|
xmlns="https://github.com/avaloniaui"
|
||||||
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"
|
||||||
xmlns:locale="clr-namespace:Ryujinx.Ava.Common.Locale"
|
xmlns:locale="clr-namespace:Ryujinx.Ava.Common.Locale"
|
||||||
|
xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
x:Class="Ryujinx.Ava.UI.Windows.RumbleSettingsWindow"
|
x:Class="Ryujinx.Ava.UI.Views.Input.RumbleInputView"
|
||||||
|
x:DataType="viewModels:RumbleInputViewModel"
|
||||||
|
x:CompileBindings="True"
|
||||||
Focusable="True">
|
Focusable="True">
|
||||||
<Grid Margin="10">
|
<Grid Margin="10">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
@@ -6,36 +6,37 @@ using Ryujinx.Ava.UI.ViewModels;
|
|||||||
using Ryujinx.Common.Configuration.Hid.Controller;
|
using Ryujinx.Common.Configuration.Hid.Controller;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Ryujinx.Ava.UI.Windows
|
namespace Ryujinx.Ava.UI.Views.Input
|
||||||
{
|
{
|
||||||
public partial class RumbleSettingsWindow : UserControl
|
public partial class RumbleInputView : UserControl
|
||||||
{
|
{
|
||||||
private readonly InputConfiguration<GamepadInputId, StickInputId> _viewmodel;
|
private RumbleInputViewModel _viewModel;
|
||||||
|
|
||||||
public RumbleSettingsWindow()
|
public RumbleInputView()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
DataContext = _viewmodel;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public RumbleSettingsWindow(ControllerSettingsViewModel viewmodel)
|
public RumbleInputView(ControllerInputViewModel viewModel)
|
||||||
{
|
{
|
||||||
var config = viewmodel.Configuration as InputConfiguration<GamepadInputId, StickInputId>;
|
var config = viewModel.Configuration as InputConfiguration<GamepadInputId, StickInputId>;
|
||||||
|
|
||||||
_viewmodel = new InputConfiguration<GamepadInputId, StickInputId>()
|
_viewModel = new RumbleInputViewModel
|
||||||
{
|
{
|
||||||
StrongRumble = config.StrongRumble, WeakRumble = config.WeakRumble
|
StrongRumble = config.StrongRumble,
|
||||||
|
WeakRumble = config.WeakRumble
|
||||||
};
|
};
|
||||||
|
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
DataContext = _viewmodel;
|
|
||||||
|
DataContext = _viewModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async Task Show(ControllerSettingsViewModel viewmodel)
|
public static async Task Show(ControllerInputViewModel viewModel)
|
||||||
{
|
{
|
||||||
RumbleSettingsWindow content = new RumbleSettingsWindow(viewmodel);
|
RumbleInputView content = new(viewModel);
|
||||||
|
|
||||||
ContentDialog contentDialog = new ContentDialog
|
ContentDialog contentDialog = new()
|
||||||
{
|
{
|
||||||
Title = LocaleManager.Instance[LocaleKeys.ControllerRumbleTitle],
|
Title = LocaleManager.Instance[LocaleKeys.ControllerRumbleTitle],
|
||||||
PrimaryButtonText = LocaleManager.Instance[LocaleKeys.ControllerSettingsSave],
|
PrimaryButtonText = LocaleManager.Instance[LocaleKeys.ControllerSettingsSave],
|
||||||
@@ -43,14 +44,14 @@ namespace Ryujinx.Ava.UI.Windows
|
|||||||
CloseButtonText = LocaleManager.Instance[LocaleKeys.ControllerSettingsClose],
|
CloseButtonText = LocaleManager.Instance[LocaleKeys.ControllerSettingsClose],
|
||||||
Content = content,
|
Content = content,
|
||||||
};
|
};
|
||||||
|
|
||||||
contentDialog.PrimaryButtonClick += (sender, args) =>
|
contentDialog.PrimaryButtonClick += (sender, args) =>
|
||||||
{
|
{
|
||||||
var config = viewmodel.Configuration as InputConfiguration<GamepadInputId, StickInputId>;
|
var config = viewModel.Configuration as InputConfiguration<GamepadInputId, StickInputId>;
|
||||||
config.StrongRumble = content._viewmodel.StrongRumble;
|
config.StrongRumble = content._viewModel.StrongRumble;
|
||||||
config.WeakRumble = content._viewmodel.WeakRumble;
|
config.WeakRumble = content._viewModel.WeakRumble;
|
||||||
};
|
};
|
||||||
|
|
||||||
await contentDialog.ShowAsync();
|
await contentDialog.ShowAsync();
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -1,11 +1,11 @@
|
|||||||
<UserControl
|
<UserControl
|
||||||
x:Class="Ryujinx.Ava.UI.Views.Settings.SettingsInputView"
|
x:Class="Ryujinx.Ava.UI.Views.Settings.SettingsInputView"
|
||||||
xmlns="https://github.com/avaloniaui"
|
xmlns="https://github.com/avaloniaui"
|
||||||
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"
|
||||||
xmlns:locale="clr-namespace:Ryujinx.Ava.Common.Locale"
|
xmlns:locale="clr-namespace:Ryujinx.Ava.Common.Locale"
|
||||||
xmlns:window="clr-namespace:Ryujinx.Ava.UI.Windows"
|
xmlns:views="clr-namespace:Ryujinx.Ava.UI.Views.Input"
|
||||||
xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels"
|
xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
x:CompileBindings="True"
|
x:CompileBindings="True"
|
||||||
@@ -13,34 +13,56 @@
|
|||||||
<Design.DataContext>
|
<Design.DataContext>
|
||||||
<viewModels:SettingsViewModel />
|
<viewModels:SettingsViewModel />
|
||||||
</Design.DataContext>
|
</Design.DataContext>
|
||||||
<ScrollViewer
|
<ScrollViewer
|
||||||
Name="InputPage"
|
Name="InputPage"
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
VerticalAlignment="Stretch"
|
VerticalAlignment="Stretch"
|
||||||
HorizontalScrollBarVisibility="Disabled"
|
HorizontalScrollBarVisibility="Disabled"
|
||||||
VerticalScrollBarVisibility="Auto">
|
VerticalScrollBarVisibility="Auto">
|
||||||
<Border Classes="settings">
|
<Border Classes="settings">
|
||||||
<StackPanel Margin="4" Orientation="Vertical">
|
<Panel
|
||||||
<StackPanel Orientation="Horizontal">
|
Margin="10">
|
||||||
<CheckBox Margin="5,0"
|
<Grid>
|
||||||
ToolTip.Tip="{locale:Locale DockModeToggleTooltip}"
|
<Grid.RowDefinitions>
|
||||||
IsChecked="{Binding EnableDockedMode}">
|
<RowDefinition Height="Auto"/>
|
||||||
<TextBlock VerticalAlignment="Center"
|
<RowDefinition Height="*" />
|
||||||
Text="{locale:Locale SettingsTabInputEnableDockedMode}" />
|
<RowDefinition Height="Auto" />
|
||||||
</CheckBox>
|
</Grid.RowDefinitions>
|
||||||
<CheckBox Margin="5,0"
|
<views:ControllerInputView
|
||||||
ToolTip.Tip="{locale:Locale DirectKeyboardTooltip}"
|
Grid.Row="0"
|
||||||
IsChecked="{Binding EnableKeyboard}">
|
Name="ControllerSettings" />
|
||||||
<TextBlock Text="{locale:Locale SettingsTabInputDirectKeyboardAccess}" />
|
<StackPanel
|
||||||
</CheckBox>
|
Orientation="Vertical"
|
||||||
<CheckBox Margin="5,0"
|
Grid.Row="2">
|
||||||
ToolTip.Tip="{locale:Locale DirectMouseTooltip}"
|
<Separator
|
||||||
IsChecked="{Binding EnableMouse}">
|
Margin="0 10"
|
||||||
<TextBlock Text="{locale:Locale SettingsTabInputDirectMouseAccess}" />
|
Height="1" />
|
||||||
</CheckBox>
|
<StackPanel
|
||||||
</StackPanel>
|
Orientation="Horizontal"
|
||||||
<window:ControllerSettingsWindow Name="ControllerSettings" Margin="0" MinHeight="600" />
|
Spacing="10">
|
||||||
</StackPanel>
|
<CheckBox
|
||||||
|
ToolTip.Tip="{locale:Locale DockModeToggleTooltip}"
|
||||||
|
MinWidth="0"
|
||||||
|
IsChecked="{Binding EnableDockedMode}">
|
||||||
|
<TextBlock
|
||||||
|
Text="{locale:Locale SettingsTabInputEnableDockedMode}" />
|
||||||
|
</CheckBox>
|
||||||
|
<CheckBox
|
||||||
|
ToolTip.Tip="{locale:Locale DirectKeyboardTooltip}"
|
||||||
|
IsChecked="{Binding EnableKeyboard}">
|
||||||
|
<TextBlock
|
||||||
|
Text="{locale:Locale SettingsTabInputDirectKeyboardAccess}" />
|
||||||
|
</CheckBox>
|
||||||
|
<CheckBox
|
||||||
|
ToolTip.Tip="{locale:Locale DirectMouseTooltip}"
|
||||||
|
IsChecked="{Binding EnableMouse}">
|
||||||
|
<TextBlock
|
||||||
|
Text="{locale:Locale SettingsTabInputDirectMouseAccess}" />
|
||||||
|
</CheckBox>
|
||||||
|
</StackPanel>
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</Panel>
|
||||||
</Border>
|
</Border>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
</UserControl>
|
</UserControl>
|
@@ -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 = 4646;
|
private const uint CodeGenVersion = 5031;
|
||||||
|
|
||||||
private const string SharedTocFileName = "shared.toc";
|
private const string SharedTocFileName = "shared.toc";
|
||||||
private const string SharedDataFileName = "shared.data";
|
private const string SharedDataFileName = "shared.data";
|
||||||
|
@@ -187,27 +187,6 @@ namespace Ryujinx.Graphics.Shader.Instructions
|
|||||||
context.Config.GpuAccessor.Log("Shader instruction Longjmp is not implemented.");
|
context.Config.GpuAccessor.Log("Shader instruction Longjmp is not implemented.");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void P2rR(EmitterContext context)
|
|
||||||
{
|
|
||||||
InstP2rR op = context.GetOp<InstP2rR>();
|
|
||||||
|
|
||||||
context.Config.GpuAccessor.Log("Shader instruction P2rR is not implemented.");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void P2rI(EmitterContext context)
|
|
||||||
{
|
|
||||||
InstP2rI op = context.GetOp<InstP2rI>();
|
|
||||||
|
|
||||||
context.Config.GpuAccessor.Log("Shader instruction P2rI is not implemented.");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void P2rC(EmitterContext context)
|
|
||||||
{
|
|
||||||
InstP2rC op = context.GetOp<InstP2rC>();
|
|
||||||
|
|
||||||
context.Config.GpuAccessor.Log("Shader instruction P2rC is not implemented.");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void Pexit(EmitterContext context)
|
public static void Pexit(EmitterContext context)
|
||||||
{
|
{
|
||||||
InstPexit op = context.GetOp<InstPexit>();
|
InstPexit op = context.GetOp<InstPexit>();
|
||||||
|
@@ -209,21 +209,15 @@ namespace Ryujinx.Graphics.Shader.Instructions
|
|||||||
return context.ICompareNotEqual(context.BitwiseAnd(value, Const(1 << bit)), Const(0));
|
return context.ICompareNotEqual(context.BitwiseAnd(value, Const(1 << bit)), Const(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ccpr)
|
int count = ccpr ? RegisterConsts.FlagsCount : RegisterConsts.PredsCount;
|
||||||
|
RegisterType type = ccpr ? RegisterType.Flag : RegisterType.Predicate;
|
||||||
|
int shift = (int)byteSel * 8;
|
||||||
|
|
||||||
|
for (int bit = 0; bit < count; bit++)
|
||||||
{
|
{
|
||||||
// TODO: Support Register to condition code flags copy.
|
Operand flag = Register(bit, type);
|
||||||
context.Config.GpuAccessor.Log("R2P.CC not implemented.");
|
Operand res = context.ConditionalSelect(Test(mask, bit), Test(value, bit + shift), flag);
|
||||||
}
|
context.Copy(flag, res);
|
||||||
else
|
|
||||||
{
|
|
||||||
int shift = (int)byteSel * 8;
|
|
||||||
|
|
||||||
for (int bit = 0; bit < RegisterConsts.PredsCount; bit++)
|
|
||||||
{
|
|
||||||
Operand pred = Register(bit, RegisterType.Predicate);
|
|
||||||
Operand res = context.ConditionalSelect(Test(mask, bit), Test(value, bit + shift), pred);
|
|
||||||
context.Copy(pred, res);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,7 +1,6 @@
|
|||||||
using Ryujinx.Graphics.Shader.Decoders;
|
using Ryujinx.Graphics.Shader.Decoders;
|
||||||
using Ryujinx.Graphics.Shader.IntermediateRepresentation;
|
using Ryujinx.Graphics.Shader.IntermediateRepresentation;
|
||||||
using Ryujinx.Graphics.Shader.Translation;
|
using Ryujinx.Graphics.Shader.Translation;
|
||||||
|
|
||||||
using static Ryujinx.Graphics.Shader.Instructions.InstEmitAluHelper;
|
using static Ryujinx.Graphics.Shader.Instructions.InstEmitAluHelper;
|
||||||
using static Ryujinx.Graphics.Shader.Instructions.InstEmitHelper;
|
using static Ryujinx.Graphics.Shader.Instructions.InstEmitHelper;
|
||||||
using static Ryujinx.Graphics.Shader.IntermediateRepresentation.OperandHelper;
|
using static Ryujinx.Graphics.Shader.IntermediateRepresentation.OperandHelper;
|
||||||
@@ -50,5 +49,68 @@ namespace Ryujinx.Graphics.Shader.Instructions
|
|||||||
context.Copy(Register(op.DestPred, RegisterType.Predicate), p0Res);
|
context.Copy(Register(op.DestPred, RegisterType.Predicate), p0Res);
|
||||||
context.Copy(Register(op.DestPredInv, RegisterType.Predicate), p1Res);
|
context.Copy(Register(op.DestPredInv, RegisterType.Predicate), p1Res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void P2rC(EmitterContext context)
|
||||||
|
{
|
||||||
|
InstP2rC op = context.GetOp<InstP2rC>();
|
||||||
|
|
||||||
|
Operand srcA = GetSrcReg(context, op.SrcA);
|
||||||
|
Operand dest = GetSrcReg(context, op.Dest);
|
||||||
|
Operand mask = GetSrcCbuf(context, op.CbufSlot, op.CbufOffset);
|
||||||
|
|
||||||
|
EmitP2r(context, srcA, dest, mask, op.ByteSel, op.Ccpr);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void P2rI(EmitterContext context)
|
||||||
|
{
|
||||||
|
InstP2rI op = context.GetOp<InstP2rI>();
|
||||||
|
|
||||||
|
Operand srcA = GetSrcReg(context, op.SrcA);
|
||||||
|
Operand dest = GetSrcReg(context, op.Dest);
|
||||||
|
Operand mask = GetSrcImm(context, op.Imm20);
|
||||||
|
|
||||||
|
EmitP2r(context, srcA, dest, mask, op.ByteSel, op.Ccpr);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void P2rR(EmitterContext context)
|
||||||
|
{
|
||||||
|
InstP2rR op = context.GetOp<InstP2rR>();
|
||||||
|
|
||||||
|
Operand srcA = GetSrcReg(context, op.SrcA);
|
||||||
|
Operand dest = GetSrcReg(context, op.Dest);
|
||||||
|
Operand mask = GetSrcReg(context, op.SrcB);
|
||||||
|
|
||||||
|
EmitP2r(context, srcA, dest, mask, op.ByteSel, op.Ccpr);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void EmitP2r(
|
||||||
|
EmitterContext context,
|
||||||
|
Operand srcA,
|
||||||
|
Operand dest,
|
||||||
|
Operand mask,
|
||||||
|
ByteSel byteSel,
|
||||||
|
bool ccpr)
|
||||||
|
{
|
||||||
|
int count = ccpr ? RegisterConsts.FlagsCount : RegisterConsts.PredsCount;
|
||||||
|
int shift = (int)byteSel * 8;
|
||||||
|
mask = context.BitwiseAnd(mask, Const(0xff));
|
||||||
|
|
||||||
|
Operand insert = Const(0);
|
||||||
|
for (int i = 0; i < count; i++)
|
||||||
|
{
|
||||||
|
Operand condition = ccpr
|
||||||
|
? Register(i, RegisterType.Flag)
|
||||||
|
: Register(i, RegisterType.Predicate);
|
||||||
|
|
||||||
|
Operand bit = context.ConditionalSelect(condition, Const(1 << (i + shift)), Const(0));
|
||||||
|
insert = context.BitwiseOr(insert, bit);
|
||||||
|
}
|
||||||
|
|
||||||
|
Operand maskShifted = context.ShiftLeft(mask, Const(shift));
|
||||||
|
Operand masked = context.BitwiseAnd(srcA, context.BitwiseNot(maskShifted));
|
||||||
|
Operand res = context.BitwiseOr(masked, context.BitwiseAnd(insert, maskShifted));
|
||||||
|
|
||||||
|
context.Copy(dest, res);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -168,5 +168,223 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
{
|
{
|
||||||
return _table[(int)format];
|
return _table[(int)format];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static int GetAttributeFormatSize(VkFormat format)
|
||||||
|
{
|
||||||
|
switch (format)
|
||||||
|
{
|
||||||
|
case VkFormat.R8Unorm:
|
||||||
|
case VkFormat.R8SNorm:
|
||||||
|
case VkFormat.R8Uint:
|
||||||
|
case VkFormat.R8Sint:
|
||||||
|
case VkFormat.R8Uscaled:
|
||||||
|
case VkFormat.R8Sscaled:
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
case VkFormat.R8G8Unorm:
|
||||||
|
case VkFormat.R8G8SNorm:
|
||||||
|
case VkFormat.R8G8Uint:
|
||||||
|
case VkFormat.R8G8Sint:
|
||||||
|
case VkFormat.R8G8Uscaled:
|
||||||
|
case VkFormat.R8G8Sscaled:
|
||||||
|
case VkFormat.R16Sfloat:
|
||||||
|
case VkFormat.R16Unorm:
|
||||||
|
case VkFormat.R16SNorm:
|
||||||
|
case VkFormat.R16Uint:
|
||||||
|
case VkFormat.R16Sint:
|
||||||
|
case VkFormat.R16Uscaled:
|
||||||
|
case VkFormat.R16Sscaled:
|
||||||
|
return 2;
|
||||||
|
|
||||||
|
case VkFormat.R8G8B8Unorm:
|
||||||
|
case VkFormat.R8G8B8SNorm:
|
||||||
|
case VkFormat.R8G8B8Uint:
|
||||||
|
case VkFormat.R8G8B8Sint:
|
||||||
|
case VkFormat.R8G8B8Uscaled:
|
||||||
|
case VkFormat.R8G8B8Sscaled:
|
||||||
|
return 3;
|
||||||
|
|
||||||
|
case VkFormat.R8G8B8A8Unorm:
|
||||||
|
case VkFormat.R8G8B8A8SNorm:
|
||||||
|
case VkFormat.R8G8B8A8Uint:
|
||||||
|
case VkFormat.R8G8B8A8Sint:
|
||||||
|
case VkFormat.R8G8B8A8Srgb:
|
||||||
|
case VkFormat.R8G8B8A8Uscaled:
|
||||||
|
case VkFormat.R8G8B8A8Sscaled:
|
||||||
|
case VkFormat.B8G8R8A8Unorm:
|
||||||
|
case VkFormat.B8G8R8A8Srgb:
|
||||||
|
case VkFormat.R16G16Sfloat:
|
||||||
|
case VkFormat.R16G16Unorm:
|
||||||
|
case VkFormat.R16G16SNorm:
|
||||||
|
case VkFormat.R16G16Uint:
|
||||||
|
case VkFormat.R16G16Sint:
|
||||||
|
case VkFormat.R16G16Uscaled:
|
||||||
|
case VkFormat.R16G16Sscaled:
|
||||||
|
case VkFormat.R32Sfloat:
|
||||||
|
case VkFormat.R32Uint:
|
||||||
|
case VkFormat.R32Sint:
|
||||||
|
case VkFormat.A2B10G10R10UnormPack32:
|
||||||
|
case VkFormat.A2B10G10R10UintPack32:
|
||||||
|
case VkFormat.B10G11R11UfloatPack32:
|
||||||
|
case VkFormat.E5B9G9R9UfloatPack32:
|
||||||
|
case VkFormat.A2B10G10R10SNormPack32:
|
||||||
|
case VkFormat.A2B10G10R10SintPack32:
|
||||||
|
case VkFormat.A2B10G10R10UscaledPack32:
|
||||||
|
case VkFormat.A2B10G10R10SscaledPack32:
|
||||||
|
return 4;
|
||||||
|
|
||||||
|
case VkFormat.R16G16B16Sfloat:
|
||||||
|
case VkFormat.R16G16B16Unorm:
|
||||||
|
case VkFormat.R16G16B16SNorm:
|
||||||
|
case VkFormat.R16G16B16Uint:
|
||||||
|
case VkFormat.R16G16B16Sint:
|
||||||
|
case VkFormat.R16G16B16Uscaled:
|
||||||
|
case VkFormat.R16G16B16Sscaled:
|
||||||
|
return 6;
|
||||||
|
|
||||||
|
case VkFormat.R16G16B16A16Sfloat:
|
||||||
|
case VkFormat.R16G16B16A16Unorm:
|
||||||
|
case VkFormat.R16G16B16A16SNorm:
|
||||||
|
case VkFormat.R16G16B16A16Uint:
|
||||||
|
case VkFormat.R16G16B16A16Sint:
|
||||||
|
case VkFormat.R16G16B16A16Uscaled:
|
||||||
|
case VkFormat.R16G16B16A16Sscaled:
|
||||||
|
case VkFormat.R32G32Sfloat:
|
||||||
|
case VkFormat.R32G32Uint:
|
||||||
|
case VkFormat.R32G32Sint:
|
||||||
|
return 8;
|
||||||
|
|
||||||
|
case VkFormat.R32G32B32Sfloat:
|
||||||
|
case VkFormat.R32G32B32Uint:
|
||||||
|
case VkFormat.R32G32B32Sint:
|
||||||
|
return 12;
|
||||||
|
|
||||||
|
case VkFormat.R32G32B32A32Sfloat:
|
||||||
|
case VkFormat.R32G32B32A32Uint:
|
||||||
|
case VkFormat.R32G32B32A32Sint:
|
||||||
|
return 16;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static VkFormat DropLastComponent(VkFormat format)
|
||||||
|
{
|
||||||
|
switch (format)
|
||||||
|
{
|
||||||
|
case VkFormat.R8G8Unorm:
|
||||||
|
return VkFormat.R8Unorm;
|
||||||
|
case VkFormat.R8G8SNorm:
|
||||||
|
return VkFormat.R8SNorm;
|
||||||
|
case VkFormat.R8G8Uint:
|
||||||
|
return VkFormat.R8Uint;
|
||||||
|
case VkFormat.R8G8Sint:
|
||||||
|
return VkFormat.R8Sint;
|
||||||
|
case VkFormat.R8G8Uscaled:
|
||||||
|
return VkFormat.R8Uscaled;
|
||||||
|
case VkFormat.R8G8Sscaled:
|
||||||
|
return VkFormat.R8Sscaled;
|
||||||
|
|
||||||
|
case VkFormat.R8G8B8Unorm:
|
||||||
|
return VkFormat.R8G8Unorm;
|
||||||
|
case VkFormat.R8G8B8SNorm:
|
||||||
|
return VkFormat.R8G8SNorm;
|
||||||
|
case VkFormat.R8G8B8Uint:
|
||||||
|
return VkFormat.R8G8Uint;
|
||||||
|
case VkFormat.R8G8B8Sint:
|
||||||
|
return VkFormat.R8G8Sint;
|
||||||
|
case VkFormat.R8G8B8Uscaled:
|
||||||
|
return VkFormat.R8G8Uscaled;
|
||||||
|
case VkFormat.R8G8B8Sscaled:
|
||||||
|
return VkFormat.R8G8Sscaled;
|
||||||
|
|
||||||
|
case VkFormat.R8G8B8A8Unorm:
|
||||||
|
return VkFormat.R8G8B8Unorm;
|
||||||
|
case VkFormat.R8G8B8A8SNorm:
|
||||||
|
return VkFormat.R8G8B8SNorm;
|
||||||
|
case VkFormat.R8G8B8A8Uint:
|
||||||
|
return VkFormat.R8G8B8Uint;
|
||||||
|
case VkFormat.R8G8B8A8Sint:
|
||||||
|
return VkFormat.R8G8B8Sint;
|
||||||
|
case VkFormat.R8G8B8A8Srgb:
|
||||||
|
return VkFormat.R8G8B8Srgb;
|
||||||
|
case VkFormat.R8G8B8A8Uscaled:
|
||||||
|
return VkFormat.R8G8B8Uscaled;
|
||||||
|
case VkFormat.R8G8B8A8Sscaled:
|
||||||
|
return VkFormat.R8G8B8Sscaled;
|
||||||
|
case VkFormat.B8G8R8A8Unorm:
|
||||||
|
return VkFormat.B8G8R8Unorm;
|
||||||
|
case VkFormat.B8G8R8A8Srgb:
|
||||||
|
return VkFormat.B8G8R8Srgb;
|
||||||
|
|
||||||
|
case VkFormat.R16G16Sfloat:
|
||||||
|
return VkFormat.R16Sfloat;
|
||||||
|
case VkFormat.R16G16Unorm:
|
||||||
|
return VkFormat.R16Unorm;
|
||||||
|
case VkFormat.R16G16SNorm:
|
||||||
|
return VkFormat.R16SNorm;
|
||||||
|
case VkFormat.R16G16Uint:
|
||||||
|
return VkFormat.R16Uint;
|
||||||
|
case VkFormat.R16G16Sint:
|
||||||
|
return VkFormat.R16Sint;
|
||||||
|
case VkFormat.R16G16Uscaled:
|
||||||
|
return VkFormat.R16Uscaled;
|
||||||
|
case VkFormat.R16G16Sscaled:
|
||||||
|
return VkFormat.R16Sscaled;
|
||||||
|
|
||||||
|
case VkFormat.R16G16B16Sfloat:
|
||||||
|
return VkFormat.R16G16Sfloat;
|
||||||
|
case VkFormat.R16G16B16Unorm:
|
||||||
|
return VkFormat.R16G16Unorm;
|
||||||
|
case VkFormat.R16G16B16SNorm:
|
||||||
|
return VkFormat.R16G16SNorm;
|
||||||
|
case VkFormat.R16G16B16Uint:
|
||||||
|
return VkFormat.R16G16Uint;
|
||||||
|
case VkFormat.R16G16B16Sint:
|
||||||
|
return VkFormat.R16G16Sint;
|
||||||
|
case VkFormat.R16G16B16Uscaled:
|
||||||
|
return VkFormat.R16G16Uscaled;
|
||||||
|
case VkFormat.R16G16B16Sscaled:
|
||||||
|
return VkFormat.R16G16Sscaled;
|
||||||
|
|
||||||
|
case VkFormat.R16G16B16A16Sfloat:
|
||||||
|
return VkFormat.R16G16B16Sfloat;
|
||||||
|
case VkFormat.R16G16B16A16Unorm:
|
||||||
|
return VkFormat.R16G16B16Unorm;
|
||||||
|
case VkFormat.R16G16B16A16SNorm:
|
||||||
|
return VkFormat.R16G16B16SNorm;
|
||||||
|
case VkFormat.R16G16B16A16Uint:
|
||||||
|
return VkFormat.R16G16B16Uint;
|
||||||
|
case VkFormat.R16G16B16A16Sint:
|
||||||
|
return VkFormat.R16G16B16Sint;
|
||||||
|
case VkFormat.R16G16B16A16Uscaled:
|
||||||
|
return VkFormat.R16G16B16Uscaled;
|
||||||
|
case VkFormat.R16G16B16A16Sscaled:
|
||||||
|
return VkFormat.R16G16B16Sscaled;
|
||||||
|
|
||||||
|
case VkFormat.R32G32Sfloat:
|
||||||
|
return VkFormat.R32Sfloat;
|
||||||
|
case VkFormat.R32G32Uint:
|
||||||
|
return VkFormat.R32Uint;
|
||||||
|
case VkFormat.R32G32Sint:
|
||||||
|
return VkFormat.R32Sint;
|
||||||
|
|
||||||
|
case VkFormat.R32G32B32Sfloat:
|
||||||
|
return VkFormat.R32G32Sfloat;
|
||||||
|
case VkFormat.R32G32B32Uint:
|
||||||
|
return VkFormat.R32G32Uint;
|
||||||
|
case VkFormat.R32G32B32Sint:
|
||||||
|
return VkFormat.R32G32Sint;
|
||||||
|
|
||||||
|
case VkFormat.R32G32B32A32Sfloat:
|
||||||
|
return VkFormat.R32G32B32Sfloat;
|
||||||
|
case VkFormat.R32G32B32A32Uint:
|
||||||
|
return VkFormat.R32G32B32Uint;
|
||||||
|
case VkFormat.R32G32B32A32Sint:
|
||||||
|
return VkFormat.R32G32B32Sint;
|
||||||
|
}
|
||||||
|
|
||||||
|
return format;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -28,6 +28,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
public readonly bool SupportsSubgroupSizeControl;
|
public readonly bool SupportsSubgroupSizeControl;
|
||||||
public readonly bool SupportsShaderInt8;
|
public readonly bool SupportsShaderInt8;
|
||||||
public readonly bool SupportsShaderStencilExport;
|
public readonly bool SupportsShaderStencilExport;
|
||||||
|
public readonly bool SupportsShaderStorageImageMultisample;
|
||||||
public readonly bool SupportsConditionalRendering;
|
public readonly bool SupportsConditionalRendering;
|
||||||
public readonly bool SupportsExtendedDynamicState;
|
public readonly bool SupportsExtendedDynamicState;
|
||||||
public readonly bool SupportsMultiView;
|
public readonly bool SupportsMultiView;
|
||||||
@@ -63,6 +64,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
bool supportsSubgroupSizeControl,
|
bool supportsSubgroupSizeControl,
|
||||||
bool supportsShaderInt8,
|
bool supportsShaderInt8,
|
||||||
bool supportsShaderStencilExport,
|
bool supportsShaderStencilExport,
|
||||||
|
bool supportsShaderStorageImageMultisample,
|
||||||
bool supportsConditionalRendering,
|
bool supportsConditionalRendering,
|
||||||
bool supportsExtendedDynamicState,
|
bool supportsExtendedDynamicState,
|
||||||
bool supportsMultiView,
|
bool supportsMultiView,
|
||||||
@@ -97,6 +99,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
SupportsSubgroupSizeControl = supportsSubgroupSizeControl;
|
SupportsSubgroupSizeControl = supportsSubgroupSizeControl;
|
||||||
SupportsShaderInt8 = supportsShaderInt8;
|
SupportsShaderInt8 = supportsShaderInt8;
|
||||||
SupportsShaderStencilExport = supportsShaderStencilExport;
|
SupportsShaderStencilExport = supportsShaderStencilExport;
|
||||||
|
SupportsShaderStorageImageMultisample = supportsShaderStorageImageMultisample;
|
||||||
SupportsConditionalRendering = supportsConditionalRendering;
|
SupportsConditionalRendering = supportsConditionalRendering;
|
||||||
SupportsExtendedDynamicState = supportsExtendedDynamicState;
|
SupportsExtendedDynamicState = supportsExtendedDynamicState;
|
||||||
SupportsMultiView = supportsMultiView;
|
SupportsMultiView = supportsMultiView;
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
using Silk.NET.Vulkan;
|
using Ryujinx.Common.Memory;
|
||||||
|
using Silk.NET.Vulkan;
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace Ryujinx.Graphics.Vulkan
|
namespace Ryujinx.Graphics.Vulkan
|
||||||
@@ -308,6 +309,8 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
public PipelineLayout PipelineLayout;
|
public PipelineLayout PipelineLayout;
|
||||||
public SpecData SpecializationData;
|
public SpecData SpecializationData;
|
||||||
|
|
||||||
|
private Array32<VertexInputAttributeDescription> _vertexAttributeDescriptions2;
|
||||||
|
|
||||||
public void Initialize()
|
public void Initialize()
|
||||||
{
|
{
|
||||||
Stages = new NativeArray<PipelineShaderStageCreateInfo>(Constants.MaxShaderStages);
|
Stages = new NativeArray<PipelineShaderStageCreateInfo>(Constants.MaxShaderStages);
|
||||||
@@ -400,7 +403,15 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
|
|
||||||
Pipeline pipelineHandle = default;
|
Pipeline pipelineHandle = default;
|
||||||
|
|
||||||
|
bool isMoltenVk = gd.IsMoltenVk;
|
||||||
|
|
||||||
|
if (isMoltenVk)
|
||||||
|
{
|
||||||
|
UpdateVertexAttributeDescriptions();
|
||||||
|
}
|
||||||
|
|
||||||
fixed (VertexInputAttributeDescription* pVertexAttributeDescriptions = &Internal.VertexAttributeDescriptions[0])
|
fixed (VertexInputAttributeDescription* pVertexAttributeDescriptions = &Internal.VertexAttributeDescriptions[0])
|
||||||
|
fixed (VertexInputAttributeDescription* pVertexAttributeDescriptions2 = &_vertexAttributeDescriptions2[0])
|
||||||
fixed (VertexInputBindingDescription* pVertexBindingDescriptions = &Internal.VertexBindingDescriptions[0])
|
fixed (VertexInputBindingDescription* pVertexBindingDescriptions = &Internal.VertexBindingDescriptions[0])
|
||||||
fixed (Viewport* pViewports = &Internal.Viewports[0])
|
fixed (Viewport* pViewports = &Internal.Viewports[0])
|
||||||
fixed (Rect2D* pScissors = &Internal.Scissors[0])
|
fixed (Rect2D* pScissors = &Internal.Scissors[0])
|
||||||
@@ -410,7 +421,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
{
|
{
|
||||||
SType = StructureType.PipelineVertexInputStateCreateInfo,
|
SType = StructureType.PipelineVertexInputStateCreateInfo,
|
||||||
VertexAttributeDescriptionCount = VertexAttributeDescriptionsCount,
|
VertexAttributeDescriptionCount = VertexAttributeDescriptionsCount,
|
||||||
PVertexAttributeDescriptions = pVertexAttributeDescriptions,
|
PVertexAttributeDescriptions = isMoltenVk ? pVertexAttributeDescriptions2 : pVertexAttributeDescriptions,
|
||||||
VertexBindingDescriptionCount = VertexBindingDescriptionsCount,
|
VertexBindingDescriptionCount = VertexBindingDescriptionsCount,
|
||||||
PVertexBindingDescriptions = pVertexBindingDescriptions
|
PVertexBindingDescriptions = pVertexBindingDescriptions
|
||||||
};
|
};
|
||||||
@@ -612,6 +623,40 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void UpdateVertexAttributeDescriptions()
|
||||||
|
{
|
||||||
|
// Vertex attributes exceeding the stride are invalid.
|
||||||
|
// In metal, they cause glitches with the vertex shader fetching incorrect values.
|
||||||
|
// To work around this, we reduce the format to something that doesn't exceed the stride if possible.
|
||||||
|
// The assumption is that the exceeding components are not actually accessed on the shader.
|
||||||
|
|
||||||
|
for (int index = 0; index < VertexAttributeDescriptionsCount; index++)
|
||||||
|
{
|
||||||
|
var attribute = Internal.VertexAttributeDescriptions[index];
|
||||||
|
ref var vb = ref Internal.VertexBindingDescriptions[(int)attribute.Binding];
|
||||||
|
|
||||||
|
Format format = attribute.Format;
|
||||||
|
|
||||||
|
while (vb.Stride != 0 && attribute.Offset + FormatTable.GetAttributeFormatSize(format) > vb.Stride)
|
||||||
|
{
|
||||||
|
Format newFormat = FormatTable.DropLastComponent(format);
|
||||||
|
|
||||||
|
if (newFormat == format)
|
||||||
|
{
|
||||||
|
// That case means we failed to find a format that fits within the stride,
|
||||||
|
// so just restore the original format and give up.
|
||||||
|
format = attribute.Format;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
format = newFormat;
|
||||||
|
}
|
||||||
|
|
||||||
|
attribute.Format = format;
|
||||||
|
_vertexAttributeDescriptions2[index] = attribute;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
Stages.Dispose();
|
Stages.Dispose();
|
||||||
|
@@ -80,7 +80,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
|
|
||||||
var sampleCountFlags = ConvertToSampleCountFlags(gd.Capabilities.SupportedSampleCounts, (uint)info.Samples);
|
var sampleCountFlags = ConvertToSampleCountFlags(gd.Capabilities.SupportedSampleCounts, (uint)info.Samples);
|
||||||
|
|
||||||
var usage = GetImageUsageFromFormat(info.Format);
|
var usage = GetImageUsage(info.Format, info.Target, gd.Capabilities.SupportsShaderStorageImageMultisample);
|
||||||
|
|
||||||
var flags = ImageCreateFlags.CreateMutableFormatBit;
|
var flags = ImageCreateFlags.CreateMutableFormatBit;
|
||||||
|
|
||||||
@@ -293,7 +293,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ImageUsageFlags GetImageUsageFromFormat(GAL.Format format)
|
public static ImageUsageFlags GetImageUsage(GAL.Format format, Target target, bool supportsMsStorage)
|
||||||
{
|
{
|
||||||
var usage = DefaultUsageFlags;
|
var usage = DefaultUsageFlags;
|
||||||
|
|
||||||
@@ -306,7 +306,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
usage |= ImageUsageFlags.ColorAttachmentBit;
|
usage |= ImageUsageFlags.ColorAttachmentBit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (format.IsImageCompatible())
|
if (format.IsImageCompatible() && (supportsMsStorage || !target.IsMultisample()))
|
||||||
{
|
{
|
||||||
usage |= ImageUsageFlags.StorageBit;
|
usage |= ImageUsageFlags.StorageBit;
|
||||||
}
|
}
|
||||||
|
@@ -54,7 +54,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
gd.Textures.Add(this);
|
gd.Textures.Add(this);
|
||||||
|
|
||||||
var format = _gd.FormatCapabilities.ConvertToVkFormat(info.Format);
|
var format = _gd.FormatCapabilities.ConvertToVkFormat(info.Format);
|
||||||
var usage = TextureStorage.GetImageUsageFromFormat(info.Format);
|
var usage = TextureStorage.GetImageUsage(info.Format, info.Target, gd.Capabilities.SupportsShaderStorageImageMultisample);
|
||||||
var levels = (uint)info.Levels;
|
var levels = (uint)info.Levels;
|
||||||
var layers = (uint)info.GetLayers();
|
var layers = (uint)info.GetLayers();
|
||||||
|
|
||||||
|
@@ -295,6 +295,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
supportsSubgroupSizeControl,
|
supportsSubgroupSizeControl,
|
||||||
featuresShaderInt8.ShaderInt8,
|
featuresShaderInt8.ShaderInt8,
|
||||||
_physicalDevice.IsDeviceExtensionPresent("VK_EXT_shader_stencil_export"),
|
_physicalDevice.IsDeviceExtensionPresent("VK_EXT_shader_stencil_export"),
|
||||||
|
features2.Features.ShaderStorageImageMultisample,
|
||||||
_physicalDevice.IsDeviceExtensionPresent(ExtConditionalRendering.ExtensionName),
|
_physicalDevice.IsDeviceExtensionPresent(ExtConditionalRendering.ExtensionName),
|
||||||
_physicalDevice.IsDeviceExtensionPresent(ExtExtendedDynamicState.ExtensionName),
|
_physicalDevice.IsDeviceExtensionPresent(ExtExtendedDynamicState.ExtensionName),
|
||||||
features2.Features.MultiViewport,
|
features2.Features.MultiViewport,
|
||||||
@@ -599,6 +600,25 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
return new HardwareInfo(GpuVendor, GpuRenderer);
|
return new HardwareInfo(GpuVendor, GpuRenderer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the available Vulkan devices using the default Vulkan API
|
||||||
|
/// object returned by <see cref="Vk.GetApi()"/>
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static DeviceInfo[] GetPhysicalDevices()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
return VulkanInitialization.GetSuitablePhysicalDevices(Vk.GetApi());
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Logger.Error?.PrintMsg(LogClass.Gpu, $"Error querying Vulkan devices: {ex.Message}");
|
||||||
|
|
||||||
|
return Array.Empty<DeviceInfo>();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static DeviceInfo[] GetPhysicalDevices(Vk api)
|
public static DeviceInfo[] GetPhysicalDevices(Vk api)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 59 KiB After Width: | Height: | Size: 8.0 KiB |
@@ -478,7 +478,7 @@ namespace Ryujinx.Ui.Windows
|
|||||||
|
|
||||||
if (Enum.Parse<GraphicsBackend>(_graphicsBackend.ActiveId) == GraphicsBackend.Vulkan)
|
if (Enum.Parse<GraphicsBackend>(_graphicsBackend.ActiveId) == GraphicsBackend.Vulkan)
|
||||||
{
|
{
|
||||||
var devices = VulkanRenderer.GetPhysicalDevices(Vk.GetApi());
|
var devices = VulkanRenderer.GetPhysicalDevices();
|
||||||
string preferredGpuIdFromConfig = ConfigurationState.Instance.Graphics.PreferredGpu.Value;
|
string preferredGpuIdFromConfig = ConfigurationState.Instance.Graphics.PreferredGpu.Value;
|
||||||
string preferredGpuId = preferredGpuIdFromConfig;
|
string preferredGpuId = preferredGpuIdFromConfig;
|
||||||
bool noGpuId = string.IsNullOrEmpty(preferredGpuIdFromConfig);
|
bool noGpuId = string.IsNullOrEmpty(preferredGpuIdFromConfig);
|
||||||
|
Reference in New Issue
Block a user