From 288a9bca5c27be80f4e58e3a39ac7b1429f967aa Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Fonseca?= Date: Sat, 28 May 2011 11:06:35 +0100 Subject: [PATCH] Fix D3D shader dumping after trace writing refactoring. --- d3d8.py | 2 +- d3d9.py | 2 +- d3dshader.cpp | 7 +++---- d3dshader.hpp | 4 +++- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/d3d8.py b/d3d8.py index 89ad997..f5fb76e 100644 --- a/d3d8.py +++ b/d3d8.py @@ -288,7 +288,7 @@ class D3D8Tracer(DllTracer): def dump_arg_instance(self, function, arg): # Dump shaders as strings if function.name in ('CreateVertexShader', 'CreatePixelShader') and arg.name == 'pFunction': - print ' DumpShader(%s);' % (arg.name) + print ' DumpShader(__writer, %s);' % (arg.name) return DllTracer.dump_arg_instance(self, function, arg) diff --git a/d3d9.py b/d3d9.py index 8140162..4a4bd42 100644 --- a/d3d9.py +++ b/d3d9.py @@ -455,7 +455,7 @@ class D3D9Tracer(DllTracer): def dump_arg_instance(self, function, arg): # Dump shaders as strings if function.name in ('CreateVertexShader', 'CreatePixelShader') and arg.name == 'pFunction': - print ' DumpShader(%s);' % (arg.name) + print ' DumpShader(__writer, %s);' % (arg.name) return DllTracer.dump_arg_instance(self, function, arg) diff --git a/d3dshader.cpp b/d3dshader.cpp index 97f5d42..13987f4 100644 --- a/d3dshader.cpp +++ b/d3dshader.cpp @@ -27,7 +27,6 @@ #include -#include "trace_writer.hpp" #include "d3d9imports.hpp" #include "d3dshader.hpp" @@ -41,7 +40,7 @@ typedef HRESULT ); -void DumpShader(const DWORD *tokens) +void DumpShader(Trace::Writer &writer, const DWORD *tokens) { static BOOL firsttime = TRUE; static HMODULE hD3DXModule = NULL; @@ -81,7 +80,7 @@ found: hr = pfnD3DXDisassembleShader( (DWORD *)tokens, FALSE, NULL, &pDisassembly); if (hr == D3D_OK) { - Trace::LiteralString((const char *)pDisassembly->GetBufferPointer()); + writer.writeString((const char *)pDisassembly->GetBufferPointer()); } if (pDisassembly) { @@ -93,5 +92,5 @@ found: } } - Trace::LiteralOpaque(tokens); + writer.writeOpaque(tokens); } diff --git a/d3dshader.hpp b/d3dshader.hpp index fdde4e4..64a878b 100644 --- a/d3dshader.hpp +++ b/d3dshader.hpp @@ -30,7 +30,9 @@ #include -void DumpShader(const DWORD *tokens); +#include "trace_writer.hpp" + +void DumpShader(Trace::Writer &writer, const DWORD *tokens); #endif /* _D3DSHADER_HPP_ */ -- 2.45.2