Change GPU errors to debug and reduce log messages

This commit is contained in:
gdkchan 2019-12-30 14:47:20 -03:00 committed by Thog
parent bacb278dc1
commit 80ff2eab29
8 changed files with 26 additions and 25 deletions

View File

@ -446,7 +446,7 @@ namespace Ryujinx.Graphics.Gpu.Engine
if (!FormatTable.TryGetAttribFormat(vertexAttrib.UnpackFormat(), out Format format)) if (!FormatTable.TryGetAttribFormat(vertexAttrib.UnpackFormat(), out Format format))
{ {
Logger.PrintError(LogClass.Gpu, $"Invalid attribute format 0x{vertexAttrib.UnpackFormat():X}."); Logger.PrintDebug(LogClass.Gpu, $"Invalid attribute format 0x{vertexAttrib.UnpackFormat():X}.");
format = Format.R32G32B32A32Float; format = Format.R32G32B32A32Float;
} }

View File

@ -347,7 +347,7 @@ namespace Ryujinx.Graphics.Gpu.Image
{ {
string texInfo = $"{Info.Target} {Info.FormatInfo.Format} {Info.Width}x{Info.Height}x{Info.DepthOrLayers} levels {Info.Levels}"; string texInfo = $"{Info.Target} {Info.FormatInfo.Format} {Info.Width}x{Info.Height}x{Info.DepthOrLayers} levels {Info.Levels}";
Logger.PrintError(LogClass.Gpu, $"Invalid ASTC texture at 0x{Info.Address:X} ({texInfo})."); Logger.PrintDebug(LogClass.Gpu, $"Invalid ASTC texture at 0x{Info.Address:X} ({texInfo}).");
} }
data = decoded; data = decoded;

View File

@ -157,7 +157,7 @@ namespace Ryujinx.Graphics.Gpu.Image
if (!FormatTable.TryGetTextureFormat(format, srgb, out FormatInfo formatInfo)) if (!FormatTable.TryGetTextureFormat(format, srgb, out FormatInfo formatInfo))
{ {
Logger.PrintError(LogClass.Gpu, $"Invalid texture format 0x{format:X} (sRGB: {srgb})."); Logger.PrintDebug(LogClass.Gpu, $"Invalid texture format 0x{format:X} (sRGB: {srgb}).");
formatInfo = FormatInfo.Default; formatInfo = FormatInfo.Default;
} }

View File

@ -34,7 +34,7 @@ namespace Ryujinx.Graphics.OpenGL
switch (type) switch (type)
{ {
case DebugType.DebugTypeError: case DebugType.DebugTypeError:
Logger.PrintError(LogClass.Gpu, fullMessage); Logger.PrintDebug(LogClass.Gpu, fullMessage);
break; break;
case DebugType.DebugTypePerformance: case DebugType.DebugTypePerformance:
Logger.PrintWarning(LogClass.Gpu, fullMessage); Logger.PrintWarning(LogClass.Gpu, fullMessage);

View File

@ -28,7 +28,7 @@ namespace Ryujinx.Graphics.OpenGL
return TextureWrapMode.ClampToEdge; return TextureWrapMode.ClampToEdge;
} }
Logger.PrintError(LogClass.Gpu, $"Invalid {nameof(AddressMode)} enum value: {mode}."); Logger.PrintDebug(LogClass.Gpu, $"Invalid {nameof(AddressMode)} enum value: {mode}.");
return TextureWrapMode.Clamp; return TextureWrapMode.Clamp;
} }
@ -92,7 +92,7 @@ namespace Ryujinx.Graphics.OpenGL
return All.OneMinusConstantAlpha; return All.OneMinusConstantAlpha;
} }
Logger.PrintError(LogClass.Gpu, $"Invalid {nameof(BlendFactor)} enum value: {factor}."); Logger.PrintDebug(LogClass.Gpu, $"Invalid {nameof(BlendFactor)} enum value: {factor}.");
return All.Zero; return All.Zero;
} }
@ -118,7 +118,7 @@ namespace Ryujinx.Graphics.OpenGL
return BlendEquationMode.Max; return BlendEquationMode.Max;
} }
Logger.PrintError(LogClass.Gpu, $"Invalid {nameof(BlendOp)} enum value: {op}."); Logger.PrintDebug(LogClass.Gpu, $"Invalid {nameof(BlendOp)} enum value: {op}.");
return BlendEquationMode.FuncAdd; return BlendEquationMode.FuncAdd;
} }
@ -133,7 +133,7 @@ namespace Ryujinx.Graphics.OpenGL
return TextureCompareMode.CompareRToTexture; return TextureCompareMode.CompareRToTexture;
} }
Logger.PrintError(LogClass.Gpu, $"Invalid {nameof(CompareMode)} enum value: {mode}."); Logger.PrintDebug(LogClass.Gpu, $"Invalid {nameof(CompareMode)} enum value: {mode}.");
return TextureCompareMode.None; return TextureCompareMode.None;
} }
@ -168,7 +168,7 @@ namespace Ryujinx.Graphics.OpenGL
return All.Always; return All.Always;
} }
Logger.PrintError(LogClass.Gpu, $"Invalid {nameof(CompareOp)} enum value: {op}."); Logger.PrintDebug(LogClass.Gpu, $"Invalid {nameof(CompareOp)} enum value: {op}.");
return All.Never; return All.Never;
} }
@ -183,7 +183,7 @@ namespace Ryujinx.Graphics.OpenGL
return ClipDepthMode.ZeroToOne; return ClipDepthMode.ZeroToOne;
} }
Logger.PrintError(LogClass.Gpu, $"Invalid {nameof(DepthMode)} enum value: {mode}."); Logger.PrintDebug(LogClass.Gpu, $"Invalid {nameof(DepthMode)} enum value: {mode}.");
return ClipDepthMode.NegativeOneToOne; return ClipDepthMode.NegativeOneToOne;
} }
@ -198,7 +198,7 @@ namespace Ryujinx.Graphics.OpenGL
return All.Stencil; return All.Stencil;
} }
Logger.PrintError(LogClass.Gpu, $"Invalid {nameof(DepthStencilMode)} enum value: {mode}."); Logger.PrintDebug(LogClass.Gpu, $"Invalid {nameof(DepthStencilMode)} enum value: {mode}.");
return All.Depth; return All.Depth;
} }
@ -215,7 +215,7 @@ namespace Ryujinx.Graphics.OpenGL
return CullFaceMode.FrontAndBack; return CullFaceMode.FrontAndBack;
} }
Logger.PrintError(LogClass.Gpu, $"Invalid {nameof(Face)} enum value: {face}."); Logger.PrintDebug(LogClass.Gpu, $"Invalid {nameof(Face)} enum value: {face}.");
return CullFaceMode.Back; return CullFaceMode.Back;
} }
@ -230,7 +230,7 @@ namespace Ryujinx.Graphics.OpenGL
return FrontFaceDirection.Ccw; return FrontFaceDirection.Ccw;
} }
Logger.PrintError(LogClass.Gpu, $"Invalid {nameof(FrontFace)} enum value: {frontFace}."); Logger.PrintDebug(LogClass.Gpu, $"Invalid {nameof(FrontFace)} enum value: {frontFace}.");
return FrontFaceDirection.Cw; return FrontFaceDirection.Cw;
} }
@ -247,7 +247,7 @@ namespace Ryujinx.Graphics.OpenGL
return DrawElementsType.UnsignedInt; return DrawElementsType.UnsignedInt;
} }
Logger.PrintError(LogClass.Gpu, $"Invalid {nameof(IndexType)} enum value: {type}."); Logger.PrintDebug(LogClass.Gpu, $"Invalid {nameof(IndexType)} enum value: {type}.");
return DrawElementsType.UnsignedByte; return DrawElementsType.UnsignedByte;
} }
@ -262,7 +262,7 @@ namespace Ryujinx.Graphics.OpenGL
return TextureMagFilter.Linear; return TextureMagFilter.Linear;
} }
Logger.PrintError(LogClass.Gpu, $"Invalid {nameof(MagFilter)} enum value: {filter}."); Logger.PrintDebug(LogClass.Gpu, $"Invalid {nameof(MagFilter)} enum value: {filter}.");
return TextureMagFilter.Nearest; return TextureMagFilter.Nearest;
} }
@ -285,7 +285,7 @@ namespace Ryujinx.Graphics.OpenGL
return TextureMinFilter.LinearMipmapLinear; return TextureMinFilter.LinearMipmapLinear;
} }
Logger.PrintError(LogClass.Gpu, $"Invalid {nameof(MinFilter)} enum value: {filter}."); Logger.PrintDebug(LogClass.Gpu, $"Invalid {nameof(MinFilter)} enum value: {filter}.");
return TextureMinFilter.Nearest; return TextureMinFilter.Nearest;
} }
@ -326,7 +326,7 @@ namespace Ryujinx.Graphics.OpenGL
return PrimitiveType.Patches; return PrimitiveType.Patches;
} }
Logger.PrintError(LogClass.Gpu, $"Invalid {nameof(PrimitiveTopology)} enum value: {topology}."); Logger.PrintDebug(LogClass.Gpu, $"Invalid {nameof(PrimitiveTopology)} enum value: {topology}.");
return PrimitiveType.Points; return PrimitiveType.Points;
} }
@ -353,7 +353,7 @@ namespace Ryujinx.Graphics.OpenGL
return OpenTK.Graphics.OpenGL.StencilOp.DecrWrap; return OpenTK.Graphics.OpenGL.StencilOp.DecrWrap;
} }
Logger.PrintError(LogClass.Gpu, $"Invalid {nameof(GAL.StencilOp)} enum value: {op}."); Logger.PrintDebug(LogClass.Gpu, $"Invalid {nameof(GAL.StencilOp)} enum value: {op}.");
return OpenTK.Graphics.OpenGL.StencilOp.Keep; return OpenTK.Graphics.OpenGL.StencilOp.Keep;
} }
@ -376,7 +376,7 @@ namespace Ryujinx.Graphics.OpenGL
return All.Alpha; return All.Alpha;
} }
Logger.PrintError(LogClass.Gpu, $"Invalid {nameof(SwizzleComponent)} enum value: {swizzleComponent}."); Logger.PrintDebug(LogClass.Gpu, $"Invalid {nameof(SwizzleComponent)} enum value: {swizzleComponent}.");
return All.Zero; return All.Zero;
} }
@ -412,7 +412,7 @@ namespace Ryujinx.Graphics.OpenGL
return TextureTarget.TextureBuffer; return TextureTarget.TextureBuffer;
} }
Logger.PrintError(LogClass.Gpu, $"Invalid {nameof(Target)} enum value: {target}."); Logger.PrintDebug(LogClass.Gpu, $"Invalid {nameof(Target)} enum value: {target}.");
return TextureTarget.Texture2D; return TextureTarget.Texture2D;
} }

View File

@ -99,7 +99,7 @@ namespace Ryujinx.Graphics.OpenGL
{ {
if (!_program.IsLinked) if (!_program.IsLinked)
{ {
Logger.PrintError(LogClass.Gpu, "Dispatch error, shader not linked."); Logger.PrintDebug(LogClass.Gpu, "Dispatch error, shader not linked.");
return; return;
} }
@ -113,7 +113,7 @@ namespace Ryujinx.Graphics.OpenGL
{ {
if (!_program.IsLinked) if (!_program.IsLinked)
{ {
Logger.PrintError(LogClass.Gpu, "Draw error, shader not linked."); Logger.PrintDebug(LogClass.Gpu, "Draw error, shader not linked.");
return; return;
} }
@ -221,7 +221,7 @@ namespace Ryujinx.Graphics.OpenGL
{ {
if (!_program.IsLinked) if (!_program.IsLinked)
{ {
Logger.PrintError(LogClass.Gpu, "Draw error, shader not linked."); Logger.PrintDebug(LogClass.Gpu, "Draw error, shader not linked.");
return; return;
} }

View File

@ -195,7 +195,8 @@ namespace Ryujinx.Graphics.OpenGL
if (status == 0) if (status == 0)
{ {
Logger.PrintError(LogClass.Gpu, $"Shader linking failed: {GL.GetProgramInfoLog(Handle)}"); // Use GL.GetProgramInfoLog(Handle), it may be too long to print on the log.
Logger.PrintDebug(LogClass.Gpu, "Shader linking failed.");
} }
else else
{ {

View File

@ -136,7 +136,7 @@ namespace Ryujinx.Graphics.OpenGL
break; break;
default: default:
Logger.PrintError(LogClass.Gpu, $"Invalid or unsupported texture target: {target}."); Logger.PrintDebug(LogClass.Gpu, $"Invalid or unsupported texture target: {target}.");
break; break;
} }
} }