Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

igl | vulkan | Disable dualSrcBlend on Android. #169

Closed
wants to merge 2 commits into from

Conversation

vinsentli
Copy link
Contributor

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

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
@@ -27,7 +27,9 @@ void VulkanFeatures::populateWithAvailablePhysicalDeviceFeatures(

void VulkanFeatures::enableDefaultFeatures1_1() noexcept {
auto& features = VkPhysicalDeviceFeatures2_.features;
#if !IGL_PLATFORM_ANDROID
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, it looks risky, we don't know how many clients may silently rely on it.
We have the usage of this feature in IGL:

return VK_BLEND_FACTOR_SRC1_COLOR;

Please feel free to keep this fix in your fork, unfortunately we can't accept it in this form IMO. Possibly @mmaurer knows how to do a proper fix in the main branch

@vinsentli
Copy link
Contributor Author

Another solution is to specify vulkan::VulkanFeatures when calling vulkan::HWDevice::create().

void TinyRenderer::init() {

    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_, 
                                 height_, 
                                 0,
                                 nullptr,
                                 &vulkanFeatures,
                                 &result);
}

@rokuz
Copy link

rokuz commented Aug 27, 2024

That's much better. TinyRenderer is used only for IGL samples

@vinsentli vinsentli requested a review from rokuz August 27, 2024 11:03
@rokuz
Copy link

rokuz commented Aug 27, 2024

LGTM

@facebook-github-bot
Copy link
Contributor

@corporateshark has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@corporateshark merged this pull request in fdc586d.

@vinsentli vinsentli deleted the android_dualSrcBlend branch August 27, 2024 23:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants