Commit Graph

11 Commits

Author SHA1 Message Date
Alistair Strachan 89301eaf21 Fix EGL shim extension injection for GL ES 3 drivers.
The Android EGL shim injects GL_EXT_debug_marker into the ES driver
EXTENSIONS string for the OpenGL ES 1.x and 2.0/3.0/3.1 drivers if
the extension is not already provided. This feature is used by
GLES_trace.

In Open GL ES 3.0 it became possible to query an indexed version of
the EXTENSIONS string via GetStringi(). NUM_EXTENSIONS Gets were
also added to the specification (taken from Open GL).

If the shim does not have to inject the extension, then there is no
problem, as glGetString() and glGetStringi() / NUM_EXTENSIONS will
be consistent. However, if the Android EGL shim injects the
extension, NUM_EXTENSIONS and GetStringi() will report one less
extension than is really available.

Consistency between these methods is tested by the dEQP framework
with the dEQP-GLES3.functional.state_query.string.extensions test.
If the driver does not provide GL_EXT_debug_marker, this test
fails.

This change wraps all of the affected entry points so that the
wrapped driver extensions are never visible directly to dEQP,
eliminating the inconsistency.
2015-05-28 15:34:31 -07:00
Jesse Hall fca1b54031 opengl: Regenerate code with ES 3.1 and new extensions
Enable ES 3.1 generation in glgen.py, and regenerate everything to add
support for that as well as these new extensions in the registry:
- EXT_copy_image
- EXT_draw_buffers_indexed
- EXT_geometry_shader
- EXT_gpu_shader5
- EXT_primitive_bounding_box
- EXT_shader_implicit_conversions
- EXT_shader_io_blocks
- EXT_tessellation_shader
- EXT_texture_border_clamp
- EXT_texture_buffer
- EXT_texture_cube_map_array
- EXT_texture_view

Bug: 15028495
Change-Id: I3f45a7ef5367c70e54ce6b36a8c030ae11033434
2014-05-21 15:32:23 -07:00
Jesse Hall 3703f7f014 opengl: Update GLES headers and generate *.in from registry XML
Import GLES headers from Khronos SVN r26322:
https://cvs.khronos.org/svn/repos/registry/trunk/public/gles/api

There are many non-functional whitespace and parameter name changes
included here. These were introduced upstream when converting from the
old .spec registry to the new XML registry.

There are also some new extensions added. Unfortunately there isn't a
version of the XML that matches the headers the previous versions of
the *.in files were generated from, so I can't separate out the
non-functional changes from the new extensions (other than temporarily
hacking them out of the XML). See below for a list.

Finally, I had to hack the official glext.h. Khronos hasn't updated
the official GLES1 headers since switching to the XML registry, and
there is one critical difference: a "const void**" parameter in the
official header is "const void* const*" in the registry. I changed the
header to avoid build errors with code generated from the registry.

Dependencies on the *.in files required manually updating some
GLES_trace/ files as well:

- gltrace_api.{h,cpp} must be manually re-generated using
  tools/genapi.py.
- New GL prototypes must be manually added to gltrace.proto.
- gltrace.pb.{h,cpp} must be regenerated using aprotoc (see dev.make)

New GLES extensions in libs/GLES_CM/glext_api.in:
- GL_OES_byte_coordinates
- GL_EXT_map_buffer_range
- GL_APPLE_copy_texture_levels
- GL_APPLE_sync

New GLES2 extensions in libs/GLES2/gl2ext_api.in:
- GL_KHR_blend_equation_advanced
- GL_KHR_debug
- GL_OES_sample_shading
- GL_OES_texture_storage_multisample_2d_array
- GL_EXT_disjoint_timer_query
- GL_EXT_draw_buffers
- GL_EXT_draw_instanced
- GL_EXT_instanced_arrays
- GL_EXT_map_buffer_range
- GL_EXT_map_buffer_range
- GL_EXT_multiview_draw_buffers
- GL_EXT_separate_shader_objects
- GL_ANGLE_instanced_arrays
- GL_ANGLE_translated_shader_source
- GL_APPLE_copy_texture_levels
- GL_APPLE_sync
- GL_INTEL_performance_query
- GL_NV_blend_equation_advanced
- GL_NV_copy_buffer
- GL_NV_draw_instanced
- GL_NV_framebuffer_blit
- GL_NV_framebuffer_multisample
- GL_NV_instanced_arrays
- GL_NV_non_square_matrices

Bug: 15028495
Change-Id: I902517c23354e14f9c63b1584db286d682315bb5
2014-05-21 14:58:00 -07:00
Jesse Hall 0b96e6c44b Revert "opengl: Generate *.in from registry XML"
This reverts commit 4a73962c69.

Change-Id: I1fa5cbe4d0b86f6df69d616157b3fec68d706d7a
2014-05-20 21:38:44 +00:00
Jesse Hall 4a73962c69 opengl: Generate *.in from registry XML
There are many non-functional whitespace and parameter name changes
included here. These were introduced upstream when converting from the
old .spec registry to the new XML registry.

There are also some new extensions added. Unfortunately there isn't a
version of the XML that matches the headers the previous versions of
the *.in files were generated from, so I can't separate out the
non-functional changes from the new extensions (other than temporarily
hacking them out of the XML). See below.

Finally, I had to hack the official glext.h. Khronos hasn't updated
the official GLES1 headers since switching to the XML registry, and
there is one critical difference: a "const void**" parameter in the
official header is "const void* const*" in the registry. I changed the
header to avoid build errors with code generated from the registry.

Dependencies on the *.in files required manually updating some
GLES_trace/ files as well:

- gltrace_api.{h,cpp} must be manually re-generated using
  tools/genapi.py.
- New GL prototypes must be manually added to gltrace.proto.
- gltrace.pb.{h,cpp} must be regenerated using aprotoc (see dev.make)

New GLES extensions in libs/GLES_CM/glext_api.in:
- GL_OES_byte_coordinates
- GL_EXT_map_buffer_range
- GL_APPLE_copy_texture_levels
- GL_APPLE_sync

New GLES2 extensions in libs/GLES2/gl2ext_api.in:
- GL_KHR_blend_equation_advanced
- GL_KHR_debug
- GL_OES_sample_shading
- GL_OES_texture_storage_multisample_2d_array
- GL_EXT_disjoint_timer_query
- GL_EXT_draw_buffers
- GL_EXT_draw_instanced
- GL_EXT_instanced_arrays
- GL_EXT_map_buffer_range
- GL_EXT_map_buffer_range
- GL_EXT_multiview_draw_buffers
- GL_EXT_separate_shader_objects
- GL_ANGLE_instanced_arrays
- GL_ANGLE_translated_shader_source
- GL_APPLE_copy_texture_levels
- GL_APPLE_sync
- GL_INTEL_performance_query
- GL_NV_blend_equation_advanced
- GL_NV_copy_buffer
- GL_NV_draw_instanced
- GL_NV_framebuffer_blit
- GL_NV_framebuffer_multisample
- GL_NV_instanced_arrays
- GL_NV_non_square_matrices

Bug: 15028495
Change-Id: Ib3fa700a146adf7f1487a93e459b1e6df0dcdc42
2014-05-19 12:54:05 -07:00
Jesse Hall 4c0596f4cc Rationalize GLES2/3 .in files.
We weren't using gl2_api.in, since gl3_api.in was a superset. And
gl3ext_api.in was empty, and Khronos has decided to keep it that way
(any GLES2/3/... extensions will be in gl2ext.h).

Since libGLES2.so will have all future backwards-compatible GLES APIs,
it makes sense to just use gl2_api.in and gl2ext_api.in to build its
contents. This changes renames gl3_api.in to gl2_api.in and updates
uses of it, and removes gl3ext_api.in and references.

Bug: 15028495
Change-Id: I0745eda27ec91ee625f03e957e4fdb22035dd781
2014-05-17 19:31:48 -07:00
Alistair Strachan 7c95911157 Import constness fix from gl3.h into gl2.h.
This change has been made in Khronos SVN for GLES2 already, however it
is mildly controversial and discussion is on-going.

This change is necessary for Android because otherwise applications
cannot include both GLES2/gl2.h and GLES3/gl3.h as the glShaderSource()
prototype mismatches. Native programs may include framework headers
(which now include GLES3 headers only) but already have included GLES2
headers, creating an incompatibility.

Change-Id: I70a4075e079ee063e76cef5a227abb0ae70aebb4
2013-02-11 16:12:49 -08:00
Andrew Hsieh 300ad09822 Fix return type of glGetAttribLocation and glGetUniformLocation
from int to GLint.

See:
   http://www.khronos.org/opengles/sdk/docs/man/xhtml/glGetAttribLocation.xml
   http://www.khronos.org/opengles/sdk/docs/man/xhtml/glGetUniformLocation.xml

Change-Id: I4a9f8e9e34b8c3cca239ae84bfe8f3cdfd94802a
2012-11-06 14:39:08 -08:00
Mathias Agopian 48d438d05f add support for GL_EXT_debug_marker
This extension is always added to the GL_EXTENSIONS
extension string for the current GL context, regardless
of if it's supported by the h/w driver.

The extension itself will be handled by GLES_trace (eventually),
when GLES_trace is not enabled, it'll result to a no-op.

If the h/w implementation has this extension, we'll call that version
instead of our dummy version.

Change-Id: Ie5dd3387c4d45cd5ed5f03b73bda6045620a96bc
2012-01-29 22:22:09 -08:00
Mathias Agopian 11cca925b2 update GL ES stub libraries with the new GL ES headers
Change-Id: I83be94049ddfe3fd7f5bee71a21172ade1498dd5
2010-06-09 18:20:21 -07:00
Mathias Agopian b1a39d67be Added most of the support needed for GLES 2.x 2009-05-27 20:38:06 -07:00