aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Gpu/State
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.Graphics.Gpu/State')
-rw-r--r--Ryujinx.Graphics.Gpu/State/BufferSwizzleComponent.cs16
-rw-r--r--Ryujinx.Graphics.Gpu/State/CopyBufferSwizzle.cs36
-rw-r--r--Ryujinx.Graphics.Gpu/State/MethodOffset.cs2
3 files changed, 54 insertions, 0 deletions
diff --git a/Ryujinx.Graphics.Gpu/State/BufferSwizzleComponent.cs b/Ryujinx.Graphics.Gpu/State/BufferSwizzleComponent.cs
new file mode 100644
index 00000000..5c23cb2d
--- /dev/null
+++ b/Ryujinx.Graphics.Gpu/State/BufferSwizzleComponent.cs
@@ -0,0 +1,16 @@
+namespace Ryujinx.Graphics.Gpu.State
+{
+ /// <summary>
+ /// Buffer swizzle component.
+ /// </summary>
+ enum BufferSwizzleComponent
+ {
+ SrcX,
+ SrcY,
+ SrcZ,
+ SrcW,
+ ConstA,
+ ConstB,
+ NoWrite
+ }
+}
diff --git a/Ryujinx.Graphics.Gpu/State/CopyBufferSwizzle.cs b/Ryujinx.Graphics.Gpu/State/CopyBufferSwizzle.cs
index b4a9d9c2..94b650c4 100644
--- a/Ryujinx.Graphics.Gpu/State/CopyBufferSwizzle.cs
+++ b/Ryujinx.Graphics.Gpu/State/CopyBufferSwizzle.cs
@@ -10,6 +10,42 @@ namespace Ryujinx.Graphics.Gpu.State
#pragma warning restore CS0649
/// <summary>
+ /// Unpacks the source for the buffer destination vector X component.
+ /// </summary>
+ /// <returns>Destination component</returns>
+ public BufferSwizzleComponent UnpackDstX()
+ {
+ return (BufferSwizzleComponent)(Swizzle & 7);
+ }
+
+ /// <summary>
+ /// Unpacks the source for the buffer destination vector Y component.
+ /// </summary>
+ /// <returns>Destination component</returns>
+ public BufferSwizzleComponent UnpackDstY()
+ {
+ return (BufferSwizzleComponent)((Swizzle >> 4) & 7);
+ }
+
+ /// <summary>
+ /// Unpacks the source for the buffer destination vector Z component.
+ /// </summary>
+ /// <returns>Destination component</returns>
+ public BufferSwizzleComponent UnpackDstZ()
+ {
+ return (BufferSwizzleComponent)((Swizzle >> 8) & 7);
+ }
+
+ /// <summary>
+ /// Unpacks the source for the buffer destination vector W component.
+ /// </summary>
+ /// <returns>Destination component</returns>
+ public BufferSwizzleComponent UnpackDstW()
+ {
+ return (BufferSwizzleComponent)((Swizzle >> 12) & 7);
+ }
+
+ /// <summary>
/// Unpacks the size of each vector component of the copy.
/// </summary>
/// <returns>Vector component size</returns>
diff --git a/Ryujinx.Graphics.Gpu/State/MethodOffset.cs b/Ryujinx.Graphics.Gpu/State/MethodOffset.cs
index 6ec94c1b..4504e6b1 100644
--- a/Ryujinx.Graphics.Gpu/State/MethodOffset.cs
+++ b/Ryujinx.Graphics.Gpu/State/MethodOffset.cs
@@ -23,6 +23,8 @@ namespace Ryujinx.Graphics.Gpu.State
TfBufferState = 0xe0,
CopyBufferParams = 0x100,
TfState = 0x1c0,
+ CopyBufferConstA = 0x1c0,
+ CopyBufferConstB = 0x1c1,
CopyBufferSwizzle = 0x1c2,
CopyBufferDstTexture = 0x1c3,
CopyBufferSrcTexture = 0x1ca,