diff options
author | gdkchan <gab.dark.100@gmail.com> | 2023-05-20 16:19:26 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-20 16:19:26 -0300 |
commit | 402f05b8ef013807997589ecc0a8ff50267dcd23 (patch) | |
tree | 8e3b06c2ce3e3ccd4b443a4c68365251acc668fa /src/Ryujinx.Graphics.Shader/SupportBuffer.cs | |
parent | fb27042e01b0fa110184673d436ec96ec8cf20c7 (diff) |
Replace constant buffer access on shader with new Load instruction (#4646)1.1.811
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; |