From 13ca42f17dfcf7c899a6c8118c978efa1c07a744 Mon Sep 17 00:00:00 2001 From: Payam Date: Sun, 23 Jan 2022 15:15:20 -0500 Subject: [PATCH] SWDEV-318704 fix for GL-interop second render Change-Id: I27403c0444350a64a11b1beee071b0f1dbe8e3f7 [ROCm/clr commit: 96ae15fe5d29625403c2d33eb3d1a632e3b70460] --- projects/clr/hipamd/src/hip_gl.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/projects/clr/hipamd/src/hip_gl.cpp b/projects/clr/hipamd/src/hip_gl.cpp index 0ec94e353d..16938a22d7 100644 --- a/projects/clr/hipamd/src/hip_gl.cpp +++ b/projects/clr/hipamd/src/hip_gl.cpp @@ -108,6 +108,15 @@ hipError_t hipGLGetDevices(unsigned int* pHipDeviceCount, int* pHipDevices, LogError("Failed : Invalid Shared Group Reference \n"); HIP_RETURN(hipErrorInvalidValue); } + amd::GLFunctions* glenv = hip::getCurrentDevice()->asContext()->glenv(); + if (glenv != nullptr) { +#ifdef _WIN32 + info.hCtx_ = glenv->wglGetCurrentContext_(); +#else + info.hCtx_ = glenv->glXGetCurrentContext_(); +#endif + hip::getCurrentDevice()->asContext()->setInfo(info); + } *pHipDeviceCount = 0; switch (deviceList) {