MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / CreateContext

Function CreateContext

tensorflow/lite/delegates/gpu/gl/egl_context.cc:40–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38}
39
40Status CreateContext(EGLDisplay display, EGLContext shared_context,
41 EGLConfig config, EglContext* egl_context) {
42 static const EGLint attributes[] = {EGL_CONTEXT_CLIENT_VERSION, 3,
43#ifdef _DEBUG // Add debugging bit
44 EGL_CONTEXT_FLAGS_KHR,
45 EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR,
46#endif
47 EGL_NONE};
48 EGLContext context =
49 eglCreateContext(display, config, shared_context, attributes);
50 RETURN_IF_ERROR(GetOpenGlErrors());
51 if (context == EGL_NO_CONTEXT) {
52 return InternalError("No EGL error, but eglCreateContext failed.");
53 }
54 *egl_context = EglContext(context, display, config, true);
55 return OkStatus();
56}
57
58bool HasExtension(EGLDisplay display, const char* name) {
59 return std::strstr(eglQueryString(display, EGL_EXTENSIONS), name);

Callers 5

InitMethod · 0.85
InitMethod · 0.85
CreateConfiglessContextFunction · 0.85
CreateSurfacelessContextFunction · 0.85
CreatePBufferContextFunction · 0.85

Calls 4

GetOpenGlErrorsFunction · 0.85
EglContextClass · 0.85
OkStatusFunction · 0.85
InternalErrorFunction · 0.50

Tested by

no test coverage detected