Skip to content

Commit

Permalink
igl | vulkan | Disable dualSrcBlend on Android. (#169)
Browse files Browse the repository at this point in the history
Summary:
Reference from : gpuweb/gpuweb#4283

The dualSrcBlend feature is available on 72.6% of devices. This feature is overwhelmingly supported on Windows, Linux, MacOS and iOS devices, however, only 49.5% of Android devices have support. Android devices that do not support dualSrcBlend primarily use ARM, ImgTec, and Qualcomm GPUs.https://vulkan.gpuinfo.org/listdevicescoverage.php?feature=dualSrcBlend&platform=android&option=not

Pull Request resolved: #169

Reviewed By: rokuz, mmaurer

Differential Revision: D61858037

Pulled By: corporateshark

fbshipit-source-id: 94d626c20d013e6ef582ff03ac7340c88807ebd2
  • Loading branch information
vinsentli authored and facebook-github-bot committed Aug 27, 2024
1 parent f6c01dc commit fdc586d
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion shell/android/jni/TinyRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,23 @@ void TinyRenderer::init(AAssetManager* mgr,
IGL_ASSERT(result.isOk());
width_ = static_cast<uint32_t>(ANativeWindow_getWidth(nativeWindow));
height_ = static_cast<uint32_t>(ANativeWindow_getHeight(nativeWindow));

// https://github.com/gpuweb/gpuweb/issues/4283
// Only 49.5% of Android devices support dualSrcBlend.
// Android devices that do not support dualSrcBlend primarily use ARM, ImgTec, and Qualcomm
// GPUs.
// https://vulkan.gpuinfo.org/listdevicescoverage.php?feature=dualSrcBlend&platform=android&option=not
igl::vulkan::VulkanFeatures vulkanFeatures(VK_API_VERSION_1_1, config);
vulkanFeatures.enableDefaultFeatures1_1();
vulkanFeatures.VkPhysicalDeviceFeatures2_.features.dualSrcBlend = VK_FALSE;

d = vulkan::HWDevice::create(std::move(ctx),
devices[0],
width_, // width
height_, // height,,
0,
nullptr,
nullptr,
&vulkanFeatures,
&result);
break;
}
Expand Down

0 comments on commit fdc586d

Please sign in to comment.