From f0c91d9efb7eff0b8bbe8fc8d4901af5a9d59005 Mon Sep 17 00:00:00 2001
From: mageven <62494521+mageven@users.noreply.github.com>
Date: Sun, 2 Aug 2020 20:11:24 +0530
Subject: Facilitate OpenGL debug logging via GUI (#1373)
* Allow printing GL Debug logs with GUI options
Improve GL Debugger
Make the new option persistent
Address gdkchan's comments
- Rename enum to GraphicsDebugLevel
- Move Debugger Init to Renderer Init
- Fix formatting
* nit: newlines
---
.../Configuration/ConfigurationFileFormat.cs | 8 ++++-
Ryujinx.Common/Configuration/ConfigurationState.cs | 37 ++++++++++++++++------
Ryujinx.Common/Configuration/GraphicsDebugLevel.cs | 10 ++++++
3 files changed, 45 insertions(+), 10 deletions(-)
create mode 100644 Ryujinx.Common/Configuration/GraphicsDebugLevel.cs
(limited to 'Ryujinx.Common/Configuration')
diff --git a/Ryujinx.Common/Configuration/ConfigurationFileFormat.cs b/Ryujinx.Common/Configuration/ConfigurationFileFormat.cs
index 13dad62c..ae3fa493 100644
--- a/Ryujinx.Common/Configuration/ConfigurationFileFormat.cs
+++ b/Ryujinx.Common/Configuration/ConfigurationFileFormat.cs
@@ -1,5 +1,6 @@
using System.Collections.Generic;
using System.IO;
+using Ryujinx.Common.Configuration;
using Ryujinx.Common.Configuration.Hid;
using Ryujinx.Common.Logging;
using Ryujinx.Common.Utilities;
@@ -13,7 +14,7 @@ namespace Ryujinx.Configuration
///
/// The current version of the file format
///
- public const int CurrentVersion = 11;
+ public const int CurrentVersion = 12;
public int Version { get; set; }
@@ -77,6 +78,11 @@ namespace Ryujinx.Configuration
///
public LogClass[] LoggingFilteredClasses { get; set; }
+ ///
+ /// Change Graphics API debug log level
+ ///
+ public GraphicsDebugLevel LoggingGraphicsDebugLevel { get; set; }
+
///
/// Enables or disables logging to a file on disk
///
diff --git a/Ryujinx.Common/Configuration/ConfigurationState.cs b/Ryujinx.Common/Configuration/ConfigurationState.cs
index 3149f250..dc9dd659 100644
--- a/Ryujinx.Common/Configuration/ConfigurationState.cs
+++ b/Ryujinx.Common/Configuration/ConfigurationState.cs
@@ -1,4 +1,5 @@
using Ryujinx.Common;
+using Ryujinx.Common.Configuration;
using Ryujinx.Common.Configuration.Hid;
using Ryujinx.Common.Logging;
using Ryujinx.Configuration.Hid;
@@ -141,17 +142,23 @@ namespace Ryujinx.Configuration
///
public ReactiveObject EnableFileLog { get; private set; }
+ ///
+ /// Controls which OpenGL log messages are recorded in the log
+ ///
+ public ReactiveObject GraphicsDebugLevel { get; private set; }
+
public LoggerSection()
{
- EnableDebug = new ReactiveObject();
- EnableStub = new ReactiveObject();
- EnableInfo = new ReactiveObject();
- EnableWarn = new ReactiveObject();
- EnableError = new ReactiveObject();
- EnableGuest = new ReactiveObject();
- EnableFsAccessLog = new ReactiveObject();
- FilteredClasses = new ReactiveObject();
- EnableFileLog = new ReactiveObject();
+ EnableDebug = new ReactiveObject();
+ EnableStub = new ReactiveObject();
+ EnableInfo = new ReactiveObject();
+ EnableWarn = new ReactiveObject();
+ EnableError = new ReactiveObject();
+ EnableGuest = new ReactiveObject();
+ EnableFsAccessLog = new ReactiveObject();
+ FilteredClasses = new ReactiveObject();
+ EnableFileLog = new ReactiveObject();
+ GraphicsDebugLevel = new ReactiveObject();
}
}
@@ -378,6 +385,7 @@ namespace Ryujinx.Configuration
LoggingEnableGuest = Logger.EnableGuest,
LoggingEnableFsAccessLog = Logger.EnableFsAccessLog,
LoggingFilteredClasses = Logger.FilteredClasses,
+ LoggingGraphicsDebugLevel = Logger.GraphicsDebugLevel,
EnableFileLog = Logger.EnableFileLog,
SystemLanguage = System.Language,
SystemRegion = System.Region,
@@ -436,6 +444,7 @@ namespace Ryujinx.Configuration
Logger.EnableGuest.Value = true;
Logger.EnableFsAccessLog.Value = false;
Logger.FilteredClasses.Value = new LogClass[] { };
+ Logger.GraphicsDebugLevel.Value = GraphicsDebugLevel.None;
Logger.EnableFileLog.Value = true;
System.Language.Value = Language.AmericanEnglish;
System.Region.Value = Region.USA;
@@ -678,6 +687,15 @@ namespace Ryujinx.Configuration
configurationFileUpdated = true;
}
+ if (configurationFileFormat.Version < 12)
+ {
+ Common.Logging.Logger.PrintWarning(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 12.");
+
+ configurationFileFormat.LoggingGraphicsDebugLevel = GraphicsDebugLevel.None;
+
+ configurationFileUpdated = true;
+ }
+
List inputConfig = new List();
inputConfig.AddRange(configurationFileFormat.ControllerConfig);
inputConfig.AddRange(configurationFileFormat.KeyboardConfig);
@@ -694,6 +712,7 @@ namespace Ryujinx.Configuration
Logger.EnableGuest.Value = configurationFileFormat.LoggingEnableGuest;
Logger.EnableFsAccessLog.Value = configurationFileFormat.LoggingEnableFsAccessLog;
Logger.FilteredClasses.Value = configurationFileFormat.LoggingFilteredClasses;
+ Logger.GraphicsDebugLevel.Value = configurationFileFormat.LoggingGraphicsDebugLevel;
Logger.EnableFileLog.Value = configurationFileFormat.EnableFileLog;
System.Language.Value = configurationFileFormat.SystemLanguage;
System.Region.Value = configurationFileFormat.SystemRegion;
diff --git a/Ryujinx.Common/Configuration/GraphicsDebugLevel.cs b/Ryujinx.Common/Configuration/GraphicsDebugLevel.cs
new file mode 100644
index 00000000..1bef4a7e
--- /dev/null
+++ b/Ryujinx.Common/Configuration/GraphicsDebugLevel.cs
@@ -0,0 +1,10 @@
+namespace Ryujinx.Common.Configuration
+{
+ public enum GraphicsDebugLevel
+ {
+ None,
+ Error,
+ Performance,
+ All
+ }
+}
--
cgit v1.2.3