X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=retrace%2Fd3d11state.cpp;h=cc1f6c724abf70d55b00bf453a2a83699331269a;hb=8b095e5763690867bdc5e8ae204e0712a669b880;hp=05885f4cd2cde494760cd8e8627aaacd15f82371;hpb=944088ed749f195699228598ce3955063696931b;p=apitrace diff --git a/retrace/d3d11state.cpp b/retrace/d3d11state.cpp index 05885f4..cc1f6c7 100644 --- a/retrace/d3d11state.cpp +++ b/retrace/d3d11state.cpp @@ -29,18 +29,59 @@ #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); + + dumpTextures(json, pDeviceContext); + + dumpFramebuffer(json, pDeviceContext); }