MCPcopy Create free account
hub / github.com/aliasIsolation/aliasIsolation / Draw_hook

Function Draw_hook

src/dll/rendering.cpp:108–142  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106//const char *const s_overallString = "Overall Draw";
107
108HRESULT 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(&currentVs.p, nullptr, nullptr);
119 context->PSGetShader(&currentPs.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

Callers

nothing calls this directly

Calls 3

taaOnDrawFunction · 0.85
caOnDrawFunction · 0.85
finishFrameFunction · 0.85

Tested by

no test coverage detected