| 172 | //const char *const s_taaString = "Temporal Anti-Aliasing"; |
| 173 | |
| 174 | bool taaOnDraw(ID3D11DeviceContext *context, ID3D11VertexShader *currentVs, ID3D11PixelShader *currentPs) |
| 175 | { |
| 176 | ZoneScopedN(__FUNCTION__); |
| 177 | |
| 178 | #ifndef ALIASISOLATION_NO_TAA_PASS |
| 179 | // Run TAA before the DoF encode if it's present in the frame; otherwise run it before the RGBM encode |
| 180 | bool shouldRunTaa = g_alienResources.dofEncodePs == currentPs || |
| 181 | (!g_frameConstants.taaRanThisFrame && g_alienResources.rgbmEncodeVs == currentVs && |
| 182 | g_alienResources.rgbmEncodePs == currentPs); |
| 183 | |
| 184 | if (shouldRunTaa) |
| 185 | { |
| 186 | CComPtr<ID3D11ShaderResourceView> mainTexView = nullptr; |
| 187 | context->PSGetShaderResources(0, 1, &mainTexView.p); |
| 188 | |
| 189 | if (mainTexView) |
| 190 | { |
| 191 | TracyD3D11Zone(g_tracyD3D11Ctx, "Temporal Anti-Aliasing"); |
| 192 | // FrameMarkStart(s_taaString); |
| 193 | |
| 194 | CComPtr<ID3D11Texture2D> const mainTex = texFromView(mainTexView); |
| 195 | D3D11_TEXTURE2D_DESC mainTexDesc; |
| 196 | mainTex->GetDesc(&mainTexDesc); |
| 197 | |
| 198 | if (mainTexDesc.Format == DXGI_FORMAT_R11G11B10_FLOAT && |
| 199 | !!(mainTexDesc.BindFlags & D3D11_BIND_RENDER_TARGET)) |
| 200 | { |
| 201 | g_alienResources.mainTexView = mainTexView; |
| 202 | |
| 203 | insertRendering(context, [&](ID3D11DeviceContext *dev) { renderTaa(dev, mainTexView); }); |
| 204 | |
| 205 | g_frameConstants.taaRanThisFrame = true; |
| 206 | ++g_frameConstants.taaSampleIdx; |
| 207 | } |
| 208 | |
| 209 | // FrameMarkEnd(s_taaString); |
| 210 | |
| 211 | return true; |
| 212 | } |
| 213 | } |
| 214 | #endif |
| 215 | |
| 216 | return false; |
| 217 | } |
| 218 | |
| 219 | // ---------------------------------------------------------------------------------------------------------------- |
| 220 |
no test coverage detected