SWDEV-321160 - Checking if GL-Context is initialized
Change-Id: I5482fa33bcf9a1587ee68ed37f2058b7ed7e706a
[ROCm/clr commit: f501317b5b]
Esse commit está contido em:
@@ -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());
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário