Commit Graph

890 Commits

Author SHA1 Message Date
David 'Digit' Turner
c6d73d7af4 am d960239d: am 43946da5: am 7f45e7c1: Merge "emulator: oops, really fix the build"
* commit 'd960239de6371c2368792c6cc75de6d59abe172c':
  emulator: oops, really fix the build
2011-08-29 11:05:01 -07:00
David 'Digit' Turner
bce8ca33d0 am fec153a7: am 9765cb8a: am 2a59fa7d: Merge "emulator: fix the build"
* commit 'fec153a765edf051f3b97610c748d1ab9526cbfa':
  emulator: fix the build
2011-08-29 11:04:57 -07:00
David 'Digit' Turner
d960239de6 am 43946da5: am 7f45e7c1: Merge "emulator: oops, really fix the build"
* commit '43946da54d3dc8d840c5e39c8eaf2f46ece57518':
  emulator: oops, really fix the build
2011-08-25 14:30:12 -07:00
David 'Digit' Turner
fec153a765 am 9765cb8a: am 2a59fa7d: Merge "emulator: fix the build"
* commit '9765cb8a7f29dacc615d2357d04ee5412c3e888d':
  emulator: fix the build
2011-08-25 14:30:08 -07:00
David 'Digit' Turner
20d5b0a857 emulator: oops, really fix the build
Change-Id: Id8de1b6a069cdc462681cf44bf8ebd84bbd1e6f0
2011-08-25 22:14:29 +02:00
David 'Digit' Turner
8b55909388 emulator: fix the build
Change-Id: Id88f488d441f04b10de3bca8ffe5c37763c4e98e
2011-08-25 22:00:55 +02:00
David 'Digit' Turner
2746a34082 am c0a719b8: am c6623763: am f29ee346: Merge "emulator: opengl: Open libGL.dylib as a framework on Mac"
* commit 'c0a719b864071df069859ef595271020b960a99a':
  emulator: opengl: Open libGL.dylib as a framework on Mac
2011-08-25 05:58:38 -07:00
David 'Digit' Turner
c0a719b864 am c6623763: am f29ee346: Merge "emulator: opengl: Open libGL.dylib as a framework on Mac"
* commit 'c6623763231c35b738863f5429ddf11c1af3a0be':
  emulator: opengl: Open libGL.dylib as a framework on Mac
2011-08-25 05:56:45 -07:00
David 'Digit' Turner
3f88bea9a8 emulator: opengl: Open libGL.dylib as a framework on Mac
This patch modifies GLDispatch.cpp in the translator libraries
to open the Darwin GL library as a framework. Using a hard-coded
system path prevents the requirement to modify LD_LIBRARY_PATH
or DYLD_LIBRARY_PATH to point to the directory that contains the
library.

In this specific case, this is equivalent to

/System/Frameworks/OpenGL.framework/Libraries/libGL.dylib

But is the "kosher" way to open it the library.

Change-Id: Iccd6568d36fc97200617c268f05d7b4ea85f918e
2011-08-25 14:40:43 +02:00
David 'Digit' Turner
58df39a591 am 93ee57e6: am 3490b1c2: am b69f4871: Merge "emulator: opengl: remove debug traces."
* commit '93ee57e6786ff406a01161f7a07d9103d4856e48':
  emulator: opengl: remove debug traces.
2011-08-24 09:27:56 -07:00
David 'Digit' Turner
64483553ef am 614d39c2: am f66bbde9: am 95f517bf: Merge "emulator: opengl: Make host decoder libraries static"
* commit '614d39c2f75db3f25ce55a876948c91591f8bf1d':
  emulator: opengl: Make host decoder libraries static
2011-08-24 09:27:54 -07:00
David 'Digit' Turner
0705808814 am efd0415c: am b492a89f: am 476ff38f: Merge "emulator: opengl: build gralloc driver by default"
* commit 'efd0415cf81ddf8c276af1553ded3756e71c53bf':
  emulator: opengl: build gralloc driver by default
2011-08-24 09:27:51 -07:00
David 'Digit' Turner
4ff832cc41 am e0a093ec: am e526f515: am 6d241caf: Merge "emulator: opengl: support moved shared libraries."
* commit 'e0a093ec5b527b3f5455fc54b59e96bd9cc88188':
  emulator: opengl: support moved shared libraries.
2011-08-24 09:27:49 -07:00
David 'Digit' Turner
9eb39ab27f am 6479d059: am 4a6acc04: am d8079c1e: Merge "emulator: opengl: Avoid conflicts with SDL_CONFIG"
* commit '6479d059feb638a7230379621fdd54b86eee5951':
  emulator: opengl: Avoid conflicts with SDL_CONFIG
2011-08-24 09:27:46 -07:00
David 'Digit' Turner
96fafad0ca am b0e1f794: am 011acd64: am d98b3782: Merge "emulator: opengl: fix Windows build"
* commit 'b0e1f794c08f09e4e3f30a00ca686d02a838a020':
  emulator: opengl: fix Windows build
2011-08-24 09:27:43 -07:00
David 'Digit' Turner
eaaa559011 am 827619fc: am d9e0cdfd: am 69f7c472: Merge "Remove obsolete comments"
* commit '827619fc57402c2fbc974e3c2a5da60a3819bf51':
  Remove obsolete comments
2011-08-24 09:27:38 -07:00
David 'Digit' Turner
93ee57e678 am 3490b1c2: am b69f4871: Merge "emulator: opengl: remove debug traces."
* commit '3490b1c2e45f72114d3ac78b35854573e2cbe6de':
  emulator: opengl: remove debug traces.
2011-08-24 09:23:38 -07:00
David 'Digit' Turner
614d39c2f7 am f66bbde9: am 95f517bf: Merge "emulator: opengl: Make host decoder libraries static"
* commit 'f66bbde91de9ff4a9ea87bb16133393fc1027bd7':
  emulator: opengl: Make host decoder libraries static
2011-08-24 09:23:36 -07:00
David 'Digit' Turner
efd0415cf8 am b492a89f: am 476ff38f: Merge "emulator: opengl: build gralloc driver by default"
* commit 'b492a89f00dcea382fc238eb85f5ce3ce4262039':
  emulator: opengl: build gralloc driver by default
2011-08-24 09:23:34 -07:00
David 'Digit' Turner
e0a093ec5b am e526f515: am 6d241caf: Merge "emulator: opengl: support moved shared libraries."
* commit 'e526f515d4615ca2d97fde5aa945f8f60a148089':
  emulator: opengl: support moved shared libraries.
2011-08-24 09:23:31 -07:00
David 'Digit' Turner
6479d059fe am 4a6acc04: am d8079c1e: Merge "emulator: opengl: Avoid conflicts with SDL_CONFIG"
* commit '4a6acc04ca6982114a24c85cc1220bc216d4d867':
  emulator: opengl: Avoid conflicts with SDL_CONFIG
2011-08-24 09:23:28 -07:00
David 'Digit' Turner
b0e1f794c0 am 011acd64: am d98b3782: Merge "emulator: opengl: fix Windows build"
* commit '011acd64edd3d484c0705c426b8d2d3b69f3f997':
  emulator: opengl: fix Windows build
2011-08-24 09:23:25 -07:00
David 'Digit' Turner
827619fc57 am d9e0cdfd: am 69f7c472: Merge "Remove obsolete comments"
* commit 'd9e0cdfda9988f2f45ded4c2c590b8f61c4d9335':
  Remove obsolete comments
2011-08-24 09:23:21 -07:00
David 'Digit' Turner
47cbdfb291 emulator: opengl: remove debug traces.
You can still re-enable them by uncommenting one line in
development/tools/emulator/opengl/Android.mk

Change-Id: Ie0a640b6f3359b437aba40b124da0892defb00ef
2011-08-24 16:06:21 +02:00
David 'Digit' Turner
cecb6a0e36 emulator: opengl: Make host decoder libraries static
These libraries are only used by libOpenglRender, so make them
static so that their code is included in this shared library
instead. This reduces the shared library dependencies that
will be required from the emulator.

Change-Id: I24438932f0d6b40852b515140ea6950c04124fdd
2011-08-24 16:06:21 +02:00
David 'Digit' Turner
6efe381c82 emulator: opengl: build gralloc driver by default
This patch forces the default definition of BUILD_EMULATOR_OPENGL_DRIVER
to true by default, which is the common case where we will build the
goldfish-specific gralloc hardware module to allow SurfaceFlinger to
use GLES emulation exclusively.

The only reason to define thi to 'false' today is to debug specific
apps, but this requires displaying the GL output in a different window
than the emulator to be usable.

Change-Id: Iaf03a9c780449bb6b991928d324a088021a73203
2011-08-24 16:06:21 +02:00
David 'Digit' Turner
5dfd5b292a emulator: opengl: support moved shared libraries.
It is possible to move the final installation path of a shared
library by using LOCAL_MODULE_PATH/LOCAL_UNSTRIPPED_PATH in its
module declaration.

We do this for example to put certain libraries under /system/lib/egl
or /system/lib/hw.

However, the Android build system has a small bug where you cannot
depend on these shared libraries because it will complain it doesn't
find them under /system/lib, the default install location.

More precisely, consider libfoo defined as:

  include $(CLEAR_VARS)
  LOCAL_MODULE := libfoo
  LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/egl
  ...
  include $(BUILD_SHARED_LIBRARY)

Its final binary will be installed to /system/lib/egl/libfoo.so

Now, let's write a module that depends on it, as:

  include $(CLEAR_VARS)
  LOCAL_MODULE := libbar
  LOCAL_SHARED_LIBRARIES += libfoo
  ...
  include $(BUILD_SHARED_LIBRARY)

The build system will complain there is no rule to define the target
/system/lib/libfoo.so, but the target should be /system/lib/egl/libfoo.so.

A work-around is to define libbar as follows instead:

  include $(CLEAR_VARS)
  LOCAL_MODULE := libbar
  LOCAL_ADDITIONAL_DEPENDENCIES := $(TARGET_OUT_SHARED_LIBRARIES)/egl/libfoo.so
  ...
  include $(BUILD_SHARED_LIBRARY)

This works if you don't need to link against the library when building your
shared library (which is fortunately the case for the GLES emulation
libraries).

That's essentially what this patch implements under common.mk. We update
emugl-set-shared-library-subpath to record that a module has been "moved",
and we avoid adding them to the LOCAL_SHARED_LIBRARIES variable of the
modules that export it.

+ Simplify three Android.mk files accordingly.

Change-Id: Id15bef5359b0daa8d82bfaa5abf9346f00190ab5
2011-08-24 16:01:00 +02:00
David 'Digit' Turner
e2dda38017 emulator: opengl: Avoid conflicts with SDL_CONFIG
Do not redefine SDL_CONFIG to avoid conflicts with the emulator's
build system which depend on its definition. Note that this has
been fixed in another patch (https://review.source.android.com/25684)
but it is also cleaner to do this here.

Change-Id: I1a30d200e467ac7a91a1e6135fa1de34033e8df0
2011-08-24 16:00:56 +02:00
David 'Digit' Turner
0008793af3 emulator: opengl: fix Windows build
Change-Id: I6953feee41cb2e27f884629104ff6b3b9cccabbc
2011-08-24 16:00:55 +02:00
David 'Digit' Turner
503419ca75 Remove obsolete comments
Change-Id: Ibaeca7f3cd17305dd4cac042d6020455c5675e2d
2011-08-23 14:10:46 +02:00
David Turner
8597e73b09 am 215a9b22: am 4b9e753f: am beda8a2f: Merge "opengles emulator- check framebuffer status fix"
* commit '215a9b221436a1f1137a48c529d955893dad0736':
  opengles emulator- check framebuffer status fix
2011-08-22 05:39:56 -07:00
David Turner
215a9b2214 am 4b9e753f: am beda8a2f: Merge "opengles emulator- check framebuffer status fix"
* commit '4b9e753fd5fe8e39b122c31e4f4d0911a4c65dc6':
  opengles emulator- check framebuffer status fix
2011-08-22 05:37:28 -07:00
Liran
f7e7e467ce opengles emulator- check framebuffer status fix
add drawValidate when calling glCheckFramebufferStatus
in the draw validate, a color attachement will be added to the
framebuffer if there is no target attached to COLOR_ATTACHMENT
of the framebuffer.
opengl does not allow framebuffer with no color attachement
so CheckFramebufferStatus would return INCOMPLETE status.

We already call drawValidate before any draw, the call was
missing at glCheckFramebufferStatus.

Change-Id: I94b930024c3076ac5fe0f8662d11884729c4f953
2011-08-22 14:11:45 +02:00
David Turner
fd783762b0 am 7de05220: am 0b21f486: am b5588b2e: Merge "opengles emulator: fixes flashing effect on Mac"
* commit '7de05220d9ac57691beb4b9a38b7b2113b0f41ab':
  opengles emulator: fixes flashing effect on Mac
2011-08-22 04:19:09 -07:00
David Turner
5df789464c am c3b673b9: am d11fe07f: am 2b80fc12: Merge "opengles emulator: fixed EGL sharing context"
* commit 'c3b673b99cb8e5650355bcb27079dc92b38dbb12':
  opengles emulator: fixed EGL sharing context
2011-08-22 04:19:04 -07:00
David Turner
7de05220d9 am 0b21f486: am b5588b2e: Merge "opengles emulator: fixes flashing effect on Mac"
* commit '0b21f4863bb56f7f5e159dd1cb8dbdba364a7c3e':
  opengles emulator: fixes flashing effect on Mac
2011-08-22 04:15:26 -07:00
David Turner
c3b673b99c am d11fe07f: am 2b80fc12: Merge "opengles emulator: fixed EGL sharing context"
* commit 'd11fe07fed4a1d06ece5b21a05ab9fd302abc4bf':
  opengles emulator: fixed EGL sharing context
2011-08-22 04:15:23 -07:00
Guy Zadickario
4629d2412b opengles emulator: fixes flashing effect on Mac
There is a flashing effect we see on Mac when switching between
drawables (pbuffer and a window) on the same context.
This change make the FrameBuffer object in the renderer to use
two different OpenGL contexts, one which is used while the pbuffer
drawable is bound and another which is used when the subwindow is
bounded during swap. The two contexts share textures so both contexts
have access to all allocated color buffers.

While this fixes the flashing effect on Mac, it should be more effective on
other platforms as well.

Change-Id: I63b49f0cdae8e2785765503750bbf5fbd4d963a1
2011-08-18 13:36:38 +03:00
Guy Zadickario
bdf4c1f436 opengles emulator: fixed EGL sharing context
Wrong share group was set up when two user contexts are sharing !
That means that shared context was not really worked before, now it does.

Change-Id: Ia4edbba0441e309902b2c48c44865342410bae3d
2011-08-18 13:36:38 +03:00
David Turner
27cc0fe3dd am c2f31ef2: am dba6bd45: am ca7a7b05: Merge "opengles emulator: use bionic tls slot"
* commit 'c2f31ef27b778e77e71a918276f6f6cad0e7d071':
  opengles emulator: use bionic tls slot
2011-08-16 07:56:07 -07:00
David Turner
c2f31ef27b am dba6bd45: am ca7a7b05: Merge "opengles emulator: use bionic tls slot"
* commit 'dba6bd45f8a7398d217c6418211dfc9d2c34966d':
  opengles emulator: use bionic tls slot
2011-08-16 07:54:53 -07:00
David Turner
ca7a7b0571 Merge "opengles emulator: use bionic tls slot" 2011-08-16 07:35:29 -07:00
David Turner
f297a9e9d8 am 436dc98c: am 11064844: am 8066f12a: Merge "opengles emulator: code cleanup removing dead code"
* commit '436dc98c3d8f803e3f14cdc1193048240c7a31e7':
  opengles emulator: code cleanup removing dead code
2011-08-16 06:59:43 -07:00
David Turner
436dc98c3d am 11064844: am 8066f12a: Merge "opengles emulator: code cleanup removing dead code"
* commit '11064844ee9ed8123f1e5f815e1982bb3101dc8b':
  opengles emulator: code cleanup removing dead code
2011-08-16 06:55:50 -07:00
Guy Zadickario
75094ee1ac opengles emulator: use bionic tls slot
This make the EGL/GLESv1/GLESv2 libraries on the guest to use
the OPENGL bionic tls slot for faster tls access.
Note that we still setting the slower tls in order to have the
tls destructor which allow us to close the host connection
when the thread exits.

Gives slightly performance improvement, the avg score for the
teapot test in 0xBench goes from 34 to 37 fps. (This test is
near immediate mode since it renders a lot of small primitives
so it is a good candicate to be improved).

Change-Id: I9060c75cc29c2e28721fa11d3f318b438edb5da9
2011-08-16 15:12:03 +03:00
David Turner
0ccfb0b02f am 61a5598a: am ca84c2cf: am 2c68d0f3: Merge "opengles emulator: replace the readback at end of frame with blit"
* commit '61a5598aed847bc4cf6003b3cdbc96863b6f4ba2':
  opengles emulator: replace the readback at end of frame with blit
2011-08-16 03:52:13 -07:00
David Turner
61a5598aed am ca84c2cf: am 2c68d0f3: Merge "opengles emulator: replace the readback at end of frame with blit"
* commit 'ca84c2cf37597603f6502c9ba51ca8dbdccaa76d':
  opengles emulator: replace the readback at end of frame with blit
2011-08-16 03:38:49 -07:00
Guy Zadickario
b9a5baf42b opengles emulator: code cleanup removing dead code
This change removes the 'blitFromPbuffer' path in the renderer
which uses binding pbuffer to texture. This path does not work
on all platforms and is not relavent any more. It simplifies
a lot the FBConfig filtering code.

Also, added a check to fail the renderer initialization if
the translator plugin does not support EGL_KHR_gl_texture_2d_image
and GL_OES_EGL_IMAGE (by both GLES implementations [1 and 2])
since our implementation requires it.

Change-Id: Ifd4c66943a8da56308cfb7e38914c962b4f5befe
2011-08-16 12:14:02 +03:00
Guy Zadickario
8c962dce6c opengles emulator: replace the readback at end of frame with blit
That replaces the readback to host we do at the end of each frame
with two blits on the GPU, one to copy the pixels into a texture
and another to render the texture to another in order to flip
the image.

Change-Id: I7e0e10493d38944d0b613e245023f34236d3dfc4
2011-08-16 10:52:19 +03:00
David Turner
d1e8a2e257 am 53aef614: am e8026df0: am e16a448d: Merge "emulator opengles: improve TcpStream throughput"
* commit '53aef61457167f1dae050a30df7ed7f49ac55cc3':
  emulator opengles: improve TcpStream throughput
2011-08-15 16:23:33 -07:00