2019-12-06 17:37:00 -05:00
|
|
|
namespace Ryujinx.Graphics.Gpu.State
|
|
|
|
{
|
2019-12-31 11:32:06 -05:00
|
|
|
/// <summary>
|
|
|
|
/// Render target draw buffers control.
|
|
|
|
/// </summary>
|
2019-12-06 17:37:00 -05:00
|
|
|
struct RtControl
|
|
|
|
{
|
2020-04-20 17:59:59 -04:00
|
|
|
#pragma warning disable CS0649
|
2019-12-06 17:37:00 -05:00
|
|
|
public uint Packed;
|
2020-04-20 17:59:59 -04:00
|
|
|
#pragma warning restore CS0649
|
2019-12-06 17:37:00 -05:00
|
|
|
|
2019-12-31 11:32:06 -05:00
|
|
|
/// <summary>
|
|
|
|
/// Unpacks the number of active draw buffers.
|
|
|
|
/// </summary>
|
|
|
|
/// <returns>Number of active draw buffers</returns>
|
2019-12-06 17:37:00 -05:00
|
|
|
public int UnpackCount()
|
|
|
|
{
|
|
|
|
return (int)(Packed & 0xf);
|
|
|
|
}
|
|
|
|
|
2019-12-31 11:32:06 -05: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 17:37:00 -05:00
|
|
|
public int UnpackPermutationIndex(int index)
|
|
|
|
{
|
|
|
|
return (int)((Packed >> (4 + index * 3)) & 7);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|