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

VkMat可以提取单通道数据吗?为什么Mat提供了channel()函数用于提取单通道,而VkMat没有呢? #5511

Closed
Gao-JF opened this issue Jun 13, 2024 · 2 comments

Comments

@Gao-JF
Copy link

Gao-JF commented Jun 13, 2024

detail | 详细描述 | 詳細な説明

我想把RGB的VkMat转为只有R通道的VkMat。

但我发现VkMat没有类似Mat的channel(int c)函数用于提取单通道,那么VkMat如何提取单通道呢?还是说是因为VkMat无法提取单通道才没有channel函数呢?

请求路过的大佬帮忙解答一下(鞠躬)

@nihui
Copy link
Member

nihui commented Jun 21, 2024

因为 vulkan buffer 在资源绑定时有对齐限制...
直接在 shader 代码里提取单通道即可

@Gao-JF
Copy link
Author

Gao-JF commented Jun 24, 2024

因为 vulkan buffer 在资源绑定时有对齐限制... 直接在 shader 代码里提取单通道即可

哦哦明白🫡,谢谢nihui大佬!

@Gao-JF Gao-JF closed this as completed Jun 26, 2024
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

No branches or pull requests

2 participants