From c6f33966b4f7aa3c92421c97922b7e651b90e3bc Mon Sep 17 00:00:00 2001 From: MysterD Date: Fri, 21 Apr 2023 22:53:32 -0700 Subject: [PATCH] Fix DirectX memory leak (thanks integerbang) --- src/pc/gfx/gfx_dxgi.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/pc/gfx/gfx_dxgi.cpp b/src/pc/gfx/gfx_dxgi.cpp index caefebdb..33a8ba61 100644 --- a/src/pc/gfx/gfx_dxgi.cpp +++ b/src/pc/gfx/gfx_dxgi.cpp @@ -549,10 +549,10 @@ static bool gfx_dxgi_start_frame(void) { static void gfx_dxgi_swap_buffers_begin(void) { ThrowIfFailed(dxgi.swap_chain->Present(dxgi.length_in_vsync_frames, 0)); - UINT this_present_id; - if (dxgi.swap_chain->GetLastPresentCount(&this_present_id) == S_OK) { - dxgi.pending_frame_stats.insert(std::make_pair(this_present_id, dxgi.length_in_vsync_frames)); - } + //UINT this_present_id; + //if (dxgi.swap_chain->GetLastPresentCount(&this_present_id) == S_OK) { + // dxgi.pending_frame_stats.insert(std::make_pair(this_present_id, dxgi.length_in_vsync_frames)); + //} dxgi.dropped_frame = false; } @@ -573,7 +573,7 @@ static void gfx_dxgi_swap_buffers_end(void) { QueryPerformanceCounter(&t2); - dxgi.sync_interval_means_frames_to_wait = dxgi.pending_frame_stats.rbegin()->first == stats.PresentCount; + //dxgi.sync_interval_means_frames_to_wait = dxgi.pending_frame_stats.rbegin()->first == stats.PresentCount; //printf("done %llu gpu:%d wait:%d freed:%llu frame:%u %u monitor:%u t:%llu\n", (unsigned long long)(t0.QuadPart - dxgi.qpc_init), (int)(t1.QuadPart - t0.QuadPart), (int)(t2.QuadPart - t0.QuadPart), (unsigned long long)(t2.QuadPart - dxgi.qpc_init), dxgi.pending_frame_stats.rbegin()->first, stats.PresentCount, stats.SyncRefreshCount, (unsigned long long)(stats.SyncQPCTime.QuadPart - dxgi.qpc_init)); }