Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GLES driver does not report version information #90

Closed
tthef opened this issue Sep 9, 2012 · 6 comments
Closed

GLES driver does not report version information #90

tthef opened this issue Sep 9, 2012 · 6 comments

Comments

@tthef
Copy link

tthef commented Sep 9, 2012

I am trying to use Cogl with RPI, but glGetString (GL_RENDERER), glGetString (GL_VERSION), glGetString (GL_VENDOR), glGetString (GL_EXTENSIONS) all seem return NULL with the current version of the driver. Without the versioning info Cogl is unable to determine the features the driver supports.

@johang
Copy link

johang commented Oct 6, 2012

The OpenGL and EGL stuff is a bit quirky. These calls will start returning sane values after a call to eglMakeCurrent.

For the record:

GL_RENDERER: VideoCore IV HW
GL_VERSION: OpenGL ES-CM 1.1
GL_VENDOR: Broadcom
GL_EXTENSIONS: GL_OES_compressed_ETC1_RGB8_texture GL_OES_compressed_paletted_texture GL_OES_texture_npot GL_OES_EGL_image GL_OES_EGL_image_external GL_EXT_discard_framebuffer GL_OES_query_matrix GL_OES_framebuffer_object GL_OES_rgb8_rgba8 GL_OES_depth24 GL_OES_depth32 GL_OES_stencil8 GL_OES_draw_texture GL_OES_mapbuffer GL_EXT_texture_format_BGRA8888 GL_APPLE_rgb_422 GL_OES_matrix_palette GL_EXT_debug_marker

@tthef
Copy link
Author

tthef commented Oct 8, 2012

That's broken, rather than quirky :) Per OpenGl docs glGetString is used for platform recognition, so it needs to be available before any vendor-specific platform set up is done. It's a context-less call, these are static strings, so there is no reason why it should no work as soon as the gles lib is dlopen-ed.

BTW, I get the impression the OGL bits of RPi are currently unmaintained?

@popcornmix
Copy link
Contributor

Our 3D guy doesn't belive the behaviour is incorrect. You need to do an eglMakeCurrent first:

"I can't find anything definitive in the EGL or GL specs, but the GL spec does say: "Issuing GL commands when the program is not connected to a context results in undefined behavior". The glGetString documentation doesn't suggest that glGetString is special. In fact, it says "GetString returns ... that can be supported on the connection" which suggests that you're supposed to be connected first. We return different strings depending on whether the current context is a GLES 1.1 context or a GLES 2.0 context, so it wouldn't necessarily be trivial to "fix" this.

(The VG spec explicitly says "If no context is current, vgGetString returns NULL")"

@tthef
Copy link
Author

tthef commented Oct 8, 2012

We return different strings depending on whether the current context is a GLES 1.1 context or a GLES 2.0 context, so it wouldn't necessarily be trivial to "fix" this.

Surely, the client is either using libGLESv2, in which case glGetString() should provide information about the GLES2 capabilities of the server, or the client is using libGLESv1_CM, in which case glGetString() should report on the GLES1 capabilities of the server?

@popcornmix
Copy link
Contributor

No, you can switch at runtime.

@tthef
Copy link
Author

tthef commented Oct 9, 2012

My 3D guy says your 3D guy is right about the context binding, so this looks like a cogl bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants