From ca992e1dc343fe4e9f7b5a90e30ed2262dfe46b1 Mon Sep 17 00:00:00 2001 From: pghafari <61991377+pghafari@users.noreply.github.com> Date: Tue, 11 Jan 2022 03:19:31 -0500 Subject: [PATCH] SWDEV-245531 - GLInterop - adding register image api (#2454) Change-Id: Iff40f244f0d9c31b462c5878a8c8eed6f5292517 [ROCm/hip commit: b59522d188665a98073abee597773ec558ce015b] --- projects/hip/include/hip/hip_runtime_api.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/projects/hip/include/hip/hip_runtime_api.h b/projects/hip/include/hip/hip_runtime_api.h index 6fb56a0325..7d4d58ec24 100644 --- a/projects/hip/include/hip/hip_runtime_api.h +++ b/projects/hip/include/hip/hip_runtime_api.h @@ -4276,7 +4276,7 @@ typedef enum hipGraphExecUpdateResult { ///< in the return value of the function hipGraphExecUpdateErrorTopologyChanged = 0x2, ///< The update failed because the topology changed hipGraphExecUpdateErrorNodeTypeChanged = 0x3, ///< The update failed because a node type changed - hipGraphExecUpdateErrorFunctionChanged = + hipGraphExecUpdateErrorFunctionChanged = 0x4, ///< The update failed because the function of a kernel node changed hipGraphExecUpdateErrorParametersChanged = 0x5, ///< The update failed because the parameters changed in a way that is not supported @@ -5223,6 +5223,7 @@ hipError_t hipGraphExecEventWaitNodeSetEvent(hipGraphExec_t hGraphExec, hipGraph * This section describes Stream Memory Wait and Write functions of HIP runtime API. */ typedef unsigned int GLuint; +typedef unsigned int GLenum; // Queries devices associated with GL Context. hipError_t hipGLGetDevices(unsigned int* pHipDeviceCount, int* pHipDevices, @@ -5230,9 +5231,15 @@ hipError_t hipGLGetDevices(unsigned int* pHipDeviceCount, int* pHipDevices, // Registers a GL Buffer for interop and returns corresponding graphics resource. hipError_t hipGraphicsGLRegisterBuffer(hipGraphicsResource** resource, GLuint buffer, unsigned int flags); +// Register a GL Image for interop and returns the corresponding graphic resource +hipError_t hipGraphicsGLRegisterImage(hipGraphicsResource** resource, GLuint image, + GLenum target, unsigned int flags); // Maps a graphics resource for hip access. hipError_t hipGraphicsMapResources(int count, hipGraphicsResource_t* resources, hipStream_t stream __dparm(0) ); +// Get an array through which to access a subresource of a mapped graphics resource. +hipError_t hipGraphicsSubResourceGetMappedArray(hipArray_t* array, hipGraphicsResource_t resource, + unsigned int arrayIndex, unsigned int mipLevel); // Gets device accessible address of a graphics resource. hipError_t hipGraphicsResourceGetMappedPointer(void** devPtr, size_t* size, hipGraphicsResource_t resource);