Skip to content

igl | vulkan | Disable dualSrcBlend on Android. - #169

Closed
vinsentli wants to merge 2 commits into
meta:mainfrom
vinsentli:android_dualSrcBlend
Closed

vinsentli wants to merge 2 commits into
meta:mainfrom
vinsentli:android_dualSrcBlend

Conversation

@vinsentli

Copy link
Copy Markdown
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
Comment thread src/igl/vulkan/VulkanFeatures.cpp Outdated

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

Copy link
Copy Markdown

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: https://github.com/facebook/igl/blob/8c591a7aeacb48e93b2f04840aec9d4924e94747/src/igl/vulkan/RenderPipelineState.cpp#L250

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
Copy Markdown
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

rokuz commented Aug 27, 2024

Copy link
Copy Markdown

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

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

rokuz commented Aug 27, 2024

Copy link
Copy Markdown

LGTM

@facebook-github-bot

Copy link
Copy Markdown
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
Copy Markdown
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.

4 participants