如何将深度图像复制为彩色图像?

Art*_*iro 5 c++ vulkan

我尝试将深度图像传输为较小的图像(目标是模糊图像)。

问题是,当我执行vkCmdBlitImagewith时VK_FILTER_LINEAR,我收到以下消息:If the format of srcImage is a depth, stencil, or depth stencil then filter must be VK_FILTER_NEAREST。我想我首先需要将深度图像复制到彩色图像。

我尝试了vkCmdBlitImage,VK_FILTER_NEAREST但出现了这个错误:If one of srcImage and dstImage images has a format of depth, stencil or depth stencil, the other one must have exactly the same format。

我有同样的问题vkCmdCopyImage。

我的问题是:我可以将深度图像复制到彩色图像而不创建管道吗?

Nic*_*las 4

您不能直接将深度数据复制到彩色图像中。您可以通过 将深度数据复制到缓冲区vkCmdCopyImageToBuffer,然后使用 将数据复制到图像中vkCmdCopyBufferToImage。