@@ -27,14 +27,22 @@ extern "C" {
27
27
typedef void CAMetalLayer ;
28
28
#endif
29
29
30
+ #define SDL_UNSAFE_UNRETAINED
31
+ #if defined(__OBJC__) && defined(__has_feature)
32
+ #if __has_feature(objc_arc)
33
+ #undef SDL_UNSAFE_UNRETAINED
34
+ #define SDL_UNSAFE_UNRETAINED __unsafe_unretained
35
+ #endif
36
+ #endif
37
+
30
38
#define VK_EXT_METAL_SURFACE_SPEC_VERSION 1
31
39
#define VK_EXT_METAL_SURFACE_EXTENSION_NAME " VK_EXT_metal_surface"
32
40
typedef VkFlags VkMetalSurfaceCreateFlagsEXT;
33
41
typedef struct VkMetalSurfaceCreateInfoEXT {
34
42
VkStructureType sType ;
35
43
const void * pNext;
36
44
VkMetalSurfaceCreateFlagsEXT flags;
37
- const CAMetalLayer * pLayer;
45
+ const CAMetalLayer SDL_UNSAFE_UNRETAINED * pLayer;
38
46
} VkMetalSurfaceCreateInfoEXT;
39
47
40
48
typedef VkResult (VKAPI_PTR *PFN_vkCreateMetalSurfaceEXT)(VkInstance instance, const VkMetalSurfaceCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
@@ -113,27 +121,27 @@ typedef struct VkExportMetalObjectsInfoEXT {
113
121
typedef struct VkExportMetalDeviceInfoEXT {
114
122
VkStructureType sType ;
115
123
const void * pNext;
116
- MTLDevice_id mtlDevice;
124
+ MTLDevice_id SDL_UNSAFE_UNRETAINED mtlDevice;
117
125
} VkExportMetalDeviceInfoEXT;
118
126
119
127
typedef struct VkExportMetalCommandQueueInfoEXT {
120
128
VkStructureType sType ;
121
129
const void * pNext;
122
130
VkQueue queue;
123
- MTLCommandQueue_id mtlCommandQueue;
131
+ MTLCommandQueue_id SDL_UNSAFE_UNRETAINED mtlCommandQueue;
124
132
} VkExportMetalCommandQueueInfoEXT;
125
133
126
134
typedef struct VkExportMetalBufferInfoEXT {
127
135
VkStructureType sType ;
128
136
const void * pNext;
129
137
VkDeviceMemory memory;
130
- MTLBuffer_id mtlBuffer;
138
+ MTLBuffer_id SDL_UNSAFE_UNRETAINED mtlBuffer;
131
139
} VkExportMetalBufferInfoEXT;
132
140
133
141
typedef struct VkImportMetalBufferInfoEXT {
134
142
VkStructureType sType ;
135
143
const void * pNext;
136
- MTLBuffer_id mtlBuffer;
144
+ MTLBuffer_id SDL_UNSAFE_UNRETAINED mtlBuffer;
137
145
} VkImportMetalBufferInfoEXT;
138
146
139
147
typedef struct VkExportMetalTextureInfoEXT {
@@ -143,14 +151,14 @@ typedef struct VkExportMetalTextureInfoEXT {
143
151
VkImageView imageView;
144
152
VkBufferView bufferView;
145
153
VkImageAspectFlagBits plane;
146
- MTLTexture_id mtlTexture;
154
+ MTLTexture_id SDL_UNSAFE_UNRETAINED mtlTexture;
147
155
} VkExportMetalTextureInfoEXT;
148
156
149
157
typedef struct VkImportMetalTextureInfoEXT {
150
158
VkStructureType sType ;
151
159
const void * pNext;
152
160
VkImageAspectFlagBits plane;
153
- MTLTexture_id mtlTexture;
161
+ MTLTexture_id SDL_UNSAFE_UNRETAINED mtlTexture;
154
162
} VkImportMetalTextureInfoEXT;
155
163
156
164
typedef struct VkExportMetalIOSurfaceInfoEXT {
@@ -171,13 +179,13 @@ typedef struct VkExportMetalSharedEventInfoEXT {
171
179
const void * pNext;
172
180
VkSemaphore semaphore;
173
181
VkEvent event;
174
- MTLSharedEvent_id mtlSharedEvent;
182
+ MTLSharedEvent_id SDL_UNSAFE_UNRETAINED mtlSharedEvent;
175
183
} VkExportMetalSharedEventInfoEXT;
176
184
177
185
typedef struct VkImportMetalSharedEventInfoEXT {
178
186
VkStructureType sType ;
179
187
const void * pNext;
180
- MTLSharedEvent_id mtlSharedEvent;
188
+ MTLSharedEvent_id SDL_UNSAFE_UNRETAINED mtlSharedEvent;
181
189
} VkImportMetalSharedEventInfoEXT;
182
190
183
191
typedef void (VKAPI_PTR *PFN_vkExportMetalObjectsEXT)(VkDevice device, VkExportMetalObjectsInfoEXT* pMetalObjectsInfo);
0 commit comments