File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change 44
55#include " PresentMon.hpp"
66#include " ../IntelPresentMon/CommonUtilities/Math.h"
7+ #include " ../IntelPresentMon/CommonUtilities/str/String.h"
78
89#include < algorithm>
910#include < shlwapi.h>
1011#include < thread>
1112
13+ using namespace pmon ;
14+
1215static std::thread gThread ;
1316static bool gQuit = false ;
1417
@@ -838,11 +841,22 @@ static void PruneOldSwapChainData(
838841
839842 for (auto & pair : gProcesses ) {
840843 auto processInfo = &pair.second ;
844+
845+ // Check if this is DWM process
846+ const bool isDwmProcess =
847+ util::str::ToLower (processInfo->mModuleName ).contains (L" dwm.exe" );
848+
841849 for (auto ii = processInfo->mSwapChain .begin (), ie = processInfo->mSwapChain .end (); ii != ie; ) {
850+ auto swapChainAddress = ii->first ;
842851 auto chain = &ii->second ;
843- if (chain->mLastPresent && chain->mLastPresent ->PresentStartTime < minTimestamp) {
852+
853+ // Don't prune DWM swap chains with address 0x0
854+ bool shouldSkipPruning = isDwmProcess && swapChainAddress == 0x0 ;
855+
856+ if (!shouldSkipPruning && chain->mLastPresent && chain->mLastPresent ->PresentStartTime < minTimestamp) {
844857 ii = processInfo->mSwapChain .erase (ii);
845- } else {
858+ }
859+ else {
846860 ++ii;
847861 }
848862 }
You can’t perform that action at this time.
0 commit comments