diff options
| author | gdkchan <gab.dark.100@gmail.com> | 2022-11-18 23:27:54 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-11-18 23:27:54 -0300 |
| commit | 2e43d01d3658d82f98c9eeea8280d8ec122c0c6b (patch) | |
| tree | 9d9e33db173a6dfc9e3fa0c05b3421a74f621d14 /Ryujinx.Graphics.Shader/Translation/ShaderConfig.cs | |
| parent | 7373ec579226e198d3d7825811eb592489acee1c (diff) | |
Move gl_Layer from vertex to geometry if GPU does not support it on vertex (#3866)
* Move gl_Layer from vertex to geometry if GPU does not support it on vertex
* Shader cache version bump
* PR feedback
Diffstat (limited to 'Ryujinx.Graphics.Shader/Translation/ShaderConfig.cs')
| -rw-r--r-- | Ryujinx.Graphics.Shader/Translation/ShaderConfig.cs | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/Ryujinx.Graphics.Shader/Translation/ShaderConfig.cs b/Ryujinx.Graphics.Shader/Translation/ShaderConfig.cs index fcf35ce2..ae4107e8 100644 --- a/Ryujinx.Graphics.Shader/Translation/ShaderConfig.cs +++ b/Ryujinx.Graphics.Shader/Translation/ShaderConfig.cs @@ -48,6 +48,9 @@ namespace Ryujinx.Graphics.Shader.Translation public int Cb1DataSize { get; private set; } + public bool LayerOutputWritten { get; private set; } + public int LayerOutputAttribute { get; private set; } + public bool NextUsesFixedFuncAttributes { get; private set; } public int UsedInputAttributes { get; private set; } public int UsedOutputAttributes { get; private set; } @@ -131,6 +134,20 @@ namespace Ryujinx.Graphics.Shader.Translation _usedImages = new Dictionary<TextureInfo, TextureMeta>(); } + public ShaderConfig( + ShaderStage stage, + OutputTopology outputTopology, + int maxOutputVertices, + IGpuAccessor gpuAccessor, + TranslationOptions options) : this(gpuAccessor, options) + { + Stage = stage; + ThreadsPerInputPrimitive = 1; + OutputTopology = outputTopology; + MaxOutputVertices = maxOutputVertices; + TransformFeedbackEnabled = gpuAccessor.QueryTransformFeedbackEnabled(); + } + public ShaderConfig(ShaderHeader header, IGpuAccessor gpuAccessor, TranslationOptions options) : this(gpuAccessor, options) { Stage = header.Stage; @@ -240,6 +257,12 @@ namespace Ryujinx.Graphics.Shader.Translation } } + public void SetLayerOutputAttribute(int attr) + { + LayerOutputWritten = true; + LayerOutputAttribute = attr; + } + public void SetInputUserAttributeFixedFunc(int index) { UsedInputAttributes |= 1 << index; @@ -694,5 +717,20 @@ namespace Ryujinx.Graphics.Shader.Translation { return FindDescriptorIndex(GetImageDescriptors(), texOp); } + + public ShaderProgramInfo CreateProgramInfo() + { + return new ShaderProgramInfo( + GetConstantBufferDescriptors(), + GetStorageBufferDescriptors(), + GetTextureDescriptors(), + GetImageDescriptors(), + Stage, + UsedFeatures.HasFlag(FeatureFlags.InstanceId), + UsedFeatures.HasFlag(FeatureFlags.DrawParameters), + UsedFeatures.HasFlag(FeatureFlags.RtLayer), + ClipDistancesWritten, + OmapTargets); + } } }
\ No newline at end of file |
