using Ryujinx.Graphics.GAL;
namespace Ryujinx.Graphics.Gpu.State
{
///
/// Viewport transform parameters, for viewport transformation.
///
struct ViewportTransform
{
public float ScaleX;
public float ScaleY;
public float ScaleZ;
public float TranslateX;
public float TranslateY;
public float TranslateZ;
public uint Swizzle;
public uint SubpixelPrecisionBias;
///
/// Unpacks viewport swizzle of the position X component.
///
/// Swizzle enum value
public ViewportSwizzle UnpackSwizzleX()
{
return (ViewportSwizzle)(Swizzle & 7);
}
///
/// Unpacks viewport swizzle of the position Y component.
///
/// Swizzle enum value
public ViewportSwizzle UnpackSwizzleY()
{
return (ViewportSwizzle)((Swizzle >> 4) & 7);
}
///
/// Unpacks viewport swizzle of the position Z component.
///
/// Swizzle enum value
public ViewportSwizzle UnpackSwizzleZ()
{
return (ViewportSwizzle)((Swizzle >> 8) & 7);
}
///
/// Unpacks viewport swizzle of the position W component.
///
/// Swizzle enum value
public ViewportSwizzle UnpackSwizzleW()
{
return (ViewportSwizzle)((Swizzle >> 12) & 7);
}
}
}