Address feedback
This commit is contained in:
parent
561fab56ac
commit
eda3ef302a
4 changed files with 15 additions and 13 deletions
|
@ -1,4 +0,0 @@
|
||||||
public static class AGraphicsConfig
|
|
||||||
{
|
|
||||||
public static string ShadersDumpPath = "";
|
|
||||||
}
|
|
|
@ -5,22 +5,24 @@ namespace Ryujinx.Graphics.Gal
|
||||||
{
|
{
|
||||||
static class ShaderDumper
|
static class ShaderDumper
|
||||||
{
|
{
|
||||||
private static string RuntimeDir = "";
|
private static string RuntimeDir;
|
||||||
|
|
||||||
private static int DumpIndex = 1;
|
private static int DumpIndex = 1;
|
||||||
|
|
||||||
public static void Dump(IGalMemory Memory, long Position, GalShaderType Type, string ExtSuffix = "")
|
public static void Dump(IGalMemory Memory, long Position, GalShaderType Type, string ExtSuffix = "")
|
||||||
{
|
{
|
||||||
if (AGraphicsConfig.ShadersDumpPath == "")
|
if (string.IsNullOrWhiteSpace(GraphicsConfig.ShadersDumpPath))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
string Path = DumpDir() + "/Shader" + DumpIndex.ToString("d4") + "." + ShaderExtension(Type) + ExtSuffix + ".bin";
|
string FileName = "Shader" + DumpIndex.ToString("d4") + "." + ShaderExtension(Type) + ExtSuffix + ".bin";
|
||||||
|
|
||||||
|
string FilePath = Path.Combine(DumpDir(), FileName);
|
||||||
|
|
||||||
DumpIndex++;
|
DumpIndex++;
|
||||||
|
|
||||||
using (FileStream Output = File.Create(Path))
|
using (FileStream Output = File.Create(FilePath))
|
||||||
using (BinaryWriter Writer = new BinaryWriter(Output))
|
using (BinaryWriter Writer = new BinaryWriter(Output))
|
||||||
{
|
{
|
||||||
long Offset = 0;
|
long Offset = 0;
|
||||||
|
@ -28,7 +30,7 @@ namespace Ryujinx.Graphics.Gal
|
||||||
ulong Instruction = 0;
|
ulong Instruction = 0;
|
||||||
|
|
||||||
//Dump until a NOP instruction is found
|
//Dump until a NOP instruction is found
|
||||||
while (Instruction >> 52 != 0x50b)
|
while ((Instruction >> 52 & 0xfff8) != 0x50b0)
|
||||||
{
|
{
|
||||||
uint Word0 = (uint)Memory.ReadInt32(Position + Offset + 0);
|
uint Word0 = (uint)Memory.ReadInt32(Position + Offset + 0);
|
||||||
uint Word1 = (uint)Memory.ReadInt32(Position + Offset + 4);
|
uint Word1 = (uint)Memory.ReadInt32(Position + Offset + 4);
|
||||||
|
@ -59,13 +61,13 @@ namespace Ryujinx.Graphics.Gal
|
||||||
|
|
||||||
private static string DumpDir()
|
private static string DumpDir()
|
||||||
{
|
{
|
||||||
if (RuntimeDir == "")
|
if (string.IsNullOrEmpty(RuntimeDir))
|
||||||
{
|
{
|
||||||
int Index = 1;
|
int Index = 1;
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
RuntimeDir = AGraphicsConfig.ShadersDumpPath + "/Dumps" + Index.ToString("d2");
|
RuntimeDir = Path.Combine(GraphicsConfig.ShadersDumpPath, "Dumps" + Index.ToString("d2"));
|
||||||
|
|
||||||
Index++;
|
Index++;
|
||||||
}
|
}
|
||||||
|
|
4
Ryujinx.Graphics/GraphicsConfig.cs
Normal file
4
Ryujinx.Graphics/GraphicsConfig.cs
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
public static class GraphicsConfig
|
||||||
|
{
|
||||||
|
public static string ShadersDumpPath;
|
||||||
|
}
|
|
@ -29,7 +29,7 @@ namespace Ryujinx
|
||||||
|
|
||||||
AOptimizations.DisableMemoryChecks = !Convert.ToBoolean(Parser.Value("Enable_Memory_Checks"));
|
AOptimizations.DisableMemoryChecks = !Convert.ToBoolean(Parser.Value("Enable_Memory_Checks"));
|
||||||
|
|
||||||
AGraphicsConfig.ShadersDumpPath = Parser.Value("Graphics_Shaders_Dump_Path");
|
GraphicsConfig.ShadersDumpPath = Parser.Value("Graphics_Shaders_Dump_Path");
|
||||||
|
|
||||||
Log.SetEnable(LogLevel.Debug, Convert.ToBoolean(Parser.Value("Logging_Enable_Debug")));
|
Log.SetEnable(LogLevel.Debug, Convert.ToBoolean(Parser.Value("Logging_Enable_Debug")));
|
||||||
Log.SetEnable(LogLevel.Stub, Convert.ToBoolean(Parser.Value("Logging_Enable_Stub")));
|
Log.SetEnable(LogLevel.Stub, Convert.ToBoolean(Parser.Value("Logging_Enable_Stub")));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue