From d0c1be0db6ac3fa07048762f15eb99e9114982b7 Mon Sep 17 00:00:00 2001 From: pghafari Date: Mon, 28 Jun 2021 23:53:49 -0400 Subject: [PATCH] SWDEV-245531 - GLInterop: Add Buffer Interop api Change-Id: Iddb0bb2a232e97d9071320244adc360bd7d011b5 --- include/hip/hip_runtime_api.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/include/hip/hip_runtime_api.h b/include/hip/hip_runtime_api.h index 30f12bc329..22b2086f15 100644 --- a/include/hip/hip_runtime_api.h +++ b/include/hip/hip_runtime_api.h @@ -4335,7 +4335,41 @@ static inline hipError_t hipUnbindTexture( { return hipUnbindTexture(&tex); } + + #endif // __cplusplus + +/** + *------------------------------------------------------------------------------------------------- + *------------------------------------------------------------------------------------------------- + * @defgroup GL Interop + * @{ + * This section describes Stream Memory Wait and Write functions of HIP runtime API. + */ +typedef unsigned int GLuint; + +// Queries devices associated with GL Context. +hipError_t hipGLGetDevices(unsigned int* pHipDeviceCount, int* pHipDevices, + unsigned int hipDeviceCount, hipGLDeviceList deviceList); +// Registers a GL Buffer for interop and returns corresponding graphics resource. +hipError_t hipGraphicsGLRegisterBuffer(hipGraphicsResource** resource, GLuint buffer, + unsigned int flags); +// Maps a graphics resource for hip access. +hipError_t hipGraphicsMapResources(int count, hipGraphicsResource_t* resources, + hipStream_t stream __dparm(0) ); +// Gets device accessible address of a graphics resource. +hipError_t hipGraphicsResourceGetMappedPointer(void** devPtr, size_t* size, + hipGraphicsResource_t resource); +// Unmaps a graphics resource for hip access. +hipError_t hipGraphicsUnmapResources(int count, hipGraphicsResource_t* resources, + hipStream_t stream __dparm(0)); +// Unregisters a graphics resource. +hipError_t hipGraphicsUnregisterResource(hipGraphicsResource_t resource); +// doxygen end GL Interop +/** + * @} + */ + #ifdef __GNUC__ #pragma GCC visibility pop #endif