| 290 | } |
| 291 | |
| 292 | void PMTraceConsumer::HandleD3D9Event(EVENT_RECORD* pEventRecord) |
| 293 | { |
| 294 | auto const& hdr = pEventRecord->EventHeader; |
| 295 | switch (hdr.EventDescriptor.Id) { |
| 296 | case Microsoft_Windows_D3D9::Present_Start::Id: |
| 297 | if (IsProcessTrackedForFiltering(hdr.ProcessId)) { |
| 298 | EventDataDesc desc[] = { |
| 299 | { L"pSwapchain" }, |
| 300 | { L"Flags" }, |
| 301 | }; |
| 302 | mMetadata.GetEventData(pEventRecord, desc, _countof(desc)); |
| 303 | auto pSwapchain = desc[0].GetData<uint64_t>(); |
| 304 | auto Flags = desc[1].GetData<uint32_t>(); |
| 305 | |
| 306 | uint32_t dxgiPresentFlags = 0; |
| 307 | if (Flags & D3DPRESENT_DONOTFLIP) dxgiPresentFlags |= DXGI_PRESENT_DO_NOT_SEQUENCE; |
| 308 | if (Flags & D3DPRESENT_DONOTWAIT) dxgiPresentFlags |= DXGI_PRESENT_DO_NOT_WAIT; |
| 309 | if (Flags & D3DPRESENT_FLIPRESTART) dxgiPresentFlags |= DXGI_PRESENT_RESTART; |
| 310 | |
| 311 | int32_t syncInterval = -1; |
| 312 | if (Flags & D3DPRESENT_FORCEIMMEDIATE) { |
| 313 | syncInterval = 0; |
| 314 | } |
| 315 | |
| 316 | RuntimePresentStart(Runtime::D3D9, hdr, pSwapchain, dxgiPresentFlags, syncInterval); |
| 317 | } |
| 318 | break; |
| 319 | case Microsoft_Windows_D3D9::Present_Stop::Id: |
| 320 | if (IsProcessTrackedForFiltering(hdr.ProcessId)) { |
| 321 | RuntimePresentStop(Runtime::D3D9, hdr, mMetadata.GetEventData<uint32_t>(pEventRecord, L"Result")); |
| 322 | } |
| 323 | break; |
| 324 | default: |
| 325 | assert(!mFilteredEvents); // Assert that filtering is working if expected |
| 326 | break; |
| 327 | } |
| 328 | } |
| 329 | |
| 330 | void PMTraceConsumer::HandleDXGIEvent(EVENT_RECORD* pEventRecord) |
| 331 | { |
no test coverage detected