From df820a72def62319fe97236a2006c64bfb7c065a Mon Sep 17 00:00:00 2001 From: gdkchan Date: Tue, 12 Jan 2021 18:50:54 -0300 Subject: Implement clear buffer (fast path) (#1902) * Implement clear buffer (fast path) * Remove blank line --- Ryujinx.Graphics.Gpu/State/CopyBufferSwizzle.cs | 36 +++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'Ryujinx.Graphics.Gpu/State/CopyBufferSwizzle.cs') 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 @@ -9,6 +9,42 @@ namespace Ryujinx.Graphics.Gpu.State public uint Swizzle; #pragma warning restore CS0649 + /// + /// Unpacks the source for the buffer destination vector X component. + /// + /// Destination component + public BufferSwizzleComponent UnpackDstX() + { + return (BufferSwizzleComponent)(Swizzle & 7); + } + + /// + /// Unpacks the source for the buffer destination vector Y component. + /// + /// Destination component + public BufferSwizzleComponent UnpackDstY() + { + return (BufferSwizzleComponent)((Swizzle >> 4) & 7); + } + + /// + /// Unpacks the source for the buffer destination vector Z component. + /// + /// Destination component + public BufferSwizzleComponent UnpackDstZ() + { + return (BufferSwizzleComponent)((Swizzle >> 8) & 7); + } + + /// + /// Unpacks the source for the buffer destination vector W component. + /// + /// Destination component + public BufferSwizzleComponent UnpackDstW() + { + return (BufferSwizzleComponent)((Swizzle >> 12) & 7); + } + /// /// Unpacks the size of each vector component of the copy. /// -- cgit v1.2.3