summaryrefslogtreecommitdiff
path: root/retrace/d3d10state.cpp
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2012-12-04 13:04:14 +0000
committerJosé Fonseca <jfonseca@vmware.com>2012-12-04 13:04:14 +0000
commit1592ad278ba90ed2d5f6fa2b49fadf2cc6e4e77e (patch)
treebb88603e8b24febe78b82c7c16a16b0436c083a6 /retrace/d3d10state.cpp
parentafe24b9e8c90d02a640dafd241370ef2198380b5 (diff)
d3dretrace: Dump D3D11 images/shaders too.
Diffstat (limited to 'retrace/d3d10state.cpp')
-rw-r--r--retrace/d3d10state.cpp46
1 files changed, 2 insertions, 44 deletions
diff --git a/retrace/d3d10state.cpp b/retrace/d3d10state.cpp
index 15be6c48..d5e41da0 100644
--- a/retrace/d3d10state.cpp
+++ b/retrace/d3d10state.cpp
@@ -28,10 +28,8 @@
#include <iostream>
-#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)
{