X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=retrace%2Fd3d11state.cpp;h=bc8f7c44b2618f366585322c1deb8f14385ba6c5;hb=1592ad278ba90ed2d5f6fa2b49fadf2cc6e4e77e;hp=05885f4cd2cde494760cd8e8627aaacd15f82371;hpb=afe24b9e8c90d02a640dafd241370ef2198380b5;p=apitrace diff --git a/retrace/d3d11state.cpp b/retrace/d3d11state.cpp index 05885f4..bc8f7c4 100644 --- a/retrace/d3d11state.cpp +++ b/retrace/d3d11state.cpp @@ -29,18 +29,62 @@ #include #include "d3d11imports.hpp" -#include "json.hpp" +#include "d3d10state.hpp" namespace d3dstate { +static void +dumpShaders(JSONWriter &json, ID3D11DeviceContext *pDeviceContext) +{ + json.beginMember("shaders"); + json.beginObject(); + + ID3D11VertexShader *pVertexShader = NULL; + pDeviceContext->VSGetShader(&pVertexShader, NULL, NULL); + if (pVertexShader) { + dumpShader(json, "VS", pVertexShader); + pVertexShader->Release(); + } + + ID3D11GeometryShader *pGeometryShader = NULL; + pDeviceContext->GSGetShader(&pGeometryShader, NULL, NULL); + if (pGeometryShader) { + dumpShader(json, "GS", pGeometryShader); + pGeometryShader->Release(); + } + + ID3D11PixelShader *pPixelShader = NULL; + pDeviceContext->PSGetShader(&pPixelShader, NULL, NULL); + if (pPixelShader) { + dumpShader(json, "PS", pPixelShader); + } + + json.endObject(); + json.endMember(); // shaders +} + + void dumpDevice(std::ostream &os, ID3D11DeviceContext *pDeviceContext) { JSONWriter json(os); /* TODO */ + json.beginMember("parameters"); + json.beginObject(); + json.endObject(); + json.endMember(); // parameters + + dumpShaders(json, pDeviceContext); + + json.beginMember("textures"); + json.beginObject(); + json.endObject(); + json.endMember(); // textures + + dumpFramebuffer(json, pDeviceContext); }