using Ryujinx.Common.Memory;
namespace Ryujinx.Graphics.Shader
{
///
/// GPU graphics state that the shader depends on.
///
public readonly struct GpuGraphicsState
{
///
/// Early Z force enable.
///
public readonly bool EarlyZForce;
///
/// Primitive topology of current draw.
///
public readonly InputTopology Topology;
///
/// Tessellation winding order.
///
public readonly bool TessCw;
///
/// Tessellation patch type.
///
public readonly TessPatchType TessPatchType;
///
/// Tessellation spacing.
///
public readonly TessSpacing TessSpacing;
///
/// Indicates whether alpha-to-coverage is enabled.
///
public readonly bool AlphaToCoverageEnable;
///
/// Indicates whether alpha-to-coverage dithering is enabled.
///
public readonly bool AlphaToCoverageDitherEnable;
///
/// Indicates whether the viewport transform is disabled.
///
public readonly bool ViewportTransformDisable;
///
/// Depth mode zero to one or minus one to one.
///
public readonly bool DepthMode;
///
/// Indicates if the point size is set on the shader or is fixed.
///
public readonly bool ProgramPointSizeEnable;
///
/// Point size used if is false.
///
public readonly float PointSize;
///
/// When alpha test is enabled, indicates the comparison that decides if the fragment should be discarded.
///
public readonly AlphaTestOp AlphaTestCompare;
///
/// When alpha test is enabled, indicates the value to compare with the fragment output alpha.
///
public readonly float AlphaTestReference;
///
/// Type of the vertex attributes consumed by the shader.
///
public readonly Array32 AttributeTypes;
///
/// Indicates that the draw is writing the base vertex, base instance and draw index to Constant Buffer 0.
///
public readonly bool HasConstantBufferDrawParameters;
///
/// Type of the fragment shader outputs.
///
public readonly Array8 FragmentOutputTypes;
///
/// Indicates whether dual source blend is enabled.
///
public readonly bool DualSourceBlendEnable;
///
/// Indicates if negation of the viewport Y axis is enabled.
///
public readonly bool YNegateEnabled;
///
/// If true, indicates that the fragment origin is the upper left corner of the viewport, otherwise it is the lower left corner.
///
public readonly bool OriginUpperLeft;
///
/// Creates a new GPU graphics state.
///
/// Early Z force enable
/// Primitive topology
/// Tessellation winding order (clockwise or counter-clockwise)
/// Tessellation patch type
/// Tessellation spacing
/// Indicates whether alpha-to-coverage is enabled
/// Indicates whether alpha-to-coverage dithering is enabled
/// Indicates whether the viewport transform is disabled
/// Depth mode zero to one or minus one to one
/// Indicates if the point size is set on the shader or is fixed
/// Point size if not set from shader
/// When alpha test is enabled, indicates the comparison that decides if the fragment should be discarded
/// When alpha test is enabled, indicates the value to compare with the fragment output alpha
/// Type of the vertex attributes consumed by the shader
/// Indicates that the draw is writing the base vertex, base instance and draw index to Constant Buffer 0
/// Type of the fragment shader outputs
/// Indicates whether dual source blend is enabled
/// Indicates if negation of the viewport Y axis is enabled
/// If true, indicates that the fragment origin is the upper left corner of the viewport, otherwise it is the lower left corner
public GpuGraphicsState(
bool earlyZForce,
InputTopology topology,
bool tessCw,
TessPatchType tessPatchType,
TessSpacing tessSpacing,
bool alphaToCoverageEnable,
bool alphaToCoverageDitherEnable,
bool viewportTransformDisable,
bool depthMode,
bool programPointSizeEnable,
float pointSize,
AlphaTestOp alphaTestCompare,
float alphaTestReference,
in Array32 attributeTypes,
bool hasConstantBufferDrawParameters,
in Array8 fragmentOutputTypes,
bool dualSourceBlendEnable,
bool yNegateEnabled,
bool originUpperLeft)
{
EarlyZForce = earlyZForce;
Topology = topology;
TessCw = tessCw;
TessPatchType = tessPatchType;
TessSpacing = tessSpacing;
AlphaToCoverageEnable = alphaToCoverageEnable;
AlphaToCoverageDitherEnable = alphaToCoverageDitherEnable;
ViewportTransformDisable = viewportTransformDisable;
DepthMode = depthMode;
ProgramPointSizeEnable = programPointSizeEnable;
PointSize = pointSize;
AlphaTestCompare = alphaTestCompare;
AlphaTestReference = alphaTestReference;
AttributeTypes = attributeTypes;
HasConstantBufferDrawParameters = hasConstantBufferDrawParameters;
FragmentOutputTypes = fragmentOutputTypes;
DualSourceBlendEnable = dualSourceBlendEnable;
YNegateEnabled = yNegateEnabled;
OriginUpperLeft = originUpperLeft;
}
}
}