Ryujinx/src/Ryujinx.Graphics.Shader/Translation/IoUsage.cs
gdkchan f09bba82b9
Geometry shader emulation for macOS (#5551)
* Implement vertex and geometry shader conversion to compute

* Call InitializeReservedCounts for compute too

* PR feedback

* Set clip distance mask for geometry and tessellation shaders too

* Transform feedback emulation only for vertex
2023-08-29 21:10:34 -03:00

28 lines
1.1 KiB
C#

namespace Ryujinx.Graphics.Shader.Translation
{
readonly struct IoUsage
{
private readonly FeatureFlags _usedFeatures;
public readonly bool UsesRtLayer => _usedFeatures.HasFlag(FeatureFlags.RtLayer);
public readonly bool UsesViewportIndex => _usedFeatures.HasFlag(FeatureFlags.ViewportIndex);
public readonly bool UsesViewportMask => _usedFeatures.HasFlag(FeatureFlags.ViewportMask);
public readonly byte ClipDistancesWritten { get; }
public readonly int UserDefinedMap { get; }
public IoUsage(FeatureFlags usedFeatures, byte clipDistancesWritten, int userDefinedMap)
{
_usedFeatures = usedFeatures;
ClipDistancesWritten = clipDistancesWritten;
UserDefinedMap = userDefinedMap;
}
public readonly IoUsage Combine(IoUsage other)
{
return new IoUsage(
_usedFeatures | other._usedFeatures,
(byte)(ClipDistancesWritten | other.ClipDistancesWritten),
UserDefinedMap | other.UserDefinedMap);
}
}
}