-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposed VK_EXT_metal_objects
extension to expose Metal objects to Vulkan apps
#34
Comments
Hi Everyone…
Based on the discussion on last week’s portability call, I’ve updated the definition <#34> of the VK_EXT_metal_objects extension.
It’s now a Device extension, and VkDevice is now the dispatchable object on the get/set calls.
The type and struct definitions are all now functional.
I’ve built a MoltenVK branch <https://github.com/KhronosGroup/MoltenVK/tree/vk-ext-metal-objects> that supports the extension, and have tested it.
Now that the definition is complete and working, I’m going to move onto the documentation components of the spec for this extension.
I’d appreciate any feedback on the definitions and functionality.
…Bill
… On Nov 18, 2021, at 5:05 PM, Bill Hollings ***@***.***> wrote:
Two calls:
vkGetMetalObjectsEXT() to retrieve one or more metal objects from the associated Vulkan objects (each 1:1).
vkSetMetalObjectsEXT() to set one or more metal objects into the associated Vulkan objects (each 1:1).
Each call makes use of a set of structs chained to the pNext of the VkMetalObjectsInfoEXT, each of which connects one Metal object with a Vulkan object (reading/writing the Metal object from/to the Vulkan object).
Multiple objects can be read/written with each call if multiple pNext structs are included.
#define VK_EXT_metal_objects 1
#define VK_EXT_METAL_OBJECTS_SPEC_VERSION 1
#define VK_EXT_METAL_OBJECTS_EXTENSION_NAME "VK_EXT_metal_objects"
typedef struct VkMetalObjectsInfoEXT {
VkStructureType sType;
const void* pNext;
} VkMetalObjectsInfoEXT;
typedef struct VkMetalDeviceInfoEXT {
VkStructureType sType;
const void* pNext;
id<MTLDevice>* pMTLDevice;
} VkMetalDeviceInfoEXT;
typedef struct VkMetalCommandQueueInfoEXT {
VkStructureType sType;
const void* pNext;
VkQueue queue;
id<MTLCommandQueue>* pMTLCommandQueue;
} VkMetalCommandQueueInfoEXT;
typedef struct VkMetalBufferInfoEXT {
VkStructureType sType;
const void* pNext;
VkBuffer buffer;
id<MTLBuffer>* pMTLBuffer;
} VkMetalBufferInfoEXT;
typedef struct VkMetalTextureInfoEXT {
VkStructureType sType;
const void* pNext;
VkImage image;
VkImageAspectFlags aspectMask;
id<MTLTexture>* pMTLTexture;
} VkMetalTextureInfoEXT;
typedef struct VkMetalIOSurfaceInfoEXT {
VkStructureType sType;
const void* pNext;
VkImage image;
IOSurfaceRef* pIOSurface;
} VkMetalIOSurfaceInfoEXT;
typedef void (VKAPI_PTR *PFN_vkGetMetalObjectsEXT)(VkPhysicalDevice physicalDevice, const VkMetalObjectsInfoEXT* pMetalObjectsInfo);
typedef VkResult (VKAPI_PTR *PFN_vkSetMetalObjectsEXT)(VkPhysicalDevice physicalDevice, const VkMetalObjectsInfoEXT* pMetalObjectsInfo);
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR void VKAPI_CALL vkGetMetalObjectsEXT(
VkPhysicalDevice physicalDevice,
const VkMetalObjectsInfoEXT* pMetalObjectsInfo);
VKAPI_ATTR VkResult VKAPI_CALL vkSetMetalObjectsEXT(
VkPhysicalDevice physicalDevice,
const VkMetalObjectsInfoEXT* pMetalObjectsInfo);
#endif
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub <#34>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AACXAMV45VXR6CKQ2A4YRW3UMV2DHANCNFSM5IKWSWEQ>.
Triage notifications on the go with GitHub Mobile for iOS <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Are the pointers guaranteed to be valid |
Good point. Thanks. I've added
Not sure if this matters, unless there is a use case for retrieving buffer memory underlying the texture? Current use cases focus on retrieving the |
Do we need to extract a |
This has been included now, along with |
This extension has now been implemented: https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_metal_objects.html |
Two calls:
vkGetMetalObjectsEXT()
to retrieve one or more metal objects from the associated Vulkan objects (each 1:1).vkSetMetalObjectsEXT()
to set one or more metal objects into the associated Vulkan objects (each 1:1).Each call makes use of a set of structs chained to the
pNext
of theVkMetalObjectsInfoEXT
, each of which connects one Metal object with a Vulkan object (reading/writing the Metal object from/to the Vulkan object).Multiple objects can be read/written with each call if multiple
pNext
structs are included.The text was updated successfully, but these errors were encountered: