Skip to content

Commit

Permalink
dxgistate: Dump the stencil state.
Browse files Browse the repository at this point in the history
In both d3d10/d3d11 it's important to see the stencil state
currently set, so lets dump that info too.
  • Loading branch information
zackr authored and jrfonseca committed Mar 19, 2015
1 parent 99ff4a7 commit acca7d2
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
15 changes: 15 additions & 0 deletions retrace/d3d10state.cpp
Expand Up @@ -67,6 +67,20 @@ dumpBlendState(JSONWriter &json, ID3D10Device *pDevice)
}


static void
dumpDepthStencilState(JSONWriter &json, ID3D10Device *pDevice)
{
com_ptr<ID3D10DepthStencilState> pDepthStencilState;
UINT stencilRef;

pDevice->OMGetDepthStencilState(&pDepthStencilState, &stencilRef);
json.beginMember("DepthStencilState");
dumpStateObjectDesc(json, pDepthStencilState);
json.endMember(); // DepthStencilState
json.writeIntMember("StencilRef", stencilRef);
}


static void
dumpParameters(JSONWriter &json, ID3D10Device *pDevice)
{
Expand All @@ -75,6 +89,7 @@ dumpParameters(JSONWriter &json, ID3D10Device *pDevice)
json.beginObject();

dumpBlendState(json, pDevice);
dumpDepthStencilState(json, pDevice);

json.endObject();
json.endMember(); // parameters
Expand Down
15 changes: 15 additions & 0 deletions retrace/d3d11state.cpp
Expand Up @@ -79,6 +79,20 @@ dumpBlendState(JSONWriter &json, ID3D11DeviceContext *pDeviceContext)
}


static void
dumpDepthStencilState(JSONWriter &json, ID3D11DeviceContext *pDeviceContext)
{
com_ptr<ID3D11DepthStencilState> pDepthStencilState;
UINT stencilRef;

pDeviceContext->OMGetDepthStencilState(&pDepthStencilState, &stencilRef);
json.beginMember("DepthStencilState");
dumpStateObjectDesc(json, pDepthStencilState);
json.endMember(); // DepthStencilState
json.writeIntMember("StencilRef", stencilRef);
}


static void
dumpParameters(JSONWriter &json, ID3D11DeviceContext *pDeviceContext)
{
Expand All @@ -88,6 +102,7 @@ dumpParameters(JSONWriter &json, ID3D11DeviceContext *pDeviceContext)

dumpRasterizerState(json, pDeviceContext);
dumpBlendState(json, pDeviceContext);
dumpDepthStencilState(json, pDeviceContext);

json.endObject();
json.endMember(); // parameters
Expand Down

0 comments on commit acca7d2

Please sign in to comment.