我创建了Android graphic的buffer,
首先用eglCreateImageKHR创建了 image,然后用 clCreateFromEGLImageKHR创建cl_mem但是返回-30,我检查了参数没什么问题,是我创建上下文的参数缺少配置吗?
求大神帮忙看看~
glCtx->param.inImage = eglCreateImageKHR(glCtx->Display, glCtx->context, EGL_NATIVE_BUFFER_ANDROID, (EGLClientBuffer)glCtx->param.input, 0); glCtx->param.outImage = eglCreateImageKHR(glCtx->Display, glCtx->context, EGL_NATIVE_BUFFER_ANDROID, (EGLClientBuffer)glCtx->param.output, 0); LOGD("graphic handle is %p %p \n", glCtx->param.input, glCtx->param.output); if ((glCtx->param.inImage == EGL_NO_IMAGE_KHR) || (glCtx->param.outImage == EGL_NO_IMAGE_KHR)) { LOGD("eglCreateImageKHR err \n"); } cl_int ret; clArg->memory[0].mem = clCreateFromEGLImageKHR(clArg->ctx, (CLeglDisplayKHR)glCtx->Display, ((CLeglImageKHR)glCtx->param.inImage), CL_MEM_READ_ONLY, 0, &ret);//(CLeglImageKHR)glCtx->param.inImage (CLeglDisplayKHR)glCtx->Display if ((clArg->memory[0].mem == NULL) || (ret != CL_SUCCESS)) { LOGD("clCreateFromEGLImageKHR err errNum is %d \n", ret); }
This question is Android specific but not for Arm IPs. We recommend you to consult in Android technical forms.
OK, Thanks