diff --git a/gfx/thebes/DeviceManagerDx.cpp b/gfx/thebes/DeviceManagerDx.cpp index e3e9eedd4780..18c5cea7db7c 100644 --- a/gfx/thebes/DeviceManagerDx.cpp +++ b/gfx/thebes/DeviceManagerDx.cpp @@ -740,6 +740,13 @@ void DeviceManagerDx::CreateCompositorDevice(FeatureState& d3d11) { D3D11Checks::WarnOnAdapterMismatch(device); } + RefPtr multi; + HRESULT hr = device->QueryInterface(__uuidof(ID3D10Multithread), + getter_AddRefs(multi)); + if (SUCCEEDED(hr) && multi) { + multi->SetMultithreadProtected(TRUE); + } + uint32_t featureLevel = device->GetFeatureLevel(); auto formatOptions = D3D11Checks::FormatOptions(device); mCompositorDevice = device; @@ -832,6 +839,13 @@ void DeviceManagerDx::CreateWARPCompositorDevice() { bool textureSharingWorks = D3D11Checks::DoesTextureSharingWork(device); + RefPtr multi; + hr = device->QueryInterface(__uuidof(ID3D10Multithread), + getter_AddRefs(multi)); + if (SUCCEEDED(hr) && multi) { + multi->SetMultithreadProtected(TRUE); + } + DXGI_ADAPTER_DESC desc; D3D11Checks::GetDxgiDesc(device, &desc); @@ -934,7 +948,7 @@ RefPtr DeviceManagerDx::CreateDecoderDevice( mDecoderDevice->QueryInterface(__uuidof(ID3D10Multithread), getter_AddRefs(multi)); if (multi) { - multi->SetMultithreadProtected(TRUE); + MOZ_ASSERT(multi->GetMultithreadProtected()); } } @@ -1221,8 +1235,9 @@ RefPtr DeviceManagerDx::GetImageDevice() { if (FAILED(hr) || !multi) { gfxWarning() << "Multithread safety interface not supported. " << hr; return nullptr; + } else { + MOZ_ASSERT(multi->GetMultithreadProtected()); } - multi->SetMultithreadProtected(TRUE); mImageDevice = device;