Silence spurious Advanced Layers warnings in the D3D11 debug layer. (bug 1383326, r=bas)

This commit is contained in:
David Anderson 2017-07-25 22:34:29 -07:00
Родитель 93a171958a
Коммит 4ccde3c049
3 изменённых файлов: 20 добавлений и 0 удалений

Просмотреть файл

@ -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();

Просмотреть файл

@ -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));

Просмотреть файл

@ -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);