Use decoder texture binding by default when using separate devices

This significantly improves performance on Ryzen 3300U and should generally perform equal or better everywhere.

This decoder->SRV path has been prone to driver bugs, so we may need to adjust this logic if driver issues crop up.
This commit is contained in:
Cameron Gutman
2026-01-19 16:46:50 -06:00
parent b5e7dec378
commit a0a4c1ea83

View File

@@ -364,17 +364,6 @@ bool D3D11VARenderer::createDeviceByAdapterIndex(int adapterIndex, bool* adapter
}
}
if (Utils::getEnvironmentVariableOverride("D3D11VA_FORCE_BIND", &m_BindDecoderOutputTextures)) {
SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION,
"Using D3D11VA_FORCE_BIND to override default bind/copy logic");
}
else {
// Skip copying to our own internal texture on Intel GPUs due to
// significant performance impact of the extra copy. See:
// https://github.com/moonlight-stream/moonlight-qt/issues/1304
m_BindDecoderOutputTextures = adapterDesc.VendorId == 0x8086;
}
bool separateDevices;
if (Utils::getEnvironmentVariableOverride("D3D11VA_FORCE_SEPARATE_DEVICES", &separateDevices)) {
SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION,
@@ -406,6 +395,23 @@ bool D3D11VARenderer::createDeviceByAdapterIndex(int adapterIndex, bool* adapter
separateDevices = false;
}
if (Utils::getEnvironmentVariableOverride("D3D11VA_FORCE_BIND", &m_BindDecoderOutputTextures)) {
SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION,
"Using D3D11VA_FORCE_BIND to override default bind/copy logic");
}
else {
// Skip copying to our own internal texture on Intel GPUs due to
// significant performance impact of the extra copy. See:
// https://github.com/moonlight-stream/moonlight-qt/issues/1304
//
// Also bind SRVs when using separate decoding and rendering
// devices as this improves render times by about 2x on my
// Ryzen 3300U system. The fences we use between decoding
// and rendering contexts should hopefully avoid any of the
// synchronization issues we've seen between decoder and SRVs.
m_BindDecoderOutputTextures = adapterDesc.VendorId == 0x8086 || separateDevices;
}
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
"Decoder texture access: %s (fence: %s)",
m_BindDecoderOutputTextures ? "bind" : "copy",