2019-12-06 14:37:00 -08:00
|
|
|
namespace Ryujinx.Graphics.Gpu.State
|
|
|
|
{
|
2019-12-31 08:32:06 -08:00
|
|
|
/// <summary>
|
|
|
|
/// Render target draw buffers control.
|
|
|
|
/// </summary>
|
2019-12-06 14:37:00 -08:00
|
|
|
struct RtControl
|
|
|
|
{
|
|
|
|
public uint Packed;
|
|
|
|
|
2019-12-31 08:32:06 -08:00
|
|
|
/// <summary>
|
|
|
|
/// Unpacks the number of active draw buffers.
|
|
|
|
/// </summary>
|
|
|
|
/// <returns>Number of active draw buffers</returns>
|
2019-12-06 14:37:00 -08:00
|
|
|
public int UnpackCount()
|
|
|
|
{
|
|
|
|
return (int)(Packed & 0xf);
|
|
|
|
}
|
|
|
|
|
2019-12-31 08:32:06 -08:00
|
|
|
/// <summary>
|
|
|
|
/// Unpacks the color attachment index for a given draw buffer.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="index">Index of the draw buffer</param>
|
|
|
|
/// <returns>Attachment index</returns>
|
2019-12-06 14:37:00 -08:00
|
|
|
public int UnpackPermutationIndex(int index)
|
|
|
|
{
|
|
|
|
return (int)((Packed >> (4 + index * 3)) & 7);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|