Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
e3d0ccf8d5 | ||
|
c14844d12c | ||
|
7fea26e97e | ||
|
7b7f62c776 | ||
|
423dbc8888 |
@@ -20,7 +20,7 @@
|
||||
<PackageVersion Include="GtkSharp.Dependencies.osx" Version="0.0.5" />
|
||||
<PackageVersion Include="jp2masa.Avalonia.Flexbox" Version="0.2.0" />
|
||||
<PackageVersion Include="LibHac" Version="0.17.0" />
|
||||
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.3" />
|
||||
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4" />
|
||||
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.4.0" />
|
||||
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
|
||||
<PackageVersion Include="MsgPack.Cli" Version="1.0.1" />
|
||||
|
@@ -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)
|
||||
{
|
||||
@@ -240,7 +240,7 @@ namespace Ryujinx.Ava
|
||||
lock (_lockObject)
|
||||
{
|
||||
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
|
||||
{
|
||||
|
@@ -140,68 +140,75 @@ namespace Ryujinx.Ava.UI.Renderer
|
||||
{
|
||||
if (VisualRoot != null)
|
||||
{
|
||||
Point rootVisualPosition = this.TranslatePoint(new Point((long)lParam & 0xFFFF, (long)lParam >> 16 & 0xFFFF), VisualRoot).Value;
|
||||
Pointer pointer = new(0, PointerType.Mouse, true);
|
||||
|
||||
switch (msg)
|
||||
if (msg == WindowsMessages.LBUTTONDOWN ||
|
||||
msg == WindowsMessages.RBUTTONDOWN ||
|
||||
msg == WindowsMessages.LBUTTONUP ||
|
||||
msg == WindowsMessages.RBUTTONUP ||
|
||||
msg == WindowsMessages.MOUSEMOVE)
|
||||
{
|
||||
case WindowsMessages.LBUTTONDOWN:
|
||||
case WindowsMessages.RBUTTONDOWN:
|
||||
{
|
||||
bool isLeft = msg == WindowsMessages.LBUTTONDOWN;
|
||||
RawInputModifiers pointerPointModifier = isLeft ? RawInputModifiers.LeftMouseButton : RawInputModifiers.RightMouseButton;
|
||||
PointerPointProperties properties = new(pointerPointModifier, isLeft ? PointerUpdateKind.LeftButtonPressed : PointerUpdateKind.RightButtonPressed);
|
||||
Point rootVisualPosition = this.TranslatePoint(new Point((long)lParam & 0xFFFF, (long)lParam >> 16 & 0xFFFF), VisualRoot).Value;
|
||||
Pointer pointer = new(0, PointerType.Mouse, true);
|
||||
|
||||
var evnt = new PointerPressedEventArgs(
|
||||
this,
|
||||
pointer,
|
||||
VisualRoot,
|
||||
rootVisualPosition,
|
||||
(ulong)Environment.TickCount64,
|
||||
properties,
|
||||
KeyModifiers.None);
|
||||
switch (msg)
|
||||
{
|
||||
case WindowsMessages.LBUTTONDOWN:
|
||||
case WindowsMessages.RBUTTONDOWN:
|
||||
{
|
||||
bool isLeft = msg == WindowsMessages.LBUTTONDOWN;
|
||||
RawInputModifiers pointerPointModifier = isLeft ? RawInputModifiers.LeftMouseButton : RawInputModifiers.RightMouseButton;
|
||||
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;
|
||||
}
|
||||
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);
|
||||
RaiseEvent(evnt);
|
||||
|
||||
var evnt = new PointerReleasedEventArgs(
|
||||
this,
|
||||
pointer,
|
||||
VisualRoot,
|
||||
rootVisualPosition,
|
||||
(ulong)Environment.TickCount64,
|
||||
properties,
|
||||
KeyModifiers.None,
|
||||
isLeft ? MouseButton.Left : MouseButton.Right);
|
||||
break;
|
||||
}
|
||||
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);
|
||||
|
||||
RaiseEvent(evnt);
|
||||
var evnt = new PointerReleasedEventArgs(
|
||||
this,
|
||||
pointer,
|
||||
VisualRoot,
|
||||
rootVisualPosition,
|
||||
(ulong)Environment.TickCount64,
|
||||
properties,
|
||||
KeyModifiers.None,
|
||||
isLeft ? MouseButton.Left : MouseButton.Right);
|
||||
|
||||
break;
|
||||
}
|
||||
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);
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -21,8 +21,9 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using SpanHelpers = LibHac.Common.SpanHelpers;
|
||||
using System.Text;
|
||||
using Path = System.IO.Path;
|
||||
using SpanHelpers = LibHac.Common.SpanHelpers;
|
||||
|
||||
namespace Ryujinx.Ava.UI.ViewModels;
|
||||
|
||||
@@ -90,6 +91,8 @@ public class TitleUpdateViewModel : BaseModel
|
||||
Selected = "",
|
||||
Paths = new List<string>()
|
||||
};
|
||||
|
||||
Save();
|
||||
}
|
||||
|
||||
LoadUpdates();
|
||||
@@ -102,6 +105,9 @@ public class TitleUpdateViewModel : BaseModel
|
||||
AddUpdate(path);
|
||||
}
|
||||
|
||||
// NOTE: Save the list again to remove leftovers.
|
||||
Save();
|
||||
|
||||
TitleUpdateModel selected = TitleUpdates.FirstOrDefault(x => x.Path == _titleUpdateWindowData.Selected, null);
|
||||
|
||||
SelectedUpdate = selected;
|
||||
@@ -223,4 +229,22 @@ public class TitleUpdateViewModel : BaseModel
|
||||
|
||||
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)));
|
||||
}
|
||||
}
|
@@ -60,24 +60,7 @@ namespace Ryujinx.Ava.UI.Windows
|
||||
|
||||
public void Save(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ViewModel._titleUpdateWindowData.Paths.Clear();
|
||||
|
||||
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)));
|
||||
}
|
||||
ViewModel.Save();
|
||||
|
||||
if (VisualRoot is MainWindow window)
|
||||
{
|
||||
|
@@ -7,9 +7,7 @@ using Ryujinx.Graphics.GAL.Multithreading.Commands.Sampler;
|
||||
using Ryujinx.Graphics.GAL.Multithreading.Commands.Texture;
|
||||
using Ryujinx.Graphics.GAL.Multithreading.Commands.Window;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
@@ -30,207 +28,115 @@ namespace Ryujinx.Graphics.GAL.Multithreading
|
||||
|
||||
public static int GetMaxCommandSize()
|
||||
{
|
||||
Assembly assembly = typeof(CommandHelper).Assembly;
|
||||
|
||||
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.
|
||||
return InitLookup() + 1; // 1 byte reserved for command size.
|
||||
}
|
||||
|
||||
private static void InitLookup()
|
||||
private static int InitLookup()
|
||||
{
|
||||
_lookup[(int)CommandType.Action] = (memory, threaded, renderer) =>
|
||||
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);
|
||||
int maxCommandSize = 0;
|
||||
|
||||
_lookup[(int)CommandType.BufferDispose] = (memory, threaded, renderer) =>
|
||||
BufferDisposeCommand.Run(ref GetCommand<BufferDisposeCommand>(memory), threaded, renderer);
|
||||
_lookup[(int)CommandType.BufferGetData] = (memory, threaded, renderer) =>
|
||||
BufferGetDataCommand.Run(ref GetCommand<BufferGetDataCommand>(memory), threaded, renderer);
|
||||
_lookup[(int)CommandType.BufferSetData] = (memory, threaded, renderer) =>
|
||||
BufferSetDataCommand.Run(ref GetCommand<BufferSetDataCommand>(memory), threaded, renderer);
|
||||
void Register<T>(CommandType commandType) where T : unmanaged, IGALCommand, IGALCommand<T>
|
||||
{
|
||||
maxCommandSize = Math.Max(maxCommandSize, Unsafe.SizeOf<T>());
|
||||
_lookup[(int)commandType] = (memory, threaded, renderer) => T.Run(ref GetCommand<T>(memory), threaded, renderer);
|
||||
}
|
||||
|
||||
_lookup[(int)CommandType.CounterEventDispose] = (memory, threaded, renderer) =>
|
||||
CounterEventDisposeCommand.Run(ref GetCommand<CounterEventDisposeCommand>(memory), threaded, renderer);
|
||||
_lookup[(int)CommandType.CounterEventFlush] = (memory, threaded, renderer) =>
|
||||
CounterEventFlushCommand.Run(ref GetCommand<CounterEventFlushCommand>(memory), threaded, renderer);
|
||||
Register<ActionCommand>(CommandType.Action);
|
||||
Register<CreateBufferCommand>(CommandType.CreateBuffer);
|
||||
Register<CreateProgramCommand>(CommandType.CreateProgram);
|
||||
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) =>
|
||||
ProgramDisposeCommand.Run(ref GetCommand<ProgramDisposeCommand>(memory), threaded, renderer);
|
||||
_lookup[(int)CommandType.ProgramGetBinary] = (memory, threaded, renderer) =>
|
||||
ProgramGetBinaryCommand.Run(ref GetCommand<ProgramGetBinaryCommand>(memory), threaded, renderer);
|
||||
_lookup[(int)CommandType.ProgramCheckLink] = (memory, threaded, renderer) =>
|
||||
ProgramCheckLinkCommand.Run(ref GetCommand<ProgramCheckLinkCommand>(memory), threaded, renderer);
|
||||
Register<BufferDisposeCommand>(CommandType.BufferDispose);
|
||||
Register<BufferGetDataCommand>(CommandType.BufferGetData);
|
||||
Register<BufferSetDataCommand>(CommandType.BufferSetData);
|
||||
|
||||
_lookup[(int)CommandType.SamplerDispose] = (memory, threaded, renderer) =>
|
||||
SamplerDisposeCommand.Run(ref GetCommand<SamplerDisposeCommand>(memory), threaded, renderer);
|
||||
Register<CounterEventDisposeCommand>(CommandType.CounterEventDispose);
|
||||
Register<CounterEventFlushCommand>(CommandType.CounterEventFlush);
|
||||
|
||||
_lookup[(int)CommandType.TextureCopyTo] = (memory, threaded, renderer) =>
|
||||
TextureCopyToCommand.Run(ref GetCommand<TextureCopyToCommand>(memory), threaded, renderer);
|
||||
_lookup[(int)CommandType.TextureCopyToScaled] = (memory, threaded, renderer) =>
|
||||
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);
|
||||
Register<ProgramDisposeCommand>(CommandType.ProgramDispose);
|
||||
Register<ProgramGetBinaryCommand>(CommandType.ProgramGetBinary);
|
||||
Register<ProgramCheckLinkCommand>(CommandType.ProgramCheckLink);
|
||||
|
||||
_lookup[(int)CommandType.WindowPresent] = (memory, threaded, renderer) =>
|
||||
WindowPresentCommand.Run(ref GetCommand<WindowPresentCommand>(memory), threaded, renderer);
|
||||
Register<SamplerDisposeCommand>(CommandType.SamplerDispose);
|
||||
|
||||
_lookup[(int)CommandType.Barrier] = (memory, threaded, renderer) =>
|
||||
BarrierCommand.Run(ref GetCommand<BarrierCommand>(memory), threaded, renderer);
|
||||
_lookup[(int)CommandType.BeginTransformFeedback] = (memory, threaded, renderer) =>
|
||||
BeginTransformFeedbackCommand.Run(ref GetCommand<BeginTransformFeedbackCommand>(memory), threaded, renderer);
|
||||
_lookup[(int)CommandType.ClearBuffer] = (memory, threaded, renderer) =>
|
||||
ClearBufferCommand.Run(ref GetCommand<ClearBufferCommand>(memory), threaded, renderer);
|
||||
_lookup[(int)CommandType.ClearRenderTargetColor] = (memory, threaded, renderer) =>
|
||||
ClearRenderTargetColorCommand.Run(ref GetCommand<ClearRenderTargetColorCommand>(memory), threaded, renderer);
|
||||
_lookup[(int)CommandType.ClearRenderTargetDepthStencil] = (memory, threaded, renderer) =>
|
||||
ClearRenderTargetDepthStencilCommand.Run(ref GetCommand<ClearRenderTargetDepthStencilCommand>(memory), threaded, renderer);
|
||||
_lookup[(int)CommandType.CommandBufferBarrier] = (memory, threaded, renderer) =>
|
||||
CommandBufferBarrierCommand.Run(ref GetCommand<CommandBufferBarrierCommand>(memory), threaded, renderer);
|
||||
_lookup[(int)CommandType.CopyBuffer] = (memory, threaded, renderer) =>
|
||||
CopyBufferCommand.Run(ref GetCommand<CopyBufferCommand>(memory), threaded, renderer);
|
||||
_lookup[(int)CommandType.DispatchCompute] = (memory, threaded, renderer) =>
|
||||
DispatchComputeCommand.Run(ref GetCommand<DispatchComputeCommand>(memory), threaded, renderer);
|
||||
_lookup[(int)CommandType.Draw] = (memory, threaded, renderer) =>
|
||||
DrawCommand.Run(ref GetCommand<DrawCommand>(memory), threaded, renderer);
|
||||
_lookup[(int)CommandType.DrawIndexed] = (memory, threaded, renderer) =>
|
||||
DrawIndexedCommand.Run(ref GetCommand<DrawIndexedCommand>(memory), threaded, renderer);
|
||||
_lookup[(int)CommandType.DrawIndexedIndirect] = (memory, threaded, renderer) =>
|
||||
DrawIndexedIndirectCommand.Run(ref GetCommand<DrawIndexedIndirectCommand>(memory), threaded, renderer);
|
||||
_lookup[(int)CommandType.DrawIndexedIndirectCount] = (memory, threaded, renderer) =>
|
||||
DrawIndexedIndirectCountCommand.Run(ref GetCommand<DrawIndexedIndirectCountCommand>(memory), threaded, renderer);
|
||||
_lookup[(int)CommandType.DrawIndirect] = (memory, threaded, renderer) =>
|
||||
DrawIndirectCommand.Run(ref GetCommand<DrawIndirectCommand>(memory), threaded, renderer);
|
||||
_lookup[(int)CommandType.DrawIndirectCount] = (memory, threaded, renderer) =>
|
||||
DrawIndirectCountCommand.Run(ref GetCommand<DrawIndirectCountCommand>(memory), threaded, renderer);
|
||||
_lookup[(int)CommandType.DrawTexture] = (memory, threaded, renderer) =>
|
||||
DrawTextureCommand.Run(ref GetCommand<DrawTextureCommand>(memory), threaded, renderer);
|
||||
_lookup[(int)CommandType.EndHostConditionalRendering] = (memory, threaded, renderer) =>
|
||||
EndHostConditionalRenderingCommand.Run(renderer);
|
||||
_lookup[(int)CommandType.EndTransformFeedback] = (memory, threaded, renderer) =>
|
||||
EndTransformFeedbackCommand.Run(ref GetCommand<EndTransformFeedbackCommand>(memory), threaded, renderer);
|
||||
_lookup[(int)CommandType.SetAlphaTest] = (memory, threaded, renderer) =>
|
||||
SetAlphaTestCommand.Run(ref GetCommand<SetAlphaTestCommand>(memory), threaded, renderer);
|
||||
_lookup[(int)CommandType.SetBlendState] = (memory, threaded, renderer) =>
|
||||
SetBlendStateCommand.Run(ref GetCommand<SetBlendStateCommand>(memory), threaded, renderer);
|
||||
_lookup[(int)CommandType.SetDepthBias] = (memory, threaded, renderer) =>
|
||||
SetDepthBiasCommand.Run(ref GetCommand<SetDepthBiasCommand>(memory), threaded, renderer);
|
||||
_lookup[(int)CommandType.SetDepthClamp] = (memory, threaded, renderer) =>
|
||||
SetDepthClampCommand.Run(ref GetCommand<SetDepthClampCommand>(memory), threaded, renderer);
|
||||
_lookup[(int)CommandType.SetDepthMode] = (memory, threaded, renderer) =>
|
||||
SetDepthModeCommand.Run(ref GetCommand<SetDepthModeCommand>(memory), threaded, renderer);
|
||||
_lookup[(int)CommandType.SetDepthTest] = (memory, threaded, renderer) =>
|
||||
SetDepthTestCommand.Run(ref GetCommand<SetDepthTestCommand>(memory), threaded, renderer);
|
||||
_lookup[(int)CommandType.SetFaceCulling] = (memory, threaded, renderer) =>
|
||||
SetFaceCullingCommand.Run(ref GetCommand<SetFaceCullingCommand>(memory), threaded, renderer);
|
||||
_lookup[(int)CommandType.SetFrontFace] = (memory, threaded, renderer) =>
|
||||
SetFrontFaceCommand.Run(ref GetCommand<SetFrontFaceCommand>(memory), threaded, renderer);
|
||||
_lookup[(int)CommandType.SetStorageBuffers] = (memory, threaded, renderer) =>
|
||||
SetStorageBuffersCommand.Run(ref GetCommand<SetStorageBuffersCommand>(memory), threaded, renderer);
|
||||
_lookup[(int)CommandType.SetTransformFeedbackBuffers] = (memory, threaded, renderer) =>
|
||||
SetTransformFeedbackBuffersCommand.Run(ref GetCommand<SetTransformFeedbackBuffersCommand>(memory), threaded, renderer);
|
||||
_lookup[(int)CommandType.SetUniformBuffers] = (memory, threaded, renderer) =>
|
||||
SetUniformBuffersCommand.Run(ref GetCommand<SetUniformBuffersCommand>(memory), threaded, renderer);
|
||||
_lookup[(int)CommandType.SetImage] = (memory, threaded, renderer) =>
|
||||
SetImageCommand.Run(ref GetCommand<SetImageCommand>(memory), threaded, renderer);
|
||||
_lookup[(int)CommandType.SetIndexBuffer] = (memory, threaded, renderer) =>
|
||||
SetIndexBufferCommand.Run(ref GetCommand<SetIndexBufferCommand>(memory), threaded, renderer);
|
||||
_lookup[(int)CommandType.SetLineParameters] = (memory, threaded, renderer) =>
|
||||
SetLineParametersCommand.Run(ref GetCommand<SetLineParametersCommand>(memory), threaded, renderer);
|
||||
_lookup[(int)CommandType.SetLogicOpState] = (memory, threaded, renderer) =>
|
||||
SetLogicOpStateCommand.Run(ref GetCommand<SetLogicOpStateCommand>(memory), threaded, renderer);
|
||||
_lookup[(int)CommandType.SetMultisampleState] = (memory, threaded, renderer) =>
|
||||
SetMultisampleStateCommand.Run(ref GetCommand<SetMultisampleStateCommand>(memory), threaded, renderer);
|
||||
_lookup[(int)CommandType.SetPatchParameters] = (memory, threaded, renderer) =>
|
||||
SetPatchParametersCommand.Run(ref GetCommand<SetPatchParametersCommand>(memory), threaded, renderer);
|
||||
_lookup[(int)CommandType.SetPointParameters] = (memory, threaded, renderer) =>
|
||||
SetPointParametersCommand.Run(ref GetCommand<SetPointParametersCommand>(memory), threaded, renderer);
|
||||
_lookup[(int)CommandType.SetPolygonMode] = (memory, threaded, renderer) =>
|
||||
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);
|
||||
Register<TextureCopyToCommand>(CommandType.TextureCopyTo);
|
||||
Register<TextureCopyToScaledCommand>(CommandType.TextureCopyToScaled);
|
||||
Register<TextureCopyToSliceCommand>(CommandType.TextureCopyToSlice);
|
||||
Register<TextureCreateViewCommand>(CommandType.TextureCreateView);
|
||||
Register<TextureGetDataCommand>(CommandType.TextureGetData);
|
||||
Register<TextureGetDataSliceCommand>(CommandType.TextureGetDataSlice);
|
||||
Register<TextureReleaseCommand>(CommandType.TextureRelease);
|
||||
Register<TextureSetDataCommand>(CommandType.TextureSetData);
|
||||
Register<TextureSetDataSliceCommand>(CommandType.TextureSetDataSlice);
|
||||
Register<TextureSetDataSliceRegionCommand>(CommandType.TextureSetDataSliceRegion);
|
||||
Register<TextureSetStorageCommand>(CommandType.TextureSetStorage);
|
||||
|
||||
Register<WindowPresentCommand>(CommandType.WindowPresent);
|
||||
|
||||
Register<BarrierCommand>(CommandType.Barrier);
|
||||
Register<BeginTransformFeedbackCommand>(CommandType.BeginTransformFeedback);
|
||||
Register<ClearBufferCommand>(CommandType.ClearBuffer);
|
||||
Register<ClearRenderTargetColorCommand>(CommandType.ClearRenderTargetColor);
|
||||
Register<ClearRenderTargetDepthStencilCommand>(CommandType.ClearRenderTargetDepthStencil);
|
||||
Register<CommandBufferBarrierCommand>(CommandType.CommandBufferBarrier);
|
||||
Register<CopyBufferCommand>(CommandType.CopyBuffer);
|
||||
Register<DispatchComputeCommand>(CommandType.DispatchCompute);
|
||||
Register<DrawCommand>(CommandType.Draw);
|
||||
Register<DrawIndexedCommand>(CommandType.DrawIndexed);
|
||||
Register<DrawIndexedIndirectCommand>(CommandType.DrawIndexedIndirect);
|
||||
Register<DrawIndexedIndirectCountCommand>(CommandType.DrawIndexedIndirectCount);
|
||||
Register<DrawIndirectCommand>(CommandType.DrawIndirect);
|
||||
Register<DrawIndirectCountCommand>(CommandType.DrawIndirectCount);
|
||||
Register<DrawTextureCommand>(CommandType.DrawTexture);
|
||||
Register<EndHostConditionalRenderingCommand>(CommandType.EndHostConditionalRendering);
|
||||
Register<EndTransformFeedbackCommand>(CommandType.EndTransformFeedback);
|
||||
Register<SetAlphaTestCommand>(CommandType.SetAlphaTest);
|
||||
Register<SetBlendStateCommand>(CommandType.SetBlendState);
|
||||
Register<SetDepthBiasCommand>(CommandType.SetDepthBias);
|
||||
Register<SetDepthClampCommand>(CommandType.SetDepthClamp);
|
||||
Register<SetDepthModeCommand>(CommandType.SetDepthMode);
|
||||
Register<SetDepthTestCommand>(CommandType.SetDepthTest);
|
||||
Register<SetFaceCullingCommand>(CommandType.SetFaceCulling);
|
||||
Register<SetFrontFaceCommand>(CommandType.SetFrontFace);
|
||||
Register<SetStorageBuffersCommand>(CommandType.SetStorageBuffers);
|
||||
Register<SetTransformFeedbackBuffersCommand>(CommandType.SetTransformFeedbackBuffers);
|
||||
Register<SetUniformBuffersCommand>(CommandType.SetUniformBuffers);
|
||||
Register<SetImageCommand>(CommandType.SetImage);
|
||||
Register<SetIndexBufferCommand>(CommandType.SetIndexBuffer);
|
||||
Register<SetLineParametersCommand>(CommandType.SetLineParameters);
|
||||
Register<SetLogicOpStateCommand>(CommandType.SetLogicOpState);
|
||||
Register<SetMultisampleStateCommand>(CommandType.SetMultisampleState);
|
||||
Register<SetPatchParametersCommand>(CommandType.SetPatchParameters);
|
||||
Register<SetPointParametersCommand>(CommandType.SetPointParameters);
|
||||
Register<SetPolygonModeCommand>(CommandType.SetPolygonMode);
|
||||
Register<SetPrimitiveRestartCommand>(CommandType.SetPrimitiveRestart);
|
||||
Register<SetPrimitiveTopologyCommand>(CommandType.SetPrimitiveTopology);
|
||||
Register<SetProgramCommand>(CommandType.SetProgram);
|
||||
Register<SetRasterizerDiscardCommand>(CommandType.SetRasterizerDiscard);
|
||||
Register<SetRenderTargetColorMasksCommand>(CommandType.SetRenderTargetColorMasks);
|
||||
Register<SetRenderTargetScaleCommand>(CommandType.SetRenderTargetScale);
|
||||
Register<SetRenderTargetsCommand>(CommandType.SetRenderTargets);
|
||||
Register<SetScissorsCommand>(CommandType.SetScissor);
|
||||
Register<SetStencilTestCommand>(CommandType.SetStencilTest);
|
||||
Register<SetTextureAndSamplerCommand>(CommandType.SetTextureAndSampler);
|
||||
Register<SetUserClipDistanceCommand>(CommandType.SetUserClipDistance);
|
||||
Register<SetVertexAttribsCommand>(CommandType.SetVertexAttribs);
|
||||
Register<SetVertexBuffersCommand>(CommandType.SetVertexBuffers);
|
||||
Register<SetViewportsCommand>(CommandType.SetViewports);
|
||||
Register<TextureBarrierCommand>(CommandType.TextureBarrier);
|
||||
Register<TextureBarrierTiledCommand>(CommandType.TextureBarrierTiled);
|
||||
Register<TryHostConditionalRenderingCommand>(CommandType.TryHostConditionalRendering);
|
||||
Register<TryHostConditionalRenderingFlushCommand>(CommandType.TryHostConditionalRenderingFlush);
|
||||
Register<UpdateRenderScaleCommand>(CommandType.UpdateRenderScale);
|
||||
|
||||
return maxCommandSize;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
|
@@ -1,6 +1,6 @@
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands
|
||||
{
|
||||
struct BarrierCommand : IGALCommand
|
||||
struct BarrierCommand : IGALCommand, IGALCommand<BarrierCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.Barrier;
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands
|
||||
{
|
||||
struct BeginTransformFeedbackCommand : IGALCommand
|
||||
struct BeginTransformFeedbackCommand : IGALCommand, IGALCommand<BeginTransformFeedbackCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.BeginTransformFeedback;
|
||||
private PrimitiveTopology _topology;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Buffer
|
||||
{
|
||||
struct BufferDisposeCommand : IGALCommand
|
||||
struct BufferDisposeCommand : IGALCommand, IGALCommand<BufferDisposeCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.BufferDispose;
|
||||
private BufferHandle _buffer;
|
||||
|
@@ -3,7 +3,7 @@ using System;
|
||||
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Buffer
|
||||
{
|
||||
struct BufferGetDataCommand : IGALCommand
|
||||
struct BufferGetDataCommand : IGALCommand, IGALCommand<BufferGetDataCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.BufferGetData;
|
||||
private BufferHandle _buffer;
|
||||
|
@@ -3,7 +3,7 @@ using System;
|
||||
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Buffer
|
||||
{
|
||||
struct BufferSetDataCommand : IGALCommand
|
||||
struct BufferSetDataCommand : IGALCommand, IGALCommand<BufferSetDataCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.BufferSetData;
|
||||
private BufferHandle _buffer;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands
|
||||
{
|
||||
struct ClearBufferCommand : IGALCommand
|
||||
struct ClearBufferCommand : IGALCommand, IGALCommand<ClearBufferCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.ClearBuffer;
|
||||
private BufferHandle _destination;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands
|
||||
{
|
||||
struct ClearRenderTargetColorCommand : IGALCommand
|
||||
struct ClearRenderTargetColorCommand : IGALCommand, IGALCommand<ClearRenderTargetColorCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.ClearRenderTargetColor;
|
||||
private int _index;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands
|
||||
{
|
||||
struct ClearRenderTargetDepthStencilCommand : IGALCommand
|
||||
struct ClearRenderTargetDepthStencilCommand : IGALCommand, IGALCommand<ClearRenderTargetDepthStencilCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.ClearRenderTargetDepthStencil;
|
||||
private int _layer;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands
|
||||
{
|
||||
struct CommandBufferBarrierCommand : IGALCommand
|
||||
struct CommandBufferBarrierCommand : IGALCommand, IGALCommand<CommandBufferBarrierCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.CommandBufferBarrier;
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands
|
||||
{
|
||||
struct CopyBufferCommand : IGALCommand
|
||||
struct CopyBufferCommand : IGALCommand, IGALCommand<CopyBufferCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.CopyBuffer;
|
||||
private BufferHandle _source;
|
||||
|
@@ -3,7 +3,7 @@ using Ryujinx.Graphics.GAL.Multithreading.Resources;
|
||||
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.CounterEvent
|
||||
{
|
||||
struct CounterEventDisposeCommand : IGALCommand
|
||||
struct CounterEventDisposeCommand : IGALCommand, IGALCommand<CounterEventDisposeCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.CounterEventDispose;
|
||||
private TableRef<ThreadedCounterEvent> _event;
|
||||
|
@@ -3,7 +3,7 @@ using Ryujinx.Graphics.GAL.Multithreading.Resources;
|
||||
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.CounterEvent
|
||||
{
|
||||
struct CounterEventFlushCommand : IGALCommand
|
||||
struct CounterEventFlushCommand : IGALCommand, IGALCommand<CounterEventFlushCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.CounterEventFlush;
|
||||
private TableRef<ThreadedCounterEvent> _event;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands
|
||||
{
|
||||
struct DispatchComputeCommand : IGALCommand
|
||||
struct DispatchComputeCommand : IGALCommand, IGALCommand<DispatchComputeCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.DispatchCompute;
|
||||
private int _groupsX;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands
|
||||
{
|
||||
struct DrawIndexedCommand : IGALCommand
|
||||
struct DrawIndexedCommand : IGALCommand, IGALCommand<DrawIndexedCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.DrawIndexed;
|
||||
private int _indexCount;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands
|
||||
{
|
||||
struct DrawCommand : IGALCommand
|
||||
struct DrawCommand : IGALCommand, IGALCommand<DrawCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.Draw;
|
||||
private int _vertexCount;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands
|
||||
{
|
||||
struct DrawIndexedIndirectCommand : IGALCommand
|
||||
struct DrawIndexedIndirectCommand : IGALCommand, IGALCommand<DrawIndexedIndirectCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.DrawIndexedIndirect;
|
||||
private BufferRange _indirectBuffer;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands
|
||||
{
|
||||
struct DrawIndexedIndirectCountCommand : IGALCommand
|
||||
struct DrawIndexedIndirectCountCommand : IGALCommand, IGALCommand<DrawIndexedIndirectCountCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.DrawIndexedIndirectCount;
|
||||
private BufferRange _indirectBuffer;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands
|
||||
{
|
||||
struct DrawIndirectCommand : IGALCommand
|
||||
struct DrawIndirectCommand : IGALCommand, IGALCommand<DrawIndirectCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.DrawIndirect;
|
||||
private BufferRange _indirectBuffer;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands
|
||||
{
|
||||
struct DrawIndirectCountCommand : IGALCommand
|
||||
struct DrawIndirectCountCommand : IGALCommand, IGALCommand<DrawIndirectCountCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.DrawIndirectCount;
|
||||
private BufferRange _indirectBuffer;
|
||||
|
@@ -3,7 +3,7 @@ using Ryujinx.Graphics.GAL.Multithreading.Resources;
|
||||
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands
|
||||
{
|
||||
struct DrawTextureCommand : IGALCommand
|
||||
struct DrawTextureCommand : IGALCommand, IGALCommand<DrawTextureCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.DrawTexture;
|
||||
private TableRef<ITexture> _texture;
|
||||
|
@@ -1,10 +1,10 @@
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands
|
||||
{
|
||||
struct EndHostConditionalRenderingCommand : IGALCommand
|
||||
struct EndHostConditionalRenderingCommand : IGALCommand, IGALCommand<EndHostConditionalRenderingCommand>
|
||||
{
|
||||
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();
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands
|
||||
{
|
||||
struct EndTransformFeedbackCommand : IGALCommand
|
||||
struct EndTransformFeedbackCommand : IGALCommand, IGALCommand<EndTransformFeedbackCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.EndTransformFeedback;
|
||||
|
||||
|
@@ -4,4 +4,9 @@
|
||||
{
|
||||
CommandType CommandType { get; }
|
||||
}
|
||||
|
||||
interface IGALCommand<T> where T : IGALCommand
|
||||
{
|
||||
abstract static void Run(ref T command, ThreadedRenderer threaded, IRenderer renderer);
|
||||
}
|
||||
}
|
||||
|
@@ -3,7 +3,7 @@ using Ryujinx.Graphics.GAL.Multithreading.Resources;
|
||||
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Program
|
||||
{
|
||||
struct ProgramCheckLinkCommand : IGALCommand
|
||||
struct ProgramCheckLinkCommand : IGALCommand, IGALCommand<ProgramCheckLinkCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.ProgramCheckLink;
|
||||
private TableRef<ThreadedProgram> _program;
|
||||
|
@@ -3,7 +3,7 @@ using Ryujinx.Graphics.GAL.Multithreading.Resources;
|
||||
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Program
|
||||
{
|
||||
struct ProgramDisposeCommand : IGALCommand
|
||||
struct ProgramDisposeCommand : IGALCommand, IGALCommand<ProgramDisposeCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.ProgramDispose;
|
||||
private TableRef<ThreadedProgram> _program;
|
||||
|
@@ -3,7 +3,7 @@ using Ryujinx.Graphics.GAL.Multithreading.Resources;
|
||||
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Program
|
||||
{
|
||||
struct ProgramGetBinaryCommand : IGALCommand
|
||||
struct ProgramGetBinaryCommand : IGALCommand, IGALCommand<ProgramGetBinaryCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.ProgramGetBinary;
|
||||
private TableRef<ThreadedProgram> _program;
|
||||
|
@@ -3,7 +3,7 @@ using System;
|
||||
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Renderer
|
||||
{
|
||||
struct ActionCommand : IGALCommand
|
||||
struct ActionCommand : IGALCommand, IGALCommand<ActionCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.Action;
|
||||
private TableRef<Action> _action;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Renderer
|
||||
{
|
||||
struct CreateBufferCommand : IGALCommand
|
||||
struct CreateBufferCommand : IGALCommand, IGALCommand<CreateBufferCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.CreateBuffer;
|
||||
private BufferHandle _threadedHandle;
|
||||
|
@@ -3,7 +3,7 @@ using Ryujinx.Graphics.GAL.Multithreading.Resources.Programs;
|
||||
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Renderer
|
||||
{
|
||||
struct CreateProgramCommand : IGALCommand
|
||||
struct CreateProgramCommand : IGALCommand, IGALCommand<CreateProgramCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.CreateProgram;
|
||||
private TableRef<IProgramRequest> _request;
|
||||
|
@@ -3,7 +3,7 @@ using Ryujinx.Graphics.GAL.Multithreading.Resources;
|
||||
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Renderer
|
||||
{
|
||||
struct CreateSamplerCommand : IGALCommand
|
||||
struct CreateSamplerCommand : IGALCommand, IGALCommand<CreateSamplerCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.CreateSampler;
|
||||
private TableRef<ThreadedSampler> _sampler;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Renderer
|
||||
{
|
||||
struct CreateSyncCommand : IGALCommand
|
||||
struct CreateSyncCommand : IGALCommand, IGALCommand<CreateSyncCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.CreateSync;
|
||||
private ulong _id;
|
||||
|
@@ -3,7 +3,7 @@ using Ryujinx.Graphics.GAL.Multithreading.Resources;
|
||||
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Renderer
|
||||
{
|
||||
struct CreateTextureCommand : IGALCommand
|
||||
struct CreateTextureCommand : IGALCommand, IGALCommand<CreateTextureCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.CreateTexture;
|
||||
private TableRef<ThreadedTexture> _texture;
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Renderer
|
||||
{
|
||||
struct GetCapabilitiesCommand : IGALCommand
|
||||
struct GetCapabilitiesCommand : IGALCommand, IGALCommand<GetCapabilitiesCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.GetCapabilities;
|
||||
private TableRef<ResultBox<Capabilities>> _result;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Renderer
|
||||
{
|
||||
struct PreFrameCommand : IGALCommand
|
||||
struct PreFrameCommand : IGALCommand, IGALCommand<PreFrameCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.PreFrame;
|
||||
|
||||
|
@@ -4,7 +4,7 @@ using System;
|
||||
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Renderer
|
||||
{
|
||||
struct ReportCounterCommand : IGALCommand
|
||||
struct ReportCounterCommand : IGALCommand, IGALCommand<ReportCounterCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.ReportCounter;
|
||||
private TableRef<ThreadedCounterEvent> _event;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Renderer
|
||||
{
|
||||
struct ResetCounterCommand : IGALCommand
|
||||
struct ResetCounterCommand : IGALCommand, IGALCommand<ResetCounterCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.ResetCounter;
|
||||
private CounterType _type;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Renderer
|
||||
{
|
||||
struct UpdateCountersCommand : IGALCommand
|
||||
struct UpdateCountersCommand : IGALCommand, IGALCommand<UpdateCountersCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.UpdateCounters;
|
||||
|
||||
|
@@ -3,7 +3,7 @@ using Ryujinx.Graphics.GAL.Multithreading.Resources;
|
||||
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Sampler
|
||||
{
|
||||
struct SamplerDisposeCommand : IGALCommand
|
||||
struct SamplerDisposeCommand : IGALCommand, IGALCommand<SamplerDisposeCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.SamplerDispose;
|
||||
private TableRef<ThreadedSampler> _sampler;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands
|
||||
{
|
||||
struct SetAlphaTestCommand : IGALCommand
|
||||
struct SetAlphaTestCommand : IGALCommand, IGALCommand<SetAlphaTestCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.SetAlphaTest;
|
||||
private bool _enable;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands
|
||||
{
|
||||
struct SetBlendStateCommand : IGALCommand
|
||||
struct SetBlendStateCommand : IGALCommand, IGALCommand<SetBlendStateCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.SetBlendState;
|
||||
private int _index;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands
|
||||
{
|
||||
struct SetDepthBiasCommand : IGALCommand
|
||||
struct SetDepthBiasCommand : IGALCommand, IGALCommand<SetDepthBiasCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.SetDepthBias;
|
||||
private PolygonModeMask _enables;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands
|
||||
{
|
||||
struct SetDepthClampCommand : IGALCommand
|
||||
struct SetDepthClampCommand : IGALCommand, IGALCommand<SetDepthClampCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.SetDepthClamp;
|
||||
private bool _clamp;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands
|
||||
{
|
||||
struct SetDepthModeCommand : IGALCommand
|
||||
struct SetDepthModeCommand : IGALCommand, IGALCommand<SetDepthModeCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.SetDepthMode;
|
||||
private DepthMode _mode;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands
|
||||
{
|
||||
struct SetDepthTestCommand : IGALCommand
|
||||
struct SetDepthTestCommand : IGALCommand, IGALCommand<SetDepthTestCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.SetDepthTest;
|
||||
private DepthTestDescriptor _depthTest;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands
|
||||
{
|
||||
struct SetFaceCullingCommand : IGALCommand
|
||||
struct SetFaceCullingCommand : IGALCommand, IGALCommand<SetFaceCullingCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.SetFaceCulling;
|
||||
private bool _enable;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands
|
||||
{
|
||||
struct SetFrontFaceCommand : IGALCommand
|
||||
struct SetFrontFaceCommand : IGALCommand, IGALCommand<SetFrontFaceCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.SetFrontFace;
|
||||
private FrontFace _frontFace;
|
||||
|
@@ -3,7 +3,7 @@ using Ryujinx.Graphics.GAL.Multithreading.Resources;
|
||||
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands
|
||||
{
|
||||
struct SetImageCommand : IGALCommand
|
||||
struct SetImageCommand : IGALCommand, IGALCommand<SetImageCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.SetImage;
|
||||
private int _binding;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands
|
||||
{
|
||||
struct SetIndexBufferCommand : IGALCommand
|
||||
struct SetIndexBufferCommand : IGALCommand, IGALCommand<SetIndexBufferCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.SetIndexBuffer;
|
||||
private BufferRange _buffer;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands
|
||||
{
|
||||
struct SetLineParametersCommand : IGALCommand
|
||||
struct SetLineParametersCommand : IGALCommand, IGALCommand<SetLineParametersCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.SetLineParameters;
|
||||
private float _width;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands
|
||||
{
|
||||
struct SetLogicOpStateCommand : IGALCommand
|
||||
struct SetLogicOpStateCommand : IGALCommand, IGALCommand<SetLogicOpStateCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.SetLogicOpState;
|
||||
private bool _enable;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands
|
||||
{
|
||||
struct SetMultisampleStateCommand : IGALCommand
|
||||
struct SetMultisampleStateCommand : IGALCommand, IGALCommand<SetMultisampleStateCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.SetMultisampleState;
|
||||
private MultisampleDescriptor _multisample;
|
||||
|
@@ -3,7 +3,7 @@ using System;
|
||||
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands
|
||||
{
|
||||
struct SetPatchParametersCommand : IGALCommand
|
||||
struct SetPatchParametersCommand : IGALCommand, IGALCommand<SetPatchParametersCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.SetPatchParameters;
|
||||
private int _vertices;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands
|
||||
{
|
||||
struct SetPointParametersCommand : IGALCommand
|
||||
struct SetPointParametersCommand : IGALCommand, IGALCommand<SetPointParametersCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.SetPointParameters;
|
||||
private float _size;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands
|
||||
{
|
||||
struct SetPolygonModeCommand : IGALCommand
|
||||
struct SetPolygonModeCommand : IGALCommand, IGALCommand<SetPolygonModeCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.SetPolygonMode;
|
||||
private PolygonMode _frontMode;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands
|
||||
{
|
||||
struct SetPrimitiveRestartCommand : IGALCommand
|
||||
struct SetPrimitiveRestartCommand : IGALCommand, IGALCommand<SetPrimitiveRestartCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.SetPrimitiveRestart;
|
||||
private bool _enable;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands
|
||||
{
|
||||
struct SetPrimitiveTopologyCommand : IGALCommand
|
||||
struct SetPrimitiveTopologyCommand : IGALCommand, IGALCommand<SetPrimitiveTopologyCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.SetPrimitiveTopology;
|
||||
private PrimitiveTopology _topology;
|
||||
|
@@ -3,7 +3,7 @@ using Ryujinx.Graphics.GAL.Multithreading.Resources;
|
||||
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands
|
||||
{
|
||||
struct SetProgramCommand : IGALCommand
|
||||
struct SetProgramCommand : IGALCommand, IGALCommand<SetProgramCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.SetProgram;
|
||||
private TableRef<IProgram> _program;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands
|
||||
{
|
||||
struct SetRasterizerDiscardCommand : IGALCommand
|
||||
struct SetRasterizerDiscardCommand : IGALCommand, IGALCommand<SetRasterizerDiscardCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.SetRasterizerDiscard;
|
||||
private bool _discard;
|
||||
|
@@ -3,7 +3,7 @@ using System;
|
||||
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands
|
||||
{
|
||||
struct SetRenderTargetColorMasksCommand : IGALCommand
|
||||
struct SetRenderTargetColorMasksCommand : IGALCommand, IGALCommand<SetRenderTargetColorMasksCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.SetRenderTargetColorMasks;
|
||||
private SpanRef<uint> _componentMask;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands
|
||||
{
|
||||
struct SetRenderTargetScaleCommand : IGALCommand
|
||||
struct SetRenderTargetScaleCommand : IGALCommand, IGALCommand<SetRenderTargetScaleCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.SetRenderTargetScale;
|
||||
private float _scale;
|
||||
|
@@ -4,7 +4,7 @@ using System.Linq;
|
||||
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands
|
||||
{
|
||||
struct SetRenderTargetsCommand : IGALCommand
|
||||
struct SetRenderTargetsCommand : IGALCommand, IGALCommand<SetRenderTargetsCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.SetRenderTargets;
|
||||
private TableRef<ITexture[]> _colors;
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands
|
||||
{
|
||||
struct SetScissorsCommand : IGALCommand
|
||||
struct SetScissorsCommand : IGALCommand, IGALCommand<SetScissorsCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.SetScissor;
|
||||
private SpanRef<Rectangle<int>> _scissors;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands
|
||||
{
|
||||
struct SetStencilTestCommand : IGALCommand
|
||||
struct SetStencilTestCommand : IGALCommand, IGALCommand<SetStencilTestCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.SetStencilTest;
|
||||
private StencilTestDescriptor _stencilTest;
|
||||
|
@@ -3,7 +3,7 @@ using System;
|
||||
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands
|
||||
{
|
||||
struct SetStorageBuffersCommand : IGALCommand
|
||||
struct SetStorageBuffersCommand : IGALCommand, IGALCommand<SetStorageBuffersCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.SetStorageBuffers;
|
||||
private SpanRef<BufferAssignment> _buffers;
|
||||
|
@@ -4,7 +4,7 @@ using Ryujinx.Graphics.Shader;
|
||||
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands
|
||||
{
|
||||
struct SetTextureAndSamplerCommand : IGALCommand
|
||||
struct SetTextureAndSamplerCommand : IGALCommand, IGALCommand<SetTextureAndSamplerCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.SetTextureAndSampler;
|
||||
private ShaderStage _stage;
|
||||
|
@@ -3,7 +3,7 @@ using System;
|
||||
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands
|
||||
{
|
||||
struct SetTransformFeedbackBuffersCommand : IGALCommand
|
||||
struct SetTransformFeedbackBuffersCommand : IGALCommand, IGALCommand<SetTransformFeedbackBuffersCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.SetTransformFeedbackBuffers;
|
||||
private SpanRef<BufferRange> _buffers;
|
||||
|
@@ -3,7 +3,7 @@ using System;
|
||||
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands
|
||||
{
|
||||
struct SetUniformBuffersCommand : IGALCommand
|
||||
struct SetUniformBuffersCommand : IGALCommand, IGALCommand<SetUniformBuffersCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.SetUniformBuffers;
|
||||
private SpanRef<BufferAssignment> _buffers;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands
|
||||
{
|
||||
struct SetUserClipDistanceCommand : IGALCommand
|
||||
struct SetUserClipDistanceCommand : IGALCommand, IGALCommand<SetUserClipDistanceCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.SetUserClipDistance;
|
||||
private int _index;
|
||||
|
@@ -3,7 +3,7 @@ using System;
|
||||
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands
|
||||
{
|
||||
struct SetVertexAttribsCommand : IGALCommand
|
||||
struct SetVertexAttribsCommand : IGALCommand, IGALCommand<SetVertexAttribsCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.SetVertexAttribs;
|
||||
private SpanRef<VertexAttribDescriptor> _vertexAttribs;
|
||||
|
@@ -3,7 +3,7 @@ using System;
|
||||
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands
|
||||
{
|
||||
struct SetVertexBuffersCommand : IGALCommand
|
||||
struct SetVertexBuffersCommand : IGALCommand, IGALCommand<SetVertexBuffersCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.SetVertexBuffers;
|
||||
private SpanRef<VertexBufferDescriptor> _vertexBuffers;
|
||||
|
@@ -3,7 +3,7 @@ using System;
|
||||
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands
|
||||
{
|
||||
struct SetViewportsCommand : IGALCommand
|
||||
struct SetViewportsCommand : IGALCommand, IGALCommand<SetViewportsCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.SetViewports;
|
||||
private SpanRef<Viewport> _viewports;
|
||||
|
@@ -3,7 +3,7 @@ using Ryujinx.Graphics.GAL.Multithreading.Resources;
|
||||
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Texture
|
||||
{
|
||||
struct TextureCopyToCommand : IGALCommand
|
||||
struct TextureCopyToCommand : IGALCommand, IGALCommand<TextureCopyToCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.TextureCopyTo;
|
||||
private TableRef<ThreadedTexture> _texture;
|
||||
|
@@ -3,7 +3,7 @@ using Ryujinx.Graphics.GAL.Multithreading.Resources;
|
||||
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Texture
|
||||
{
|
||||
struct TextureCopyToScaledCommand : IGALCommand
|
||||
struct TextureCopyToScaledCommand : IGALCommand, IGALCommand<TextureCopyToScaledCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.TextureCopyToScaled;
|
||||
private TableRef<ThreadedTexture> _texture;
|
||||
|
@@ -3,7 +3,7 @@ using Ryujinx.Graphics.GAL.Multithreading.Resources;
|
||||
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Texture
|
||||
{
|
||||
struct TextureCopyToSliceCommand : IGALCommand
|
||||
struct TextureCopyToSliceCommand : IGALCommand, IGALCommand<TextureCopyToSliceCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.TextureCopyToSlice;
|
||||
private TableRef<ThreadedTexture> _texture;
|
||||
|
@@ -3,7 +3,7 @@ using Ryujinx.Graphics.GAL.Multithreading.Resources;
|
||||
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Texture
|
||||
{
|
||||
struct TextureCreateViewCommand : IGALCommand
|
||||
struct TextureCreateViewCommand : IGALCommand, IGALCommand<TextureCreateViewCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.TextureCreateView;
|
||||
private TableRef<ThreadedTexture> _texture;
|
||||
|
@@ -4,7 +4,7 @@ using System;
|
||||
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Texture
|
||||
{
|
||||
struct TextureGetDataCommand : IGALCommand
|
||||
struct TextureGetDataCommand : IGALCommand, IGALCommand<TextureGetDataCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.TextureGetData;
|
||||
private TableRef<ThreadedTexture> _texture;
|
||||
|
@@ -4,7 +4,7 @@ using System;
|
||||
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Texture
|
||||
{
|
||||
struct TextureGetDataSliceCommand : IGALCommand
|
||||
struct TextureGetDataSliceCommand : IGALCommand, IGALCommand<TextureGetDataSliceCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.TextureGetDataSlice;
|
||||
private TableRef<ThreadedTexture> _texture;
|
||||
|
@@ -3,7 +3,7 @@ using Ryujinx.Graphics.GAL.Multithreading.Resources;
|
||||
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Texture
|
||||
{
|
||||
struct TextureReleaseCommand : IGALCommand
|
||||
struct TextureReleaseCommand : IGALCommand, IGALCommand<TextureReleaseCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.TextureRelease;
|
||||
private TableRef<ThreadedTexture> _texture;
|
||||
|
@@ -4,7 +4,7 @@ using System;
|
||||
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Texture
|
||||
{
|
||||
struct TextureSetDataCommand : IGALCommand
|
||||
struct TextureSetDataCommand : IGALCommand, IGALCommand<TextureSetDataCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.TextureSetData;
|
||||
private TableRef<ThreadedTexture> _texture;
|
||||
|
@@ -4,7 +4,7 @@ using System;
|
||||
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Texture
|
||||
{
|
||||
struct TextureSetDataSliceCommand : IGALCommand
|
||||
struct TextureSetDataSliceCommand : IGALCommand, IGALCommand<TextureSetDataSliceCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.TextureSetDataSlice;
|
||||
private TableRef<ThreadedTexture> _texture;
|
||||
|
@@ -4,7 +4,7 @@ using System;
|
||||
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Texture
|
||||
{
|
||||
struct TextureSetDataSliceRegionCommand : IGALCommand
|
||||
struct TextureSetDataSliceRegionCommand : IGALCommand, IGALCommand<TextureSetDataSliceRegionCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.TextureSetDataSliceRegion;
|
||||
private TableRef<ThreadedTexture> _texture;
|
||||
|
@@ -3,7 +3,7 @@ using Ryujinx.Graphics.GAL.Multithreading.Resources;
|
||||
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Texture
|
||||
{
|
||||
struct TextureSetStorageCommand : IGALCommand
|
||||
struct TextureSetStorageCommand : IGALCommand, IGALCommand<TextureSetStorageCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.TextureSetStorage;
|
||||
private TableRef<ThreadedTexture> _texture;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands
|
||||
{
|
||||
struct TextureBarrierCommand : IGALCommand
|
||||
struct TextureBarrierCommand : IGALCommand, IGALCommand<TextureBarrierCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.TextureBarrier;
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands
|
||||
{
|
||||
struct TextureBarrierTiledCommand : IGALCommand
|
||||
struct TextureBarrierTiledCommand : IGALCommand, IGALCommand<TextureBarrierTiledCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.TextureBarrierTiled;
|
||||
|
||||
|
@@ -3,7 +3,7 @@ using Ryujinx.Graphics.GAL.Multithreading.Resources;
|
||||
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands
|
||||
{
|
||||
struct TryHostConditionalRenderingCommand : IGALCommand
|
||||
struct TryHostConditionalRenderingCommand : IGALCommand, IGALCommand<TryHostConditionalRenderingCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.TryHostConditionalRendering;
|
||||
private TableRef<ThreadedCounterEvent> _value;
|
||||
|
@@ -3,7 +3,7 @@ using Ryujinx.Graphics.GAL.Multithreading.Resources;
|
||||
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands
|
||||
{
|
||||
struct TryHostConditionalRenderingFlushCommand : IGALCommand
|
||||
struct TryHostConditionalRenderingFlushCommand : IGALCommand, IGALCommand<TryHostConditionalRenderingFlushCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.TryHostConditionalRenderingFlush;
|
||||
private TableRef<ThreadedCounterEvent> _value;
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands
|
||||
{
|
||||
struct UpdateRenderScaleCommand : IGALCommand
|
||||
struct UpdateRenderScaleCommand : IGALCommand, IGALCommand<UpdateRenderScaleCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.UpdateRenderScale;
|
||||
private SpanRef<float> _scales;
|
||||
|
@@ -4,7 +4,7 @@ using System;
|
||||
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Window
|
||||
{
|
||||
struct WindowPresentCommand : IGALCommand
|
||||
struct WindowPresentCommand : IGALCommand, IGALCommand<WindowPresentCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.WindowPresent;
|
||||
private TableRef<ThreadedTexture> _texture;
|
||||
|
@@ -135,7 +135,7 @@ namespace Ryujinx.Graphics.GAL.Multithreading
|
||||
// The other thread can only increase the command count.
|
||||
// We can assume that if it is above 0, it will stay there or get higher.
|
||||
|
||||
while (_commandCount > 0 && Volatile.Read(ref _interruptAction) == null)
|
||||
while (Volatile.Read(ref _commandCount) > 0 && Volatile.Read(ref _interruptAction) == null)
|
||||
{
|
||||
int commandPtr = _consumerPtr;
|
||||
|
||||
@@ -169,7 +169,7 @@ namespace Ryujinx.Graphics.GAL.Multithreading
|
||||
|
||||
internal ref T New<T>() where T : struct
|
||||
{
|
||||
while (_producerPtr == (_consumerPtr + QueueCount - 1) % QueueCount)
|
||||
while (_producerPtr == (Volatile.Read(ref _consumerPtr) + QueueCount - 1) % QueueCount)
|
||||
{
|
||||
// If incrementing the producer pointer would overflow, we need to wait.
|
||||
// _consumerPtr can only move forward, so there's no race to worry about here.
|
||||
|
@@ -349,6 +349,11 @@ namespace Ryujinx.Graphics.Gpu.Engine.Twod
|
||||
return;
|
||||
}
|
||||
|
||||
if (srcTexture.Info.Samples > 1 || dstTexture.Info.Samples > 1)
|
||||
{
|
||||
srcTexture.PropagateScale(dstTexture);
|
||||
}
|
||||
|
||||
float scale = srcTexture.ScaleFactor;
|
||||
float dstScale = dstTexture.ScaleFactor;
|
||||
|
||||
|
@@ -25,6 +25,12 @@ namespace Ryujinx.Graphics.Gpu.Image
|
||||
// This method uses much more memory so we want to avoid it if possible.
|
||||
private const int ByteComparisonSwitchThreshold = 4;
|
||||
|
||||
// Tuning for blacklisting textures from scaling when their data is updated from CPU.
|
||||
// Each write adds the weight, each GPU modification subtracts 1.
|
||||
// Exceeding the threshold blacklists the texture.
|
||||
private const int ScaledSetWeight = 10;
|
||||
private const int ScaledSetThreshold = 30;
|
||||
|
||||
private const int MinLevelsForForceAnisotropy = 5;
|
||||
|
||||
private struct TexturePoolOwner
|
||||
@@ -122,6 +128,8 @@ namespace Ryujinx.Graphics.Gpu.Image
|
||||
private Target _arrayViewTarget;
|
||||
|
||||
private ITexture _flushHostTexture;
|
||||
private ITexture _setHostTexture;
|
||||
private int _scaledSetScore;
|
||||
|
||||
private Texture _viewStorage;
|
||||
|
||||
@@ -518,6 +526,25 @@ namespace Ryujinx.Graphics.Gpu.Image
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Registers when a texture has had its data set after being scaled, and
|
||||
/// determines if it should be blacklisted from scaling to improve performance.
|
||||
/// </summary>
|
||||
/// <returns>True if setting data for a scaled texture is allowed, false if the texture has been blacklisted</returns>
|
||||
private bool AllowScaledSetData()
|
||||
{
|
||||
_scaledSetScore += ScaledSetWeight;
|
||||
|
||||
if (_scaledSetScore >= ScaledSetThreshold)
|
||||
{
|
||||
BlacklistScale();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Blacklists this texture from being scaled. Resets its scale to 1 if needed.
|
||||
/// </summary>
|
||||
@@ -554,9 +581,10 @@ namespace Ryujinx.Graphics.Gpu.Image
|
||||
/// Copy the host texture to a scaled one. If a texture is not provided, create it with the given scale.
|
||||
/// </summary>
|
||||
/// <param name="scale">Scale factor</param>
|
||||
/// <param name="copy">True if the data should be copied to the texture, false otherwise</param>
|
||||
/// <param name="storage">Texture to use instead of creating one</param>
|
||||
/// <returns>A host texture containing a scaled version of this texture</returns>
|
||||
private ITexture GetScaledHostTexture(float scale, ITexture storage = null)
|
||||
private ITexture GetScaledHostTexture(float scale, bool copy, ITexture storage = null)
|
||||
{
|
||||
if (storage == null)
|
||||
{
|
||||
@@ -564,7 +592,10 @@ namespace Ryujinx.Graphics.Gpu.Image
|
||||
storage = _context.Renderer.CreateTexture(createInfo, scale);
|
||||
}
|
||||
|
||||
HostTexture.CopyTo(storage, new Extents2D(0, 0, HostTexture.Width, HostTexture.Height), new Extents2D(0, 0, storage.Width, storage.Height), true);
|
||||
if (copy)
|
||||
{
|
||||
HostTexture.CopyTo(storage, new Extents2D(0, 0, HostTexture.Width, HostTexture.Height), new Extents2D(0, 0, storage.Width, storage.Height), true);
|
||||
}
|
||||
|
||||
return storage;
|
||||
}
|
||||
@@ -595,7 +626,7 @@ namespace Ryujinx.Graphics.Gpu.Image
|
||||
|
||||
ScaleFactor = scale;
|
||||
|
||||
ITexture newStorage = GetScaledHostTexture(ScaleFactor);
|
||||
ITexture newStorage = GetScaledHostTexture(ScaleFactor, true);
|
||||
|
||||
Logger.Debug?.Print(LogClass.Gpu, $" Copy performed: {HostTexture.Width}x{HostTexture.Height} to {newStorage.Width}x{newStorage.Height}");
|
||||
|
||||
@@ -692,11 +723,6 @@ namespace Ryujinx.Graphics.Gpu.Image
|
||||
/// </summary>
|
||||
public void SynchronizeFull()
|
||||
{
|
||||
if (_hasData)
|
||||
{
|
||||
BlacklistScale();
|
||||
}
|
||||
|
||||
ReadOnlySpan<byte> data = _physicalMemory.GetSpan(Range);
|
||||
|
||||
// If the host does not support ASTC compression, we need to do the decompression.
|
||||
@@ -723,7 +749,19 @@ namespace Ryujinx.Graphics.Gpu.Image
|
||||
|
||||
SpanOrArray<byte> result = ConvertToHostCompatibleFormat(data);
|
||||
|
||||
HostTexture.SetData(result);
|
||||
if (ScaleFactor != 1f && AllowScaledSetData())
|
||||
{
|
||||
// If needed, create a texture to load from 1x scale.
|
||||
ITexture texture = _setHostTexture = GetScaledHostTexture(1f, false, _setHostTexture);
|
||||
|
||||
texture.SetData(result);
|
||||
|
||||
texture.CopyTo(HostTexture, new Extents2D(0, 0, texture.Width, texture.Height), new Extents2D(0, 0, HostTexture.Width, HostTexture.Height), true);
|
||||
}
|
||||
else
|
||||
{
|
||||
HostTexture.SetData(result);
|
||||
}
|
||||
|
||||
_hasData = true;
|
||||
}
|
||||
@@ -1056,7 +1094,7 @@ namespace Ryujinx.Graphics.Gpu.Image
|
||||
if (ScaleFactor != 1f)
|
||||
{
|
||||
// If needed, create a texture to flush back to host at 1x scale.
|
||||
texture = _flushHostTexture = GetScaledHostTexture(1f, _flushHostTexture);
|
||||
texture = _flushHostTexture = GetScaledHostTexture(1f, true, _flushHostTexture);
|
||||
}
|
||||
|
||||
return texture;
|
||||
@@ -1456,6 +1494,8 @@ namespace Ryujinx.Graphics.Gpu.Image
|
||||
/// </summary>
|
||||
public void SignalModified()
|
||||
{
|
||||
_scaledSetScore = Math.Max(0, _scaledSetScore - 1);
|
||||
|
||||
if (_modifiedStale || Group.HasCopyDependencies)
|
||||
{
|
||||
_modifiedStale = false;
|
||||
@@ -1472,6 +1512,11 @@ namespace Ryujinx.Graphics.Gpu.Image
|
||||
/// <param name="bound">True if the texture has been bound, false if it has been unbound</param>
|
||||
public void SignalModifying(bool bound)
|
||||
{
|
||||
if (bound)
|
||||
{
|
||||
_scaledSetScore = Math.Max(0, _scaledSetScore - 1);
|
||||
}
|
||||
|
||||
if (_modifiedStale || Group.HasCopyDependencies)
|
||||
{
|
||||
_modifiedStale = false;
|
||||
@@ -1685,6 +1730,9 @@ namespace Ryujinx.Graphics.Gpu.Image
|
||||
|
||||
_flushHostTexture?.Release();
|
||||
_flushHostTexture = null;
|
||||
|
||||
_setHostTexture?.Release();
|
||||
_setHostTexture = null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@@ -112,7 +112,7 @@ namespace Ryujinx.Graphics.Gpu.Image
|
||||
/// <returns>True if eligible</returns>
|
||||
private static TextureScaleMode IsUpscaleCompatible(TextureInfo info, bool withUpscale)
|
||||
{
|
||||
if ((info.Target == Target.Texture2D || info.Target == Target.Texture2DArray) && !info.FormatInfo.IsCompressed)
|
||||
if ((info.Target == Target.Texture2D || info.Target == Target.Texture2DArray || info.Target == Target.Texture2DMultisample) && !info.FormatInfo.IsCompressed)
|
||||
{
|
||||
return UpscaleSafeMode(info) ? (withUpscale ? TextureScaleMode.Scaled : TextureScaleMode.Eligible) : TextureScaleMode.Undesired;
|
||||
}
|
||||
|
@@ -2,6 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@@ -2,6 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user