Work around poor video scaling quality on Qualcomm GPUs

This commit is contained in:
Cameron Gutman 2020-12-21 20:48:28 -06:00
parent 1197b17509
commit 3defccb6e2

View File

@ -382,7 +382,8 @@ bool DXVA2Renderer::isDXVideoProcessorAPIBlacklisted()
D3DADAPTER_IDENTIFIER9 id;
hr = d3d9->GetAdapterIdentifier(caps.AdapterOrdinal, 0, &id);
if (SUCCEEDED(hr) && id.VendorId == 0x8086) {
if (SUCCEEDED(hr)) {
if (id.VendorId == 0x8086) {
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
"Avoiding IDirectXVideoProcessor API on Intel GPU");
@ -392,6 +393,18 @@ bool DXVA2Renderer::isDXVideoProcessorAPIBlacklisted()
// platforms.
result = true;
}
else if (id.VendorId == 0x4d4f4351) { // QCOM in ASCII
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
"Avoiding IDirectXVideoProcessor API on Qualcomm GPU");
// On Qualcomm GPUs (all D3D9on12 GPUs?), the scaling quality of VideoProcessBlt()
// is absolutely horrible. StretchRect() is much much better.
result = true;
}
else {
result = false;
}
}
else {
result = false;
}
@ -971,7 +984,7 @@ Exit:
int DXVA2Renderer::getDecoderColorspace()
{
if (isDXVideoProcessorAPIBlacklisted()) {
// StretchRect() assumes Rec 601 on Intel GPUs
// StretchRect() assumes Rec 601 on Intel and Qualcomm GPUs.
return COLORSPACE_REC_601;
}
else {