Skip to content

Commit 0987328

Browse files
committed
Only use separate D3D11 devices on Intel and Nvidia
Preserve the texture array binding path on AMD FL11.1+, since it seems to work fine on Polaris with shared devices. Fixes #2003
1 parent 54f8fed commit 0987328

1 file changed

Lines changed: 16 additions & 20 deletions

File tree

app/streaming/video/ffmpeg-renderers/d3d11va.cpp

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -371,20 +371,17 @@ bool D3D11VARenderer::createDeviceByAdapterIndex(int adapterIndex, bool* adapter
371371
separateDevices = SUCCEEDED(hr) && d3d11Options.ExtendedResourceSharing && m_FenceType != SupportedFenceType::None;
372372

373373
if (separateDevices) {
374-
// The Radon HD 5570 GPU drivers deadlock when decoding into shared texture arrays, so let's
375-
// limit usage of separate devices to FL 11.1+ GPUs to try to exclude old GPU drivers. We'll
376-
// exempt Intel GPUs because those have been confirmed to work properly (and the extra fence
377-
// that this device separation uses acts as a workaround for a bug in their old drivers where
378-
// they don't properly synchronize between decoder output usage and SRV usage).
379-
if (featureLevel < D3D_FEATURE_LEVEL_11_1 && adapterDesc.VendorId != 0x8086) {
380-
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
381-
"Avoiding texture sharing for old pre-FL11.1 GPU");
382-
separateDevices = false;
383-
}
384-
else if (adapterDesc.VendorId == 0x1ED5 || // Moore Threads (texture is all zero/green)
385-
adapterDesc.VendorId == 0x4D4F4351) { // Qualcomm (decoding is unstable/slow on QC710)
386-
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
387-
"Avoiding texture sharing on known broken GPU vendor");
374+
// This texture array sharing codepath is quite prone to driver bugs.
375+
//
376+
// Broken GPU vendors/cards/drivers include:
377+
// - Moore Threads (texture is all zero/green)
378+
// - Qualcomm (decoding is unstable/slow on QC710)
379+
// - AMD (Polaris cards display corrupt output - see #2003,
380+
// HD 5570 drivers deadlock with shared texture arrays)
381+
//
382+
// Due to all these issues, we will only use this path for Intel and NVIDIA where we know it
383+
// provides tangible benefits (performance for the former and VRR support for the latter).
384+
if (adapterDesc.VendorId != 0x8086 && adapterDesc.VendorId != 0x10DE && adapterDesc.VendorId != 'ADVN') {
388385
separateDevices = false;
389386
}
390387
}
@@ -406,12 +403,11 @@ bool D3D11VARenderer::createDeviceByAdapterIndex(int adapterIndex, bool* adapter
406403
// significant performance impact of the extra copy. See:
407404
// https://github.com/moonlight-stream/moonlight-qt/issues/1304
408405
//
409-
// Also bind SRVs when using separate decoding and rendering
410-
// devices as this improves render times by about 2x on my
411-
// Ryzen 3300U system. The fences we use between decoding
412-
// and rendering contexts should hopefully avoid any of the
413-
// synchronization issues we've seen between decoder and SRVs.
414-
m_BindDecoderOutputTextures = adapterDesc.VendorId == 0x8086 || separateDevices;
406+
// Also bind SRVs as this improves render times by about 2x on
407+
// my Ryzen 3300U system.
408+
m_BindDecoderOutputTextures = adapterDesc.VendorId == 0x8086 ||
409+
(adapterDesc.VendorId == 0x1002 && featureLevel >= D3D_FEATURE_LEVEL_11_1) ||
410+
separateDevices;
415411
}
416412

417413
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,

0 commit comments

Comments
 (0)