OpenGL Interoperability#
Collaboration diagram for OpenGL Interoperability:
Functions | |
| hipError_t | hipGLGetDevices (unsigned int *pHipDeviceCount, int *pHipDevices, unsigned int hipDeviceCount, hipGLDeviceList deviceList) |
| Queries devices associated with the current OpenGL context. | |
| hipError_t | hipGraphicsGLRegisterBuffer (hipGraphicsResource **resource, GLuint buffer, unsigned int flags) |
| Registers a GL Buffer for interop and returns corresponding graphics resource. | |
| hipError_t | hipGraphicsGLRegisterImage (hipGraphicsResource **resource, GLuint image, GLenum target, unsigned int flags) |
| Register a GL Image for interop and returns the corresponding graphic resource. | |
Detailed Description
This section describes OpenGL interoperability functions of HIP runtime API.
Function Documentation
◆ hipGLGetDevices()
| hipError_t hipGLGetDevices | ( | unsigned int * | pHipDeviceCount, |
| int * | pHipDevices, | ||
| unsigned int | hipDeviceCount, | ||
| hipGLDeviceList | deviceList | ||
| ) |
Queries devices associated with the current OpenGL context.
- Parameters
-
[out] pHipDeviceCount - Pointer of number of devices on the current GL context. [out] pHipDevices - Pointer of devices on the current OpenGL context. [in] hipDeviceCount - Size of device. [in] deviceList - The setting of devices. It could be either hipGLDeviceListCurrentFrame for the devices used to render the current frame, or hipGLDeviceListAll for all devices. The default setting is Invalid deviceList value.
◆ hipGraphicsGLRegisterBuffer()
| hipError_t hipGraphicsGLRegisterBuffer | ( | hipGraphicsResource ** | resource, |
| GLuint | buffer, | ||
| unsigned int | flags | ||
| ) |
Registers a GL Buffer for interop and returns corresponding graphics resource.
- Parameters
-
[out] resource - Returns pointer of graphics resource. [in] buffer - Buffer to be registered. [in] flags - Register flags.
◆ hipGraphicsGLRegisterImage()
| hipError_t hipGraphicsGLRegisterImage | ( | hipGraphicsResource ** | resource, |
| GLuint | image, | ||
| GLenum | target, | ||
| unsigned int | flags | ||
| ) |
Register a GL Image for interop and returns the corresponding graphic resource.
- Parameters
-
[out] resource - Returns pointer of graphics resource. [in] image - Image to be registered. [in] target - Valid target value Id. [in] flags - Register flags.