Compare commits

...

11 Commits

Author SHA1 Message Date
gdkchan
296c4a3d01 Relax Vulkan requirements (#4282)
* Relax Vulkan requirements

* Fix MaxColorAttachmentIndex

* Fix ColorBlendAttachmentStateCount value mismatch for background pipelines

* Change query capability check to check for pipeline statistics query rather than geometry shader support
2023-01-26 18:34:35 -03:00
riperiperi
e7cf4e6eaf Vulkan: Reset queries on same command buffer (#4329)
* Reset queries on same command buffer

Vulkan seems to complain when the queries are reset on another command buffer. No idea why, the spec really could be written better in this regard. This fixes complaints, and hopefully any implementations that care extensively about them.

This change _guesses_ how many queries need to be reset and resets as many as possible at the same time to avoid splitting render passes. If it resets too many queries, we didn't waste too much time - if it runs out of resets it will batch reset 10 more.

The number of queries reset is the maximum number of queries in the last 3 frames. This has been worked into the AutoFlushCounter so that it only resets up to 32 if it is yet to force a command buffer submission in this attachment.

This is only done for samples passed queries right now, as they have by far the most resets.

* Address Feedback
2023-01-24 13:32:56 -03:00
gdkchan
a1a4771ac1 Remove use of GetFunctionPointerForDelegate to get JIT cache function pointer (#4337)
* Remove use of GetFunctionPointerForDelegate to get JIT cache function pointer

* Rename FuncPtr to FuncPointer
2023-01-23 22:37:53 +00:00
gdkchan
2fd819613f SPIR-V: Change BitfieldExtract and BitfieldInsert for SPIRV-Cross (#4336)
* SPIR-V: Change BitfieldExtract and BitfieldInsert types to make Metal MSL compiler happy

* Shader cache version bump
2023-01-23 19:20:40 -03:00
TSRBerry
ad6ff6ce99 GUI: Add option to register file types (#4250)
* Add FileAssociationHelper.cs

* Add register file types option to gtk

* Add register file types option to avalonia

* Add Windows support to FileAssociationHelper.cs

* linux: Add uninstall support for file types

* Ignore .glade~ backup files

* Rename Register/Unregister methods

* gtk: Add manage file types submenu

* ava: Add manage file types submenu

* windows: Add uninstall support for file types

* Don't invert uninstall condition (formatting change)

Co-authored-by: gdkchan <gab.dark.100@gmail.com>

* Add IsTypesRegisteredWindows & Fix Windows install function

* Add AreMimeTypesRegisteredLinux()

* Fix wrong indention

Co-authored-by: AcK77 <acoustik666@gmail.com>
Co-authored-by: gdkchan <gab.dark.100@gmail.com>
2023-01-22 17:39:00 +00:00
gnisman
dc30d94852 Handle parsing of corrupt Config.json and prevent crash on launch (#4309)
* Handle parsing of corrupt Config.json and prevent crash on launch

* Implement a cleaner solution to handle empty json object
2023-01-22 17:04:33 +01:00
merry
4f293f8cbe Arm64: Simplify TryEncodeBitMask and use for constants (#4328)
* Arm64: Simplify TryEncodeBitMask

* CodeGenerator: Use TryEncodeBitMask in GenerateConstantCopy

* Ptc: Bump version
2023-01-22 14:15:49 +00:00
merry
32a1cd83fd AvaloniaKeyboardDriver: Swallow TextInput events to avoid bell (#4320) 2023-01-22 11:21:52 +01:00
riperiperi
e3d0ccf8d5 Allow setting texture data from 1x to fix some textures resetting randomly (#2860)
* Allow setting texture data from 1x to fix some textures resetting randomly

Expected targets:

- Deltarune 1+2
- Crash Team Racing
- Those new pokemon games idk

* Allow scaling of MSAA textures, propagate scale on copy.

* Fix Rebase

Oops

* Automatic disable

* A bit more aggressive

* Without the debug log

* Actually decrement the score when writing.
2023-01-22 02:03:30 +00:00
Ac_K
c14844d12c Ava UI: Various Fixes (#4326)
* Ava UI: Various Fixes

* use WriteAllBytes
2023-01-22 01:42:55 +01:00
gdkchan
7fea26e97e Remove use of reflection on GAL multithreading (#4287)
* Introduce new IGALCommand<T> interface and use it

* Remove use of reflection on GAL multithreading

* Unmanaged constraint
2023-01-22 01:07:43 +01:00
135 changed files with 1229 additions and 910 deletions

3
.gitignore vendored
View File

@@ -170,3 +170,6 @@ launchSettings.json
# NetCore Publishing Profiles # NetCore Publishing Profiles
PublishProfiles/ PublishProfiles/
# Glade backup files
*.glade~

View File

@@ -16,4 +16,10 @@
</ContentWithTargetPath> </ContentWithTargetPath>
</ItemGroup> </ItemGroup>
<ItemGroup>
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
<_Parameter1>Ryujinx.Tests</_Parameter1>
</AssemblyAttribute>
</ItemGroup>
</Project> </Project>

View File

@@ -1,5 +1,4 @@
using ARMeilleure.IntermediateRepresentation; using ARMeilleure.IntermediateRepresentation;
using System;
using System.Numerics; using System.Numerics;
namespace ARMeilleure.CodeGen.Arm64 namespace ARMeilleure.CodeGen.Arm64
@@ -32,9 +31,12 @@ namespace ARMeilleure.CodeGen.Arm64
public static bool TryEncodeBitMask(Operand operand, out int immN, out int immS, out int immR) public static bool TryEncodeBitMask(Operand operand, out int immN, out int immS, out int immR)
{ {
ulong value = operand.Value; return TryEncodeBitMask(operand.Type, operand.Value, out immN, out immS, out immR);
}
if (operand.Type == OperandType.I32) public static bool TryEncodeBitMask(OperandType type, ulong value, out int immN, out int immS, out int immR)
{
if (type == OperandType.I32)
{ {
value |= value << 32; value |= value << 32;
} }
@@ -50,7 +52,7 @@ namespace ARMeilleure.CodeGen.Arm64
// Any value AND all ones will be equal itself, so it's effectively a no-op. // Any value AND all ones will be equal itself, so it's effectively a no-op.
// Any value OR all ones will be equal all ones, so one can just use MOV. // Any value OR all ones will be equal all ones, so one can just use MOV.
// Any value XOR all ones will be equal its inverse, so one can just use MVN. // Any value XOR all ones will be equal its inverse, so one can just use MVN.
if (value == ulong.MaxValue) if (value == 0 || value == ulong.MaxValue)
{ {
immN = 0; immN = 0;
immS = 0; immS = 0;
@@ -59,79 +61,18 @@ namespace ARMeilleure.CodeGen.Arm64
return false; return false;
} }
int bitLength = CountSequence(value); // Normalize value, rotating it such that the LSB is 1: Ensures we get a complete element that has not
// been cut-in-half across the word boundary.
int rotation = BitOperations.TrailingZeroCount(value & (value + 1));
ulong rotatedValue = ulong.RotateRight(value, rotation);
if ((value >> bitLength) != 0) // Now that we have a complete element in the LSB with the LSB = 1, determine size and number of ones
{ // in element.
bitLength += CountSequence(value >> bitLength); int elementSize = BitOperations.TrailingZeroCount(rotatedValue & (rotatedValue + 1));
} int onesInElement = BitOperations.TrailingZeroCount(~rotatedValue);
int bitLengthLog2 = BitOperations.Log2((uint)bitLength); // Check the value is repeating; also ensures element size is a power of two.
int bitLengthPow2 = 1 << bitLengthLog2; if (ulong.RotateRight(value, elementSize) != value)
if (bitLengthPow2 < bitLength)
{
bitLengthLog2++;
bitLengthPow2 <<= 1;
}
int selectedESize = 64;
int repetitions = 1;
int onesCount = BitOperations.PopCount(value);
if (bitLengthPow2 < 64 && (value >> bitLengthPow2) != 0)
{
for (int eSizeLog2 = bitLengthLog2; eSizeLog2 < 6; eSizeLog2++)
{
bool match = true;
int eSize = 1 << eSizeLog2;
ulong mask = (1UL << eSize) - 1;
ulong eValue = value & mask;
for (int e = 1; e < 64 / eSize; e++)
{
if (((value >> (e * eSize)) & mask) != eValue)
{
match = false;
break;
}
}
if (match)
{
selectedESize = eSize;
repetitions = 64 / eSize;
onesCount = BitOperations.PopCount(eValue);
break;
}
}
}
// Find rotation. We have two cases, one where the highest bit is 0
// and one where it is 1.
// If it's 1, we just need to count the number of 1 bits on the MSB to find the right rotation.
// If it's 0, we just need to count the number of 0 bits on the LSB to find the left rotation,
// then we can convert it to the right rotation shift by subtracting the value from the element size.
int rotation;
long vHigh = (long)(value << (64 - selectedESize));
if (vHigh < 0)
{
rotation = BitOperations.LeadingZeroCount(~(ulong)vHigh);
}
else
{
rotation = (selectedESize - BitOperations.TrailingZeroCount(value)) & (selectedESize - 1);
}
// Reconstruct value and see if it matches. If not, we can't encode.
ulong reconstructed = onesCount == 64 ? ulong.MaxValue : RotateRight((1UL << onesCount) - 1, rotation, selectedESize);
for (int bit = 32; bit >= selectedESize; bit >>= 1)
{
reconstructed |= reconstructed << bit;
}
if (reconstructed != value || onesCount == 0)
{ {
immN = 0; immN = 0;
immS = 0; immS = 0;
@@ -140,34 +81,11 @@ namespace ARMeilleure.CodeGen.Arm64
return false; return false;
} }
immR = rotation; immN = (elementSize >> 6) & 1;
immS = (((~elementSize + 1) << 1) | (onesInElement - 1)) & 0x3f;
// immN indicates that there are no repetitions. immR = (elementSize - rotation) & (elementSize - 1);
// The MSB of immS indicates the amount of repetitions, and the LSB the number of bits set.
if (repetitions == 1)
{
immN = 1;
immS = 0;
}
else
{
immN = 0;
immS = (0xf80 >> BitOperations.Log2((uint)repetitions)) & 0x3f;
}
immS |= onesCount - 1;
return true; return true;
} }
private static int CountSequence(ulong value)
{
return BitOperations.TrailingZeroCount(value) + BitOperations.TrailingZeroCount(~value);
}
private static ulong RotateRight(ulong bits, int shift, int size)
{
return (bits >> shift) | ((bits << (size - shift)) & (size == 64 ? ulong.MaxValue : (1UL << size) - 1));
}
} }
} }

View File

@@ -1303,7 +1303,15 @@ namespace ARMeilleure.CodeGen.Arm64
private static void GenerateConstantCopy(CodeGenContext context, Operand dest, ulong value) private static void GenerateConstantCopy(CodeGenContext context, Operand dest, ulong value)
{ {
if (value != 0) if (value == 0)
{
context.Assembler.Mov(dest, Register(ZrRegister, dest.Type));
}
else if (CodeGenCommon.TryEncodeBitMask(dest.Type, value, out _, out _, out _))
{
context.Assembler.Orr(dest, Register(ZrRegister, dest.Type), Const(dest.Type, (long)value));
}
else
{ {
int hw = 0; int hw = 0;
bool first = true; bool first = true;
@@ -1328,10 +1336,6 @@ namespace ARMeilleure.CodeGen.Arm64
value >>= 16; value >>= 16;
} }
} }
else
{
context.Assembler.Mov(dest, Register(ZrRegister, dest.Type));
}
} }
private static void GenerateAtomicCas( private static void GenerateAtomicCas(

View File

@@ -48,9 +48,21 @@ namespace ARMeilleure.CodeGen
/// <returns>A delegate of type <typeparamref name="T"/> pointing to the mapped function</returns> /// <returns>A delegate of type <typeparamref name="T"/> pointing to the mapped function</returns>
public T Map<T>() public T Map<T>()
{ {
IntPtr codePtr = JitCache.Map(this); return MapWithPointer<T>(out _);
}
return Marshal.GetDelegateForFunctionPointer<T>(codePtr); /// <summary>
/// Maps the <see cref="CompiledFunction"/> onto the <see cref="JitCache"/> and returns a delegate of type
/// <typeparamref name="T"/> pointing to the mapped function.
/// </summary>
/// <typeparam name="T">Type of delegate</typeparam>
/// <param name="codePointer">Pointer to the function code in memory</param>
/// <returns>A delegate of type <typeparamref name="T"/> pointing to the mapped function</returns>
public T MapWithPointer<T>(out IntPtr codePointer)
{
codePointer = JitCache.Map(this);
return Marshal.GetDelegateForFunctionPointer<T>(codePointer);
} }
} }
} }

View File

@@ -191,7 +191,7 @@ namespace ARMeilleure.Instructions
{ {
TranslatedFunction function = Context.Translator.GetOrTranslate(address, GetContext().ExecutionMode); TranslatedFunction function = Context.Translator.GetOrTranslate(address, GetContext().ExecutionMode);
return (ulong)function.FuncPtr.ToInt64(); return (ulong)function.FuncPointer.ToInt64();
} }
public static void InvalidateCacheLine(ulong address) public static void InvalidateCacheLine(ulong address)

View File

@@ -29,7 +29,7 @@ namespace ARMeilleure.Translation.PTC
private const string OuterHeaderMagicString = "PTCohd\0\0"; private const string OuterHeaderMagicString = "PTCohd\0\0";
private const string InnerHeaderMagicString = "PTCihd\0\0"; private const string InnerHeaderMagicString = "PTCihd\0\0";
private const uint InternalVersion = 4272; //! To be incremented manually for each change to the ARMeilleure project. private const uint InternalVersion = 4328; //! To be incremented manually for each change to the ARMeilleure project.
private const string ActualDir = "0"; private const string ActualDir = "0";
private const string BackupDir = "1"; private const string BackupDir = "1";
@@ -745,9 +745,9 @@ namespace ARMeilleure.Translation.PTC
bool highCq) bool highCq)
{ {
var cFunc = new CompiledFunction(code, unwindInfo, RelocInfo.Empty); var cFunc = new CompiledFunction(code, unwindInfo, RelocInfo.Empty);
var gFunc = cFunc.Map<GuestFunction>(); var gFunc = cFunc.MapWithPointer<GuestFunction>(out IntPtr gFuncPointer);
return new TranslatedFunction(gFunc, callCounter, guestSize, highCq); return new TranslatedFunction(gFunc, gFuncPointer, callCounter, guestSize, highCq);
} }
private void UpdateInfo(InfoEntry infoEntry) private void UpdateInfo(InfoEntry infoEntry)

View File

@@ -1,6 +1,5 @@
using ARMeilleure.Common; using ARMeilleure.Common;
using System; using System;
using System.Runtime.InteropServices;
namespace ARMeilleure.Translation namespace ARMeilleure.Translation
{ {
@@ -8,18 +7,18 @@ namespace ARMeilleure.Translation
{ {
private readonly GuestFunction _func; // Ensure that this delegate will not be garbage collected. private readonly GuestFunction _func; // Ensure that this delegate will not be garbage collected.
public IntPtr FuncPointer { get; }
public Counter<uint> CallCounter { get; } public Counter<uint> CallCounter { get; }
public ulong GuestSize { get; } public ulong GuestSize { get; }
public bool HighCq { get; } public bool HighCq { get; }
public IntPtr FuncPtr { get; }
public TranslatedFunction(GuestFunction func, Counter<uint> callCounter, ulong guestSize, bool highCq) public TranslatedFunction(GuestFunction func, IntPtr funcPointer, Counter<uint> callCounter, ulong guestSize, bool highCq)
{ {
_func = func; _func = func;
FuncPointer = funcPointer;
CallCounter = callCounter; CallCounter = callCounter;
GuestSize = guestSize; GuestSize = guestSize;
HighCq = highCq; HighCq = highCq;
FuncPtr = Marshal.GetFunctionPointerForDelegate(func);
} }
public ulong Execute(State.ExecutionContext context) public ulong Execute(State.ExecutionContext context)

View File

@@ -211,7 +211,7 @@ namespace ARMeilleure.Translation
if (oldFunc != func) if (oldFunc != func)
{ {
JitCache.Unmap(func.FuncPtr); JitCache.Unmap(func.FuncPointer);
func = oldFunc; func = oldFunc;
} }
@@ -230,7 +230,7 @@ namespace ARMeilleure.Translation
{ {
if (FunctionTable.IsValid(guestAddress) && (Optimizations.AllowLcqInFunctionTable || func.HighCq)) if (FunctionTable.IsValid(guestAddress) && (Optimizations.AllowLcqInFunctionTable || func.HighCq))
{ {
Volatile.Write(ref FunctionTable.GetValue(guestAddress), (ulong)func.FuncPtr); Volatile.Write(ref FunctionTable.GetValue(guestAddress), (ulong)func.FuncPointer);
} }
} }
@@ -292,11 +292,11 @@ namespace ARMeilleure.Translation
_ptc.WriteCompiledFunction(address, funcSize, hash, highCq, compiledFunc); _ptc.WriteCompiledFunction(address, funcSize, hash, highCq, compiledFunc);
} }
GuestFunction func = compiledFunc.Map<GuestFunction>(); GuestFunction func = compiledFunc.MapWithPointer<GuestFunction>(out IntPtr funcPointer);
Allocators.ResetAll(); Allocators.ResetAll();
return new TranslatedFunction(func, counter, funcSize, highCq); return new TranslatedFunction(func, funcPointer, counter, funcSize, highCq);
} }
private void BackgroundTranslate() private void BackgroundTranslate()
@@ -537,7 +537,7 @@ namespace ARMeilleure.Translation
foreach (var func in functions) foreach (var func in functions)
{ {
JitCache.Unmap(func.FuncPtr); JitCache.Unmap(func.FuncPointer);
func.CallCounter?.Dispose(); func.CallCounter?.Dispose();
} }
@@ -546,7 +546,7 @@ namespace ARMeilleure.Translation
while (_oldFuncs.TryDequeue(out var kv)) while (_oldFuncs.TryDequeue(out var kv))
{ {
JitCache.Unmap(kv.Value.FuncPtr); JitCache.Unmap(kv.Value.FuncPointer);
kv.Value.CallCounter?.Dispose(); kv.Value.CallCounter?.Dispose();
} }

View File

@@ -231,7 +231,7 @@ namespace Ryujinx.Ava
} }
} }
private unsafe void Renderer_ScreenCaptured(object sender, ScreenCaptureImageInfo e) private void Renderer_ScreenCaptured(object sender, ScreenCaptureImageInfo e)
{ {
if (e.Data.Length > 0 && e.Height > 0 && e.Width > 0) if (e.Data.Length > 0 && e.Height > 0 && e.Width > 0)
{ {
@@ -240,7 +240,7 @@ namespace Ryujinx.Ava
lock (_lockObject) lock (_lockObject)
{ {
DateTime currentTime = DateTime.Now; DateTime currentTime = DateTime.Now;
string filename = $"ryujinx_capture_{currentTime}-{currentTime:D2}-{currentTime:D2}_{currentTime:D2}-{currentTime:D2}-{currentTime:D2}.png"; string filename = $"ryujinx_capture_{currentTime.Year}-{currentTime.Month:D2}-{currentTime.Day:D2}_{currentTime.Hour:D2}-{currentTime.Minute:D2}-{currentTime.Second:D2}.png";
string directory = AppDataManager.Mode switch string directory = AppDataManager.Mode switch
{ {

View File

@@ -26,6 +26,9 @@
"MenuBarToolsInstallFirmware": "Install Firmware", "MenuBarToolsInstallFirmware": "Install Firmware",
"MenuBarFileToolsInstallFirmwareFromFile": "Install a firmware from XCI or ZIP", "MenuBarFileToolsInstallFirmwareFromFile": "Install a firmware from XCI or ZIP",
"MenuBarFileToolsInstallFirmwareFromDirectory": "Install a firmware from a directory", "MenuBarFileToolsInstallFirmwareFromDirectory": "Install a firmware from a directory",
"MenuBarToolsManageFileTypes": "Manage file types",
"MenuBarToolsInstallFileTypes": "Install file types",
"MenuBarToolsUninstallFileTypes": "Uninstall file types",
"MenuBarHelp": "Help", "MenuBarHelp": "Help",
"MenuBarHelpCheckForUpdates": "Check for Updates", "MenuBarHelpCheckForUpdates": "Check for Updates",
"MenuBarHelpAbout": "About", "MenuBarHelpAbout": "About",
@@ -339,6 +342,10 @@
"DialogFirmwareInstallEmbeddedSuccessMessage": "No installed firmware was found but Ryujinx was able to install firmware {0} from the provided game.\\nThe emulator will now start.", "DialogFirmwareInstallEmbeddedSuccessMessage": "No installed firmware was found but Ryujinx was able to install firmware {0} from the provided game.\\nThe emulator will now start.",
"DialogFirmwareNoFirmwareInstalledMessage": "No Firmware Installed", "DialogFirmwareNoFirmwareInstalledMessage": "No Firmware Installed",
"DialogFirmwareInstalledMessage": "Firmware {0} was installed", "DialogFirmwareInstalledMessage": "Firmware {0} was installed",
"DialogInstallFileTypesSuccessMessage": "Successfully installed file types!",
"DialogInstallFileTypesErrorMessage": "Failed to install file types.",
"DialogUninstallFileTypesSuccessMessage": "Successfully uninstalled file types!",
"DialogUninstallFileTypesErrorMessage": "Failed to uninstall file types.",
"DialogOpenSettingsWindowLabel": "Open Settings Window", "DialogOpenSettingsWindowLabel": "Open Settings Window",
"DialogControllerAppletTitle": "Controller Applet", "DialogControllerAppletTitle": "Controller Applet",
"DialogMessageDialogErrorExceptionMessage": "Error displaying Message Dialog: {0}", "DialogMessageDialogErrorExceptionMessage": "Error displaying Message Dialog: {0}",
@@ -619,4 +626,4 @@
"UserProfilesRecoverEmptyList": "No profiles to recover", "UserProfilesRecoverEmptyList": "No profiles to recover",
"UserEditorTitle" : "Edit User", "UserEditorTitle" : "Edit User",
"UserEditorTitleCreate" : "Create User" "UserEditorTitleCreate" : "Create User"
} }

View File

@@ -1,5 +1,6 @@
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Input; using Avalonia.Input;
using Avalonia.Interactivity;
using Ryujinx.Ava.Common.Locale; using Ryujinx.Ava.Common.Locale;
using Ryujinx.Input; using Ryujinx.Input;
using System; using System;
@@ -30,6 +31,7 @@ namespace Ryujinx.Ava.Input
_control.KeyDown += OnKeyPress; _control.KeyDown += OnKeyPress;
_control.KeyUp += OnKeyRelease; _control.KeyUp += OnKeyRelease;
_control.TextInput += Control_TextInput; _control.TextInput += Control_TextInput;
_control.AddHandler(InputElement.TextInputEvent, Control_LastChanceTextInput, RoutingStrategies.Bubble);
} }
private void Control_TextInput(object sender, TextInputEventArgs e) private void Control_TextInput(object sender, TextInputEventArgs e)
@@ -37,6 +39,12 @@ namespace Ryujinx.Ava.Input
TextInput?.Invoke(this, e.Text); TextInput?.Invoke(this, e.Text);
} }
private void Control_LastChanceTextInput(object sender, TextInputEventArgs e)
{
// Swallow event
e.Handled = true;
}
public event Action<string> OnGamepadConnected public event Action<string> OnGamepadConnected
{ {
add { } add { }

View File

@@ -14,10 +14,8 @@ using Ryujinx.Ui.Common;
using Ryujinx.Ui.Common.Configuration; using Ryujinx.Ui.Common.Configuration;
using Ryujinx.Ui.Common.Helper; using Ryujinx.Ui.Common.Helper;
using System; using System;
using System.Diagnostics;
using System.IO; using System.IO;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Ryujinx.Ava namespace Ryujinx.Ava
@@ -35,48 +33,6 @@ namespace Ryujinx.Ava
private const uint MB_ICONWARNING = 0x30; private const uint MB_ICONWARNING = 0x30;
[SupportedOSPlatform("linux")]
static void RegisterMimeTypes()
{
if (ReleaseInformation.IsFlatHubBuild())
{
return;
}
string mimeDbPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".local", "share", "mime");
if (!File.Exists(Path.Combine(mimeDbPath, "packages", "Ryujinx.xml")))
{
string mimeTypesFile = Path.Combine(ReleaseInformation.GetBaseApplicationDirectory(), "mime", "Ryujinx.xml");
using Process mimeProcess = new();
mimeProcess.StartInfo.FileName = "xdg-mime";
mimeProcess.StartInfo.Arguments = $"install --novendor --mode user {mimeTypesFile}";
mimeProcess.Start();
mimeProcess.WaitForExit();
if (mimeProcess.ExitCode != 0)
{
Logger.Error?.PrintMsg(LogClass.Application, $"Unable to install mime types. Make sure xdg-utils is installed. Process exited with code: {mimeProcess.ExitCode}");
return;
}
using Process updateMimeProcess = new();
updateMimeProcess.StartInfo.FileName = "update-mime-database";
updateMimeProcess.StartInfo.Arguments = mimeDbPath;
updateMimeProcess.Start();
updateMimeProcess.WaitForExit();
if (updateMimeProcess.ExitCode != 0)
{
Logger.Error?.PrintMsg(LogClass.Application, $"Could not update local mime database. Process exited with code: {updateMimeProcess.ExitCode}");
}
}
}
public static void Main(string[] args) public static void Main(string[] args)
{ {
Version = ReleaseInformation.GetVersion(); Version = ReleaseInformation.GetVersion();
@@ -139,12 +95,6 @@ namespace Ryujinx.Ava
// Initialize the logger system. // Initialize the logger system.
LoggerModule.Initialize(); LoggerModule.Initialize();
// Register mime types on linux.
if (OperatingSystem.IsLinux())
{
RegisterMimeTypes();
}
// Initialize Discord integration. // Initialize Discord integration.
DiscordIntegrationModule.Initialize(); DiscordIntegrationModule.Initialize();

View File

@@ -140,68 +140,75 @@ namespace Ryujinx.Ava.UI.Renderer
{ {
if (VisualRoot != null) if (VisualRoot != null)
{ {
Point rootVisualPosition = this.TranslatePoint(new Point((long)lParam & 0xFFFF, (long)lParam >> 16 & 0xFFFF), VisualRoot).Value; if (msg == WindowsMessages.LBUTTONDOWN ||
Pointer pointer = new(0, PointerType.Mouse, true); msg == WindowsMessages.RBUTTONDOWN ||
msg == WindowsMessages.LBUTTONUP ||
switch (msg) msg == WindowsMessages.RBUTTONUP ||
msg == WindowsMessages.MOUSEMOVE)
{ {
case WindowsMessages.LBUTTONDOWN: Point rootVisualPosition = this.TranslatePoint(new Point((long)lParam & 0xFFFF, (long)lParam >> 16 & 0xFFFF), VisualRoot).Value;
case WindowsMessages.RBUTTONDOWN: Pointer pointer = new(0, PointerType.Mouse, true);
{
bool isLeft = msg == WindowsMessages.LBUTTONDOWN;
RawInputModifiers pointerPointModifier = isLeft ? RawInputModifiers.LeftMouseButton : RawInputModifiers.RightMouseButton;
PointerPointProperties properties = new(pointerPointModifier, isLeft ? PointerUpdateKind.LeftButtonPressed : PointerUpdateKind.RightButtonPressed);
var evnt = new PointerPressedEventArgs( switch (msg)
this, {
pointer, case WindowsMessages.LBUTTONDOWN:
VisualRoot, case WindowsMessages.RBUTTONDOWN:
rootVisualPosition, {
(ulong)Environment.TickCount64, bool isLeft = msg == WindowsMessages.LBUTTONDOWN;
properties, RawInputModifiers pointerPointModifier = isLeft ? RawInputModifiers.LeftMouseButton : RawInputModifiers.RightMouseButton;
KeyModifiers.None); PointerPointProperties properties = new(pointerPointModifier, isLeft ? PointerUpdateKind.LeftButtonPressed : PointerUpdateKind.RightButtonPressed);
RaiseEvent(evnt); var evnt = new PointerPressedEventArgs(
this,
pointer,
VisualRoot,
rootVisualPosition,
(ulong)Environment.TickCount64,
properties,
KeyModifiers.None);
break; RaiseEvent(evnt);
}
case WindowsMessages.LBUTTONUP:
case WindowsMessages.RBUTTONUP:
{
bool isLeft = msg == WindowsMessages.LBUTTONUP;
RawInputModifiers pointerPointModifier = isLeft ? RawInputModifiers.LeftMouseButton : RawInputModifiers.RightMouseButton;
PointerPointProperties properties = new(pointerPointModifier, isLeft ? PointerUpdateKind.LeftButtonReleased : PointerUpdateKind.RightButtonReleased);
var evnt = new PointerReleasedEventArgs( break;
this, }
pointer, case WindowsMessages.LBUTTONUP:
VisualRoot, case WindowsMessages.RBUTTONUP:
rootVisualPosition, {
(ulong)Environment.TickCount64, bool isLeft = msg == WindowsMessages.LBUTTONUP;
properties, RawInputModifiers pointerPointModifier = isLeft ? RawInputModifiers.LeftMouseButton : RawInputModifiers.RightMouseButton;
KeyModifiers.None, PointerPointProperties properties = new(pointerPointModifier, isLeft ? PointerUpdateKind.LeftButtonReleased : PointerUpdateKind.RightButtonReleased);
isLeft ? MouseButton.Left : MouseButton.Right);
RaiseEvent(evnt); var evnt = new PointerReleasedEventArgs(
this,
pointer,
VisualRoot,
rootVisualPosition,
(ulong)Environment.TickCount64,
properties,
KeyModifiers.None,
isLeft ? MouseButton.Left : MouseButton.Right);
break; RaiseEvent(evnt);
}
case WindowsMessages.MOUSEMOVE:
{
var evnt = new PointerEventArgs(
PointerMovedEvent,
this,
pointer,
VisualRoot,
rootVisualPosition,
(ulong)Environment.TickCount64,
new PointerPointProperties(RawInputModifiers.None, PointerUpdateKind.Other),
KeyModifiers.None);
RaiseEvent(evnt); break;
}
case WindowsMessages.MOUSEMOVE:
{
var evnt = new PointerEventArgs(
PointerMovedEvent,
this,
pointer,
VisualRoot,
rootVisualPosition,
(ulong)Environment.TickCount64,
new PointerPointProperties(RawInputModifiers.None, PointerUpdateKind.Other),
KeyModifiers.None);
break; RaiseEvent(evnt);
}
break;
}
}
} }
} }

View File

@@ -683,6 +683,11 @@ namespace Ryujinx.Ava.UI.ViewModels
get => ConsoleHelper.SetConsoleWindowStateSupported; get => ConsoleHelper.SetConsoleWindowStateSupported;
} }
public bool ManageFileTypesVisible
{
get => FileAssociationHelper.IsTypeAssociationSupported;
}
public ObservableCollection<ApplicationData> Applications public ObservableCollection<ApplicationData> Applications
{ {
get => _applications; get => _applications;

View File

@@ -21,8 +21,9 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using SpanHelpers = LibHac.Common.SpanHelpers; using System.Text;
using Path = System.IO.Path; using Path = System.IO.Path;
using SpanHelpers = LibHac.Common.SpanHelpers;
namespace Ryujinx.Ava.UI.ViewModels; namespace Ryujinx.Ava.UI.ViewModels;
@@ -90,6 +91,8 @@ public class TitleUpdateViewModel : BaseModel
Selected = "", Selected = "",
Paths = new List<string>() Paths = new List<string>()
}; };
Save();
} }
LoadUpdates(); LoadUpdates();
@@ -102,6 +105,9 @@ public class TitleUpdateViewModel : BaseModel
AddUpdate(path); AddUpdate(path);
} }
// NOTE: Save the list again to remove leftovers.
Save();
TitleUpdateModel selected = TitleUpdates.FirstOrDefault(x => x.Path == _titleUpdateWindowData.Selected, null); TitleUpdateModel selected = TitleUpdates.FirstOrDefault(x => x.Path == _titleUpdateWindowData.Selected, null);
SelectedUpdate = selected; SelectedUpdate = selected;
@@ -223,4 +229,22 @@ public class TitleUpdateViewModel : BaseModel
SortUpdates(); SortUpdates();
} }
public void Save()
{
_titleUpdateWindowData.Paths.Clear();
_titleUpdateWindowData.Selected = "";
foreach (TitleUpdateModel update in TitleUpdates)
{
_titleUpdateWindowData.Paths.Add(update.Path);
if (update == SelectedUpdate)
{
_titleUpdateWindowData.Selected = update.Path;
}
}
File.WriteAllBytes(_titleUpdateJsonPath, Encoding.UTF8.GetBytes(JsonHelper.Serialize(_titleUpdateWindowData, true)));
}
} }

View File

@@ -77,8 +77,7 @@
</MenuItem.Icon> </MenuItem.Icon>
</MenuItem> </MenuItem>
<Separator /> <Separator />
<MenuItem Name="ChangeLanguageMenuItem" Header="{locale:Locale MenuBarOptionsChangeLanguage}"> <MenuItem Name="ChangeLanguageMenuItem" Header="{locale:Locale MenuBarOptionsChangeLanguage}" />
</MenuItem>
<Separator /> <Separator />
<MenuItem <MenuItem
Click="OpenSettings" Click="OpenSettings"
@@ -141,6 +140,10 @@
<MenuItem Command="{ReflectionBinding InstallFirmwareFromFile}" Header="{locale:Locale MenuBarFileToolsInstallFirmwareFromFile}" /> <MenuItem Command="{ReflectionBinding InstallFirmwareFromFile}" Header="{locale:Locale MenuBarFileToolsInstallFirmwareFromFile}" />
<MenuItem Command="{ReflectionBinding InstallFirmwareFromFolder}" Header="{locale:Locale MenuBarFileToolsInstallFirmwareFromDirectory}" /> <MenuItem Command="{ReflectionBinding InstallFirmwareFromFolder}" Header="{locale:Locale MenuBarFileToolsInstallFirmwareFromDirectory}" />
</MenuItem> </MenuItem>
<MenuItem Header="{locale:Locale MenuBarToolsManageFileTypes}" IsVisible="{Binding ManageFileTypesVisible}">
<MenuItem Header="{locale:Locale MenuBarToolsInstallFileTypes}" Click="InstallFileTypes_Click"/>
<MenuItem Header="{locale:Locale MenuBarToolsUninstallFileTypes}" Click="UninstallFileTypes_Click"/>
</MenuItem>
</MenuItem> </MenuItem>
<MenuItem VerticalAlignment="Center" Header="{locale:Locale MenuBarHelp}"> <MenuItem VerticalAlignment="Center" Header="{locale:Locale MenuBarHelp}">
<MenuItem <MenuItem
@@ -157,4 +160,4 @@
</MenuItem> </MenuItem>
</Menu> </Menu>
</DockPanel> </DockPanel>
</UserControl> </UserControl>

View File

@@ -3,6 +3,7 @@ using Avalonia.Controls;
using Avalonia.Interactivity; using Avalonia.Interactivity;
using LibHac.FsSystem; using LibHac.FsSystem;
using LibHac.Ncm; using LibHac.Ncm;
using Ryujinx.Ava.Common.Locale;
using Ryujinx.Ava.UI.Helpers; using Ryujinx.Ava.UI.Helpers;
using Ryujinx.Ava.UI.ViewModels; using Ryujinx.Ava.UI.ViewModels;
using Ryujinx.Ava.UI.Windows; using Ryujinx.Ava.UI.Windows;
@@ -10,6 +11,7 @@ using Ryujinx.Common;
using Ryujinx.Common.Utilities; using Ryujinx.Common.Utilities;
using Ryujinx.HLE.HOS; using Ryujinx.HLE.HOS;
using Ryujinx.Modules; using Ryujinx.Modules;
using Ryujinx.Ui.Common.Helper;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
@@ -163,6 +165,32 @@ namespace Ryujinx.Ava.UI.Views.Main
} }
} }
private async void InstallFileTypes_Click(object sender, RoutedEventArgs e)
{
if (FileAssociationHelper.Install())
{
await ContentDialogHelper.CreateInfoDialog(LocaleManager.Instance[LocaleKeys.DialogInstallFileTypesSuccessMessage],
string.Empty, LocaleManager.Instance[LocaleKeys.InputDialogOk], string.Empty, string.Empty);
}
else
{
await ContentDialogHelper.CreateErrorDialog(LocaleManager.Instance[LocaleKeys.DialogInstallFileTypesErrorMessage]);
}
}
private async void UninstallFileTypes_Click(object sender, RoutedEventArgs e)
{
if (FileAssociationHelper.Uninstall())
{
await ContentDialogHelper.CreateInfoDialog(LocaleManager.Instance[LocaleKeys.DialogUninstallFileTypesSuccessMessage],
string.Empty, LocaleManager.Instance[LocaleKeys.InputDialogOk], string.Empty, string.Empty);
}
else
{
await ContentDialogHelper.CreateErrorDialog(LocaleManager.Instance[LocaleKeys.DialogUninstallFileTypesErrorMessage]);
}
}
public async void CheckForUpdates(object sender, RoutedEventArgs e) public async void CheckForUpdates(object sender, RoutedEventArgs e)
{ {
if (Updater.CanUpdate(true)) if (Updater.CanUpdate(true))

View File

@@ -60,24 +60,7 @@ namespace Ryujinx.Ava.UI.Windows
public void Save(object sender, RoutedEventArgs e) public void Save(object sender, RoutedEventArgs e)
{ {
ViewModel._titleUpdateWindowData.Paths.Clear(); ViewModel.Save();
ViewModel._titleUpdateWindowData.Selected = "";
foreach (TitleUpdateModel update in ViewModel.TitleUpdates)
{
ViewModel._titleUpdateWindowData.Paths.Add(update.Path);
if (update == ViewModel.SelectedUpdate)
{
ViewModel._titleUpdateWindowData.Selected = update.Path;
}
}
using (FileStream titleUpdateJsonStream = File.Create(ViewModel._titleUpdateJsonPath, 4096, FileOptions.WriteThrough))
{
titleUpdateJsonStream.Write(Encoding.UTF8.GetBytes(JsonHelper.Serialize(ViewModel._titleUpdateWindowData, true)));
}
if (VisualRoot is MainWindow window) if (VisualRoot is MainWindow window)
{ {

View File

@@ -7,9 +7,7 @@ using Ryujinx.Graphics.GAL.Multithreading.Commands.Sampler;
using Ryujinx.Graphics.GAL.Multithreading.Commands.Texture; using Ryujinx.Graphics.GAL.Multithreading.Commands.Texture;
using Ryujinx.Graphics.GAL.Multithreading.Commands.Window; using Ryujinx.Graphics.GAL.Multithreading.Commands.Window;
using System; using System;
using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
@@ -30,207 +28,115 @@ namespace Ryujinx.Graphics.GAL.Multithreading
public static int GetMaxCommandSize() public static int GetMaxCommandSize()
{ {
Assembly assembly = typeof(CommandHelper).Assembly; return InitLookup() + 1; // 1 byte reserved for command size.
IEnumerable<Type> commands = assembly.GetTypes().Where(type => typeof(IGALCommand).IsAssignableFrom(type) && type.IsValueType);
int maxSize = commands.Max(command =>
{
MethodInfo method = typeof(Unsafe).GetMethod(nameof(Unsafe.SizeOf));
MethodInfo generic = method.MakeGenericMethod(command);
int size = (int)generic.Invoke(null, null);
return size;
});
InitLookup();
return maxSize + 1; // 1 byte reserved for command size.
} }
private static void InitLookup() private static int InitLookup()
{ {
_lookup[(int)CommandType.Action] = (memory, threaded, renderer) => int maxCommandSize = 0;
ActionCommand.Run(ref GetCommand<ActionCommand>(memory), threaded, renderer);
_lookup[(int)CommandType.CreateBuffer] = (memory, threaded, renderer) =>
CreateBufferCommand.Run(ref GetCommand<CreateBufferCommand>(memory), threaded, renderer);
_lookup[(int)CommandType.CreateProgram] = (memory, threaded, renderer) =>
CreateProgramCommand.Run(ref GetCommand<CreateProgramCommand>(memory), threaded, renderer);
_lookup[(int)CommandType.CreateSampler] = (memory, threaded, renderer) =>
CreateSamplerCommand.Run(ref GetCommand<CreateSamplerCommand>(memory), threaded, renderer);
_lookup[(int)CommandType.CreateSync] = (memory, threaded, renderer) =>
CreateSyncCommand.Run(ref GetCommand<CreateSyncCommand>(memory), threaded, renderer);
_lookup[(int)CommandType.CreateTexture] = (memory, threaded, renderer) =>
CreateTextureCommand.Run(ref GetCommand<CreateTextureCommand>(memory), threaded, renderer);
_lookup[(int)CommandType.GetCapabilities] = (memory, threaded, renderer) =>
GetCapabilitiesCommand.Run(ref GetCommand<GetCapabilitiesCommand>(memory), threaded, renderer);
_lookup[(int)CommandType.PreFrame] = (memory, threaded, renderer) =>
PreFrameCommand.Run(ref GetCommand<PreFrameCommand>(memory), threaded, renderer);
_lookup[(int)CommandType.ReportCounter] = (memory, threaded, renderer) =>
ReportCounterCommand.Run(ref GetCommand<ReportCounterCommand>(memory), threaded, renderer);
_lookup[(int)CommandType.ResetCounter] = (memory, threaded, renderer) =>
ResetCounterCommand.Run(ref GetCommand<ResetCounterCommand>(memory), threaded, renderer);
_lookup[(int)CommandType.UpdateCounters] = (memory, threaded, renderer) =>
UpdateCountersCommand.Run(ref GetCommand<UpdateCountersCommand>(memory), threaded, renderer);
_lookup[(int)CommandType.BufferDispose] = (memory, threaded, renderer) => void Register<T>(CommandType commandType) where T : unmanaged, IGALCommand, IGALCommand<T>
BufferDisposeCommand.Run(ref GetCommand<BufferDisposeCommand>(memory), threaded, renderer); {
_lookup[(int)CommandType.BufferGetData] = (memory, threaded, renderer) => maxCommandSize = Math.Max(maxCommandSize, Unsafe.SizeOf<T>());
BufferGetDataCommand.Run(ref GetCommand<BufferGetDataCommand>(memory), threaded, renderer); _lookup[(int)commandType] = (memory, threaded, renderer) => T.Run(ref GetCommand<T>(memory), threaded, renderer);
_lookup[(int)CommandType.BufferSetData] = (memory, threaded, renderer) => }
BufferSetDataCommand.Run(ref GetCommand<BufferSetDataCommand>(memory), threaded, renderer);
_lookup[(int)CommandType.CounterEventDispose] = (memory, threaded, renderer) => Register<ActionCommand>(CommandType.Action);
CounterEventDisposeCommand.Run(ref GetCommand<CounterEventDisposeCommand>(memory), threaded, renderer); Register<CreateBufferCommand>(CommandType.CreateBuffer);
_lookup[(int)CommandType.CounterEventFlush] = (memory, threaded, renderer) => Register<CreateProgramCommand>(CommandType.CreateProgram);
CounterEventFlushCommand.Run(ref GetCommand<CounterEventFlushCommand>(memory), threaded, renderer); Register<CreateSamplerCommand>(CommandType.CreateSampler);
Register<CreateSyncCommand>(CommandType.CreateSync);
Register<CreateTextureCommand>(CommandType.CreateTexture);
Register<GetCapabilitiesCommand>(CommandType.GetCapabilities);
Register<PreFrameCommand>(CommandType.PreFrame);
Register<ReportCounterCommand>(CommandType.ReportCounter);
Register<ResetCounterCommand>(CommandType.ResetCounter);
Register<UpdateCountersCommand>(CommandType.UpdateCounters);
_lookup[(int)CommandType.ProgramDispose] = (memory, threaded, renderer) => Register<BufferDisposeCommand>(CommandType.BufferDispose);
ProgramDisposeCommand.Run(ref GetCommand<ProgramDisposeCommand>(memory), threaded, renderer); Register<BufferGetDataCommand>(CommandType.BufferGetData);
_lookup[(int)CommandType.ProgramGetBinary] = (memory, threaded, renderer) => Register<BufferSetDataCommand>(CommandType.BufferSetData);
ProgramGetBinaryCommand.Run(ref GetCommand<ProgramGetBinaryCommand>(memory), threaded, renderer);
_lookup[(int)CommandType.ProgramCheckLink] = (memory, threaded, renderer) =>
ProgramCheckLinkCommand.Run(ref GetCommand<ProgramCheckLinkCommand>(memory), threaded, renderer);
_lookup[(int)CommandType.SamplerDispose] = (memory, threaded, renderer) => Register<CounterEventDisposeCommand>(CommandType.CounterEventDispose);
SamplerDisposeCommand.Run(ref GetCommand<SamplerDisposeCommand>(memory), threaded, renderer); Register<CounterEventFlushCommand>(CommandType.CounterEventFlush);
_lookup[(int)CommandType.TextureCopyTo] = (memory, threaded, renderer) => Register<ProgramDisposeCommand>(CommandType.ProgramDispose);
TextureCopyToCommand.Run(ref GetCommand<TextureCopyToCommand>(memory), threaded, renderer); Register<ProgramGetBinaryCommand>(CommandType.ProgramGetBinary);
_lookup[(int)CommandType.TextureCopyToScaled] = (memory, threaded, renderer) => Register<ProgramCheckLinkCommand>(CommandType.ProgramCheckLink);
TextureCopyToScaledCommand.Run(ref GetCommand<TextureCopyToScaledCommand>(memory), threaded, renderer);
_lookup[(int)CommandType.TextureCopyToSlice] = (memory, threaded, renderer) =>
TextureCopyToSliceCommand.Run(ref GetCommand<TextureCopyToSliceCommand>(memory), threaded, renderer);
_lookup[(int)CommandType.TextureCreateView] = (memory, threaded, renderer) =>
TextureCreateViewCommand.Run(ref GetCommand<TextureCreateViewCommand>(memory), threaded, renderer);
_lookup[(int)CommandType.TextureGetData] = (memory, threaded, renderer) =>
TextureGetDataCommand.Run(ref GetCommand<TextureGetDataCommand>(memory), threaded, renderer);
_lookup[(int)CommandType.TextureGetDataSlice] = (memory, threaded, renderer) =>
TextureGetDataSliceCommand.Run(ref GetCommand<TextureGetDataSliceCommand>(memory), threaded, renderer);
_lookup[(int)CommandType.TextureRelease] = (memory, threaded, renderer) =>
TextureReleaseCommand.Run(ref GetCommand<TextureReleaseCommand>(memory), threaded, renderer);
_lookup[(int)CommandType.TextureSetData] = (memory, threaded, renderer) =>
TextureSetDataCommand.Run(ref GetCommand<TextureSetDataCommand>(memory), threaded, renderer);
_lookup[(int)CommandType.TextureSetDataSlice] = (memory, threaded, renderer) =>
TextureSetDataSliceCommand.Run(ref GetCommand<TextureSetDataSliceCommand>(memory), threaded, renderer);
_lookup[(int)CommandType.TextureSetDataSliceRegion] = (memory, threaded, renderer) =>
TextureSetDataSliceRegionCommand.Run(ref GetCommand<TextureSetDataSliceRegionCommand>(memory), threaded, renderer);
_lookup[(int)CommandType.TextureSetStorage] = (memory, threaded, renderer) =>
TextureSetStorageCommand.Run(ref GetCommand<TextureSetStorageCommand>(memory), threaded, renderer);
_lookup[(int)CommandType.WindowPresent] = (memory, threaded, renderer) => Register<SamplerDisposeCommand>(CommandType.SamplerDispose);
WindowPresentCommand.Run(ref GetCommand<WindowPresentCommand>(memory), threaded, renderer);
_lookup[(int)CommandType.Barrier] = (memory, threaded, renderer) => Register<TextureCopyToCommand>(CommandType.TextureCopyTo);
BarrierCommand.Run(ref GetCommand<BarrierCommand>(memory), threaded, renderer); Register<TextureCopyToScaledCommand>(CommandType.TextureCopyToScaled);
_lookup[(int)CommandType.BeginTransformFeedback] = (memory, threaded, renderer) => Register<TextureCopyToSliceCommand>(CommandType.TextureCopyToSlice);
BeginTransformFeedbackCommand.Run(ref GetCommand<BeginTransformFeedbackCommand>(memory), threaded, renderer); Register<TextureCreateViewCommand>(CommandType.TextureCreateView);
_lookup[(int)CommandType.ClearBuffer] = (memory, threaded, renderer) => Register<TextureGetDataCommand>(CommandType.TextureGetData);
ClearBufferCommand.Run(ref GetCommand<ClearBufferCommand>(memory), threaded, renderer); Register<TextureGetDataSliceCommand>(CommandType.TextureGetDataSlice);
_lookup[(int)CommandType.ClearRenderTargetColor] = (memory, threaded, renderer) => Register<TextureReleaseCommand>(CommandType.TextureRelease);
ClearRenderTargetColorCommand.Run(ref GetCommand<ClearRenderTargetColorCommand>(memory), threaded, renderer); Register<TextureSetDataCommand>(CommandType.TextureSetData);
_lookup[(int)CommandType.ClearRenderTargetDepthStencil] = (memory, threaded, renderer) => Register<TextureSetDataSliceCommand>(CommandType.TextureSetDataSlice);
ClearRenderTargetDepthStencilCommand.Run(ref GetCommand<ClearRenderTargetDepthStencilCommand>(memory), threaded, renderer); Register<TextureSetDataSliceRegionCommand>(CommandType.TextureSetDataSliceRegion);
_lookup[(int)CommandType.CommandBufferBarrier] = (memory, threaded, renderer) => Register<TextureSetStorageCommand>(CommandType.TextureSetStorage);
CommandBufferBarrierCommand.Run(ref GetCommand<CommandBufferBarrierCommand>(memory), threaded, renderer);
_lookup[(int)CommandType.CopyBuffer] = (memory, threaded, renderer) => Register<WindowPresentCommand>(CommandType.WindowPresent);
CopyBufferCommand.Run(ref GetCommand<CopyBufferCommand>(memory), threaded, renderer);
_lookup[(int)CommandType.DispatchCompute] = (memory, threaded, renderer) => Register<BarrierCommand>(CommandType.Barrier);
DispatchComputeCommand.Run(ref GetCommand<DispatchComputeCommand>(memory), threaded, renderer); Register<BeginTransformFeedbackCommand>(CommandType.BeginTransformFeedback);
_lookup[(int)CommandType.Draw] = (memory, threaded, renderer) => Register<ClearBufferCommand>(CommandType.ClearBuffer);
DrawCommand.Run(ref GetCommand<DrawCommand>(memory), threaded, renderer); Register<ClearRenderTargetColorCommand>(CommandType.ClearRenderTargetColor);
_lookup[(int)CommandType.DrawIndexed] = (memory, threaded, renderer) => Register<ClearRenderTargetDepthStencilCommand>(CommandType.ClearRenderTargetDepthStencil);
DrawIndexedCommand.Run(ref GetCommand<DrawIndexedCommand>(memory), threaded, renderer); Register<CommandBufferBarrierCommand>(CommandType.CommandBufferBarrier);
_lookup[(int)CommandType.DrawIndexedIndirect] = (memory, threaded, renderer) => Register<CopyBufferCommand>(CommandType.CopyBuffer);
DrawIndexedIndirectCommand.Run(ref GetCommand<DrawIndexedIndirectCommand>(memory), threaded, renderer); Register<DispatchComputeCommand>(CommandType.DispatchCompute);
_lookup[(int)CommandType.DrawIndexedIndirectCount] = (memory, threaded, renderer) => Register<DrawCommand>(CommandType.Draw);
DrawIndexedIndirectCountCommand.Run(ref GetCommand<DrawIndexedIndirectCountCommand>(memory), threaded, renderer); Register<DrawIndexedCommand>(CommandType.DrawIndexed);
_lookup[(int)CommandType.DrawIndirect] = (memory, threaded, renderer) => Register<DrawIndexedIndirectCommand>(CommandType.DrawIndexedIndirect);
DrawIndirectCommand.Run(ref GetCommand<DrawIndirectCommand>(memory), threaded, renderer); Register<DrawIndexedIndirectCountCommand>(CommandType.DrawIndexedIndirectCount);
_lookup[(int)CommandType.DrawIndirectCount] = (memory, threaded, renderer) => Register<DrawIndirectCommand>(CommandType.DrawIndirect);
DrawIndirectCountCommand.Run(ref GetCommand<DrawIndirectCountCommand>(memory), threaded, renderer); Register<DrawIndirectCountCommand>(CommandType.DrawIndirectCount);
_lookup[(int)CommandType.DrawTexture] = (memory, threaded, renderer) => Register<DrawTextureCommand>(CommandType.DrawTexture);
DrawTextureCommand.Run(ref GetCommand<DrawTextureCommand>(memory), threaded, renderer); Register<EndHostConditionalRenderingCommand>(CommandType.EndHostConditionalRendering);
_lookup[(int)CommandType.EndHostConditionalRendering] = (memory, threaded, renderer) => Register<EndTransformFeedbackCommand>(CommandType.EndTransformFeedback);
EndHostConditionalRenderingCommand.Run(renderer); Register<SetAlphaTestCommand>(CommandType.SetAlphaTest);
_lookup[(int)CommandType.EndTransformFeedback] = (memory, threaded, renderer) => Register<SetBlendStateCommand>(CommandType.SetBlendState);
EndTransformFeedbackCommand.Run(ref GetCommand<EndTransformFeedbackCommand>(memory), threaded, renderer); Register<SetDepthBiasCommand>(CommandType.SetDepthBias);
_lookup[(int)CommandType.SetAlphaTest] = (memory, threaded, renderer) => Register<SetDepthClampCommand>(CommandType.SetDepthClamp);
SetAlphaTestCommand.Run(ref GetCommand<SetAlphaTestCommand>(memory), threaded, renderer); Register<SetDepthModeCommand>(CommandType.SetDepthMode);
_lookup[(int)CommandType.SetBlendState] = (memory, threaded, renderer) => Register<SetDepthTestCommand>(CommandType.SetDepthTest);
SetBlendStateCommand.Run(ref GetCommand<SetBlendStateCommand>(memory), threaded, renderer); Register<SetFaceCullingCommand>(CommandType.SetFaceCulling);
_lookup[(int)CommandType.SetDepthBias] = (memory, threaded, renderer) => Register<SetFrontFaceCommand>(CommandType.SetFrontFace);
SetDepthBiasCommand.Run(ref GetCommand<SetDepthBiasCommand>(memory), threaded, renderer); Register<SetStorageBuffersCommand>(CommandType.SetStorageBuffers);
_lookup[(int)CommandType.SetDepthClamp] = (memory, threaded, renderer) => Register<SetTransformFeedbackBuffersCommand>(CommandType.SetTransformFeedbackBuffers);
SetDepthClampCommand.Run(ref GetCommand<SetDepthClampCommand>(memory), threaded, renderer); Register<SetUniformBuffersCommand>(CommandType.SetUniformBuffers);
_lookup[(int)CommandType.SetDepthMode] = (memory, threaded, renderer) => Register<SetImageCommand>(CommandType.SetImage);
SetDepthModeCommand.Run(ref GetCommand<SetDepthModeCommand>(memory), threaded, renderer); Register<SetIndexBufferCommand>(CommandType.SetIndexBuffer);
_lookup[(int)CommandType.SetDepthTest] = (memory, threaded, renderer) => Register<SetLineParametersCommand>(CommandType.SetLineParameters);
SetDepthTestCommand.Run(ref GetCommand<SetDepthTestCommand>(memory), threaded, renderer); Register<SetLogicOpStateCommand>(CommandType.SetLogicOpState);
_lookup[(int)CommandType.SetFaceCulling] = (memory, threaded, renderer) => Register<SetMultisampleStateCommand>(CommandType.SetMultisampleState);
SetFaceCullingCommand.Run(ref GetCommand<SetFaceCullingCommand>(memory), threaded, renderer); Register<SetPatchParametersCommand>(CommandType.SetPatchParameters);
_lookup[(int)CommandType.SetFrontFace] = (memory, threaded, renderer) => Register<SetPointParametersCommand>(CommandType.SetPointParameters);
SetFrontFaceCommand.Run(ref GetCommand<SetFrontFaceCommand>(memory), threaded, renderer); Register<SetPolygonModeCommand>(CommandType.SetPolygonMode);
_lookup[(int)CommandType.SetStorageBuffers] = (memory, threaded, renderer) => Register<SetPrimitiveRestartCommand>(CommandType.SetPrimitiveRestart);
SetStorageBuffersCommand.Run(ref GetCommand<SetStorageBuffersCommand>(memory), threaded, renderer); Register<SetPrimitiveTopologyCommand>(CommandType.SetPrimitiveTopology);
_lookup[(int)CommandType.SetTransformFeedbackBuffers] = (memory, threaded, renderer) => Register<SetProgramCommand>(CommandType.SetProgram);
SetTransformFeedbackBuffersCommand.Run(ref GetCommand<SetTransformFeedbackBuffersCommand>(memory), threaded, renderer); Register<SetRasterizerDiscardCommand>(CommandType.SetRasterizerDiscard);
_lookup[(int)CommandType.SetUniformBuffers] = (memory, threaded, renderer) => Register<SetRenderTargetColorMasksCommand>(CommandType.SetRenderTargetColorMasks);
SetUniformBuffersCommand.Run(ref GetCommand<SetUniformBuffersCommand>(memory), threaded, renderer); Register<SetRenderTargetScaleCommand>(CommandType.SetRenderTargetScale);
_lookup[(int)CommandType.SetImage] = (memory, threaded, renderer) => Register<SetRenderTargetsCommand>(CommandType.SetRenderTargets);
SetImageCommand.Run(ref GetCommand<SetImageCommand>(memory), threaded, renderer); Register<SetScissorsCommand>(CommandType.SetScissor);
_lookup[(int)CommandType.SetIndexBuffer] = (memory, threaded, renderer) => Register<SetStencilTestCommand>(CommandType.SetStencilTest);
SetIndexBufferCommand.Run(ref GetCommand<SetIndexBufferCommand>(memory), threaded, renderer); Register<SetTextureAndSamplerCommand>(CommandType.SetTextureAndSampler);
_lookup[(int)CommandType.SetLineParameters] = (memory, threaded, renderer) => Register<SetUserClipDistanceCommand>(CommandType.SetUserClipDistance);
SetLineParametersCommand.Run(ref GetCommand<SetLineParametersCommand>(memory), threaded, renderer); Register<SetVertexAttribsCommand>(CommandType.SetVertexAttribs);
_lookup[(int)CommandType.SetLogicOpState] = (memory, threaded, renderer) => Register<SetVertexBuffersCommand>(CommandType.SetVertexBuffers);
SetLogicOpStateCommand.Run(ref GetCommand<SetLogicOpStateCommand>(memory), threaded, renderer); Register<SetViewportsCommand>(CommandType.SetViewports);
_lookup[(int)CommandType.SetMultisampleState] = (memory, threaded, renderer) => Register<TextureBarrierCommand>(CommandType.TextureBarrier);
SetMultisampleStateCommand.Run(ref GetCommand<SetMultisampleStateCommand>(memory), threaded, renderer); Register<TextureBarrierTiledCommand>(CommandType.TextureBarrierTiled);
_lookup[(int)CommandType.SetPatchParameters] = (memory, threaded, renderer) => Register<TryHostConditionalRenderingCommand>(CommandType.TryHostConditionalRendering);
SetPatchParametersCommand.Run(ref GetCommand<SetPatchParametersCommand>(memory), threaded, renderer); Register<TryHostConditionalRenderingFlushCommand>(CommandType.TryHostConditionalRenderingFlush);
_lookup[(int)CommandType.SetPointParameters] = (memory, threaded, renderer) => Register<UpdateRenderScaleCommand>(CommandType.UpdateRenderScale);
SetPointParametersCommand.Run(ref GetCommand<SetPointParametersCommand>(memory), threaded, renderer);
_lookup[(int)CommandType.SetPolygonMode] = (memory, threaded, renderer) => return maxCommandSize;
SetPolygonModeCommand.Run(ref GetCommand<SetPolygonModeCommand>(memory), threaded, renderer);
_lookup[(int)CommandType.SetPrimitiveRestart] = (memory, threaded, renderer) =>
SetPrimitiveRestartCommand.Run(ref GetCommand<SetPrimitiveRestartCommand>(memory), threaded, renderer);
_lookup[(int)CommandType.SetPrimitiveTopology] = (memory, threaded, renderer) =>
SetPrimitiveTopologyCommand.Run(ref GetCommand<SetPrimitiveTopologyCommand>(memory), threaded, renderer);
_lookup[(int)CommandType.SetProgram] = (memory, threaded, renderer) =>
SetProgramCommand.Run(ref GetCommand<SetProgramCommand>(memory), threaded, renderer);
_lookup[(int)CommandType.SetRasterizerDiscard] = (memory, threaded, renderer) =>
SetRasterizerDiscardCommand.Run(ref GetCommand<SetRasterizerDiscardCommand>(memory), threaded, renderer);
_lookup[(int)CommandType.SetRenderTargetColorMasks] = (memory, threaded, renderer) =>
SetRenderTargetColorMasksCommand.Run(ref GetCommand<SetRenderTargetColorMasksCommand>(memory), threaded, renderer);
_lookup[(int)CommandType.SetRenderTargetScale] = (memory, threaded, renderer) =>
SetRenderTargetScaleCommand.Run(ref GetCommand<SetRenderTargetScaleCommand>(memory), threaded, renderer);
_lookup[(int)CommandType.SetRenderTargets] = (memory, threaded, renderer) =>
SetRenderTargetsCommand.Run(ref GetCommand<SetRenderTargetsCommand>(memory), threaded, renderer);
_lookup[(int)CommandType.SetScissor] = (memory, threaded, renderer) =>
SetScissorsCommand.Run(ref GetCommand<SetScissorsCommand>(memory), threaded, renderer);
_lookup[(int)CommandType.SetStencilTest] = (memory, threaded, renderer) =>
SetStencilTestCommand.Run(ref GetCommand<SetStencilTestCommand>(memory), threaded, renderer);
_lookup[(int)CommandType.SetTextureAndSampler] = (memory, threaded, renderer) =>
SetTextureAndSamplerCommand.Run(ref GetCommand<SetTextureAndSamplerCommand>(memory), threaded, renderer);
_lookup[(int)CommandType.SetUserClipDistance] = (memory, threaded, renderer) =>
SetUserClipDistanceCommand.Run(ref GetCommand<SetUserClipDistanceCommand>(memory), threaded, renderer);
_lookup[(int)CommandType.SetVertexAttribs] = (memory, threaded, renderer) =>
SetVertexAttribsCommand.Run(ref GetCommand<SetVertexAttribsCommand>(memory), threaded, renderer);
_lookup[(int)CommandType.SetVertexBuffers] = (memory, threaded, renderer) =>
SetVertexBuffersCommand.Run(ref GetCommand<SetVertexBuffersCommand>(memory), threaded, renderer);
_lookup[(int)CommandType.SetViewports] = (memory, threaded, renderer) =>
SetViewportsCommand.Run(ref GetCommand<SetViewportsCommand>(memory), threaded, renderer);
_lookup[(int)CommandType.TextureBarrier] = (memory, threaded, renderer) =>
TextureBarrierCommand.Run(ref GetCommand<TextureBarrierCommand>(memory), threaded, renderer);
_lookup[(int)CommandType.TextureBarrierTiled] = (memory, threaded, renderer) =>
TextureBarrierTiledCommand.Run(ref GetCommand<TextureBarrierTiledCommand>(memory), threaded, renderer);
_lookup[(int)CommandType.TryHostConditionalRendering] = (memory, threaded, renderer) =>
TryHostConditionalRenderingCommand.Run(ref GetCommand<TryHostConditionalRenderingCommand>(memory), threaded, renderer);
_lookup[(int)CommandType.TryHostConditionalRenderingFlush] = (memory, threaded, renderer) =>
TryHostConditionalRenderingFlushCommand.Run(ref GetCommand<TryHostConditionalRenderingFlushCommand>(memory), threaded, renderer);
_lookup[(int)CommandType.UpdateRenderScale] = (memory, threaded, renderer) =>
UpdateRenderScaleCommand.Run(ref GetCommand<UpdateRenderScaleCommand>(memory), threaded, renderer);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]

View File

@@ -1,6 +1,6 @@
namespace Ryujinx.Graphics.GAL.Multithreading.Commands namespace Ryujinx.Graphics.GAL.Multithreading.Commands
{ {
struct BarrierCommand : IGALCommand struct BarrierCommand : IGALCommand, IGALCommand<BarrierCommand>
{ {
public CommandType CommandType => CommandType.Barrier; public CommandType CommandType => CommandType.Barrier;

View File

@@ -1,6 +1,6 @@
namespace Ryujinx.Graphics.GAL.Multithreading.Commands namespace Ryujinx.Graphics.GAL.Multithreading.Commands
{ {
struct BeginTransformFeedbackCommand : IGALCommand struct BeginTransformFeedbackCommand : IGALCommand, IGALCommand<BeginTransformFeedbackCommand>
{ {
public CommandType CommandType => CommandType.BeginTransformFeedback; public CommandType CommandType => CommandType.BeginTransformFeedback;
private PrimitiveTopology _topology; private PrimitiveTopology _topology;

View File

@@ -1,6 +1,6 @@
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Buffer namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Buffer
{ {
struct BufferDisposeCommand : IGALCommand struct BufferDisposeCommand : IGALCommand, IGALCommand<BufferDisposeCommand>
{ {
public CommandType CommandType => CommandType.BufferDispose; public CommandType CommandType => CommandType.BufferDispose;
private BufferHandle _buffer; private BufferHandle _buffer;

View File

@@ -3,7 +3,7 @@ using System;
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Buffer namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Buffer
{ {
struct BufferGetDataCommand : IGALCommand struct BufferGetDataCommand : IGALCommand, IGALCommand<BufferGetDataCommand>
{ {
public CommandType CommandType => CommandType.BufferGetData; public CommandType CommandType => CommandType.BufferGetData;
private BufferHandle _buffer; private BufferHandle _buffer;

View File

@@ -3,7 +3,7 @@ using System;
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Buffer namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Buffer
{ {
struct BufferSetDataCommand : IGALCommand struct BufferSetDataCommand : IGALCommand, IGALCommand<BufferSetDataCommand>
{ {
public CommandType CommandType => CommandType.BufferSetData; public CommandType CommandType => CommandType.BufferSetData;
private BufferHandle _buffer; private BufferHandle _buffer;

View File

@@ -1,6 +1,6 @@
namespace Ryujinx.Graphics.GAL.Multithreading.Commands namespace Ryujinx.Graphics.GAL.Multithreading.Commands
{ {
struct ClearBufferCommand : IGALCommand struct ClearBufferCommand : IGALCommand, IGALCommand<ClearBufferCommand>
{ {
public CommandType CommandType => CommandType.ClearBuffer; public CommandType CommandType => CommandType.ClearBuffer;
private BufferHandle _destination; private BufferHandle _destination;

View File

@@ -1,6 +1,6 @@
namespace Ryujinx.Graphics.GAL.Multithreading.Commands namespace Ryujinx.Graphics.GAL.Multithreading.Commands
{ {
struct ClearRenderTargetColorCommand : IGALCommand struct ClearRenderTargetColorCommand : IGALCommand, IGALCommand<ClearRenderTargetColorCommand>
{ {
public CommandType CommandType => CommandType.ClearRenderTargetColor; public CommandType CommandType => CommandType.ClearRenderTargetColor;
private int _index; private int _index;

View File

@@ -1,6 +1,6 @@
namespace Ryujinx.Graphics.GAL.Multithreading.Commands namespace Ryujinx.Graphics.GAL.Multithreading.Commands
{ {
struct ClearRenderTargetDepthStencilCommand : IGALCommand struct ClearRenderTargetDepthStencilCommand : IGALCommand, IGALCommand<ClearRenderTargetDepthStencilCommand>
{ {
public CommandType CommandType => CommandType.ClearRenderTargetDepthStencil; public CommandType CommandType => CommandType.ClearRenderTargetDepthStencil;
private int _layer; private int _layer;

View File

@@ -1,6 +1,6 @@
namespace Ryujinx.Graphics.GAL.Multithreading.Commands namespace Ryujinx.Graphics.GAL.Multithreading.Commands
{ {
struct CommandBufferBarrierCommand : IGALCommand struct CommandBufferBarrierCommand : IGALCommand, IGALCommand<CommandBufferBarrierCommand>
{ {
public CommandType CommandType => CommandType.CommandBufferBarrier; public CommandType CommandType => CommandType.CommandBufferBarrier;

View File

@@ -1,6 +1,6 @@
namespace Ryujinx.Graphics.GAL.Multithreading.Commands namespace Ryujinx.Graphics.GAL.Multithreading.Commands
{ {
struct CopyBufferCommand : IGALCommand struct CopyBufferCommand : IGALCommand, IGALCommand<CopyBufferCommand>
{ {
public CommandType CommandType => CommandType.CopyBuffer; public CommandType CommandType => CommandType.CopyBuffer;
private BufferHandle _source; private BufferHandle _source;

View File

@@ -3,7 +3,7 @@ using Ryujinx.Graphics.GAL.Multithreading.Resources;
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.CounterEvent namespace Ryujinx.Graphics.GAL.Multithreading.Commands.CounterEvent
{ {
struct CounterEventDisposeCommand : IGALCommand struct CounterEventDisposeCommand : IGALCommand, IGALCommand<CounterEventDisposeCommand>
{ {
public CommandType CommandType => CommandType.CounterEventDispose; public CommandType CommandType => CommandType.CounterEventDispose;
private TableRef<ThreadedCounterEvent> _event; private TableRef<ThreadedCounterEvent> _event;

View File

@@ -3,7 +3,7 @@ using Ryujinx.Graphics.GAL.Multithreading.Resources;
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.CounterEvent namespace Ryujinx.Graphics.GAL.Multithreading.Commands.CounterEvent
{ {
struct CounterEventFlushCommand : IGALCommand struct CounterEventFlushCommand : IGALCommand, IGALCommand<CounterEventFlushCommand>
{ {
public CommandType CommandType => CommandType.CounterEventFlush; public CommandType CommandType => CommandType.CounterEventFlush;
private TableRef<ThreadedCounterEvent> _event; private TableRef<ThreadedCounterEvent> _event;

View File

@@ -1,6 +1,6 @@
namespace Ryujinx.Graphics.GAL.Multithreading.Commands namespace Ryujinx.Graphics.GAL.Multithreading.Commands
{ {
struct DispatchComputeCommand : IGALCommand struct DispatchComputeCommand : IGALCommand, IGALCommand<DispatchComputeCommand>
{ {
public CommandType CommandType => CommandType.DispatchCompute; public CommandType CommandType => CommandType.DispatchCompute;
private int _groupsX; private int _groupsX;

View File

@@ -1,6 +1,6 @@
namespace Ryujinx.Graphics.GAL.Multithreading.Commands namespace Ryujinx.Graphics.GAL.Multithreading.Commands
{ {
struct DrawIndexedCommand : IGALCommand struct DrawIndexedCommand : IGALCommand, IGALCommand<DrawIndexedCommand>
{ {
public CommandType CommandType => CommandType.DrawIndexed; public CommandType CommandType => CommandType.DrawIndexed;
private int _indexCount; private int _indexCount;

View File

@@ -1,6 +1,6 @@
namespace Ryujinx.Graphics.GAL.Multithreading.Commands namespace Ryujinx.Graphics.GAL.Multithreading.Commands
{ {
struct DrawCommand : IGALCommand struct DrawCommand : IGALCommand, IGALCommand<DrawCommand>
{ {
public CommandType CommandType => CommandType.Draw; public CommandType CommandType => CommandType.Draw;
private int _vertexCount; private int _vertexCount;

View File

@@ -1,6 +1,6 @@
namespace Ryujinx.Graphics.GAL.Multithreading.Commands namespace Ryujinx.Graphics.GAL.Multithreading.Commands
{ {
struct DrawIndexedIndirectCommand : IGALCommand struct DrawIndexedIndirectCommand : IGALCommand, IGALCommand<DrawIndexedIndirectCommand>
{ {
public CommandType CommandType => CommandType.DrawIndexedIndirect; public CommandType CommandType => CommandType.DrawIndexedIndirect;
private BufferRange _indirectBuffer; private BufferRange _indirectBuffer;

View File

@@ -1,6 +1,6 @@
namespace Ryujinx.Graphics.GAL.Multithreading.Commands namespace Ryujinx.Graphics.GAL.Multithreading.Commands
{ {
struct DrawIndexedIndirectCountCommand : IGALCommand struct DrawIndexedIndirectCountCommand : IGALCommand, IGALCommand<DrawIndexedIndirectCountCommand>
{ {
public CommandType CommandType => CommandType.DrawIndexedIndirectCount; public CommandType CommandType => CommandType.DrawIndexedIndirectCount;
private BufferRange _indirectBuffer; private BufferRange _indirectBuffer;

View File

@@ -1,6 +1,6 @@
namespace Ryujinx.Graphics.GAL.Multithreading.Commands namespace Ryujinx.Graphics.GAL.Multithreading.Commands
{ {
struct DrawIndirectCommand : IGALCommand struct DrawIndirectCommand : IGALCommand, IGALCommand<DrawIndirectCommand>
{ {
public CommandType CommandType => CommandType.DrawIndirect; public CommandType CommandType => CommandType.DrawIndirect;
private BufferRange _indirectBuffer; private BufferRange _indirectBuffer;

View File

@@ -1,6 +1,6 @@
namespace Ryujinx.Graphics.GAL.Multithreading.Commands namespace Ryujinx.Graphics.GAL.Multithreading.Commands
{ {
struct DrawIndirectCountCommand : IGALCommand struct DrawIndirectCountCommand : IGALCommand, IGALCommand<DrawIndirectCountCommand>
{ {
public CommandType CommandType => CommandType.DrawIndirectCount; public CommandType CommandType => CommandType.DrawIndirectCount;
private BufferRange _indirectBuffer; private BufferRange _indirectBuffer;

View File

@@ -3,7 +3,7 @@ using Ryujinx.Graphics.GAL.Multithreading.Resources;
namespace Ryujinx.Graphics.GAL.Multithreading.Commands namespace Ryujinx.Graphics.GAL.Multithreading.Commands
{ {
struct DrawTextureCommand : IGALCommand struct DrawTextureCommand : IGALCommand, IGALCommand<DrawTextureCommand>
{ {
public CommandType CommandType => CommandType.DrawTexture; public CommandType CommandType => CommandType.DrawTexture;
private TableRef<ITexture> _texture; private TableRef<ITexture> _texture;

View File

@@ -1,10 +1,10 @@
namespace Ryujinx.Graphics.GAL.Multithreading.Commands namespace Ryujinx.Graphics.GAL.Multithreading.Commands
{ {
struct EndHostConditionalRenderingCommand : IGALCommand struct EndHostConditionalRenderingCommand : IGALCommand, IGALCommand<EndHostConditionalRenderingCommand>
{ {
public CommandType CommandType => CommandType.EndHostConditionalRendering; public CommandType CommandType => CommandType.EndHostConditionalRendering;
public static void Run(IRenderer renderer) public static void Run(ref EndHostConditionalRenderingCommand command, ThreadedRenderer threaded, IRenderer renderer)
{ {
renderer.Pipeline.EndHostConditionalRendering(); renderer.Pipeline.EndHostConditionalRendering();
} }

View File

@@ -1,6 +1,6 @@
namespace Ryujinx.Graphics.GAL.Multithreading.Commands namespace Ryujinx.Graphics.GAL.Multithreading.Commands
{ {
struct EndTransformFeedbackCommand : IGALCommand struct EndTransformFeedbackCommand : IGALCommand, IGALCommand<EndTransformFeedbackCommand>
{ {
public CommandType CommandType => CommandType.EndTransformFeedback; public CommandType CommandType => CommandType.EndTransformFeedback;

View File

@@ -4,4 +4,9 @@
{ {
CommandType CommandType { get; } CommandType CommandType { get; }
} }
interface IGALCommand<T> where T : IGALCommand
{
abstract static void Run(ref T command, ThreadedRenderer threaded, IRenderer renderer);
}
} }

View File

@@ -3,7 +3,7 @@ using Ryujinx.Graphics.GAL.Multithreading.Resources;
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Program namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Program
{ {
struct ProgramCheckLinkCommand : IGALCommand struct ProgramCheckLinkCommand : IGALCommand, IGALCommand<ProgramCheckLinkCommand>
{ {
public CommandType CommandType => CommandType.ProgramCheckLink; public CommandType CommandType => CommandType.ProgramCheckLink;
private TableRef<ThreadedProgram> _program; private TableRef<ThreadedProgram> _program;

View File

@@ -3,7 +3,7 @@ using Ryujinx.Graphics.GAL.Multithreading.Resources;
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Program namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Program
{ {
struct ProgramDisposeCommand : IGALCommand struct ProgramDisposeCommand : IGALCommand, IGALCommand<ProgramDisposeCommand>
{ {
public CommandType CommandType => CommandType.ProgramDispose; public CommandType CommandType => CommandType.ProgramDispose;
private TableRef<ThreadedProgram> _program; private TableRef<ThreadedProgram> _program;

View File

@@ -3,7 +3,7 @@ using Ryujinx.Graphics.GAL.Multithreading.Resources;
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Program namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Program
{ {
struct ProgramGetBinaryCommand : IGALCommand struct ProgramGetBinaryCommand : IGALCommand, IGALCommand<ProgramGetBinaryCommand>
{ {
public CommandType CommandType => CommandType.ProgramGetBinary; public CommandType CommandType => CommandType.ProgramGetBinary;
private TableRef<ThreadedProgram> _program; private TableRef<ThreadedProgram> _program;

View File

@@ -3,7 +3,7 @@ using System;
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Renderer namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Renderer
{ {
struct ActionCommand : IGALCommand struct ActionCommand : IGALCommand, IGALCommand<ActionCommand>
{ {
public CommandType CommandType => CommandType.Action; public CommandType CommandType => CommandType.Action;
private TableRef<Action> _action; private TableRef<Action> _action;

View File

@@ -1,6 +1,6 @@
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Renderer namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Renderer
{ {
struct CreateBufferCommand : IGALCommand struct CreateBufferCommand : IGALCommand, IGALCommand<CreateBufferCommand>
{ {
public CommandType CommandType => CommandType.CreateBuffer; public CommandType CommandType => CommandType.CreateBuffer;
private BufferHandle _threadedHandle; private BufferHandle _threadedHandle;

View File

@@ -3,7 +3,7 @@ using Ryujinx.Graphics.GAL.Multithreading.Resources.Programs;
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Renderer namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Renderer
{ {
struct CreateProgramCommand : IGALCommand struct CreateProgramCommand : IGALCommand, IGALCommand<CreateProgramCommand>
{ {
public CommandType CommandType => CommandType.CreateProgram; public CommandType CommandType => CommandType.CreateProgram;
private TableRef<IProgramRequest> _request; private TableRef<IProgramRequest> _request;

View File

@@ -3,7 +3,7 @@ using Ryujinx.Graphics.GAL.Multithreading.Resources;
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Renderer namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Renderer
{ {
struct CreateSamplerCommand : IGALCommand struct CreateSamplerCommand : IGALCommand, IGALCommand<CreateSamplerCommand>
{ {
public CommandType CommandType => CommandType.CreateSampler; public CommandType CommandType => CommandType.CreateSampler;
private TableRef<ThreadedSampler> _sampler; private TableRef<ThreadedSampler> _sampler;

View File

@@ -1,6 +1,6 @@
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Renderer namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Renderer
{ {
struct CreateSyncCommand : IGALCommand struct CreateSyncCommand : IGALCommand, IGALCommand<CreateSyncCommand>
{ {
public CommandType CommandType => CommandType.CreateSync; public CommandType CommandType => CommandType.CreateSync;
private ulong _id; private ulong _id;

View File

@@ -3,7 +3,7 @@ using Ryujinx.Graphics.GAL.Multithreading.Resources;
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Renderer namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Renderer
{ {
struct CreateTextureCommand : IGALCommand struct CreateTextureCommand : IGALCommand, IGALCommand<CreateTextureCommand>
{ {
public CommandType CommandType => CommandType.CreateTexture; public CommandType CommandType => CommandType.CreateTexture;
private TableRef<ThreadedTexture> _texture; private TableRef<ThreadedTexture> _texture;

View File

@@ -2,7 +2,7 @@
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Renderer namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Renderer
{ {
struct GetCapabilitiesCommand : IGALCommand struct GetCapabilitiesCommand : IGALCommand, IGALCommand<GetCapabilitiesCommand>
{ {
public CommandType CommandType => CommandType.GetCapabilities; public CommandType CommandType => CommandType.GetCapabilities;
private TableRef<ResultBox<Capabilities>> _result; private TableRef<ResultBox<Capabilities>> _result;

View File

@@ -1,6 +1,6 @@
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Renderer namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Renderer
{ {
struct PreFrameCommand : IGALCommand struct PreFrameCommand : IGALCommand, IGALCommand<PreFrameCommand>
{ {
public CommandType CommandType => CommandType.PreFrame; public CommandType CommandType => CommandType.PreFrame;

View File

@@ -4,7 +4,7 @@ using System;
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Renderer namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Renderer
{ {
struct ReportCounterCommand : IGALCommand struct ReportCounterCommand : IGALCommand, IGALCommand<ReportCounterCommand>
{ {
public CommandType CommandType => CommandType.ReportCounter; public CommandType CommandType => CommandType.ReportCounter;
private TableRef<ThreadedCounterEvent> _event; private TableRef<ThreadedCounterEvent> _event;

View File

@@ -1,6 +1,6 @@
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Renderer namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Renderer
{ {
struct ResetCounterCommand : IGALCommand struct ResetCounterCommand : IGALCommand, IGALCommand<ResetCounterCommand>
{ {
public CommandType CommandType => CommandType.ResetCounter; public CommandType CommandType => CommandType.ResetCounter;
private CounterType _type; private CounterType _type;

View File

@@ -1,6 +1,6 @@
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Renderer namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Renderer
{ {
struct UpdateCountersCommand : IGALCommand struct UpdateCountersCommand : IGALCommand, IGALCommand<UpdateCountersCommand>
{ {
public CommandType CommandType => CommandType.UpdateCounters; public CommandType CommandType => CommandType.UpdateCounters;

View File

@@ -3,7 +3,7 @@ using Ryujinx.Graphics.GAL.Multithreading.Resources;
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Sampler namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Sampler
{ {
struct SamplerDisposeCommand : IGALCommand struct SamplerDisposeCommand : IGALCommand, IGALCommand<SamplerDisposeCommand>
{ {
public CommandType CommandType => CommandType.SamplerDispose; public CommandType CommandType => CommandType.SamplerDispose;
private TableRef<ThreadedSampler> _sampler; private TableRef<ThreadedSampler> _sampler;

View File

@@ -1,6 +1,6 @@
namespace Ryujinx.Graphics.GAL.Multithreading.Commands namespace Ryujinx.Graphics.GAL.Multithreading.Commands
{ {
struct SetAlphaTestCommand : IGALCommand struct SetAlphaTestCommand : IGALCommand, IGALCommand<SetAlphaTestCommand>
{ {
public CommandType CommandType => CommandType.SetAlphaTest; public CommandType CommandType => CommandType.SetAlphaTest;
private bool _enable; private bool _enable;

View File

@@ -1,6 +1,6 @@
namespace Ryujinx.Graphics.GAL.Multithreading.Commands namespace Ryujinx.Graphics.GAL.Multithreading.Commands
{ {
struct SetBlendStateCommand : IGALCommand struct SetBlendStateCommand : IGALCommand, IGALCommand<SetBlendStateCommand>
{ {
public CommandType CommandType => CommandType.SetBlendState; public CommandType CommandType => CommandType.SetBlendState;
private int _index; private int _index;

View File

@@ -1,6 +1,6 @@
namespace Ryujinx.Graphics.GAL.Multithreading.Commands namespace Ryujinx.Graphics.GAL.Multithreading.Commands
{ {
struct SetDepthBiasCommand : IGALCommand struct SetDepthBiasCommand : IGALCommand, IGALCommand<SetDepthBiasCommand>
{ {
public CommandType CommandType => CommandType.SetDepthBias; public CommandType CommandType => CommandType.SetDepthBias;
private PolygonModeMask _enables; private PolygonModeMask _enables;

View File

@@ -1,6 +1,6 @@
namespace Ryujinx.Graphics.GAL.Multithreading.Commands namespace Ryujinx.Graphics.GAL.Multithreading.Commands
{ {
struct SetDepthClampCommand : IGALCommand struct SetDepthClampCommand : IGALCommand, IGALCommand<SetDepthClampCommand>
{ {
public CommandType CommandType => CommandType.SetDepthClamp; public CommandType CommandType => CommandType.SetDepthClamp;
private bool _clamp; private bool _clamp;

View File

@@ -1,6 +1,6 @@
namespace Ryujinx.Graphics.GAL.Multithreading.Commands namespace Ryujinx.Graphics.GAL.Multithreading.Commands
{ {
struct SetDepthModeCommand : IGALCommand struct SetDepthModeCommand : IGALCommand, IGALCommand<SetDepthModeCommand>
{ {
public CommandType CommandType => CommandType.SetDepthMode; public CommandType CommandType => CommandType.SetDepthMode;
private DepthMode _mode; private DepthMode _mode;

View File

@@ -1,6 +1,6 @@
namespace Ryujinx.Graphics.GAL.Multithreading.Commands namespace Ryujinx.Graphics.GAL.Multithreading.Commands
{ {
struct SetDepthTestCommand : IGALCommand struct SetDepthTestCommand : IGALCommand, IGALCommand<SetDepthTestCommand>
{ {
public CommandType CommandType => CommandType.SetDepthTest; public CommandType CommandType => CommandType.SetDepthTest;
private DepthTestDescriptor _depthTest; private DepthTestDescriptor _depthTest;

View File

@@ -1,6 +1,6 @@
namespace Ryujinx.Graphics.GAL.Multithreading.Commands namespace Ryujinx.Graphics.GAL.Multithreading.Commands
{ {
struct SetFaceCullingCommand : IGALCommand struct SetFaceCullingCommand : IGALCommand, IGALCommand<SetFaceCullingCommand>
{ {
public CommandType CommandType => CommandType.SetFaceCulling; public CommandType CommandType => CommandType.SetFaceCulling;
private bool _enable; private bool _enable;

View File

@@ -1,6 +1,6 @@
namespace Ryujinx.Graphics.GAL.Multithreading.Commands namespace Ryujinx.Graphics.GAL.Multithreading.Commands
{ {
struct SetFrontFaceCommand : IGALCommand struct SetFrontFaceCommand : IGALCommand, IGALCommand<SetFrontFaceCommand>
{ {
public CommandType CommandType => CommandType.SetFrontFace; public CommandType CommandType => CommandType.SetFrontFace;
private FrontFace _frontFace; private FrontFace _frontFace;

View File

@@ -3,7 +3,7 @@ using Ryujinx.Graphics.GAL.Multithreading.Resources;
namespace Ryujinx.Graphics.GAL.Multithreading.Commands namespace Ryujinx.Graphics.GAL.Multithreading.Commands
{ {
struct SetImageCommand : IGALCommand struct SetImageCommand : IGALCommand, IGALCommand<SetImageCommand>
{ {
public CommandType CommandType => CommandType.SetImage; public CommandType CommandType => CommandType.SetImage;
private int _binding; private int _binding;

View File

@@ -1,6 +1,6 @@
namespace Ryujinx.Graphics.GAL.Multithreading.Commands namespace Ryujinx.Graphics.GAL.Multithreading.Commands
{ {
struct SetIndexBufferCommand : IGALCommand struct SetIndexBufferCommand : IGALCommand, IGALCommand<SetIndexBufferCommand>
{ {
public CommandType CommandType => CommandType.SetIndexBuffer; public CommandType CommandType => CommandType.SetIndexBuffer;
private BufferRange _buffer; private BufferRange _buffer;

View File

@@ -1,6 +1,6 @@
namespace Ryujinx.Graphics.GAL.Multithreading.Commands namespace Ryujinx.Graphics.GAL.Multithreading.Commands
{ {
struct SetLineParametersCommand : IGALCommand struct SetLineParametersCommand : IGALCommand, IGALCommand<SetLineParametersCommand>
{ {
public CommandType CommandType => CommandType.SetLineParameters; public CommandType CommandType => CommandType.SetLineParameters;
private float _width; private float _width;

View File

@@ -1,6 +1,6 @@
namespace Ryujinx.Graphics.GAL.Multithreading.Commands namespace Ryujinx.Graphics.GAL.Multithreading.Commands
{ {
struct SetLogicOpStateCommand : IGALCommand struct SetLogicOpStateCommand : IGALCommand, IGALCommand<SetLogicOpStateCommand>
{ {
public CommandType CommandType => CommandType.SetLogicOpState; public CommandType CommandType => CommandType.SetLogicOpState;
private bool _enable; private bool _enable;

View File

@@ -1,6 +1,6 @@
namespace Ryujinx.Graphics.GAL.Multithreading.Commands namespace Ryujinx.Graphics.GAL.Multithreading.Commands
{ {
struct SetMultisampleStateCommand : IGALCommand struct SetMultisampleStateCommand : IGALCommand, IGALCommand<SetMultisampleStateCommand>
{ {
public CommandType CommandType => CommandType.SetMultisampleState; public CommandType CommandType => CommandType.SetMultisampleState;
private MultisampleDescriptor _multisample; private MultisampleDescriptor _multisample;

View File

@@ -3,7 +3,7 @@ using System;
namespace Ryujinx.Graphics.GAL.Multithreading.Commands namespace Ryujinx.Graphics.GAL.Multithreading.Commands
{ {
struct SetPatchParametersCommand : IGALCommand struct SetPatchParametersCommand : IGALCommand, IGALCommand<SetPatchParametersCommand>
{ {
public CommandType CommandType => CommandType.SetPatchParameters; public CommandType CommandType => CommandType.SetPatchParameters;
private int _vertices; private int _vertices;

View File

@@ -1,6 +1,6 @@
namespace Ryujinx.Graphics.GAL.Multithreading.Commands namespace Ryujinx.Graphics.GAL.Multithreading.Commands
{ {
struct SetPointParametersCommand : IGALCommand struct SetPointParametersCommand : IGALCommand, IGALCommand<SetPointParametersCommand>
{ {
public CommandType CommandType => CommandType.SetPointParameters; public CommandType CommandType => CommandType.SetPointParameters;
private float _size; private float _size;

View File

@@ -1,6 +1,6 @@
namespace Ryujinx.Graphics.GAL.Multithreading.Commands namespace Ryujinx.Graphics.GAL.Multithreading.Commands
{ {
struct SetPolygonModeCommand : IGALCommand struct SetPolygonModeCommand : IGALCommand, IGALCommand<SetPolygonModeCommand>
{ {
public CommandType CommandType => CommandType.SetPolygonMode; public CommandType CommandType => CommandType.SetPolygonMode;
private PolygonMode _frontMode; private PolygonMode _frontMode;

View File

@@ -1,6 +1,6 @@
namespace Ryujinx.Graphics.GAL.Multithreading.Commands namespace Ryujinx.Graphics.GAL.Multithreading.Commands
{ {
struct SetPrimitiveRestartCommand : IGALCommand struct SetPrimitiveRestartCommand : IGALCommand, IGALCommand<SetPrimitiveRestartCommand>
{ {
public CommandType CommandType => CommandType.SetPrimitiveRestart; public CommandType CommandType => CommandType.SetPrimitiveRestart;
private bool _enable; private bool _enable;

View File

@@ -1,6 +1,6 @@
namespace Ryujinx.Graphics.GAL.Multithreading.Commands namespace Ryujinx.Graphics.GAL.Multithreading.Commands
{ {
struct SetPrimitiveTopologyCommand : IGALCommand struct SetPrimitiveTopologyCommand : IGALCommand, IGALCommand<SetPrimitiveTopologyCommand>
{ {
public CommandType CommandType => CommandType.SetPrimitiveTopology; public CommandType CommandType => CommandType.SetPrimitiveTopology;
private PrimitiveTopology _topology; private PrimitiveTopology _topology;

View File

@@ -3,7 +3,7 @@ using Ryujinx.Graphics.GAL.Multithreading.Resources;
namespace Ryujinx.Graphics.GAL.Multithreading.Commands namespace Ryujinx.Graphics.GAL.Multithreading.Commands
{ {
struct SetProgramCommand : IGALCommand struct SetProgramCommand : IGALCommand, IGALCommand<SetProgramCommand>
{ {
public CommandType CommandType => CommandType.SetProgram; public CommandType CommandType => CommandType.SetProgram;
private TableRef<IProgram> _program; private TableRef<IProgram> _program;

View File

@@ -1,6 +1,6 @@
namespace Ryujinx.Graphics.GAL.Multithreading.Commands namespace Ryujinx.Graphics.GAL.Multithreading.Commands
{ {
struct SetRasterizerDiscardCommand : IGALCommand struct SetRasterizerDiscardCommand : IGALCommand, IGALCommand<SetRasterizerDiscardCommand>
{ {
public CommandType CommandType => CommandType.SetRasterizerDiscard; public CommandType CommandType => CommandType.SetRasterizerDiscard;
private bool _discard; private bool _discard;

View File

@@ -3,7 +3,7 @@ using System;
namespace Ryujinx.Graphics.GAL.Multithreading.Commands namespace Ryujinx.Graphics.GAL.Multithreading.Commands
{ {
struct SetRenderTargetColorMasksCommand : IGALCommand struct SetRenderTargetColorMasksCommand : IGALCommand, IGALCommand<SetRenderTargetColorMasksCommand>
{ {
public CommandType CommandType => CommandType.SetRenderTargetColorMasks; public CommandType CommandType => CommandType.SetRenderTargetColorMasks;
private SpanRef<uint> _componentMask; private SpanRef<uint> _componentMask;

View File

@@ -1,6 +1,6 @@
namespace Ryujinx.Graphics.GAL.Multithreading.Commands namespace Ryujinx.Graphics.GAL.Multithreading.Commands
{ {
struct SetRenderTargetScaleCommand : IGALCommand struct SetRenderTargetScaleCommand : IGALCommand, IGALCommand<SetRenderTargetScaleCommand>
{ {
public CommandType CommandType => CommandType.SetRenderTargetScale; public CommandType CommandType => CommandType.SetRenderTargetScale;
private float _scale; private float _scale;

View File

@@ -4,7 +4,7 @@ using System.Linq;
namespace Ryujinx.Graphics.GAL.Multithreading.Commands namespace Ryujinx.Graphics.GAL.Multithreading.Commands
{ {
struct SetRenderTargetsCommand : IGALCommand struct SetRenderTargetsCommand : IGALCommand, IGALCommand<SetRenderTargetsCommand>
{ {
public CommandType CommandType => CommandType.SetRenderTargets; public CommandType CommandType => CommandType.SetRenderTargets;
private TableRef<ITexture[]> _colors; private TableRef<ITexture[]> _colors;

View File

@@ -2,7 +2,7 @@
namespace Ryujinx.Graphics.GAL.Multithreading.Commands namespace Ryujinx.Graphics.GAL.Multithreading.Commands
{ {
struct SetScissorsCommand : IGALCommand struct SetScissorsCommand : IGALCommand, IGALCommand<SetScissorsCommand>
{ {
public CommandType CommandType => CommandType.SetScissor; public CommandType CommandType => CommandType.SetScissor;
private SpanRef<Rectangle<int>> _scissors; private SpanRef<Rectangle<int>> _scissors;

View File

@@ -1,6 +1,6 @@
namespace Ryujinx.Graphics.GAL.Multithreading.Commands namespace Ryujinx.Graphics.GAL.Multithreading.Commands
{ {
struct SetStencilTestCommand : IGALCommand struct SetStencilTestCommand : IGALCommand, IGALCommand<SetStencilTestCommand>
{ {
public CommandType CommandType => CommandType.SetStencilTest; public CommandType CommandType => CommandType.SetStencilTest;
private StencilTestDescriptor _stencilTest; private StencilTestDescriptor _stencilTest;

View File

@@ -3,7 +3,7 @@ using System;
namespace Ryujinx.Graphics.GAL.Multithreading.Commands namespace Ryujinx.Graphics.GAL.Multithreading.Commands
{ {
struct SetStorageBuffersCommand : IGALCommand struct SetStorageBuffersCommand : IGALCommand, IGALCommand<SetStorageBuffersCommand>
{ {
public CommandType CommandType => CommandType.SetStorageBuffers; public CommandType CommandType => CommandType.SetStorageBuffers;
private SpanRef<BufferAssignment> _buffers; private SpanRef<BufferAssignment> _buffers;

View File

@@ -4,7 +4,7 @@ using Ryujinx.Graphics.Shader;
namespace Ryujinx.Graphics.GAL.Multithreading.Commands namespace Ryujinx.Graphics.GAL.Multithreading.Commands
{ {
struct SetTextureAndSamplerCommand : IGALCommand struct SetTextureAndSamplerCommand : IGALCommand, IGALCommand<SetTextureAndSamplerCommand>
{ {
public CommandType CommandType => CommandType.SetTextureAndSampler; public CommandType CommandType => CommandType.SetTextureAndSampler;
private ShaderStage _stage; private ShaderStage _stage;

View File

@@ -3,7 +3,7 @@ using System;
namespace Ryujinx.Graphics.GAL.Multithreading.Commands namespace Ryujinx.Graphics.GAL.Multithreading.Commands
{ {
struct SetTransformFeedbackBuffersCommand : IGALCommand struct SetTransformFeedbackBuffersCommand : IGALCommand, IGALCommand<SetTransformFeedbackBuffersCommand>
{ {
public CommandType CommandType => CommandType.SetTransformFeedbackBuffers; public CommandType CommandType => CommandType.SetTransformFeedbackBuffers;
private SpanRef<BufferRange> _buffers; private SpanRef<BufferRange> _buffers;

View File

@@ -3,7 +3,7 @@ using System;
namespace Ryujinx.Graphics.GAL.Multithreading.Commands namespace Ryujinx.Graphics.GAL.Multithreading.Commands
{ {
struct SetUniformBuffersCommand : IGALCommand struct SetUniformBuffersCommand : IGALCommand, IGALCommand<SetUniformBuffersCommand>
{ {
public CommandType CommandType => CommandType.SetUniformBuffers; public CommandType CommandType => CommandType.SetUniformBuffers;
private SpanRef<BufferAssignment> _buffers; private SpanRef<BufferAssignment> _buffers;

View File

@@ -1,6 +1,6 @@
namespace Ryujinx.Graphics.GAL.Multithreading.Commands namespace Ryujinx.Graphics.GAL.Multithreading.Commands
{ {
struct SetUserClipDistanceCommand : IGALCommand struct SetUserClipDistanceCommand : IGALCommand, IGALCommand<SetUserClipDistanceCommand>
{ {
public CommandType CommandType => CommandType.SetUserClipDistance; public CommandType CommandType => CommandType.SetUserClipDistance;
private int _index; private int _index;

View File

@@ -3,7 +3,7 @@ using System;
namespace Ryujinx.Graphics.GAL.Multithreading.Commands namespace Ryujinx.Graphics.GAL.Multithreading.Commands
{ {
struct SetVertexAttribsCommand : IGALCommand struct SetVertexAttribsCommand : IGALCommand, IGALCommand<SetVertexAttribsCommand>
{ {
public CommandType CommandType => CommandType.SetVertexAttribs; public CommandType CommandType => CommandType.SetVertexAttribs;
private SpanRef<VertexAttribDescriptor> _vertexAttribs; private SpanRef<VertexAttribDescriptor> _vertexAttribs;

View File

@@ -3,7 +3,7 @@ using System;
namespace Ryujinx.Graphics.GAL.Multithreading.Commands namespace Ryujinx.Graphics.GAL.Multithreading.Commands
{ {
struct SetVertexBuffersCommand : IGALCommand struct SetVertexBuffersCommand : IGALCommand, IGALCommand<SetVertexBuffersCommand>
{ {
public CommandType CommandType => CommandType.SetVertexBuffers; public CommandType CommandType => CommandType.SetVertexBuffers;
private SpanRef<VertexBufferDescriptor> _vertexBuffers; private SpanRef<VertexBufferDescriptor> _vertexBuffers;

View File

@@ -3,7 +3,7 @@ using System;
namespace Ryujinx.Graphics.GAL.Multithreading.Commands namespace Ryujinx.Graphics.GAL.Multithreading.Commands
{ {
struct SetViewportsCommand : IGALCommand struct SetViewportsCommand : IGALCommand, IGALCommand<SetViewportsCommand>
{ {
public CommandType CommandType => CommandType.SetViewports; public CommandType CommandType => CommandType.SetViewports;
private SpanRef<Viewport> _viewports; private SpanRef<Viewport> _viewports;

View File

@@ -3,7 +3,7 @@ using Ryujinx.Graphics.GAL.Multithreading.Resources;
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Texture namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Texture
{ {
struct TextureCopyToCommand : IGALCommand struct TextureCopyToCommand : IGALCommand, IGALCommand<TextureCopyToCommand>
{ {
public CommandType CommandType => CommandType.TextureCopyTo; public CommandType CommandType => CommandType.TextureCopyTo;
private TableRef<ThreadedTexture> _texture; private TableRef<ThreadedTexture> _texture;

View File

@@ -3,7 +3,7 @@ using Ryujinx.Graphics.GAL.Multithreading.Resources;
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Texture namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Texture
{ {
struct TextureCopyToScaledCommand : IGALCommand struct TextureCopyToScaledCommand : IGALCommand, IGALCommand<TextureCopyToScaledCommand>
{ {
public CommandType CommandType => CommandType.TextureCopyToScaled; public CommandType CommandType => CommandType.TextureCopyToScaled;
private TableRef<ThreadedTexture> _texture; private TableRef<ThreadedTexture> _texture;

View File

@@ -3,7 +3,7 @@ using Ryujinx.Graphics.GAL.Multithreading.Resources;
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Texture namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Texture
{ {
struct TextureCopyToSliceCommand : IGALCommand struct TextureCopyToSliceCommand : IGALCommand, IGALCommand<TextureCopyToSliceCommand>
{ {
public CommandType CommandType => CommandType.TextureCopyToSlice; public CommandType CommandType => CommandType.TextureCopyToSlice;
private TableRef<ThreadedTexture> _texture; private TableRef<ThreadedTexture> _texture;

View File

@@ -3,7 +3,7 @@ using Ryujinx.Graphics.GAL.Multithreading.Resources;
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Texture namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Texture
{ {
struct TextureCreateViewCommand : IGALCommand struct TextureCreateViewCommand : IGALCommand, IGALCommand<TextureCreateViewCommand>
{ {
public CommandType CommandType => CommandType.TextureCreateView; public CommandType CommandType => CommandType.TextureCreateView;
private TableRef<ThreadedTexture> _texture; private TableRef<ThreadedTexture> _texture;

View File

@@ -4,7 +4,7 @@ using System;
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Texture namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Texture
{ {
struct TextureGetDataCommand : IGALCommand struct TextureGetDataCommand : IGALCommand, IGALCommand<TextureGetDataCommand>
{ {
public CommandType CommandType => CommandType.TextureGetData; public CommandType CommandType => CommandType.TextureGetData;
private TableRef<ThreadedTexture> _texture; private TableRef<ThreadedTexture> _texture;

View File

@@ -4,7 +4,7 @@ using System;
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Texture namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Texture
{ {
struct TextureGetDataSliceCommand : IGALCommand struct TextureGetDataSliceCommand : IGALCommand, IGALCommand<TextureGetDataSliceCommand>
{ {
public CommandType CommandType => CommandType.TextureGetDataSlice; public CommandType CommandType => CommandType.TextureGetDataSlice;
private TableRef<ThreadedTexture> _texture; private TableRef<ThreadedTexture> _texture;

View File

@@ -3,7 +3,7 @@ using Ryujinx.Graphics.GAL.Multithreading.Resources;
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Texture namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Texture
{ {
struct TextureReleaseCommand : IGALCommand struct TextureReleaseCommand : IGALCommand, IGALCommand<TextureReleaseCommand>
{ {
public CommandType CommandType => CommandType.TextureRelease; public CommandType CommandType => CommandType.TextureRelease;
private TableRef<ThreadedTexture> _texture; private TableRef<ThreadedTexture> _texture;

View File

@@ -4,7 +4,7 @@ using System;
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Texture namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Texture
{ {
struct TextureSetDataCommand : IGALCommand struct TextureSetDataCommand : IGALCommand, IGALCommand<TextureSetDataCommand>
{ {
public CommandType CommandType => CommandType.TextureSetData; public CommandType CommandType => CommandType.TextureSetData;
private TableRef<ThreadedTexture> _texture; private TableRef<ThreadedTexture> _texture;

View File

@@ -4,7 +4,7 @@ using System;
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Texture namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Texture
{ {
struct TextureSetDataSliceCommand : IGALCommand struct TextureSetDataSliceCommand : IGALCommand, IGALCommand<TextureSetDataSliceCommand>
{ {
public CommandType CommandType => CommandType.TextureSetDataSlice; public CommandType CommandType => CommandType.TextureSetDataSlice;
private TableRef<ThreadedTexture> _texture; private TableRef<ThreadedTexture> _texture;

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