aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Gpu/State/CopyBufferSwizzle.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2021-01-12 18:50:54 -0300
committerGitHub <noreply@github.com>2021-01-13 08:50:54 +1100
commitdf820a72def62319fe97236a2006c64bfb7c065a (patch)
tree0e5d2c4f278548245e828e67194ff03d04532ce3 /Ryujinx.Graphics.Gpu/State/CopyBufferSwizzle.cs
parent68f6b79fd3f06ea572d5f0edd5fc8cbaee1ae449 (diff)
Implement clear buffer (fast path) (#1902)
* Implement clear buffer (fast path) * Remove blank line
Diffstat (limited to 'Ryujinx.Graphics.Gpu/State/CopyBufferSwizzle.cs')
-rw-r--r--Ryujinx.Graphics.Gpu/State/CopyBufferSwizzle.cs36
1 files changed, 36 insertions, 0 deletions
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>