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 bool EarlyZForce;
///
/// Primitive topology of current draw.
///
public PrimitiveTopology Topology;
///
/// Tessellation mode.
///
public TessMode TessellationMode;
///
/// Indicates whether alpha-to-coverage is enabled.
///
public bool AlphaToCoverageEnable;
///
/// Indicates whether alpha-to-coverage dithering is enabled.
///
public bool AlphaToCoverageDitherEnable;
///
/// Indicates whether the viewport transform is disabled.
///
public bool ViewportTransformDisable;
///
/// Depth mode zero to one or minus one to one.
///
public bool DepthMode;
///
/// Indicates if the point size is set on the shader or is fixed.
///
public bool ProgramPointSizeEnable;
///
/// Point size used if is false.
///
public float PointSize;
///
/// Indicates whether alpha test is enabled.
///
public bool AlphaTestEnable;
///
/// When alpha test is enabled, indicates the comparison that decides if the fragment should be discarded.
///
public CompareOp AlphaTestCompare;
///
/// When alpha test is enabled, indicates the value to compare with the fragment output alpha.
///
public float AlphaTestReference;
///
/// Type of the vertex attributes consumed by the shader.
///
public Array32 AttributeTypes;
///
/// Indicates that the draw is writing the base vertex, base instance and draw index to Constant Buffer 0.
///
public bool HasConstantBufferDrawParameters;
///
/// Indicates that any storage buffer use is unaligned.
///
public bool HasUnalignedStorageBuffer;
///
/// Type of the fragment shader outputs.
///
public Array8 FragmentOutputTypes;
///
/// Indicates whether dual source blend is enabled.
///
public bool DualSourceBlendEnable;
///
/// Creates a new GPU graphics state.
///
/// Early Z force enable
/// Primitive topology
/// Tessellation mode
/// 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
/// Indicates whether alpha test is enabled
/// 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
/// Indicates that any storage buffer use is unaligned
/// Type of the fragment shader outputs
/// Type of the vertex attributes consumed by the shader
public GpuChannelGraphicsState(
bool earlyZForce,
PrimitiveTopology topology,
TessMode tessellationMode,
bool alphaToCoverageEnable,
bool alphaToCoverageDitherEnable,
bool viewportTransformDisable,
bool depthMode,
bool programPointSizeEnable,
float pointSize,
bool alphaTestEnable,
CompareOp alphaTestCompare,
float alphaTestReference,
ref Array32 attributeTypes,
bool hasConstantBufferDrawParameters,
bool hasUnalignedStorageBuffer,
ref Array8 fragmentOutputTypes,
bool dualSourceBlendEnable)
{
EarlyZForce = earlyZForce;
Topology = topology;
TessellationMode = tessellationMode;
AlphaToCoverageEnable = alphaToCoverageEnable;
AlphaToCoverageDitherEnable = alphaToCoverageDitherEnable;
ViewportTransformDisable = viewportTransformDisable;
DepthMode = depthMode;
ProgramPointSizeEnable = programPointSizeEnable;
PointSize = pointSize;
AlphaTestEnable = alphaTestEnable;
AlphaTestCompare = alphaTestCompare;
AlphaTestReference = alphaTestReference;
AttributeTypes = attributeTypes;
HasConstantBufferDrawParameters = hasConstantBufferDrawParameters;
HasUnalignedStorageBuffer = hasUnalignedStorageBuffer;
FragmentOutputTypes = fragmentOutputTypes;
DualSourceBlendEnable = dualSourceBlendEnable;
}
}
}