d3d11: fix and enable viewport end2end tests

Bug: dawn:1705
Change-Id: Ie75f301465b5000c9ebdd58ab0cb1901d251730e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/128862
Commit-Queue: Peng Huang <penghuang@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
This commit is contained in:
Peng Huang 2023-04-28 19:01:18 +00:00 committed by Dawn LUCI CQ
parent 0621416bf4
commit 85d98a91f7
2 changed files with 40 additions and 0 deletions

View File

@ -25,6 +25,41 @@
#include "dawn/native/d3d11/PlatformFunctionsD3D11.h"
namespace dawn::native::d3d11 {
namespace {
MaybeError InitializeDebugLayerFilters(ComPtr<ID3D11Device> d3d11Device) {
ComPtr<ID3D11InfoQueue> infoQueue;
DAWN_TRY(CheckHRESULT(d3d11Device.As(&infoQueue),
"D3D11 querying device for ID3D11InfoQueue interface"));
static D3D11_MESSAGE_ID kDenyIds[] = {
// D3D11 Debug layer warns no RTV set, however it is allowed.
D3D11_MESSAGE_ID_DEVICE_DRAW_RENDERTARGETVIEW_NOT_SET,
};
// Filter out info/message and only create errors from warnings or worse.
static D3D11_MESSAGE_SEVERITY kDenySeverities[] = {
D3D11_MESSAGE_SEVERITY_INFO,
D3D11_MESSAGE_SEVERITY_MESSAGE,
};
static D3D11_INFO_QUEUE_FILTER filter = {
{}, // AllowList
{
0, // NumCategories
nullptr, // pCategoryList
std::size(kDenySeverities), // NumSeverities
kDenySeverities, // pSeverityList
std::size(kDenyIds), // NumIDs
kDenyIds, // pIDList
}, // DenyList
};
return CheckHRESULT(infoQueue->PushStorageFilter(&filter),
"D3D11 InfoQueue pushing storage filter");
}
} // namespace
Adapter::Adapter(Backend* backend,
ComPtr<IDXGIAdapter3> hardwareAdapter,
@ -59,6 +94,10 @@ ResultOrError<ComPtr<ID3D11Device>> Adapter::CreateD3D11Device() {
std::size(featureLevels), D3D11_SDK_VERSION, &device,
/*pFeatureLevel=*/nullptr, /*[out] ppImmediateContext=*/nullptr),
"D3D11CreateDevice failed"));
if (GetInstance()->IsBackendValidationEnabled()) {
DAWN_TRY(InitializeDebugLayerFilters(device));
}
}
return device;
}

View File

@ -220,6 +220,7 @@ TEST_P(ViewportTest, EmptyViewport) {
}
DAWN_INSTANTIATE_TEST(ViewportTest,
D3D11Backend(),
D3D12Backend(),
MetalBackend(),
OpenGLBackend(),