Refactor shader translator ShaderConfig and reduce the number of out args (#1438)
This commit is contained in:
parent
b3c051bbec
commit
636542d817
4 changed files with 29 additions and 35 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue