简体   繁体   English

如何在vulkan中写入android硬件缓冲区?

[英]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.

相关问题 VK_FORMAT_UNDEFINED 用于 Vulkan 上具有深度格式的 Android 硬件缓冲区 - VK_FORMAT_UNDEFINED for Android hardware buffer with depth format on Vulkan 使用 Vulkan 从 Android Camera2 硬件缓冲区进行采样 - 图像格式问题 - Using Vulkan to sample from Android Camera2 hardware buffer - Issue with image formats android:如何将数据写入媒体播放器缓冲区? - android: how to write data to media player buffer? 如何将浮点缓冲区写入 wav 文件 android? - How to write float buffer to wav file android? 如何将Android MediaCodec Surface连接到Vulkan - How to connect Android MediaCodec Surface to Vulkan 如何将 Vulkan 与 Android Java Activity 交互 - how to interact Vulkan with Android Java Activity Android如何将int值写入缓冲区并使用计时器从缓冲区中获取值? - Android how to write int values to a buffer and take values from the buffer using a timer? 如何编写代码以使用XAMARIN中的USB电缆将硬件设备连接到Android移动设备 - How to write code to connect a hardware device to Android mobile using USB cable in XAMARIN 如何伪造Android硬件设备? - How to fake a Android hardware device? 如何收听android硬件事件 - how to listen for android hardware events
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM