Backup DX state that will be modified to restore it afterwards (unfortunately this is very ugly looking and verbose. Close your eyes!)
| 197 | |
| 198 | // Backup DX state that will be modified to restore it afterwards (unfortunately this is very ugly looking and verbose. Close your eyes!) |
| 199 | struct BACKUP_DX11_STATE |
| 200 | { |
| 201 | UINT ScissorRectsCount, ViewportsCount; |
| 202 | D3D11_RECT ScissorRects[D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE]; |
| 203 | D3D11_VIEWPORT Viewports[D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE]; |
| 204 | ID3D11RasterizerState* RS; |
| 205 | ID3D11BlendState* BlendState; |
| 206 | FLOAT BlendFactor[4]; |
| 207 | UINT SampleMask; |
| 208 | UINT StencilRef; |
| 209 | ID3D11DepthStencilState* DepthStencilState; |
| 210 | ID3D11ShaderResourceView* PSShaderResource; |
| 211 | ID3D11SamplerState* PSSampler; |
| 212 | ID3D11PixelShader* PS; |
| 213 | ID3D11VertexShader* VS; |
| 214 | ID3D11GeometryShader* GS; |
| 215 | UINT PSInstancesCount, VSInstancesCount, GSInstancesCount; |
| 216 | ID3D11ClassInstance* PSInstances[256], * VSInstances[256], * GSInstances[256]; // 256 is max according to PSSetShader documentation |
| 217 | D3D11_PRIMITIVE_TOPOLOGY PrimitiveTopology; |
| 218 | ID3D11Buffer* IndexBuffer, * VertexBuffer, * VSConstantBuffer; |
| 219 | UINT IndexBufferOffset, VertexBufferStride, VertexBufferOffset; |
| 220 | DXGI_FORMAT IndexBufferFormat; |
| 221 | ID3D11InputLayout* InputLayout; |
| 222 | }; |
| 223 | BACKUP_DX11_STATE old = {}; |
| 224 | old.ScissorRectsCount = old.ViewportsCount = D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE; |
| 225 | ctx->RSGetScissorRects(&old.ScissorRectsCount, old.ScissorRects); |
nothing calls this directly
no outgoing calls
no test coverage detected