aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorriperiperi <rhy3756547@hotmail.com>2023-02-09 02:50:18 +0000
committerGitHub <noreply@github.com>2023-02-09 03:50:18 +0100
commitf1943fd0b65b74f164eec1f47a586a463fd4352a (patch)
treec509d0470aed2ff78f90fd79aa159993aa3a2978
parentec8d4f3af5d951776ab9d494ca1c5cae7809c08f (diff)
Log shader compile errors with Warning level (#2617)1.1.612
* Log shader compile errors with Warning level These are infrequent enough that I think it's worth dumping any errors into the log. They also keep causing graphical glitches, and the only indication that anything went wrong is a debug log that is never enabled. * Add maximum length for shader log
-rw-r--r--Ryujinx.Graphics.OpenGL/Program.cs13
1 files changed, 11 insertions, 2 deletions
diff --git a/Ryujinx.Graphics.OpenGL/Program.cs b/Ryujinx.Graphics.OpenGL/Program.cs
index 0cc722e6..a6009108 100644
--- a/Ryujinx.Graphics.OpenGL/Program.cs
+++ b/Ryujinx.Graphics.OpenGL/Program.cs
@@ -10,6 +10,8 @@ namespace Ryujinx.Graphics.OpenGL
{
class Program : IProgram
{
+ private const int MaxShaderLogLength = 2048;
+
public int Handle { get; private set; }
public bool IsLinked
@@ -115,9 +117,16 @@ namespace Ryujinx.Graphics.OpenGL
if (status == 0)
{
- // Use GL.GetProgramInfoLog(Handle), it may be too long to print on the log.
_status = ProgramLinkStatus.Failure;
- Logger.Debug?.Print(LogClass.Gpu, "Shader linking failed.");
+
+ string log = GL.GetProgramInfoLog(Handle);
+
+ if (log.Length > MaxShaderLogLength)
+ {
+ log = log.Substring(0, MaxShaderLogLength) + "...";
+ }
+
+ Logger.Warning?.Print(LogClass.Gpu, $"Shader linking failed: \n{log}");
}
else
{