Permalink
Browse files

Dual source blend: Remove bad #ifdef that killed dual src code on And…

…roid... oops. Re-enable on nVidia Shield TV/Tablet. Fixes #10136 properly.
  • Loading branch information...
hrydgard committed Dec 29, 2017
1 parent 2498ce5 commit 2dda2bfa78d28e24f1a371d7e940a1301a0b655a
Showing with 2 additions and 15 deletions.
  1. +0 −2 GPU/Common/GPUStateUtils.cpp
  2. +0 −7 GPU/GLES/GPU_GLES.cpp
  3. +2 −6 GPU/Vulkan/GPU_Vulkan.cpp
@@ -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
@@ -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
}
}
@@ -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;

1 comment on commit 2dda2bf

@unknownbrackets

This comment has been minimized.

Show comment
Hide comment
@unknownbrackets

unknownbrackets Dec 30, 2017

Collaborator

Bah, good catch.

-[Unknown]

Collaborator

unknownbrackets commented on 2dda2bf Dec 30, 2017

Bah, good catch.

-[Unknown]

Please sign in to comment.