2019-10-13 02:02:07 -04:00
|
|
|
namespace Ryujinx.Graphics.Gpu.State
|
|
|
|
{
|
2019-12-31 11:32:06 -05:00
|
|
|
/// <summary>
|
|
|
|
/// Buffer to buffer copy vector swizzle parameters.
|
|
|
|
/// </summary>
|
2019-10-13 02:02:07 -04:00
|
|
|
struct CopyBufferSwizzle
|
|
|
|
{
|
|
|
|
public uint Swizzle;
|
|
|
|
|
2019-12-31 11:32:06 -05:00
|
|
|
/// <summary>
|
|
|
|
/// Unpacks the size of each vector component of the copy.
|
|
|
|
/// </summary>
|
|
|
|
/// <returns>Vector component size</returns>
|
2019-10-13 02:02:07 -04:00
|
|
|
public int UnpackComponentSize()
|
|
|
|
{
|
|
|
|
return (int)((Swizzle >> 16) & 3) + 1;
|
|
|
|
}
|
|
|
|
|
2019-12-31 11:32:06 -05:00
|
|
|
/// <summary>
|
|
|
|
/// Unpacks the number of components of the source vector of the copy.
|
|
|
|
/// </summary>
|
|
|
|
/// <returns>Number of vector components</returns>
|
2019-10-13 02:02:07 -04:00
|
|
|
public int UnpackSrcComponentsCount()
|
|
|
|
{
|
|
|
|
return (int)((Swizzle >> 20) & 7) + 1;
|
|
|
|
}
|
|
|
|
|
2019-12-31 11:32:06 -05:00
|
|
|
/// <summary>
|
|
|
|
/// Unpacks the number of components of the destination vector of the copy.
|
|
|
|
/// </summary>
|
|
|
|
/// <returns>Number of vector components</returns>
|
2019-10-13 02:02:07 -04:00
|
|
|
public int UnpackDstComponentsCount()
|
|
|
|
{
|
|
|
|
return (int)((Swizzle >> 24) & 7) + 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|