aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.GAL
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.Graphics.GAL')
-rw-r--r--Ryujinx.Graphics.GAL/AdvancedBlendDescriptor.cs16
-rw-r--r--Ryujinx.Graphics.GAL/AdvancedBlendOp.cs52
-rw-r--r--Ryujinx.Graphics.GAL/AdvancedBlendOverlap.cs9
-rw-r--r--Ryujinx.Graphics.GAL/Capabilities.cs3
-rw-r--r--Ryujinx.Graphics.GAL/IPipeline.cs1
-rw-r--r--Ryujinx.Graphics.GAL/Multithreading/CommandHelper.cs1
-rw-r--r--Ryujinx.Graphics.GAL/Multithreading/CommandType.cs1
-rw-r--r--Ryujinx.Graphics.GAL/Multithreading/Commands/SetBlendStateAdvancedCommand.cs18
-rw-r--r--Ryujinx.Graphics.GAL/Multithreading/ThreadedPipeline.cs6
9 files changed, 107 insertions, 0 deletions
diff --git a/Ryujinx.Graphics.GAL/AdvancedBlendDescriptor.cs b/Ryujinx.Graphics.GAL/AdvancedBlendDescriptor.cs
new file mode 100644
index 00000000..1f1f7c3f
--- /dev/null
+++ b/Ryujinx.Graphics.GAL/AdvancedBlendDescriptor.cs
@@ -0,0 +1,16 @@
+namespace Ryujinx.Graphics.GAL
+{
+ public struct AdvancedBlendDescriptor
+ {
+ public AdvancedBlendOp Op { get; }
+ public AdvancedBlendOverlap Overlap { get; }
+ public bool SrcPreMultiplied { get; }
+
+ public AdvancedBlendDescriptor(AdvancedBlendOp op, AdvancedBlendOverlap overlap, bool srcPreMultiplied)
+ {
+ Op = op;
+ Overlap = overlap;
+ SrcPreMultiplied = srcPreMultiplied;
+ }
+ }
+}
diff --git a/Ryujinx.Graphics.GAL/AdvancedBlendOp.cs b/Ryujinx.Graphics.GAL/AdvancedBlendOp.cs
new file mode 100644
index 00000000..4140bf49
--- /dev/null
+++ b/Ryujinx.Graphics.GAL/AdvancedBlendOp.cs
@@ -0,0 +1,52 @@
+namespace Ryujinx.Graphics.GAL
+{
+ public enum AdvancedBlendOp
+ {
+ Zero,
+ Src,
+ Dst,
+ SrcOver,
+ DstOver,
+ SrcIn,
+ DstIn,
+ SrcOut,
+ DstOut,
+ SrcAtop,
+ DstAtop,
+ Xor,
+ Plus,
+ PlusClamped,
+ PlusClampedAlpha,
+ PlusDarker,
+ Multiply,
+ Screen,
+ Overlay,
+ Darken,
+ Lighten,
+ ColorDodge,
+ ColorBurn,
+ HardLight,
+ SoftLight,
+ Difference,
+ Minus,
+ MinusClamped,
+ Exclusion,
+ Contrast,
+ Invert,
+ InvertRGB,
+ InvertOvg,
+ LinearDodge,
+ LinearBurn,
+ VividLight,
+ LinearLight,
+ PinLight,
+ HardMix,
+ Red,
+ Green,
+ Blue,
+ HslHue,
+ HslSaturation,
+ HslColor,
+ HslLuminosity
+ }
+} \ No newline at end of file
diff --git a/Ryujinx.Graphics.GAL/AdvancedBlendOverlap.cs b/Ryujinx.Graphics.GAL/AdvancedBlendOverlap.cs
new file mode 100644
index 00000000..d4feb2b3
--- /dev/null
+++ b/Ryujinx.Graphics.GAL/AdvancedBlendOverlap.cs
@@ -0,0 +1,9 @@
+namespace Ryujinx.Graphics.GAL
+{
+ public enum AdvancedBlendOverlap
+ {
+ Uncorrelated,
+ Disjoint,
+ Conjoint
+ }
+}
diff --git a/Ryujinx.Graphics.GAL/Capabilities.cs b/Ryujinx.Graphics.GAL/Capabilities.cs
index 7a1f44b6..a24139eb 100644
--- a/Ryujinx.Graphics.GAL/Capabilities.cs
+++ b/Ryujinx.Graphics.GAL/Capabilities.cs
@@ -23,6 +23,7 @@ namespace Ryujinx.Graphics.GAL
public readonly bool SupportsR4G4B4A4Format;
public readonly bool SupportsSnormBufferTextureFormat;
public readonly bool Supports5BitComponentFormat;
+ public readonly bool SupportsBlendEquationAdvanced;
public readonly bool SupportsFragmentShaderInterlock;
public readonly bool SupportsFragmentShaderOrderingIntel;
public readonly bool SupportsGeometryShaderPassthrough;
@@ -64,6 +65,7 @@ namespace Ryujinx.Graphics.GAL
bool supportsR4G4B4A4Format,
bool supportsSnormBufferTextureFormat,
bool supports5BitComponentFormat,
+ bool supportsBlendEquationAdvanced,
bool supportsFragmentShaderInterlock,
bool supportsFragmentShaderOrderingIntel,
bool supportsGeometryShaderPassthrough,
@@ -102,6 +104,7 @@ namespace Ryujinx.Graphics.GAL
SupportsR4G4B4A4Format = supportsR4G4B4A4Format;
SupportsSnormBufferTextureFormat = supportsSnormBufferTextureFormat;
Supports5BitComponentFormat = supports5BitComponentFormat;
+ SupportsBlendEquationAdvanced = supportsBlendEquationAdvanced;
SupportsFragmentShaderInterlock = supportsFragmentShaderInterlock;
SupportsFragmentShaderOrderingIntel = supportsFragmentShaderOrderingIntel;
SupportsGeometryShaderPassthrough = supportsGeometryShaderPassthrough;
diff --git a/Ryujinx.Graphics.GAL/IPipeline.cs b/Ryujinx.Graphics.GAL/IPipeline.cs
index 26d019eb..0a362081 100644
--- a/Ryujinx.Graphics.GAL/IPipeline.cs
+++ b/Ryujinx.Graphics.GAL/IPipeline.cs
@@ -44,6 +44,7 @@ namespace Ryujinx.Graphics.GAL
void SetAlphaTest(bool enable, float reference, CompareOp op);
+ void SetBlendState(AdvancedBlendDescriptor blend);
void SetBlendState(int index, BlendDescriptor blend);
void SetDepthBias(PolygonModeMask enables, float factor, float units, float clamp);
diff --git a/Ryujinx.Graphics.GAL/Multithreading/CommandHelper.cs b/Ryujinx.Graphics.GAL/Multithreading/CommandHelper.cs
index 48873491..063b7edf 100644
--- a/Ryujinx.Graphics.GAL/Multithreading/CommandHelper.cs
+++ b/Ryujinx.Graphics.GAL/Multithreading/CommandHelper.cs
@@ -98,6 +98,7 @@ namespace Ryujinx.Graphics.GAL.Multithreading
Register<EndHostConditionalRenderingCommand>(CommandType.EndHostConditionalRendering);
Register<EndTransformFeedbackCommand>(CommandType.EndTransformFeedback);
Register<SetAlphaTestCommand>(CommandType.SetAlphaTest);
+ Register<SetBlendStateAdvancedCommand>(CommandType.SetBlendStateAdvanced);
Register<SetBlendStateCommand>(CommandType.SetBlendState);
Register<SetDepthBiasCommand>(CommandType.SetDepthBias);
Register<SetDepthClampCommand>(CommandType.SetDepthClamp);
diff --git a/Ryujinx.Graphics.GAL/Multithreading/CommandType.cs b/Ryujinx.Graphics.GAL/Multithreading/CommandType.cs
index c199ff34..61e729b4 100644
--- a/Ryujinx.Graphics.GAL/Multithreading/CommandType.cs
+++ b/Ryujinx.Graphics.GAL/Multithreading/CommandType.cs
@@ -60,6 +60,7 @@
EndHostConditionalRendering,
EndTransformFeedback,
SetAlphaTest,
+ SetBlendStateAdvanced,
SetBlendState,
SetDepthBias,
SetDepthClamp,
diff --git a/Ryujinx.Graphics.GAL/Multithreading/Commands/SetBlendStateAdvancedCommand.cs b/Ryujinx.Graphics.GAL/Multithreading/Commands/SetBlendStateAdvancedCommand.cs
new file mode 100644
index 00000000..2ec10a50
--- /dev/null
+++ b/Ryujinx.Graphics.GAL/Multithreading/Commands/SetBlendStateAdvancedCommand.cs
@@ -0,0 +1,18 @@
+namespace Ryujinx.Graphics.GAL.Multithreading.Commands
+{
+ struct SetBlendStateAdvancedCommand : IGALCommand, IGALCommand<SetBlendStateAdvancedCommand>
+ {
+ public CommandType CommandType => CommandType.SetBlendStateAdvanced;
+ private AdvancedBlendDescriptor _blend;
+
+ public void Set(AdvancedBlendDescriptor blend)
+ {
+ _blend = blend;
+ }
+
+ public static void Run(ref SetBlendStateAdvancedCommand command, ThreadedRenderer threaded, IRenderer renderer)
+ {
+ renderer.Pipeline.SetBlendState(command._blend);
+ }
+ }
+}
diff --git a/Ryujinx.Graphics.GAL/Multithreading/ThreadedPipeline.cs b/Ryujinx.Graphics.GAL/Multithreading/ThreadedPipeline.cs
index ba120867..1bdc9cf4 100644
--- a/Ryujinx.Graphics.GAL/Multithreading/ThreadedPipeline.cs
+++ b/Ryujinx.Graphics.GAL/Multithreading/ThreadedPipeline.cs
@@ -131,6 +131,12 @@ namespace Ryujinx.Graphics.GAL.Multithreading
_renderer.QueueCommand();
}
+ public void SetBlendState(AdvancedBlendDescriptor blend)
+ {
+ _renderer.New<SetBlendStateAdvancedCommand>().Set(blend);
+ _renderer.QueueCommand();
+ }
+
public void SetBlendState(int index, BlendDescriptor blend)
{
_renderer.New<SetBlendStateCommand>().Set(index, blend);