VK_EXT_metal_objects: alias VkImage to MTLBuffer #2087
-
Hi, I have to interface with a library exporting image data only in MTLBuffer format, device-local. The doc seems to only provide for MTLTexture import into VkImages, being unclear whether this would also work with MTLBuffers. So, is this simply not supported or a bug? And what would my options be to do in-place memory interop MTLBuffer->VkImage. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
I'm not sure what your export-import frequency is, but have you verified that a buffer-to-texture copy actually does slow things down unacceptably? Going the other route, Since they share memory, changes are dynamic. You could establish the connection once, and then if your library changes the contents of the |
Beta Was this translation helpful? Give feedback.
I'm not sure what your export-import frequency is, but have you verified that a buffer-to-texture copy actually does slow things down unacceptably?
Going the other route,
MTLBuffer newTextureWithDescriptor:offset:bytesPerRow:
does not involve a copy. It creates aMTLTexture
as a buffer view, which shares the same memory, and which you could import into aVkImage
in MoltenVK.Since they share memory, changes are dynamic. You could establish the connection once, and then if your library changes the contents of the
MTLBuffer
, it would be reflected immediately in theMTLTexture
(andVkImage
) in MoltenVK.