Commit Graph

23 Commits

Author SHA1 Message Date
Jesse Hall
5d721ef6a1 am b0a30e43: EmuGL: remove broken EGL buffer refcounting
* commit 'b0a30e43889415a9a40b9519392ad3be295b9465':
  EmuGL: remove broken EGL buffer refcounting
2011-12-12 15:23:59 -08:00
Jesse Hall
b0a30e4388 EmuGL: remove broken EGL buffer refcounting
The emulator EGL implementation tried to hold its own reference to
buffers acquired/released with dequeueBuffer/queueBuffer, but was
missing an incRef after dequeueBuffer during swapBuffers.

Since the native window holds a reference to the buffer between
dequeueBuffer and queueBuffer, the EGL reference isn't needed anyway.

Change-Id: I95e4f9f4faf59198f99939cdca6603fe176c56bc
2011-12-12 14:05:16 -08:00
Mathias Agopian
9c14396791 should fix sdk build
Change-Id: I5b403056f5245eae9a6476d9d573a3b1c25ea0c6
2011-11-15 21:09:15 -08:00
David 'Digit' Turner
0e205e6d6e emulator: opengl: minor fix and reformatting
This patches fixes a minor invalid usage of delete (instead of delete[])
and reformats the source code a little to make it more obvious.

Change-Id: If853d12e74549abcc6682430c837b0f14da81fdc
2011-10-19 17:54:20 +02:00
Guy Zadickario
f6b9241094 opengles emulator: support glEGLImageTargetRenderbufferStorageOES
needed changes to support glEGLImageTargetRenderbufferStorageOES,
added implementation in egl and added tokens to renderControl.

Also fixed function pointers returned by eglGetProcAddress to
return functions that works independant of the current context,
see system/egl/ClientAPIExts.cpp

That makes the egl_image conformance test to pass on the guest.

Change-Id: I580cda82ba0fb44f12b75aa0bbacf5cd9f15f744
2011-08-10 10:53:06 +02:00
Stas Gurtovoy
e99305dd9f opengles emulator: cache all buffer on the guest
This is needed to support the rare, but still legal scenario,
when glDrawElemets is used with some index array data is stored in VBO's
while the actual attributes (vertices) data is in immediate mode.
When in immediate mode, we need to process the incodes, in order to know
which vertex data to send, which was impossible without the caching.
This commit introduces a new class GLSharedGroup, which will hold all data
that can be shared by shared contexts (buffers are such data).
This also makes the "Jet Cars Stunts" app work properly.

Change-Id: Ic937080dae461bc8cdf4d10cf37066a6e847f464
2011-08-09 17:14:20 +02:00
Stas Gurtovoy
8f887e6f08 opengles emulator: fix eglGetError
eglGetError should set it's internal state to EGL_SUCCESS after every call

Change-Id: I55d1e5b2a03bae8b332c78e8179edd79c9e8e79e
2011-08-09 16:46:25 +02:00
Stas Gurtovoy
39c53186b9 opengles emulator: inc/dec ref-count of buffer on SwapBuffers
On every swapBuffers, we make sure to decRef on the prev buffer,
and incRef on the current buffer. This fixes all the anoying
crashes on application exit, and also after the speech windows
on Replica Island

Change-Id: I1981fbf17a24ef6f60cdcf6d7ec3a5e7eef5377f
2011-08-09 16:46:09 +02:00
Stas Gurtovoy
201584b1d4 egl emulator: fixes for covegl conformance test
Support for eglChooseConfig with configs==NULL.
Also added small change to query EGL_LARGEST_PBUFFER attrib of surfaces.
Fixed error print in QemuPipeStream::readFully.

Those changes make sure that covegl completes & passes on the emulator with Translator
on linux in the backend.

Change-Id: I892917ec102ae85d56a16a7cb321e8c12e7083f1
2011-07-12 00:46:06 +02:00
Liran
2782c5a061 System egl: fix eglInitialize
fix eglInitialize to accept NULL in major/minor parameters
2011-07-03 15:35:12 +03:00
Stas Gurtovoy
62d074d9f8 emulator opengl: add GLESv2 support to driver + renderer
Added GLESv2 library to system.
Made fixes to the host libOpenGLRender to
compile and support GLESv2 (defined WITH_GLES2).
Other fixes required to make GLESv2 to work.

Change-Id: I9eb198e6092e7fa3550342c50929dd1714282cb3
2011-06-30 09:14:12 +03:00
Guy Zadikario
0536060b40 emulator opengl: guest/host rendering syncronization.
Added a return value for rcFlushWindowColorBuffer and
rcUpdateColorBuffer in order to make those calls to block
with a round-trip to the host. This is to make sure that
the color buffer is up-to-date before the flinger use it
for rendering.
Also added a call to the native windows's lock function after
EGL is attached and bound to render on the window. This call
was missed before.

This syncronization can be optimized by removing the round-trip
and insert sync primitive to the stream at every draw command that
reads from a color buffer to make the sync happen on the host
before rendering the color buffer and remove the need for the
guest to wait for that update.

Change-Id: I1c2d8bc407b69663e992a68d5aa755f19bbe0ec3
2011-06-25 16:56:08 +03:00
Stas Gurtovoy
128f401e4f emulator opengles: Fixed a bug in eglChooseConfig implementation.
The config_size argument in rcChooseConfig should match the number
of requested configs and not the size in bytes to store it.
Moved the configs array size computation into rendeerControl.attrib.

Change-Id: I9e797024522965a656764c20252b25ff5ae657f5
2011-06-25 16:30:30 +03:00
Guy Zadikario
1ef706f96f emulator opengl: implement glGetString
Added rcGetGLString token to renderControl to query
a GL string constant from the current context from the host.
Implement glGetString functinality in EGL so that the string
value can be cached in the context structure and also
implementation can be shared between GLESv1 and GLESv2.

Also, fixed clientAPI context initialization check in
eglMakeCurrent. The check was for the previously bounded
context instead for the newly bounded context.

Change-Id: I41c0b4ad462c9ad5bd5c66719b41509bb1b7a947
2011-06-21 20:47:43 +02:00
Stas Gurtovoy
6a79e88f01 emulator opengl: pool of fixups to the system components.
Those fixes make the system load without failure.
Also the flinger and bootanimation are running.

Change-Id: Ieb7039e76c444df778a421a07bccc48514199245
2011-06-21 01:41:50 +03:00
Stas Gurtovoy
2220d27302 emulator opengl: added Bind texture to EGLImage/surface
added functionality to bind an EGLImage to a texture both
in the system and host sides.

Change-Id: I2dc26090b45da080ac4d0e8f5799c95f7cc54634
2011-06-21 01:41:50 +03:00
Stas Gurtovoy
de40cd3cc8 emulator opengl: Small change to support more surface attributes
Change-Id: I14d630d50c8505dabcd065e6187bd6d6509c312b
2011-06-17 17:27:19 +03:00
Stas Gurtovoy
a7b7e95b03 emulator opengl: implement eglChooseConfig functionality.
Added new RenderControl command to request the host to execute
the ChooseConfig functionality.

Change-Id: Ib92be313a6df740de69d671c6994ec6cae17ea13
2011-06-11 00:16:21 +03:00
Stas Gurtovoy
33dc9add2a emulator opengl: some system egl fixes after a review.
Change-Id: I4a0c72319e8c69fba8ac00ed7bfff7667ae07269
2011-06-11 00:16:21 +03:00
Stas Gurtovoy
c36ac6ed2f emulator opengl: moved gralloc buffer handle struct to be shared.
We need to share the cb_hande_t between gralloc/EGL/GLES, moved it
into the opengl system common lib.
Also added eglSwapBuffers implementation.

Change-Id: Ia461a48c273af42293aafcf084e457adf03cbed3
2011-06-11 00:16:21 +03:00
Stas Gurtovoy
dd0a3777bc Handle egl context
Added EGLContext functionality to emulator's accelerated EGL implementation.

Change-Id: Idde7d701808839f8d89c6c081a9f3216bdea7a52
2011-06-11 00:16:20 +03:00
Stas Gurtovoy
8a8c601c4f emulator opengl: Create and destroy Surfaces
Also fixed link failure.

Change-Id: I4cbe28b2d51a5d4e48c4cba72df64f9df0898da5
2011-06-11 00:15:19 +03:00
Stas Gurtovoy
37db3deb7b First commit of the system egl implementation.
At this point system/egl should build without errors

Change-Id: Ieabae930fc20a8df4f3d68f179d685401e946e74
2011-06-09 21:24:26 +03:00