diff options
Diffstat (limited to 'src/Ryujinx.Graphics.Shader/SupportBuffer.cs')
-rw-r--r-- | src/Ryujinx.Graphics.Shader/SupportBuffer.cs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/Ryujinx.Graphics.Shader/SupportBuffer.cs b/src/Ryujinx.Graphics.Shader/SupportBuffer.cs index 5fe99327..5eb7fe46 100644 --- a/src/Ryujinx.Graphics.Shader/SupportBuffer.cs +++ b/src/Ryujinx.Graphics.Shader/SupportBuffer.cs @@ -1,4 +1,6 @@ using Ryujinx.Common.Memory; +using Ryujinx.Graphics.Shader.StructuredIr; +using Ryujinx.Graphics.Shader.Translation; using System.Runtime.CompilerServices; namespace Ryujinx.Graphics.Shader @@ -11,8 +13,20 @@ namespace Ryujinx.Graphics.Shader public T W; } + enum SupportBufferField + { + // Must match the order of the fields on the struct. + FragmentAlphaTest, + FragmentIsBgra, + ViewportInverse, + FragmentRenderScaleCount, + RenderScale + } + public struct SupportBuffer { + internal const int Binding = 0; + public static int FieldSize; public static int RequiredSize; @@ -47,6 +61,18 @@ namespace Ryujinx.Graphics.Shader ComputeRenderScaleOffset = GraphicsRenderScaleOffset + FieldSize; } + internal static StructureType GetStructureType() + { + return new StructureType(new[] + { + new StructureField(AggregateType.U32, "s_alpha_test"), + new StructureField(AggregateType.Array | AggregateType.U32, "s_is_bgra", FragmentIsBgraCount), + new StructureField(AggregateType.Vector4 | AggregateType.FP32, "s_viewport_inverse"), + new StructureField(AggregateType.S32, "s_frag_scale_count"), + new StructureField(AggregateType.Array | AggregateType.FP32, "s_render_scale", RenderScaleMaxCount) + }); + } + public Vector4<int> FragmentAlphaTest; public Array8<Vector4<int>> FragmentIsBgra; public Vector4<float> ViewportInverse; |