aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Graphics.Shader/CodeGen/Glsl/Declarations.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2023-05-25 17:46:58 -0300
committerGitHub <noreply@github.com>2023-05-25 17:46:58 -0300
commit8f0c89ffd65eb2b979b24d457708218050fec6ae (patch)
tree5657b8a7f6246659d97f0f574f3f1829d65a235e /src/Ryujinx.Graphics.Shader/CodeGen/Glsl/Declarations.cs
parent2c9715acf6cb9ae8bceabec5e81602c7d64c7192 (diff)
Generate scaling helper functions on IR (#4714)
* Generate scaling helper functions on IR * Delete unused code * Split RewriteTextureSample and move gather bias add to an earlier pass * Remove using * Shader cache version bump
Diffstat (limited to 'src/Ryujinx.Graphics.Shader/CodeGen/Glsl/Declarations.cs')
-rw-r--r--src/Ryujinx.Graphics.Shader/CodeGen/Glsl/Declarations.cs29
1 files changed, 3 insertions, 26 deletions
diff --git a/src/Ryujinx.Graphics.Shader/CodeGen/Glsl/Declarations.cs b/src/Ryujinx.Graphics.Shader/CodeGen/Glsl/Declarations.cs
index 8d805e32..1bd0182b 100644
--- a/src/Ryujinx.Graphics.Shader/CodeGen/Glsl/Declarations.cs
+++ b/src/Ryujinx.Graphics.Shader/CodeGen/Glsl/Declarations.cs
@@ -239,33 +239,10 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl
context.AppendLine();
}
- bool isFragment = context.Config.Stage == ShaderStage.Fragment;
-
- if (isFragment || context.Config.Stage == ShaderStage.Compute || context.Config.Stage == ShaderStage.Vertex)
+ if (context.Config.Stage == ShaderStage.Fragment && context.Config.GpuAccessor.QueryEarlyZForce())
{
- if (isFragment && context.Config.GpuAccessor.QueryEarlyZForce())
- {
- context.AppendLine("layout(early_fragment_tests) in;");
- context.AppendLine();
- }
-
- if ((context.Config.UsedFeatures & (FeatureFlags.FragCoordXY | FeatureFlags.IntegerSampling)) != 0)
- {
- string stage = OperandManager.GetShaderStagePrefix(context.Config.Stage);
-
- int scaleElements = context.Config.GetTextureDescriptors().Length + context.Config.GetImageDescriptors().Length;
-
- if (isFragment)
- {
- scaleElements++; // Also includes render target scale, for gl_FragCoord.
- }
-
- if (context.Config.UsedFeatures.HasFlag(FeatureFlags.IntegerSampling) && scaleElements != 0)
- {
- AppendHelperFunction(context, $"Ryujinx.Graphics.Shader/CodeGen/Glsl/HelperFunctions/TexelFetchScale_{stage}.glsl");
- context.AppendLine();
- }
- }
+ context.AppendLine("layout(early_fragment_tests) in;");
+ context.AppendLine();
}
if ((info.HelperFunctionsMask & HelperFunctionsMask.AtomicMinMaxS32Shared) != 0)