Skip to content

Commit

Permalink
api: Update VPL headers for DX12 surface sharing (#6404)
Browse files Browse the repository at this point in the history
Co-authored-by: Liu, Rachel <[email protected]>
  • Loading branch information
mgonchar and rachel-liu1024 authored Jan 15, 2024
1 parent 3369891 commit 695d562
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
26 changes: 26 additions & 0 deletions api/vpl/mfxmemory.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,32 @@ typedef struct {
} mfxSurfaceOpenCLImg2D;
MFX_PACK_END()

MFX_PACK_BEGIN_STRUCT_W_PTR()
/*!
Optional extension buffer, which can be attached to mfxSurfaceHeader::ExtParam
(second parameter of mfxFrameSurfaceInterface::Export) in order to pass D3D12 parameters
during mfxFrameSurface1 exporting to D3D12 resource.
If buffer is not provided all resources will be created by oneAPI Video Processing Library (oneVPL) RT internally.
*/
typedef struct {
mfxExtBuffer Header; /*!< Extension buffer header. Header.BufferId must be equal to MFX_EXTBUFF_EXPORT_SHARING_DESC_D3D12. */

mfxHDL d3d12Device; /*!< Pointer to D3D12 Device, type ID3D12Device */

mfxHDL reserved[9];
} mfxExtSurfaceD3D12Tex2DExportDescription;
MFX_PACK_END()

MFX_PACK_BEGIN_STRUCT_W_PTR()
typedef struct {
mfxSurfaceInterface SurfaceInterface;

mfxHDL texture2D; /*!< Pointer to D3D12 resource, type ID3D12Resource */

mfxHDL reserved[7];
} mfxSurfaceD3D12Tex2D;
MFX_PACK_END()

/*! The mfxSurfaceComponent enumerator specifies the internal surface pool to use when importing surfaces. */
typedef enum {
MFX_SURFACE_COMPONENT_UNKNOWN = 0, /*!< Unknown surface component. */
Expand Down
5 changes: 5 additions & 0 deletions api/vpl/mfxstructures.h
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,7 @@ typedef enum {
MFX_SURFACE_TYPE_D3D11_TEX2D = 2, /*!< D3D11 surface of type ID3D11Texture2D. */
MFX_SURFACE_TYPE_VAAPI = 3, /*!< VA-API surface. */
MFX_SURFACE_TYPE_OPENCL_IMG2D = 4, /*!< OpenCL 2D image (cl_mem). */
MFX_SURFACE_TYPE_D3D12_TEX2D = 5, /*!< D3D12 surface of type ID3D12Resource with 2D texture type. */
} mfxSurfaceType;

/*! This enumerator specifies the sharing modes which are allowed for importing or exporting shared surfaces. */
Expand Down Expand Up @@ -2376,6 +2377,10 @@ enum {
See the mfxExtSurfaceOpenCLImg2DExportDescription structure for more details.
*/
MFX_EXTBUFF_EXPORT_SHARING_DESC_OCL = MFX_MAKEFOURCC('E', 'O', 'C', 'L'),
/*!
See the mfxExtSurfaceD3D12Tex2DExportDescription structure for more details.
*/
MFX_EXTBUFF_EXPORT_SHARING_DESC_D3D12 = MFX_MAKEFOURCC('E', 'D', '1', '2'),
#endif
};

Expand Down

0 comments on commit 695d562

Please sign in to comment.