diff options
Diffstat (limited to 'gfx/thebes')
-rw-r--r-- | gfx/thebes/DeviceManagerDx.cpp | 46 | ||||
-rw-r--r-- | gfx/thebes/DeviceManagerDx.h | 1 |
2 files changed, 22 insertions, 25 deletions
diff --git a/gfx/thebes/DeviceManagerDx.cpp b/gfx/thebes/DeviceManagerDx.cpp index 7d00e5ac1d..3a531e92ae 100644 --- a/gfx/thebes/DeviceManagerDx.cpp +++ b/gfx/thebes/DeviceManagerDx.cpp @@ -1106,33 +1106,31 @@ RefPtr<ID3D11Device> DeviceManagerDx::CreateDecoderDevice( bool isAMD = mDeviceStatus->adapter().VendorId == 0x1002; bool reuseDevice = false; - if (!aFlags.contains(DeviceFlag::disableDeviceReuse)) { - if (gfxVars::ReuseDecoderDevice()) { - reuseDevice = true; - } else if (isAMD) { - reuseDevice = true; - gfxCriticalNoteOnce << "Always have to reuse decoder device on AMD"; - } + if (gfxVars::ReuseDecoderDevice()) { + reuseDevice = true; + } else if (isAMD) { + reuseDevice = true; + gfxCriticalNoteOnce << "Always have to reuse decoder device on AMD"; + } - if (reuseDevice) { - // Use mCompositorDevice for decoder device only for hardware WebRender. - if (aFlags.contains(DeviceFlag::isHardwareWebRenderInUse) && - mCompositorDevice && mCompositorDeviceSupportsVideo && - !mDecoderDevice) { - mDecoderDevice = mCompositorDevice; - - RefPtr<ID3D10Multithread> multi; - mDecoderDevice->QueryInterface(__uuidof(ID3D10Multithread), - getter_AddRefs(multi)); - if (multi) { - MOZ_ASSERT(multi->GetMultithreadProtected()); - } + if (reuseDevice) { + // Use mCompositorDevice for decoder device only for hardware WebRender. + if (aFlags.contains(DeviceFlag::isHardwareWebRenderInUse) && + mCompositorDevice && mCompositorDeviceSupportsVideo && + !mDecoderDevice) { + mDecoderDevice = mCompositorDevice; + + RefPtr<ID3D10Multithread> multi; + mDecoderDevice->QueryInterface(__uuidof(ID3D10Multithread), + getter_AddRefs(multi)); + if (multi) { + MOZ_ASSERT(multi->GetMultithreadProtected()); } + } - if (mDecoderDevice) { - RefPtr<ID3D11Device> dev = mDecoderDevice; - return dev.forget(); - } + if (mDecoderDevice) { + RefPtr<ID3D11Device> dev = mDecoderDevice; + return dev.forget(); } } diff --git a/gfx/thebes/DeviceManagerDx.h b/gfx/thebes/DeviceManagerDx.h index 1e4182ddec..ee44447d23 100644 --- a/gfx/thebes/DeviceManagerDx.h +++ b/gfx/thebes/DeviceManagerDx.h @@ -61,7 +61,6 @@ class DeviceManagerDx final { enum class DeviceFlag { isHardwareWebRenderInUse, - disableDeviceReuse, }; using DeviceFlagSet = EnumSet<DeviceFlag, uint8_t>; RefPtr<ID3D11Device> GetCompositorDevice(); |