X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=retrace%2Fd3d10state.cpp;h=0f6cf805b21bc0ed852c9a7cb6637ea5a14e2786;hb=8cf630712592eea93b1a1988a0875fe293e6aea8;hp=15be6c48ceb930bac3f122bb48ea59075fd80c5d;hpb=377c27707a139bd36fd33bdb96d4d9c6d602d76e;p=apitrace diff --git a/retrace/d3d10state.cpp b/retrace/d3d10state.cpp index 15be6c4..0f6cf80 100644 --- a/retrace/d3d10state.cpp +++ b/retrace/d3d10state.cpp @@ -28,10 +28,8 @@ #include -#include "d3d11imports.hpp" -#include "json.hpp" -#include "d3dshader.hpp" -#include "d3dstate.hpp" +#include "d3d10imports.hpp" +#include "d3d10state.hpp" namespace d3dstate { @@ -41,46 +39,6 @@ const GUID GUID_D3DSTATE = {0x7D71CAC9,0x7F58,0x432C,{0xA9,0x75,0xA1,0x9F,0xCF,0xCE,0xFD,0x14}}; -template< class T > -inline void -dumpShader(JSONWriter &json, const char *name, T *pShader) { - if (!pShader) { - return; - } - - HRESULT hr; - - /* - * There is no method to get the shader byte code, so the creator is supposed to - * attach it via the SetPrivateData method. - */ - UINT BytecodeLength = 0; - char dummy; - hr = pShader->GetPrivateData(GUID_D3DSTATE, &BytecodeLength, &dummy); - if (hr != DXGI_ERROR_MORE_DATA) { - return; - } - - void *pShaderBytecode = malloc(BytecodeLength); - if (!pShaderBytecode) { - return; - } - - hr = pShader->GetPrivateData(GUID_D3DSTATE, &BytecodeLength, pShaderBytecode); - if (SUCCEEDED(hr)) { - IDisassemblyBuffer *pDisassembly = NULL; - hr = DisassembleShader(pShaderBytecode, BytecodeLength, &pDisassembly); - if (SUCCEEDED(hr)) { - json.beginMember(name); - json.writeString((const char *)pDisassembly->GetBufferPointer() /*, pDisassembly->GetBufferSize() */); - json.endMember(); - pDisassembly->Release(); - } - } - - free(pShaderBytecode); -} - static void dumpShaders(JSONWriter &json, ID3D10Device *pDevice) { @@ -125,10 +83,7 @@ dumpDevice(std::ostream &os, ID3D10Device *pDevice) dumpShaders(json, pDevice); - json.beginMember("textures"); - json.beginObject(); - json.endObject(); - json.endMember(); // textures + dumpTextures(json, pDevice); dumpFramebuffer(json, pDevice); }