Skip to content

VK_EXT_metal_objects: alias VkImage to MTLBuffer #2087

Answered by billhollings
blapalp asked this question in Q&A
Discussion options

You must be logged in to vote

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 a MTLTexture as a buffer view, which shares the same memory, and which you could import into a VkImage 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 the MTLTexture (and VkImage) in MoltenVK.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@blapalp
Comment options

@billhollings
Comment options

@blapalp
Comment options

Answer selected by blapalp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants