Lines Matching refs:dc

130 static void DumpDebug(RsdHal *dc) {  in DumpDebug()  argument
131 ALOGE(" EGL ver %i %i", dc->gl.egl.majorVersion, dc->gl.egl.minorVersion); in DumpDebug()
132 ALOGE(" EGL context %p surface %p, Display=%p", dc->gl.egl.context, dc->gl.egl.surface, in DumpDebug()
133 dc->gl.egl.display); in DumpDebug()
134 ALOGE(" GL vendor: %s", dc->gl.gl.vendor); in DumpDebug()
135 ALOGE(" GL renderer: %s", dc->gl.gl.renderer); in DumpDebug()
136 ALOGE(" GL Version: %s", dc->gl.gl.version); in DumpDebug()
137 ALOGE(" GL Extensions: %s", dc->gl.gl.extensions); in DumpDebug()
138 ALOGE(" GL int Versions %i %i", dc->gl.gl.majorVersion, dc->gl.gl.minorVersion); in DumpDebug()
140 ALOGV("MAX Textures %i, %i %i", dc->gl.gl.maxVertexTextureUnits, in DumpDebug()
141 dc->gl.gl.maxFragmentTextureImageUnits, dc->gl.gl.maxTextureImageUnits); in DumpDebug()
142 ALOGV("MAX Attribs %i", dc->gl.gl.maxVertexAttribs); in DumpDebug()
143 ALOGV("MAX Uniforms %i, %i", dc->gl.gl.maxVertexUniformVectors, in DumpDebug()
144 dc->gl.gl.maxFragmentUniformVectors); in DumpDebug()
145 ALOGV("MAX Varyings %i", dc->gl.gl.maxVaryingVectors); in DumpDebug()
149 RsdHal *dc = (RsdHal *)rsc->mHal.drv; in rsdGLShutdown() local
152 dc->gl.shaderCache->cleanupAll(); in rsdGLShutdown()
153 delete dc->gl.shaderCache; in rsdGLShutdown()
154 delete dc->gl.vertexArrayState; in rsdGLShutdown()
156 if (dc->gl.egl.context != EGL_NO_CONTEXT) { in rsdGLShutdown()
157 RSD_CALL_GL(eglMakeCurrent, dc->gl.egl.display, in rsdGLShutdown()
159 RSD_CALL_GL(eglDestroySurface, dc->gl.egl.display, dc->gl.egl.surfaceDefault); in rsdGLShutdown()
160 if (dc->gl.egl.surface != EGL_NO_SURFACE) { in rsdGLShutdown()
161 RSD_CALL_GL(eglDestroySurface, dc->gl.egl.display, dc->gl.egl.surface); in rsdGLShutdown()
163 RSD_CALL_GL(eglDestroyContext, dc->gl.egl.display, dc->gl.egl.context); in rsdGLShutdown()
169 RSD_CALL_GL(eglTerminate, dc->gl.egl.display); in rsdGLShutdown()
225 RsdHal *dc = (RsdHal *)rsc->mHal.drv; in rsdGLInit() local
227 dc->gl.egl.numConfigs = -1; in rsdGLInit()
234 dc->gl.egl.display = eglGetDisplay(EGL_DEFAULT_DISPLAY); in rsdGLInit()
237 RSD_CALL_GL(eglInitialize, dc->gl.egl.display, in rsdGLInit()
238 &dc->gl.egl.majorVersion, &dc->gl.egl.minorVersion); in rsdGLInit()
251 ret = eglChooseConfig(dc->gl.egl.display, configAttribs, 0, 0, &numConfigs); in rsdGLInit()
262 ret = eglChooseConfig(dc->gl.egl.display, in rsdGLInit()
270 dc->gl.egl.config = configs[0]; in rsdGLInit()
276 eglGetConfigAttrib(dc->gl.egl.display, in rsdGLInit()
285 eglGetConfigAttrib(dc->gl.egl.display, in rsdGLInit()
293 dc->gl.egl.config = configs[i]; in rsdGLInit()
302 printEGLConfiguration(dc->gl.egl.display, dc->gl.egl.config); in rsdGLInit()
307 dc->gl.egl.context = eglCreateContext(dc->gl.egl.display, dc->gl.egl.config, in rsdGLInit()
310 if (dc->gl.egl.context == EGL_NO_CONTEXT) { in rsdGLInit()
319 dc->gl.egl.surfaceDefault = eglCreatePbufferSurface(dc->gl.egl.display, dc->gl.egl.config, in rsdGLInit()
322 if (dc->gl.egl.surfaceDefault == EGL_NO_SURFACE) { in rsdGLInit()
330 ret = eglMakeCurrent(dc->gl.egl.display, dc->gl.egl.surfaceDefault, in rsdGLInit()
331 dc->gl.egl.surfaceDefault, dc->gl.egl.context); in rsdGLInit()
340 dc->gl.gl.version = glGetString(GL_VERSION); in rsdGLInit()
341 dc->gl.gl.vendor = glGetString(GL_VENDOR); in rsdGLInit()
342 dc->gl.gl.renderer = glGetString(GL_RENDERER); in rsdGLInit()
343 dc->gl.gl.extensions = glGetString(GL_EXTENSIONS); in rsdGLInit()
352 if (strlen((const char *)dc->gl.gl.version) > 9) { in rsdGLInit()
353 if (!memcmp(dc->gl.gl.version, "OpenGL ES-CM", 12)) { in rsdGLInit()
354 verptr = (const char *)dc->gl.gl.version + 12; in rsdGLInit()
356 if (!memcmp(dc->gl.gl.version, "OpenGL ES ", 10)) { in rsdGLInit()
357 verptr = (const char *)dc->gl.gl.version + 9; in rsdGLInit()
367 sscanf(verptr, " %i.%i", &dc->gl.gl.majorVersion, &dc->gl.gl.minorVersion); in rsdGLInit()
370 glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &dc->gl.gl.maxVertexAttribs); in rsdGLInit()
371 glGetIntegerv(GL_MAX_VERTEX_UNIFORM_VECTORS, &dc->gl.gl.maxVertexUniformVectors); in rsdGLInit()
372 glGetIntegerv(GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS, &dc->gl.gl.maxVertexTextureUnits); in rsdGLInit()
374 glGetIntegerv(GL_MAX_VARYING_VECTORS, &dc->gl.gl.maxVaryingVectors); in rsdGLInit()
375 glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &dc->gl.gl.maxTextureImageUnits); in rsdGLInit()
377 glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, &dc->gl.gl.maxFragmentTextureImageUnits); in rsdGLInit()
378 glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_VECTORS, &dc->gl.gl.maxFragmentUniformVectors); in rsdGLInit()
380 dc->gl.gl.OES_texture_npot = nullptr != strstr((const char *)dc->gl.gl.extensions, in rsdGLInit()
382 dc->gl.gl.IMG_texture_npot = nullptr != strstr((const char *)dc->gl.gl.extensions, in rsdGLInit()
384 dc->gl.gl.NV_texture_npot_2D_mipmap = nullptr != strstr((const char *)dc->gl.gl.extensions, in rsdGLInit()
386 dc->gl.gl.EXT_texture_max_aniso = 1.0f; in rsdGLInit()
387 bool hasAniso = nullptr != strstr((const char *)dc->gl.gl.extensions, in rsdGLInit()
390 glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &dc->gl.gl.EXT_texture_max_aniso); in rsdGLInit()
394 DumpDebug(dc); in rsdGLInit()
397 dc->gl.shaderCache = new RsdShaderCache(); in rsdGLInit()
398 dc->gl.vertexArrayState = new RsdVertexArrayState(); in rsdGLInit()
399 dc->gl.vertexArrayState->init(dc->gl.gl.maxVertexAttribs); in rsdGLInit()
400 dc->gl.currentFrameBuffer = nullptr; in rsdGLInit()
401 dc->mHasGraphics = true; in rsdGLInit()
405 EGLSyncKHR sync = eglCreateSyncKHR(dc->gl.egl.display, EGL_SYNC_NATIVE_FENCE_ANDROID, NULL); in rsdGLInit()
410 syncFd = eglDupNativeFenceFDANDROID(dc->gl.egl.display, sync); in rsdGLInit()
416 eglDestroySyncKHR(dc->gl.egl.display, sync); in rsdGLInit()
426 RsdHal *dc = (RsdHal *)rsc->mHal.drv; in rsdGLSetInternalSurface() local
429 if (dc->gl.egl.surface != nullptr) { in rsdGLSetInternalSurface()
431 ret = eglMakeCurrent(dc->gl.egl.display, dc->gl.egl.surfaceDefault, in rsdGLSetInternalSurface()
432 dc->gl.egl.surfaceDefault, dc->gl.egl.context); in rsdGLSetInternalSurface()
436 ret = eglDestroySurface(dc->gl.egl.display, dc->gl.egl.surface); in rsdGLSetInternalSurface()
439 dc->gl.egl.surface = nullptr; in rsdGLSetInternalSurface()
442 if (dc->gl.currentWndSurface != nullptr) { in rsdGLSetInternalSurface()
443 dc->gl.currentWndSurface->decStrong(nullptr); in rsdGLSetInternalSurface()
446 dc->gl.currentWndSurface = (ANativeWindow *)sur; in rsdGLSetInternalSurface()
447 if (dc->gl.currentWndSurface != nullptr) { in rsdGLSetInternalSurface()
448 dc->gl.currentWndSurface->incStrong(nullptr); in rsdGLSetInternalSurface()
451 dc->gl.egl.surface = eglCreateWindowSurface(dc->gl.egl.display, dc->gl.egl.config, in rsdGLSetInternalSurface()
452 dc->gl.currentWndSurface, nullptr); in rsdGLSetInternalSurface()
454 if (dc->gl.egl.surface == EGL_NO_SURFACE) { in rsdGLSetInternalSurface()
459 ret = eglMakeCurrent(dc->gl.egl.display, dc->gl.egl.surface, in rsdGLSetInternalSurface()
460 dc->gl.egl.surface, dc->gl.egl.context); in rsdGLSetInternalSurface()
468 RsdHal *dc = (RsdHal *)rsc->mHal.drv; in rsdGLSetSurface() local
470 if (dc->gl.wndSurface != nullptr) { in rsdGLSetSurface()
471 dc->gl.wndSurface->decStrong(nullptr); in rsdGLSetSurface()
472 dc->gl.wndSurface = nullptr; in rsdGLSetSurface()
477 dc->gl.wndSurface = (ANativeWindow *)sur; in rsdGLSetSurface()
478 if (dc->gl.wndSurface != nullptr) { in rsdGLSetSurface()
479 dc->gl.wndSurface->incStrong(nullptr); in rsdGLSetSurface()
487 RsdHal *dc = (RsdHal *)rsc->mHal.drv; in rsdGLSwap() local
488 RSD_CALL_GL(eglSwapBuffers, dc->gl.egl.display, dc->gl.egl.surface); in rsdGLSwap()