Commit Graph

96 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
Hiroshi Yamauchi 4e7de461c1 Replace JNI primitive array critical calls with non-critical ones.
The glgen part.

Bug: 19235243
Change-Id: I69dfa84f15366808b964517c1ba270ddeb3c5940
2015-05-12 14:24:23 -07:00
Dan Albert ad0f52fc2b Fix pointer-to-int and int-to-pointer warnings.
Change-Id: If534cbcf2c3e644270572cbf829ba9b5acab29e6
2015-02-23 10:45:27 -08:00
Jesse Hall 4aaa39358f Merge "Avoid overwriting EGL14.EGL_NO_SURFACE" 2014-12-02 00:34:51 +00:00
Sangkyu Lee 7290c24354 Avoid overwriting EGL14.EGL_NO_SURFACE
Both EGL14 and EGLExt have the same initialization codes for
EGL14.EGL_NO_SURFACE, EGL14.EGL_NO_CONTEXT and EGL14.EGL_NO_DISPLAY.
Since EGLExt is initialized later, they are overwritten by EGLExt's
initialization codes.
Therefore, EGL_NO_SURFACE returned by methods in EGL14 is not
actually EGL14.EGL_NO_SURFACE object and it makes several problems in
handling error cases.
For instance, "Let's fish" game application cannot be run on L.

To solve the problem, this patch makes EGL14.EGL_NO_SURFACE,
EGL14.EGL_NO_CONTEXT and EGL14.EGL_NO_DISPLAY initialized just once.

Change-Id: Icce878164ff0b715ad2b5a2cd038a9616c7cf1e9
2014-11-25 10:46:06 +09:00
Andreas Gampe b5da0d78d2 Frameworks/native: Add pragmas to glgen headers
The code currently being generated by glgen is not the cleanest, but
we would like to get core/jni onto -Werror. Thus add pragmas turning
off warnings locally to the C headers.

Also fix signed-comparison in two functions.

Longer term TODO: Emit clean code.

Change-Id: Iee8582f8c0c1de076d64851d3b6ca467afd5bc43
2014-11-12 10:10:12 -08:00
Jesse Hall 391109083f opengl: Fix include style in generated JNI code
Bug: 15028495
Change-Id: Ie38d398751a374f11bef8944a2aa0f8311934911
2014-05-20 13:31:05 -07:00
Jesse Hall 0232d3d11c opengl: Un-hide GLES31 and GLES31Ext classes
Bug: 15028495
Change-Id: Iaac1e8d2ad5ea840d728a78804e2566be18a4340
2014-05-20 13:31:05 -07:00
Jesse Hall 16f0392874 opengl: Add GLES31 and GLES31Ext class templates
Bug: 15028495
Change-Id: I276d04f029d441e092428fad72f09ca15e1d233a
2014-05-20 13:31:05 -07:00
Jesse Hall 26d82dd0ab Merge "opengl: Regenerate code with ES 3.1 and new extensions" 2014-05-20 18:42:20 +00:00
Jesse Hall c1eef76d2c Merge "opengl: Add EXT_primitive_bounding_box to registry" 2014-05-20 18:39:52 +00:00
Jesse Hall 481b5ebb90 Merge "opengl: Update registry and headers from Khronos" 2014-05-20 18:39:32 +00:00
Jesse Hall eb6e4cc81c Merge "opengl: Generate *.in from registry XML" 2014-05-20 18:39:16 +00:00
Jesse Hall 0abc6e904a Merge "Import GL registry from upstream @r26448." 2014-05-19 23:49:07 +00:00
Jesse Hall 6cb7d3dc9f 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: I35acb473cba2433b9aeb95d1b8bfbdcfadf22532
2014-05-19 12:54:05 -07:00
Jesse Hall a66730f787 opengl: Add EXT_primitive_bounding_box to registry
This extension hasn't been published yet, so it isn't in the public
registry. That will change before the next platform release to AOSP.

Bug: 15028495
Change-Id: Iadafe0f776b5b9be4f81c4279a89c57ae02293e4
2014-05-19 12:54:05 -07:00
Jesse Hall f466a51c13 opengl: Update registry and headers from Khronos
gl.xml @ r26697:
https://cvs.khronos.org/svn/repos/ogl/trunk/doc/registry/public/api

GLES headers @ r26698:
https://cvs.khronos.org/svn/repos/registry/trunk/public/gles/api

Bug: 15028495
Change-Id: Id8e7aaf8a09ec6f47dc3a3b14b95d0ddf35d50f6
2014-05-19 12:54:05 -07: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 a42788e2b8 Import GL registry from upstream @r26448.
Public GL registry is at:
https://cvs.khronos.org/svn/repos/ogl/trunk/doc/registry/public/api

Bug: 15028495
Change-Id: I41cc865bf39e1155c4467411d0b1afced44b0874
2014-05-19 12:54:04 -07:00
Jesse Hall 2fc72d1c02 opengl: Fix whitespace in Java templates
Someone fixed these in the generated code, so re-generating even with
no other changes caused diffs. Better to just fix it at the source.

Bug: 15028495
Change-Id: I248f9796d4e3d904c4c0dc15be5f8de231df7285
2014-05-18 15:34:04 -07:00
Narayan Kamath 622b6b28f2 Fix bad link tag in javadoc.
Java7 javadoc tools seem to accept this without complaint
but not all targets use java7 yet.

Change-Id: Ib08be8ad0f7db2e89f38b764cce858d0e7eecd2e
2014-02-28 14:05:52 +00:00
Narayan Kamath a90086a914 API changes for 64 bit platforms.
EGLObjectHandle.<init>(int) and int EGLObjectHandle.getHandle()
have now been deprecated and replaced with variants that take
and return java longs.

bug: 13181704
Change-Id: Ie88e591c288d6de5655364b4cd673f61cce68d7d
2014-02-27 14:12:55 +00:00
Narayan Kamath 2c95c57b62 am 3e599252: am 93e6a48b: Merge "AArch64: Make eglGetDisplay(int) work for EGL_DEFAULT_DISPLAY"
* commit '3e599252c0f5a8e70f4b8d4ab5baffb7e5b0b0e1':
  AArch64: Make eglGetDisplay(int) work for EGL_DEFAULT_DISPLAY
2014-02-27 13:29:42 +00:00
Ashok Bhat d61b48c090 AArch64: Make eglGetDisplay(int) work for EGL_DEFAULT_DISPLAY
This will allow eglGetDisplay(int) to work on both 32-bit
and 64-bit systems when EGL_DEFAULT_DISPLAY is passed as
a parameter.

Change-Id: I0d7e9ca5410b0dd893eacc02aac40956908e4f25
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
2014-02-26 19:06:27 +00:00
Narayan Kamath d6b4e78dca am aa01ad91: am aaa27fd5: Merge "Use reinterpret_cast when an integer is cast to a pointer"
* commit 'aa01ad91cd22304fd15810f241c67ebb59e90c04':
  Use reinterpret_cast when an integer is cast to a pointer
2014-02-25 13:17:12 +00:00
Narayan Kamath ab7b4fe490 am 097b5991: am e5c99bf3: Merge "Use long for pointers in opengl/EGL classes"
* commit '097b59919f01d7b057d252d23cb96ce5fcdd9469':
  Use long for pointers in opengl/EGL classes
2014-02-25 13:17:11 +00:00
Narayan Kamath aaa27fd5a0 Merge "Use reinterpret_cast when an integer is cast to a pointer" 2014-02-25 13:05:49 +00:00
Ashok Bhat d8f096114d Use reinterpret_cast when an integer is cast to a pointer
Change-Id: I5adcd59f58c029f7b2b596f4826d8ea69fb9bba6
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
2014-02-24 14:34:16 +00:00
Ashok Bhat ab6fc2a86f Use long for pointers in opengl/EGL classes
EGL classes in frameworks/base have to be updated to support
64-bit platforms. Key changes in the EGL classes include

[x] EGLObjectHandle class - EGLObjectHandle class has two public
    methods (constructor and getHandle) that assume handles are
    32-bit. They have not been changed. Instead, two new hidden
    methods (EGLObjectHandle(long) and getNativeHandle) have been
    added.

[x] EG14 class - Two public methods eglGetDisplay and
    eglCreatePbufferFromClientBuffer assume that handles are 32-bit.
    They have been changed to throw unsupported operation exception
    on non 32-bit machines. Two new methods eglGetDisplay(long)
    and eglCreatePbufferFromClientBuffer(...long buffer..) have
    been added to support 64-bit handles.

To allow the above changes in frameworks/base EGL classes,
corresponding code generation mechanism in frameworks/native has
been updated.

Change-Id: I5d0a62e10c20ccf05f610d6608b8dfb6414b5116
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
2014-02-24 14:27:44 +00:00
Narayan Kamath 9076fa78d2 Merge "Update EGL codegen to be in sync with frameworks/base" 2014-02-21 14:27:36 +00:00
Ashok Bhat fb913cdb47 Update GLES codegen to be in sync with frameworks/base
Patch from synergydev with commit-id 01994c79 changed
core/jni/com_google_android_gles_jni_GLImpl.cpp in the
frameworks/base. However the corresponding code snippet
in frameworks/native was not updated. This patch addresses
the issue.

Change-Id: I89c3d88de832efc8cbbe682c8a7ff7dfbef99db3
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
2014-02-20 19:56:50 +00:00
Ashok Bhat 8e472fb443 Update EGL codegen to be in sync with frameworks/base
Patch from Takeshi Aimi with commit-id f9337377 changed
core/jni/android_opengl_EGL14.cpp in the frameworks/base.
However the corresponding code snippet in frameworks/
native was not updated. This patch addresses the issue.

Change-Id: I40bcc43d36d7ab4e0db4a73556a4f7480c7431c1
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
2014-02-20 19:33:15 +00:00
Andy McFadden 50166d1173 Hide three malformed GL bindings
They were replaced with correct bindings a while back, but the
broken methods weren't hidden.

Also, pick up two changes that were made to the generated code
rather than the source.

Bug 6006380

Change-Id: Ibfe9a5f2e13e745f8d82116d1b4d8c2d025ac830
2014-02-19 10:27:24 -08:00
Elliott Hughes b7f3742feb am d9be16f9: Merge "Fix OpenGL stub exception handling."
* commit 'd9be16f920f7c2581fda3ca495c1e6fc88857a6c':
  Fix OpenGL stub exception handling.
2013-09-27 15:38:04 -07:00
Elliott Hughes 2adde7c837 Fix OpenGL stub exception handling.
Bug: https://code.google.com/p/android/issues/detail?id=60390
Change-Id: I2bdc22c5fe75f5e41ffb9dd9259ae92cf8a12917
2013-09-24 17:18:05 -07:00
Mathias Agopian db89edc94b All consumers now take an IGraphicBufferConsumer instead of a BufferQueue
this means they only have access to the consumer end of
the interface. we had a lot of code that assumed consumers
where holding a BufferQueue (i.e.: both ends), so most of
this change is untangling in fix that

Bug: 9265647
Change-Id: Ic2e2596ee14c7535f51bf26d9a897a0fc036d22c
2013-08-06 20:05:36 +00:00
Andy McFadden 9a90aa9003 Fix wrapper equals()
Make it faster and correcter.

Also, fixed the "gen" script to update the static/egl/*.java files
as part of doing an update.  Altered the "git" lines to change
directories before invoking git -- necessary because we're now
split between frameworks/base and frameworks/native.

Bug 9204146

Change-Id: Ie60504b1932349e6f2c9d3868dee6a645ef2b36e
2013-06-21 16:22:02 -07:00
Jesse Hall 16b4f33d2b am 958ef3d7: am c8639351: Generate new EGLExt class
* commit '958ef3d79c48ddef3afa5327f7ed15a5ecfd2d1d':
  Generate new EGLExt class
2013-05-02 13:49:25 -07:00
Jesse Hall c86393510c Generate new EGLExt class
Initially populated with EGL_ANDROID_presentation_time (moved from the
EGL14 class) and the ES-relevant parts of EGL_KHR_create_context.

Bug: 8678160
Change-Id: Ifed2ee3da264ca701ae1f4b309a0758f7fcc3acc
2013-05-02 13:44:29 -07:00
Jesse Hall c59db7fdfe am 34c0fb18: am cc8f8ad3: Merge "Fix glGetUniformIndices JNI prototype" into jb-mr2-dev
* commit '34c0fb183767b80e93a7cd77233ead5fe50bd822':
  Fix glGetUniformIndices JNI prototype
2013-04-30 19:34:49 -07:00
Jesse Hall 46fc9cb60c Fix glGetUniformIndices JNI prototype
Bug: 8657863
Change-Id: I130d1b54d0cbd1f8613d3108482526d05d73d9e4
2013-04-29 16:01:56 -07:00
Andy McFadden 42137d2e72 Fix range check
The getarray() function checks to see if there's enough room in
the buffer, but it's using a byte count for the available size
and a possibly non-byte count for the space required.  Dividing
down by the unit size corrects the problem.

Bug 8713753

Change-Id: Id42c0df65c3233dcc5f76d05e229f7d40d4c1f99
2013-04-25 15:58:25 -07:00
Jesse Hall c0d184b8c1 Subclass GLES30 from GLES20, @Deprecate GL_STENCIL_INDEX
Bug: 8566953
Change-Id: I66085c300a8658a4018796645257edb73be94719
2013-04-15 16:42:21 -07:00
Jesse Hall 4f6693080c Special-case glGetActiveUniformBlockName
Bug: 8566953
Change-Id: Ic9b3be9fa0136495633ee3b1c38583cfa315942a
2013-04-10 22:00:39 -07:00
Jesse Hall fa4c1170ac Special-case glGetStringi
Modeled on the existing glGetString special-case.

Bug: 8566953
Change-Id: Icc6b23ab53b00510368900ad99c92028253dc797
2013-04-10 22:00:33 -07:00
Jesse Hall 1c8b8e8b8e Special-case glMapBufferRange
Updating the generator to handle GLvoid*/java.nio.Buffer return values
probably wouldn't be too hard, but this is the only function that
needs it currently.

Bug: 8566953
Change-Id: I359a951136ab479ab576ce2e5a2881b937b7e8c9
2013-04-10 22:00:26 -07:00
Jesse Hall 610bbf2b6f Special-case glGetBufferPointerv
Bug: 8566953
Change-Id: I11a7394eb46f229fd3ae716e77487a45bac6ed53
2013-04-10 22:00:18 -07:00
Jesse Hall 27c86b9623 Special-case glGetUniformIndices
Bug: 8566953
Change-Id: Ic8bcd03e8d41a81f48d603f67ce2046a4afa1561
2013-04-10 22:00:18 -07:00
Jesse Hall 31f6edc21b Special-case glGetTransformFeedbackVarying
Just a search-and-replace on the glGetActiveAttrib special-case, since
they have the same signature and parameter handling.

Bug: 8566953
Change-Id: I40834d6f32bf9ecb39718df29036aa2d1bbfa07a
2013-04-10 22:00:18 -07:00
Jesse Hall 552a620482 Special-case glTransformFeedbackVaryings
Bug: 8566953
Change-Id: I02a1548aebc12bd3599903029bfd2e4ccea53211
2013-04-10 22:00:18 -07:00