SWDEV-321160 - Checking if GL-Context is initialized

Change-Id: I5482fa33bcf9a1587ee68ed37f2058b7ed7e706a


[ROCm/clr commit: f501317b5b]
Этот коммит содержится в:
Payam
2022-02-07 12:51:01 -05:00
коммит произвёл Payam Ghafari
родитель 40e2603bd0
Коммит 80026db2b3
+10
Просмотреть файл
@@ -235,6 +235,11 @@ hipError_t hipGraphicsGLRegisterImage(hipGraphicsResource** resource, GLuint ima
GLint miplevel = 0;
amd::Context& amdContext = *(hip::getCurrentDevice()->asContext());
if (amdContext.glenv() == nullptr) {
LogError("invalid context, gl interop not initialized");
HIP_RETURN(hipErrorInvalidValue);
}
amd::GLFunctions::SetIntEnv ie(amdContext.glenv());
if (!ie.isValid()) {
LogWarning("\"amdContext\" is not created from GL context or share list \n");
@@ -544,6 +549,11 @@ hipError_t hipGraphicsGLRegisterBuffer(hipGraphicsResource** resource, GLuint bu
amd::Context& amdContext = *(hip::getCurrentDevice()->asContext());
if (amdContext.glenv() == nullptr) {
LogError("invalid context, gl interop not initialized");
HIP_RETURN(hipErrorInvalidValue);
}
// Add this scope to bound the scoped lock
{
amd::GLFunctions::SetIntEnv ie(amdContext.glenv());