From 6db3a24c19e7580a0aaee7aff8a52c16489c6abe Mon Sep 17 00:00:00 2001 From: Bryan Bernhart Date: Tue, 22 Sep 2020 16:23:06 +0000 Subject: [PATCH] Revert "Disable debug layer logger" This reverts commit 52a588f3c9ba374630158cc045dfa311ed6a7584. Reason for revert: added a workaround to filter out messages. Original change's description: > Disable debug layer logger > > This logger is producing too much output on Windows and causing > Chromium's gtest harness to kill the tests. > > Tbr=cwallez@chromium.org > No-Try: true > Bug: chromium:1130483 > Change-Id: I1990bc800bbb7eda62901d14f656375c30fbeef2 > Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/28740 > Reviewed-by: Austin Eng > Commit-Queue: Austin Eng TBR=cwallez@chromium.org,enga@chromium.org Bug: chromium:1130483 Change-Id: Ifeee73838a957f619dfdb977f21585fe8abacc3b Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/28760 Reviewed-by: Corentin Wallez Reviewed-by: Austin Eng Commit-Queue: Bryan Bernhart --- src/dawn_native/d3d12/AdapterD3D12.cpp | 6 ++++++ src/tests/DawnTest.cpp | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/src/dawn_native/d3d12/AdapterD3D12.cpp b/src/dawn_native/d3d12/AdapterD3D12.cpp index 364e6c13e8..f271e7612c 100644 --- a/src/dawn_native/d3d12/AdapterD3D12.cpp +++ b/src/dawn_native/d3d12/AdapterD3D12.cpp @@ -169,6 +169,11 @@ namespace dawn_native { namespace d3d12 { ComPtr infoQueue; ASSERT_SUCCESS(mD3d12Device.As(&infoQueue)); + // To avoid flooding the console, a storage-filter is also used to + // prevent messages from getting logged. + DAWN_TRY(CheckHRESULT(infoQueue->PushStorageFilter(&filter), + "ID3D12InfoQueue::PushStorageFilter")); + DAWN_TRY(CheckHRESULT(infoQueue->PushRetrievalFilter(&filter), "ID3D12InfoQueue::PushRetrievalFilter")); @@ -182,6 +187,7 @@ namespace dawn_native { namespace d3d12 { ComPtr infoQueue; ASSERT_SUCCESS(mD3d12Device.As(&infoQueue)); infoQueue->PopRetrievalFilter(); + infoQueue->PopStorageFilter(); } ResultOrError Adapter::CreateDeviceImpl(const DeviceDescriptor* descriptor) { diff --git a/src/tests/DawnTest.cpp b/src/tests/DawnTest.cpp index 4b9ad15c21..5873da83d2 100644 --- a/src/tests/DawnTest.cpp +++ b/src/tests/DawnTest.cpp @@ -187,6 +187,11 @@ void DawnTestEnvironment::SetEnvironment(DawnTestEnvironment* env) { DawnTestEnvironment::DawnTestEnvironment(int argc, char** argv) { ParseArgs(argc, argv); + if (mEnableBackendValidation) { + mPlatformDebugLogger = + std::unique_ptr(utils::CreatePlatformDebugLogger()); + } + // Create a temporary instance to select available and preferred adapters. This is done before // test instantiation so GetAvailableAdapterTestParamsForBackends can generate test // parameterizations all selected adapters. We drop the instance at the end of this function