D3D12: Enable GPU-based validation

Enables GBV by default when the backend validation layers are enabled.
This feature is particularly useful for catching mistakes in shaders
that otherwise pass when only using the debug layer.

BUG=dawn:363

Change-Id: I7b730ce8e43069dc3150e7a5857a0977b3147390
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/21701
Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Bryan Bernhart 2020-05-14 17:38:57 +00:00 committed by Commit Bot service account
parent 983211974b
commit 1888ae7857
2 changed files with 5 additions and 1 deletions

View File

@ -33,11 +33,12 @@ namespace dawn_native { namespace d3d12 {
// Enable the debug layer (requires the Graphics Tools "optional feature"). // Enable the debug layer (requires the Graphics Tools "optional feature").
{ {
if (enableBackendValidation) { if (enableBackendValidation) {
ComPtr<ID3D12Debug> debugController; ComPtr<ID3D12Debug1> debugController;
if (SUCCEEDED( if (SUCCEEDED(
functions->d3d12GetDebugInterface(IID_PPV_ARGS(&debugController)))) { functions->d3d12GetDebugInterface(IID_PPV_ARGS(&debugController)))) {
ASSERT(debugController != nullptr); ASSERT(debugController != nullptr);
debugController->EnableDebugLayer(); debugController->EnableDebugLayer();
debugController->SetEnableGPUBasedValidation(true);
// Enable additional debug layers. // Enable additional debug layers.
dxgiFactoryFlags |= DXGI_CREATE_FACTORY_DEBUG; dxgiFactoryFlags |= DXGI_CREATE_FACTORY_DEBUG;

View File

@ -127,6 +127,9 @@ class D3D12ResidencyTests : public DawnTest {
// Check that resources existing on suballocated heaps are made resident and evicted correctly. // Check that resources existing on suballocated heaps are made resident and evicted correctly.
TEST_P(D3D12ResidencyTests, OvercommitSmallResources) { TEST_P(D3D12ResidencyTests, OvercommitSmallResources) {
// TODO(http://crbug.com/dawn/416): Tests fails on Intel HD 630 bot.
DAWN_SKIP_TEST_IF(IsIntel() && IsBackendValidationEnabled());
// Create suballocated buffers to fill half the budget. // Create suballocated buffers to fill half the budget.
std::vector<wgpu::Buffer> bufferSet1 = AllocateBuffers( std::vector<wgpu::Buffer> bufferSet1 = AllocateBuffers(
kSuballocatedResourceSize, ((kRestrictedBudgetSize / 2) / kSuballocatedResourceSize), kSuballocatedResourceSize, ((kRestrictedBudgetSize / 2) / kSuballocatedResourceSize),