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