cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

kphillisjr
Adept II

egl initialization bugs?

This is a continuation of my previous post located in the GPU Tools forum. There was two interesting bugs within the initialization that should have not been allowed.

Interesting Note1: egl bind appears to always returns true.

This is a key bug to get fixed because when eglBind fails, it is a clear sign that the desired API is completely unavailable. This is where on mobile devices when you attempt to bind OpenGL, the interface should always fail. For this example, Please look at lines 244 to 272 of the sample file. This sample is a slight modification of the OpenGL ES sample included with the OpenGL ES developers kit found on this website. This section of code has a high chance of being used in multiple locations, but the main use is to initialize a variable to make sure that the api is supported.

interesting note 2: eglCreateContext Ignores EGL_CONTEXT_CLIENT_VERSION parameter.

This is another key bug. This provides basic sanity tests to the video contexts by allowing the program to easily define a specific version of the api. Lines 351 to 367 in the attached sample uses a clearly invalid client version. The client version is requesting major version 99,999,999 and minor version 0. This is bad behavior because the context creation should have failed already. Lines 369 to 380 show a minor change to go ahead and try to create an OpenGL ES 2.0 context. Either way, there should have been one failed context and a properly working context.

Note 3: Egl error mapper.

Lines 200 to 238 show how the various EGL error codes wrap. This is useful for determining where the bug in a program occurs.

0 Likes
3 Replies
gsellers
Staff

Hi,

Thanks for looking into this. Honestly, accurate error behavior isn't something that gets fully tested here. I can see how it could be useful, though. We'll take a look at it and see if we can get our implementation tightened up a little.

Thanks,

Graham

0 Likes

Thanks, and by no means remove the OpenGL Support. I believe that the having drivers that have fully support both OpenGL ES and OpenGL with the EGL Library as the primary connection between the API and the OS will greatly simplify what the developers haft to work with.

0 Likes

Hi,

Just to be clear - desktop OpenGL is not currently supported through EGL on our drivers. Only OpenGL-ES is supported through EGL and being able to select the OpenGL (not ES) API through EGL should generate an error. We will continue to support desktop OpenGL through WGL and GLX and may investigate producing support through EGL for desktop systems in the future. However, as of today, that is not planned.

Thanks,

Graham

0 Likes