| 106 | //const char *const s_overallString = "Overall Draw"; |
| 107 | |
| 108 | HRESULT WINAPI Draw_hook(ID3D11DeviceContext *context, UINT VertexCount, UINT StartVertexLocation) |
| 109 | { |
| 110 | ZoneScopedN(__FUNCTION__); |
| 111 | //TracyD3D11Zone(g_tracyD3D11Ctx, "Overall Draw"); |
| 112 | |
| 113 | HRESULT result = NO_ERROR; |
| 114 | auto origDrawFn = [&]() { result = g_d3dHookOrig.Draw(context, VertexCount, StartVertexLocation); }; |
| 115 | #if !defined(ALIASISOLATION_NO_TAA_PASS) && !defined(ALIASISOLATION_NO_CA_PASS) |
| 116 | CComPtr<ID3D11VertexShader> currentVs = nullptr; |
| 117 | CComPtr<ID3D11PixelShader> currentPs = nullptr; |
| 118 | context->VSGetShader(¤tVs.p, nullptr, nullptr); |
| 119 | context->PSGetShader(¤tPs.p, nullptr, nullptr); |
| 120 | |
| 121 | if (currentPs == g_alienResources.cameraMotionPs && g_alienResources.cameraMotionPs != nullptr) |
| 122 | { |
| 123 | CComPtr<ID3D11ShaderResourceView> depthSrv = nullptr; |
| 124 | context->PSGetShaderResources(8, 1, &depthSrv); |
| 125 | g_alienResources.depthSrv = depthSrv; |
| 126 | } |
| 127 | #endif |
| 128 | #ifndef ALIASISOLATION_NO_TAA_PASS |
| 129 | taaOnDraw(context, currentVs, currentPs); |
| 130 | #endif |
| 131 | #ifndef ALIASISOLATION_NO_CA_PASS |
| 132 | if (caOnDraw(context, currentPs, origDrawFn)) |
| 133 | { |
| 134 | finishFrame(); |
| 135 | |
| 136 | return result; |
| 137 | } |
| 138 | #endif |
| 139 | origDrawFn(); |
| 140 | |
| 141 | return result; |
| 142 | } |
| 143 | |
| 144 | // ---------------------------------------------------------------------------------------------------------------- |
| 145 |
nothing calls this directly
no test coverage detected