1
0
mirror of synced 2024-11-12 02:00:50 +01:00

Add config option to dump shaders

This commit is contained in:
KillzXGaming 2019-12-22 18:21:48 -05:00
parent eb248e6c36
commit e23db47d3a
3 changed files with 16 additions and 2 deletions

View File

@ -214,7 +214,16 @@ namespace LayoutBXLYT
var info = GL.GetProgramInfoLog(program);
if (!string.IsNullOrWhiteSpace(info))
{
if (Toolbox.Library.Runtime.DumpShadersDEBUG)
if (!System.IO.Directory.Exists("ShaderDump"))
System.IO.Directory.CreateDirectory("ShaderDump");
System.IO.File.WriteAllText($"ShaderDump/ShaderError_VS[{vertexShader}]_FS[{fragmentShader}].txt",
info + VertexShader + FragmentShader);
Console.WriteLine($"GL.LinkProgram had info log: {info}");
}
GL.DetachShader(program, vertexShader);
GL.DetachShader(program, fragmentShader);

View File

@ -295,7 +295,10 @@ namespace Toolbox.Library
case "TransformPaneChidlren":
bool.TryParse(node.InnerText, out Runtime.LayoutEditor.TransformChidlren);
break;
case "DumpShadersDEBUG":
bool.TryParse(node.InnerText, out Runtime.DumpShadersDEBUG);
break;
}
}
@ -438,12 +441,12 @@ namespace Toolbox.Library
XmlNode mainSettingsNode = doc.CreateElement("MAINFORM");
parentNode.AppendChild(mainSettingsNode);
mainSettingsNode.AppendChild(createNode(doc, "UseSingleInstance", Runtime.UseSingleInstance.ToString()));
mainSettingsNode.AppendChild(createNode(doc, "UseDirectXTexDecoder", Runtime.UseDirectXTexDecoder.ToString()));
mainSettingsNode.AppendChild(createNode(doc, "AlwaysCompressOnSave", Runtime.AlwaysCompressOnSave.ToString()));
mainSettingsNode.AppendChild(createNode(doc, "DisplayViewport", Runtime.DisplayViewport.ToString()));
mainSettingsNode.AppendChild(createNode(doc, "UseOpenGL", Runtime.UseOpenGL.ToString()));
mainSettingsNode.AppendChild(createNode(doc, "DumpShadersDEBUG", Runtime.DumpShadersDEBUG.ToString()));
mainSettingsNode.AppendChild(createNode(doc, "UseDebugDomainExceptionHandler", Runtime.UseDebugDomainExceptionHandler.ToString()));
mainSettingsNode.AppendChild(createNode(doc, "OpenStartupWindow", Runtime.OpenStartupWindow.ToString()));
mainSettingsNode.AppendChild(createNode(doc, "EnableVersionCheck", Runtime.EnableVersionCheck.ToString()));

View File

@ -20,6 +20,8 @@ namespace Toolbox.Library
public static bool EnableDragDrop = true;
public static bool DumpShadersDEBUG = false;
public static bool UseSingleInstance = false;
public static bool UseDirectXTexDecoder = true;
public static bool DEVELOPER_DEBUG_MODE = false;