OpenGL ES extensions and limits


15 posts
by lb » Sat Jan 28, 2012 8:14 pm
What OpenGL ES 2.0 extensions are supported on the Pi? What are the limits of the implemention (number of texture units, shader attributes, etc.)? In short, what do glGetString and glGetIntegerv return for all possible parameters?

Also, is only OpenGL ES 2.0 supported, or 1.1 as well?
Posts: 193
Joined: Sat Jan 28, 2012 8:07 pm
by liz » Sat Jan 28, 2012 8:22 pm
1.1 and 2.0 are supported. I don't have it all to hand, but I do know we're towards the upper end of typical OpenGL ES 2.0 implementations - I *believe* there's an unlimited number of texture units, but don't quote me on that until I can confirm it! There's an unlimited number of uniforms, 32 varyings, textures up to 2k x 2k, and all vertex and fragment shader arithmetic is performed at 32-bit float precision - that's all I can give you right now.
--
Head of Comms, Raspberry Pi Foundation
User avatar
Raspberry Pi Foundation Employee & Forum Moderator
Raspberry Pi Foundation Employee & Forum Moderator
Posts: 4036
Joined: Thu Jul 28, 2011 7:22 pm
by jamesh » Sun Jan 29, 2012 10:43 am
lb said:


What OpenGL ES 2.0 extensions are supported on the Pi? What are the limits of the implemention (number of texture units, shader attributes, etc.)? In short, what do glGetString and glGetIntegerv return for all possible parameters?

Also, is only OpenGL ES 2.0 supported, or 1.1 as well?


I think this has been asked before, and I seem to remember  posting the results on glGetString returns. Try a forum search.
Soon to be unemployed software engineer currently specialising in camera drivers and frameworks, but can put mind to most embedded tasks. Got a job in N.Cambridge or surroundings? I'm interested!
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 11509
Joined: Sat Jul 30, 2011 7:41 pm
by lb » Sun Jan 29, 2012 2:05 pm
JamesH said:


I think this has been asked before, and I seem to remember  posting the results on glGetString returns. Try a forum search. 



I did search the forums of course, but didn"t find anything. Now I did another query for "glGetString" and that did it. However, the extensions are those for an OpenGL ES 1.x context. I can hack together a small program to check ES 2.0 extensions/limits, would you be so kind to run that?
Posts: 193
Joined: Sat Jan 28, 2012 8:07 pm
by lb » Sun Jan 29, 2012 7:40 pm
Can someone what a Pi in their possession please compile (gcc -o eglinfo eglinfo.c -lEGL -lGLESv2) and run this program?

http://pastebin.com/Vnje5sEe

This works fine on my netbook with Mesa EGL and OpenGL ES 2.0, and hopefully it'll also work on the Pi.
Posts: 193
Joined: Sat Jan 28, 2012 8:07 pm
by jamesh » Sun Jan 29, 2012 9:23 pm
lb said:


JamesH said:


I think this has been asked before, and I seem to remember  posting the results on glGetString returns. Try a forum search. 



I did search the forums of course, but didn"t find anything. Now I did another query for "glGetString" and that did it. However, the extensions are those for an OpenGL ES 1.x context. I can hack together a small program to check ES 2.0 extensions/limits, would you be so kind to run that?


To be honest I just looked at the source code and grabbed the strings out of it. I'll try and do the test below but all my code is out of date at the moment - need to get back up to speed there, but work keeps getting in the way.
Soon to be unemployed software engineer currently specialising in camera drivers and frameworks, but can put mind to most embedded tasks. Got a job in N.Cambridge or surroundings? I'm interested!
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 11509
Joined: Sat Jul 30, 2011 7:41 pm
by dom » Mon Jan 30, 2012 7:05 pm
./eglinfo
EGL
Vendor: Broadcom
Version: 1.4
Client APIs: OpenGL_ES OpenVG
Extensions: EGL_KHR_image EGL_KHR_image_base EGL_KHR_image_pixmap EGL_KHR_vg_parent_image EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_lock_surface
OpenGL ES
Vendor: Broadcom
Renderer: VideoCore IV HW
Version: OpenGL ES 2.0
GLSL version: OpenGL ES GLSL ES 1.00
Extensions: GL_OES_compressed_ETC1_RGB8_texture GL_OES_compressed_paletted_texture GL_OES_texture_npot GL_OES_depth24 GL_OES_vertex_half_float GL_OES_EGL_image GL_OES_EGL_image_external GL_EXT_discard_framebuffer GL_OES_rgb8_rgba8 GL_OES_depth32 GL_OES_mapbuffer GL_EXT_texture_format_BGRA8888 GL_APPLE_rgb_422
Implementation limits:
GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS = 8
GL_MAX_CUBE_MAP_TEXTURE_SIZE = 2048
GL_MAX_FRAGMENT_UNIFORM_VECTORS = 136
GL_MAX_RENDERBUFFER_SIZE = 2048
GL_MAX_TEXTURE_IMAGE_UNITS = 8
GL_MAX_TEXTURE_SIZE = 2048
GL_MAX_VARYING_VECTORS = 8
GL_MAX_VERTEX_ATTRIBS = 8
GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS = 0
GL_MAX_VERTEX_UNIFORM_VECTORS = 136
GL_MAX_VIEWPORT_DIMS = 2048, 2048
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 3992
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge
by Chromatix » Mon Jan 30, 2012 9:10 pm
I see that the rather common bug of omitting OpenGL_ES2 from the EGL API string is alive and well.  Sigh.

Otherwise that looks like a relatively capable ES2 implementation.  It should be capable of doing quite a lot.
The key to knowledge is not to rely on people to teach you it.
User avatar
Posts: 430
Joined: Mon Jan 02, 2012 7:00 pm
Location: Helsinki
by jamesh » Mon Jan 30, 2012 10:04 pm
Chromatix said:


I see that the rather common bug of omitting OpenGL_ES2 from the EGL API string is alive and well.  Sigh.

Otherwise that looks like a relatively capable ES2 implementation.  It should be capable of doing quite a lot.


Are you sure it's a bug? The OGL ES 2.0 implementation passes ALL the Khronos conformance tests I believe.
Soon to be unemployed software engineer currently specialising in camera drivers and frameworks, but can put mind to most embedded tasks. Got a job in N.Cambridge or surroundings? I'm interested!
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 11509
Joined: Sat Jul 30, 2011 7:41 pm
by Benedict White » Tue Jan 31, 2012 1:05 am
JamesH said:


Chromatix said:


I see that the rather common bug of omitting OpenGL_ES2 from the EGL API string is alive and well.  Sigh.

Otherwise that looks like a relatively capable ES2 implementation.  It should be capable of doing quite a lot.


Are you sure it's a bug? The OGL ES 2.0 implementation passes ALL the Khronos conformance tests I believe.


Perhaps it's a feature? (G,D&RVVF)
Posts: 225
Joined: Sat Dec 24, 2011 12:24 am
by finnw » Tue May 22, 2012 3:15 pm
dom wrote:GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS = 0


This appears to have increased to 8 in the current firmware, which is nice.
Posts: 24
Joined: Wed May 16, 2012 7:05 pm
by thijsnl » Thu Jul 26, 2012 3:14 pm
Iam getting very different results... It looks like my EGL is in software render mode.
When i try the clutter/cogl examples, they work at like 1fps... very slow..

@dom; How can i have my driver updated so that it says VideoCoreIV? Your eglinfo output
looks much better ;)

P.S. My memory split is 192/64 (also tried 128/128)
P.S.2 iam using the 2012-07-15 raspbian wheezy image

root@raspberrypi:~# ./eglinfo
libEGL warning: GLX/DRI2 is not supported
libEGL warning: DRI2: failed to authenticate
libEGL warning: DRI2: failed to open swrast (search paths /usr/lib/arm-linux-gnueabihf/dri:${ORIGIN}/dri:/usr/lib/dri)
libEGL warning: GLX: failed to load GLX
EGL
Vendor: Mesa Project
Version: 1.4 (Gallium)
Client APIs: OpenGL OpenGL_ES OpenGL_ES2 OpenVG
Extensions: EGL_KHR_image_base EGL_KHR_reusable_sync EGL_KHR_fence_sync EGL_KHR_surfaceless_gles1 EGL_KHR_surfaceless_gles2 EGL_KHR_surfaceless_opengl
OpenGL ES
Vendor: VMware, Inc.
Renderer: Gallium 0.4 on softpipe
Version: OpenGL ES 2.0 Mesa 8.0.3
GLSL version: OpenGL ES GLSL ES 1.0.16
Extensions: GL_EXT_blend_minmax GL_EXT_multi_draw_arrays GL_EXT_texture_filter_anisotropic GL_OES_draw_texture GL_EXT_texture_format_BGRA8888 GL_OES_compressed_ETC1_RGB8_texture GL_OES_depth24 GL_OES_element_index_uint GL_OES_fbo_render_mipmap GL_OES_mapbuffer GL_OES_rgb8_rgba8 GL_OES_standard_derivatives GL_OES_stencil8 GL_OES_texture_3D GL_OES_texture_npot GL_OES_EGL_image GL_OES_depth_texture GL_OES_packed_depth_stencil GL_EXT_texture_type_2_10_10_10_REV GL_NV_fbo_color_attachments GL_OES_EGL_image_external GL_NV_draw_buffers
Implementation limits:
GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS = 32
GL_MAX_CUBE_MAP_TEXTURE_SIZE = 16384
GL_MAX_FRAGMENT_UNIFORM_VECTORS = 4096
GL_MAX_RENDERBUFFER_SIZE = 16384
GL_MAX_TEXTURE_IMAGE_UNITS = 16
GL_MAX_TEXTURE_SIZE = 16384
GL_MAX_VARYING_VECTORS = 16
GL_MAX_VERTEX_ATTRIBS = 16
GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS = 16
GL_MAX_VERTEX_UNIFORM_VECTORS = 4096
GL_MAX_VIEWPORT_DIMS = 16384, 16384
Posts: 4
Joined: Sun Jul 01, 2012 7:30 pm
by jamesh » Thu Jul 26, 2012 4:05 pm
You appear to be linking against the software mesa library not the accelerated OGLES library?
Soon to be unemployed software engineer currently specialising in camera drivers and frameworks, but can put mind to most embedded tasks. Got a job in N.Cambridge or surroundings? I'm interested!
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 11509
Joined: Sat Jul 30, 2011 7:41 pm
by thijsnl » Thu Jul 26, 2012 4:54 pm
Yes that can be possible... but i don't have a clue what to change to have hardware acceleration.
What do i need to recompile, alter, or do i need to change firmware?

Greets,

Mathijs
Posts: 4
Joined: Sun Jul 01, 2012 7:30 pm
by thijsnl » Fri Jul 27, 2012 5:22 pm
Ok i found out what the problem was/is:

I want to make use of Clutter and COGL, and installed the the clutter header files with
'apt-get install clutter-1.0-dev', but i did not read what dependencies it needed.

i found out that it was quite a list including 'libegl1-mesa libegl1-mesa-dev libegl1-mesa-drivers'.
This overwrites the libEGL drivers that is already presents, and makes it a software renderer

With a clean '2012-07-15-wheezy-raspbian.img' image, i get it back to Broadcom VideoCoreIV

altough... it is still not working.. seems like a problem with X and surface to draw on... Is there already
a fix/patch that makes it possible to use OpenGLES in Xwindows?

Regards,

Mathijs
Posts: 4
Joined: Sun Jul 01, 2012 7:30 pm