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

External Texture implementation for Vulkan #8488

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rafadevai
Copy link
Contributor

Add support for the new createTextureExternalImage2R API instead of createTextureExternalImageR.

Add the support to import AHardwareBuffer objects
into Vulkan in Android.

@poweifeng poweifeng self-requested a review March 4, 2025 22:25
}
}

TextureUsage mapToFilamentUsage(unsigned int usage, TextureFormat format) noexcept {
Copy link
Contributor

Choose a reason for hiding this comment

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

Are you going to wait for the consolidation of these methods for GL/Vulkan?

Copy link
Contributor

Choose a reason for hiding this comment

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

see #8491

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes


return format;
}

void getVKFormatAndUsage(const AHardwareBuffer_Desc& desc, VkFormat& format,
Copy link
Contributor

Choose a reason for hiding this comment

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

now that we're passing in a non-reference param at the end, maybe it's a good time to refactor. Would you mind having this return a std::pair<VkFormat, VkImageUsageFlags>?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@rafadevai rafadevai force-pushed the vulkan_external_image2 branch from 579983c to 3b6fe6a Compare March 5, 2025 18:54
Add support for the new createTextureExternalImage2R
API instead of createTextureExternalImageR.

Add the support to import AHardwareBuffer objects
into Vulkan in Android.
@rafadevai rafadevai force-pushed the vulkan_external_image2 branch from 3b6fe6a to a1c30c8 Compare March 5, 2025 22:53
Copy link
Contributor

@poweifeng poweifeng left a comment

Choose a reason for hiding this comment

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

lgtm in general. Just need to rebase on top of the utils function on main.

Alway have two lingering questions.

Thanks!


#include <android/hardware_buffer.h>

namespace filament::backend::fvkandroid {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: why do we need another namespace at all?

Is it to avoid createExternalImage conflicting?

And why is createExternalImage UTILS_PUBLIC ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants