microsoft / angle

ANGLE: OpenGL ES to DirectX translation
Other
615 stars 166 forks source link

glGenTextures return texture id is 0 with creating off-screen egl context on windows 10 desktop #173

Closed erickingxu closed 3 years ago

erickingxu commented 3 years ago

Hi @austinkinross , Thanks for your attention. When I used angle by vcpkg install and linked well into my library. But some gles functions cannot work for requiring gpu resources, like textures and buffers as above. Codes as follows :

  1. create egl context with displayer and make current this off-screen context: EGLint egl_maj_vers = 0, egl_min_vers = 0; EGLint num_configs; EGLBoolean success = EGL_FALSE; egldisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY); if (egldisplay != EGL_NO_DISPLAY) { success = eglInitialize(egldisplay, &egl_maj_vers, &egl_min_vers); } if (!eglBindAPI(EGL_OPENGL_ES_API)) LOG_INFO("Failed to bind API!"); if (success != EGL_FALSE) success = eglGetConfigs(egldisplay, NULL, 0, &num_configs); if (success != EGL_FALSE && num_configs > 0) { // choose the first config, i.e. best config success = eglChooseConfig(egldisplay, conf_attr, &eglconf, 1, &num_configs); } // create a pixelbuffer surface eglsurface = eglCreatePbufferSurface(egldisplay, eglconf, surface_attr);

    eglcontext = eglCreateContext(egldisplay, eglconf, EGL_NO_CONTEXT, ctx_attr); eglMakeCurrent(egldisplay, eglsurface, eglsurface, eglcontext);

  2. And then in this context thread, create texture failed with gl error :1282 INVALID_OPERATION uint32_t textureHandles[2] = { 0,0 }; glGenTextures(2, textureHandles); textureid = textureHandles[0]; glBindTexture(target_, textureid); GLenum erp = glGetError();

My desktop is windows 10 with Intel(R) UHD Graphics 630 , and NVDIA GeForce RTX2070

austinkinross commented 3 years ago

Hi, I recommend asking your questions over on the main ANGLE discussion group, since you're likely to get a better response there. This repository has been deprecated for years (after we submitted all of its changes to the main ANGLE repo), and I haven't personally worked on ANGLE since then. Thanks!