using Ryujinx.Common.Memory;
using Ryujinx.Graphics.GAL;
using Ryujinx.Graphics.Gpu.Engine.Threed;
using Ryujinx.Graphics.Shader;
namespace Ryujinx.Graphics.Gpu.Shader
{
///
/// State used by the .
///
struct GpuChannelGraphicsState
{
// New fields should be added to the end of the struct to keep disk shader cache compatibility.
///
/// Early Z force enable.
///
public readonly bool EarlyZForce;
///
/// Primitive topology of current draw.
///
public readonly PrimitiveTopology Topology;
///
/// Tessellation mode.
///
public readonly TessMode TessellationMode;
///
/// Indicates whenever 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 if not set from shader.
///
public readonly float PointSize;
///
/// Indicates whenever alpha test is enabled.
///
public readonly bool AlphaTestEnable;
///
/// When alpha test is enabled, indicates the comparison that decides if the fragment is discarded.
///
public readonly CompareOp 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 Array32 AttributeTypes;
///
/// Creates a new GPU graphics state.
///
/// Early Z force enable
/// Primitive topology
/// Tessellation mode
/// Indicates whenever 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
/// Indicates whenever alpha test is enabled
/// When alpha test is enabled, indicates the comparison that decides if the fragment is 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
public GpuChannelGraphicsState(
bool earlyZForce,
PrimitiveTopology topology,
TessMode tessellationMode,
bool viewportTransformDisable,
bool depthMode,
bool programPointSizeEnable,
float pointSize,
bool alphaTestEnable,
CompareOp alphaTestCompare,
float alphaTestReference,
ref Array32 attributeTypes)
{
EarlyZForce = earlyZForce;
Topology = topology;
TessellationMode = tessellationMode;
ViewportTransformDisable = viewportTransformDisable;
DepthMode = depthMode;
ProgramPointSizeEnable = programPointSizeEnable;
PointSize = pointSize;
AlphaTestEnable = alphaTestEnable;
AlphaTestCompare = alphaTestCompare;
AlphaTestReference = alphaTestReference;
AttributeTypes = attributeTypes;
}
}
}