Skip to content

Commit 307c53d

Browse files
rachel-liu1024gfxVPLsdm
authored andcommitted
api: Update VPL headers for Vulkan surface sharing
1 parent a0a056c commit 307c53d

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

api/vpl/mfxmemory.h

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,39 @@ typedef struct {
199199
} mfxSurfaceD3D12Tex2D;
200200
MFX_PACK_END()
201201

202+
MFX_PACK_BEGIN_STRUCT_W_PTR()
203+
/*!
204+
Optional extension buffer, which can be attached to mfxSurfaceHeader::ExtParam
205+
(second parameter of mfxFrameSurfaceInterface::Export) in order to pass Vulkan parameters
206+
during mfxFrameSurface1 exporting to Vulkan surface.
207+
If buffer is not provided all resources will be created by oneAPI Video Processing Library (oneVPL) RT internally.
208+
*/
209+
typedef struct {
210+
mfxExtBuffer Header; /*!< Extension buffer header. Header.BufferId must be equal to MFX_EXTBUFF_EXPORT_SHARING_DESC_VULKAN. */
211+
212+
mfxHDL instance; /*!< Pointer to Vulkan instance, type VkInstance */
213+
mfxHDL physicalDevice; /*!< Pointer to Vulkan physical device, type VkPhysicalDevice */
214+
mfxHDL device; /*!< Pointer to Vulkan device, type VkDevice */
215+
216+
mfxHDL reserved[7];
217+
} mfxExtSurfaceVulkanImg2DExportDescription;
218+
MFX_PACK_END()
219+
220+
MFX_PACK_BEGIN_STRUCT_W_PTR()
221+
typedef struct {
222+
mfxSurfaceInterface SurfaceInterface;
223+
224+
mfxHDL instance; /*!< Pointer to Vulkan instance, type VkInstance */
225+
mfxHDL physicalDevice; /*!< Pointer to Vulkan physical device, type VkPhysicalDevice */
226+
mfxHDL device; /*!< Pointer to Vulkan device, type VkDevice */
227+
228+
mfxHDL image2D; /*!< Pointer to Vulkan 2D images, type VkImage */
229+
mfxHDL image2DMemory; /*!< Pointer to Vulkan device memory, VkDeviceMemory*/
230+
231+
mfxHDL reserved[10];
232+
} mfxSurfaceVulkanImg2D;
233+
MFX_PACK_END()
234+
202235
/*! The mfxSurfaceComponent enumerator specifies the internal surface pool to use when importing surfaces. */
203236
typedef enum {
204237
MFX_SURFACE_COMPONENT_UNKNOWN = 0, /*!< Unknown surface component. */

api/vpl/mfxstructures.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,7 @@ typedef enum {
435435
MFX_SURFACE_TYPE_VAAPI = 3, /*!< VA-API surface. */
436436
MFX_SURFACE_TYPE_OPENCL_IMG2D = 4, /*!< OpenCL 2D image (cl_mem). */
437437
MFX_SURFACE_TYPE_D3D12_TEX2D = 5, /*!< D3D12 surface of type ID3D12Resource with 2D texture type. */
438+
MFX_SURFACE_TYPE_VULKAN_IMG2D = 6, /*!< Vulkan 2D image (VkImage). */
438439
} mfxSurfaceType;
439440

440441
/*! This enumerator specifies the sharing modes which are allowed for importing or exporting shared surfaces. */
@@ -2420,6 +2421,10 @@ enum {
24202421
See the mfxExtSurfaceD3D12Tex2DExportDescription structure for more details.
24212422
*/
24222423
MFX_EXTBUFF_EXPORT_SHARING_DESC_D3D12 = MFX_MAKEFOURCC('E', 'D', '1', '2'),
2424+
/*!
2425+
See the mfxExtSurfaceVulkanImg2DExportDescription structure for more details.
2426+
*/
2427+
MFX_EXTBUFF_EXPORT_SHARING_DESC_VULKAN = MFX_MAKEFOURCC('E', 'V', 'U', 'L'),
24232428
#endif
24242429
#ifdef ONEVPL_EXPERIMENTAL
24252430
/*!

0 commit comments

Comments
 (0)