From 1a758d8cebdab8fe5a3a9d330c1689903a0c0fe7 Mon Sep 17 00:00:00 2001 From: Jiawei Shao Date: Tue, 28 Jun 2022 00:28:35 +0000 Subject: [PATCH] D3D12: Remove tempBuffers in ExecuteCommandList() This patch clears mTempBuffers everytime after d3d12CommandList is executed in CommandRecordingContext. Previously mTempBuffers won't be cleaned up until device is destroyed, which will consume lots of unnecessary GPU memory. Bug: chromium:1161355 Change-Id: Ie03d43847ed56e7f2b4bfc5b0f8244dfd7012625 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/94820 Commit-Queue: Jiawei Shao Reviewed-by: Austin Eng Reviewed-by: Corentin Wallez Kokoro: Kokoro --- src/dawn/native/d3d12/CommandRecordingContext.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/dawn/native/d3d12/CommandRecordingContext.cpp b/src/dawn/native/d3d12/CommandRecordingContext.cpp index 6f050147df..1f7e2766f5 100644 --- a/src/dawn/native/d3d12/CommandRecordingContext.cpp +++ b/src/dawn/native/d3d12/CommandRecordingContext.cpp @@ -130,6 +130,7 @@ MaybeError CommandRecordingContext::ExecuteCommandList(Device* device) { mIsOpen = false; mSharedTextures.clear(); mHeapsPendingUsage.clear(); + mTempBuffers.clear(); } return {}; }