diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:01:59 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:01:59 +0000 |
commit | 85310221f0512bf1aeefc49ead8a1e11bda55990 (patch) | |
tree | 70a3efbfee6c7cbeb626185b35166d2c376b4bb8 /gfx/thebes/DeviceManagerDx.cpp | |
parent | Adding upstream version 126.0. (diff) | |
download | firefox-fe6f455764a13e73a626cf290870c4c30ae1f261.tar.xz firefox-fe6f455764a13e73a626cf290870c4c30ae1f261.zip |
Adding upstream version 126.0.1.upstream/126.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'gfx/thebes/DeviceManagerDx.cpp')
-rw-r--r-- | gfx/thebes/DeviceManagerDx.cpp | 46 |
1 files changed, 22 insertions, 24 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(); } } |