aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.Graphics')
-rw-r--r--Ryujinx.Graphics/Gal/OpenGL/OGLShader.cs2
-rw-r--r--Ryujinx.Graphics/Gal/Shader/GlslDecl.cs3
-rw-r--r--Ryujinx.Graphics/Gal/Shader/GlslDecompiler.cs8
3 files changed, 7 insertions, 6 deletions
diff --git a/Ryujinx.Graphics/Gal/OpenGL/OGLShader.cs b/Ryujinx.Graphics/Gal/OpenGL/OGLShader.cs
index b45a3a3a..10a9120d 100644
--- a/Ryujinx.Graphics/Gal/OpenGL/OGLShader.cs
+++ b/Ryujinx.Graphics/Gal/OpenGL/OGLShader.cs
@@ -53,7 +53,7 @@ namespace Ryujinx.Graphics.Gal.OpenGL
{
GlslProgram Program;
- GlslDecompiler Decompiler = new GlslDecompiler();
+ GlslDecompiler Decompiler = new GlslDecompiler(OGLLimit.MaxUboSize);
int ShaderDumpIndex = ShaderDumper.DumpIndex;
diff --git a/Ryujinx.Graphics/Gal/Shader/GlslDecl.cs b/Ryujinx.Graphics/Gal/Shader/GlslDecl.cs
index f1b63a8d..b144cef3 100644
--- a/Ryujinx.Graphics/Gal/Shader/GlslDecl.cs
+++ b/Ryujinx.Graphics/Gal/Shader/GlslDecl.cs
@@ -1,4 +1,3 @@
-using Ryujinx.Graphics.Gal.OpenGL;
using System;
using System.Collections.Generic;
@@ -50,8 +49,6 @@ namespace Ryujinx.Graphics.Gal.Shader
public const string SsyStackName = "ssy_stack";
public const string SsyCursorName = "ssy_cursor";
- public static int MaxUboSize => OGLLimit.MaxUboSize / 16;
-
private string[] StagePrefixes = new string[] { "vp", "tcp", "tep", "gp", "fp" };
private string StagePrefix;
diff --git a/Ryujinx.Graphics/Gal/Shader/GlslDecompiler.cs b/Ryujinx.Graphics/Gal/Shader/GlslDecompiler.cs
index 5b62ac3a..92bdd658 100644
--- a/Ryujinx.Graphics/Gal/Shader/GlslDecompiler.cs
+++ b/Ryujinx.Graphics/Gal/Shader/GlslDecompiler.cs
@@ -31,7 +31,9 @@ namespace Ryujinx.Graphics.Gal.Shader
private StringBuilder SB;
- public GlslDecompiler()
+ public int MaxUboSize { get; }
+
+ public GlslDecompiler(int MaxUboSize)
{
InstsExpr = new Dictionary<ShaderIrInst, GetInstExpr>()
{
@@ -106,6 +108,8 @@ namespace Ryujinx.Graphics.Gal.Shader
{ ShaderIrInst.Utof, GetUtofExpr },
{ ShaderIrInst.Xor, GetXorExpr }
};
+
+ this.MaxUboSize = MaxUboSize / 16;
}
public GlslProgram Decompile(
@@ -259,7 +263,7 @@ namespace Ryujinx.Graphics.Gal.Shader
{
SB.AppendLine($"layout (std140) uniform {DeclInfo.Name} {{");
- SB.AppendLine($"{IdentationStr}vec4 {DeclInfo.Name}_data[{GlslDecl.MaxUboSize}];");
+ SB.AppendLine($"{IdentationStr}vec4 {DeclInfo.Name}_data[{MaxUboSize}];");
SB.AppendLine("};");
}