aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Shader/Translation/ShaderConfig.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2020-07-30 02:53:23 -0300
committerGitHub <noreply@github.com>2020-07-30 15:53:23 +1000
commit636542d817b3403ae44b46a48a67cedc0c7b42c5 (patch)
tree718e27464fcc3fd5539c3c10e90f686436bed50c /Ryujinx.Graphics.Shader/Translation/ShaderConfig.cs
parentb3c051bbec58c667e0e9037c57300791775d84ea (diff)
Refactor shader translator ShaderConfig and reduce the number of out args (#1438)
Diffstat (limited to 'Ryujinx.Graphics.Shader/Translation/ShaderConfig.cs')
-rw-r--r--Ryujinx.Graphics.Shader/Translation/ShaderConfig.cs20
1 files changed, 16 insertions, 4 deletions
diff --git a/Ryujinx.Graphics.Shader/Translation/ShaderConfig.cs b/Ryujinx.Graphics.Shader/Translation/ShaderConfig.cs
index aabd9ca6..7b1587ae 100644
--- a/Ryujinx.Graphics.Shader/Translation/ShaderConfig.cs
+++ b/Ryujinx.Graphics.Shader/Translation/ShaderConfig.cs
@@ -1,8 +1,6 @@
-using System;
-
namespace Ryujinx.Graphics.Shader.Translation
{
- struct ShaderConfig
+ class ShaderConfig
{
public ShaderStage Stage { get; }
@@ -22,7 +20,9 @@ namespace Ryujinx.Graphics.Shader.Translation
public TranslationFlags Flags { get; }
- public FeatureFlags UsedFeatures { get; set; }
+ public int Size { get; private set; }
+
+ public FeatureFlags UsedFeatures { get; private set; }
public ShaderConfig(IGpuAccessor gpuAccessor, TranslationFlags flags)
{
@@ -36,6 +36,7 @@ namespace Ryujinx.Graphics.Shader.Translation
OmapDepth = false;
GpuAccessor = gpuAccessor;
Flags = flags;
+ Size = 0;
UsedFeatures = FeatureFlags.None;
}
@@ -51,6 +52,7 @@ namespace Ryujinx.Graphics.Shader.Translation
OmapDepth = header.OmapDepth;
GpuAccessor = gpuAccessor;
Flags = flags;
+ Size = 0;
UsedFeatures = FeatureFlags.None;
}
@@ -93,5 +95,15 @@ namespace Ryujinx.Graphics.Shader.Translation
return format;
}
+
+ public void SizeAdd(int size)
+ {
+ Size += size;
+ }
+
+ public void SetUsedFeature(FeatureFlags flags)
+ {
+ UsedFeatures |= flags;
+ }
}
} \ No newline at end of file