Dual source blend: Remove bad #ifdef that killed dual src code on Android... oops. Re-enable on nVidia Shield TV/Tablet. Fixes #10136 properly.

This commit is contained in:
Henrik Rydgård 2017-12-30 00:09:06 +01:00
parent 2498ce5e3e
commit 2dda2bfa78
3 changed files with 2 additions and 15 deletions

View File

@ -784,12 +784,10 @@ static const BlendEq eqLookup[] = {
static BlendFactor toDualSource(BlendFactor blendfunc) {
switch (blendfunc) {
#if !defined(USING_GLES2) // TODO: Remove when we have better headers
case BlendFactor::SRC_ALPHA:
return BlendFactor::SRC1_ALPHA;
case BlendFactor::ONE_MINUS_SRC_ALPHA:
return BlendFactor::ONE_MINUS_SRC1_ALPHA;
#endif
default:
return blendfunc;
}

View File

@ -245,14 +245,7 @@ void GPU_GLES::CheckGPUFeatures() {
features |= GPU_SUPPORTS_DUALSOURCE_BLEND;
}
} else {
#ifdef __ANDROID__
// This appears to be broken on nVidia Shield TV.
if (gl_extensions.gpuVendor != GPU_VENDOR_NVIDIA) {
features |= GPU_SUPPORTS_DUALSOURCE_BLEND;
}
#else
features |= GPU_SUPPORTS_DUALSOURCE_BLEND;
#endif
}
}

View File

@ -214,12 +214,8 @@ void GPU_Vulkan::CheckGPUFeatures() {
}
if (vulkan_->GetFeaturesEnabled().dualSrcBlend) {
switch (vulkan_->GetPhysicalDeviceProperties().vendorID) {
case VULKAN_VENDOR_NVIDIA:
// Workaround for Shield TV and Shield Tablet driver bug.
if (strcmp(vulkan_->GetPhysicalDeviceProperties().deviceName, "NVIDIA Tegra X1") != 0 &&
strcmp(vulkan_->GetPhysicalDeviceProperties().deviceName, "NVIDIA Tegra K1") != 0)
features |= GPU_SUPPORTS_DUALSOURCE_BLEND;
break;
// We thought we had a bug here on nVidia but turns out we accidentally #ifdef-ed out crucial
// code on Android.
case VULKAN_VENDOR_INTEL:
// Workaround for Intel driver bug.
break;