From 4ccde3c0498c48b3b1e3bdc44079ee5545caf3b0 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 25 Jul 2017 22:34:29 -0700 Subject: [PATCH] Silence spurious Advanced Layers warnings in the D3D11 debug layer. (bug 1383326, r=bas) --- gfx/layers/mlgpu/MLGDevice.h | 6 ++++++ gfx/layers/mlgpu/RenderViewMLGPU.cpp | 3 +++ gfx/thebes/DeviceManagerDx.cpp | 11 +++++++++++ 3 files changed, 20 insertions(+) diff --git a/gfx/layers/mlgpu/MLGDevice.h b/gfx/layers/mlgpu/MLGDevice.h index 1228a3d1a2d7..c386d99c9b6e 100644 --- a/gfx/layers/mlgpu/MLGDevice.h +++ b/gfx/layers/mlgpu/MLGDevice.h @@ -424,6 +424,12 @@ public: return mMaxConstantBufferBindSize; } + // Helper function for unbinding textures since SetPSTexture is overloaded. + void UnsetPSTexture(uint32_t aSlot) { + TextureSource* nullTexture = nullptr; + SetPSTexture(aSlot, nullTexture); + } + protected: virtual ~MLGDevice(); diff --git a/gfx/layers/mlgpu/RenderViewMLGPU.cpp b/gfx/layers/mlgpu/RenderViewMLGPU.cpp index 79828f71994a..4afbee541af3 100644 --- a/gfx/layers/mlgpu/RenderViewMLGPU.cpp +++ b/gfx/layers/mlgpu/RenderViewMLGPU.cpp @@ -383,6 +383,9 @@ RenderViewMLGPU::ExecuteRendering() return; } + // Note: we unbind slot 0 (which is where the render target could have been + // bound on a previous frame). Otherwise we trigger D3D11_DEVICE_PSSETSHADERRESOURCES_HAZARD. + mDevice->UnsetPSTexture(0); mDevice->SetRenderTarget(mTarget); mDevice->SetViewport(IntRect(IntPoint(0, 0), mTarget->GetSize())); mDevice->SetScissorRect(Some(mInvalidBounds)); diff --git a/gfx/thebes/DeviceManagerDx.cpp b/gfx/thebes/DeviceManagerDx.cpp index 2c2d033f6122..cc1dc02a7d98 100644 --- a/gfx/thebes/DeviceManagerDx.cpp +++ b/gfx/thebes/DeviceManagerDx.cpp @@ -438,6 +438,17 @@ DeviceManagerDx::CreateDevice(IDXGIAdapter* aAdapter, if (!SUCCEEDED(debug->QueryInterface(__uuidof(ID3D11InfoQueue), getter_AddRefs(infoQueue)))) break; + D3D11_INFO_QUEUE_FILTER filter; + PodZero(&filter); + + // Disable warnings caused by Advanced Layers that are known and not problematic. + D3D11_MESSAGE_ID blockIDs[] = { + D3D11_MESSAGE_ID_DEVICE_DRAW_CONSTANT_BUFFER_TOO_SMALL + }; + filter.DenyList.NumIDs = MOZ_ARRAY_LENGTH(blockIDs); + filter.DenyList.pIDList = blockIDs; + infoQueue->PushStorageFilter(&filter); + infoQueue->SetBreakOnSeverity(D3D11_MESSAGE_SEVERITY_CORRUPTION, true); infoQueue->SetBreakOnSeverity(D3D11_MESSAGE_SEVERITY_ERROR, true); infoQueue->SetBreakOnSeverity(D3D11_MESSAGE_SEVERITY_WARNING, true);