Add support for YUV 4:4:4 in DXVA2

We get it basically for free now that we let FFmpeg handle the heavy lifting.
This commit is contained in:
Cameron Gutman
2026-01-11 20:55:46 -06:00
parent b8e9262b1b
commit cd13910e6c

View File

@@ -271,14 +271,18 @@ bool DXVA2Renderer::initializeQuirksForAdapter(IDirect3D9Ex* d3d9ex, int adapter
hr = d3d9ex->GetAdapterIdentifier(adapterIndex, 0, &id); hr = d3d9ex->GetAdapterIdentifier(adapterIndex, 0, &id);
if (SUCCEEDED(hr)) { if (SUCCEEDED(hr)) {
if (id.VendorId == 0x8086) { if (id.VendorId == 0x8086 && !(m_VideoFormat & VIDEO_FORMAT_MASK_YUV444)) {
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
"Avoiding IDirectXVideoProcessor API on Intel GPU"); "Avoiding IDirectXVideoProcessor API for YUV 4:2:0 on Intel GPU");
// On Intel GPUs, we can get unwanted video "enhancements" due to post-processing // On Intel GPUs, we can get unwanted video "enhancements" due to post-processing
// effects that the GPU driver forces on us. In many cases, this makes the video // effects that the GPU driver forces on us. In many cases, this makes the video
// actually look worse. We can avoid these by using StretchRect() instead on these // actually look worse. We can avoid these by using StretchRect() instead on these
// platforms. // platforms.
//
// We don't do this for YUV 4:4:4 because Intel GPUs falsely claim to support AYUV
// format conversion with StretchRect() via CheckDeviceFormatConversion() but the
// output has completely incorrect colors. VideoProcessBlt() works fine though.
m_DeviceQuirks |= DXVA2_QUIRK_NO_VP; m_DeviceQuirks |= DXVA2_QUIRK_NO_VP;
} }
else if (id.VendorId == 0x4d4f4351) { // QCOM in ASCII else if (id.VendorId == 0x4d4f4351) { // QCOM in ASCII
@@ -572,11 +576,6 @@ bool DXVA2Renderer::initialize(PDECODER_PARAMETERS params)
// the HDR colorspace and HDR display metadata required to enable HDR mode properly. // the HDR colorspace and HDR display metadata required to enable HDR mode properly.
return false; return false;
} }
else if (params->videoFormat & VIDEO_FORMAT_MASK_YUV444) {
// It's theoretically possible to use YUV444 with D3D9, but probably not worth actually
// implementing because any YUV444-capable hardware supports D3D11 or Vulkan.
return false;
}
#ifndef Q_PROCESSOR_X86 #ifndef Q_PROCESSOR_X86
else if (qgetenv("DXVA2_ENABLED") != "1" && m_DecoderSelectionPass == 0) { else if (qgetenv("DXVA2_ENABLED") != "1" && m_DecoderSelectionPass == 0) {
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,