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