namespace Ryujinx.Graphics.Gpu.State
{
///
/// Buffer to buffer copy vector swizzle parameters.
///
struct CopyBufferSwizzle
{
#pragma warning disable CS0649
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.
///
/// Vector component size
public int UnpackComponentSize()
{
return (int)((Swizzle >> 16) & 3) + 1;
}
///
/// Unpacks the number of components of the source vector of the copy.
///
/// Number of vector components
public int UnpackSrcComponentsCount()
{
return (int)((Swizzle >> 20) & 7) + 1;
}
///
/// Unpacks the number of components of the destination vector of the copy.
///
/// Number of vector components
public int UnpackDstComponentsCount()
{
return (int)((Swizzle >> 24) & 7) + 1;
}
}
}