[英]how to write to android hardware buffer in vulkan?
In OpenGL, the texture of which memory is imported by android hardware buffer can be used as sample image and color attachments.在OpenGL中,其中memory的纹理由android硬件缓冲区导入,可以作为样图和颜色附件。 However, when I try to use texture of which memory is imported from android hardware buffer, it seems than it can sampled from the texture successfully.
但是,当我尝试使用从 android 硬件缓冲区导入 memory 的纹理时,似乎可以从纹理中成功采样。 But when writing to the external memory, it does not work as expected.So how to write to android hardware buffer directly in vulkan?
但是写入外部memory时,并没有达到预期效果。那么如何在vulkan中直接写入android硬件缓冲区呢?
I consulted the documentation specification of vulkan.我查阅了vulkan的文档规范。 In the following link, https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#memory-external-handle-types in chapter of 11.2.17, i found the specification said "Vulkan can import Android hardware buffers that have external formats, but since the image contents are in an undiscoverable and possibly proprietary representation, images with external formats must only be used as sampled images, must only be sampled with a sampler that has Y′CBCR conversion enabled, and must have optimal tiling".Is that means that Android hardware buffers that have external formats cannot be used as color attactments to be write?
在以下链接中, https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#memory-external-handle-types在 11.2.17 的章节中,我发现规范说“Vulkan可以导入具有外部格式的 Android 硬件缓冲区,但由于图像内容处于不可发现且可能是专有的表示形式,具有外部格式的图像只能用作采样图像,只能使用启用了 Y'CBCR 转换的采样器进行采样,并且必须具有最佳平铺”。这是否意味着具有外部格式的 Android 硬件缓冲区不能用作要写入的颜色附件?
Based on the specs vulkan consulted, that means that Android hardware buffers with external formats cannot be used as color attachments to write to.根据 vulkan 咨询的规范,这意味着具有外部格式的 Android 硬件缓冲区不能用作要写入的颜色附件。 However, this doesn't mean that those hardware buffers can't be used at all.
然而,这并不意味着那些硬件缓冲区根本不能使用。 Instead, the hardware buffer can be used as the sampled image, and the image must be sampled with a sampler that has Y'CBCR conversion enabled, and must have optimal tiling.
相反,硬件缓冲区可以用作采样图像,并且图像必须使用启用了 Y'CBCR 转换的采样器进行采样,并且必须具有最佳平铺。 So if you want to use that hardware buffer as a color attachment to write to, you'll have to find another way to do it.
因此,如果您想将该硬件缓冲区用作要写入的颜色附件,则必须找到另一种方法来实现。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.