From 088c0cefd0f8b5482cc227955cc3057d47ec24b6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 30 May 2024 05:02:01 +0200 Subject: Merging upstream version 126.0.1. Signed-off-by: Daniel Baumann --- gfx/thebes/DeviceManagerDx.cpp | 46 ++++++++++++++++++++---------------------- gfx/thebes/DeviceManagerDx.h | 1 - 2 files changed, 22 insertions(+), 25 deletions(-) (limited to 'gfx') 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 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 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 multi; + mDecoderDevice->QueryInterface(__uuidof(ID3D10Multithread), + getter_AddRefs(multi)); + if (multi) { + MOZ_ASSERT(multi->GetMultithreadProtected()); } + } - if (mDecoderDevice) { - RefPtr dev = mDecoderDevice; - return dev.forget(); - } + if (mDecoderDevice) { + RefPtr 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; RefPtr GetCompositorDevice(); -- cgit v1.2.3