• Home
Name
Date
Size
#Lines
LOC

..--

host/03-May-2024-31,48923,248

shared/03-May-2024-4,3673,212

system/03-May-2024-9,1846,944

tests/03-May-2024-10,8898,189

Android.mkD03-May-20243.3 KiB9530

DESIGND03-May-202424.8 KiB594441

READMED03-May-20244.4 KiB9569

common.mkD03-May-202412.6 KiB342172

README

1This directory contains the modules related to hardware OpenGL ES emulation.
2
3I. Overview of components:
4==========================
5
6The 'emugen' tool is used to generate several source files related to the
7EGL/GLES command stream used between the guest and the host during emulation.
8
9  host/tools/emugen   -> emugen program
10
11Note that emugen is capable of generating, from a single set of specification
12files, three types of auto-generated sources:
13
14  - sources to encode commands into a byte stream.
15  - sources to decode the byte stream into commands.
16  - sources to wrap normal procedural EGL/GLES calls into context-aware ones.
17
18Modules under the system/ directory corresponds to code that runs on the
19guest, and implement the marshalling of EGL/GLES commands into a stream of
20bytes sent to the host through a fast pipe mechanism.
21
22   system/GLESv1_enc        -> encoder for GLES 1.1 commands
23   system/GLESv2_enc        -> encoder for GLES 2.0 commands
24   system/renderControl_enc -> encoder for rendering control commands
25   system/egl               -> emulator-specific guest EGL library
26   system/GLESv1            -> emulator-specific guest GLES 1.1 library
27   system/gralloc           -> emulator-specific gralloc module
28   system/OpenglSystemCommon -> library of common routines
29
30Modules under the host/ directory corresponds to code that runs on the
31host, and implement the decoding of the command stream, translation of
32EGL/GLES commands into desktop GL 2.0 ones, and rendering to an off-screen
33buffer.
34
35  host/libs/GLESv1_dec        -> decoder for GLES 1.1 commands
36  host/libs/GLESv2_dec        -> decoder for GLES 2.0 commands
37  host/libs/renderControl_dec -> decoder for rendering control commands
38
39  host/libs/Translator/EGL    -> translator for EGL commands
40  host/libs/Translator/GLES_CM -> translator for GLES 1.1 commands
41  host/libs/Translator/GLES_V2 -> translator for GLES 2.0 commands
42  host/libs/Translator/GLcommon -> library of common translation routines
43
44  host/libs/libOpenglRender -> rendering library (uses all host libs above)
45                               can be used by the 'renderer' program below,
46                               or directly linked into the emulator UI program.
47
48  host/renderer/ -> stand-alone renderer program executable.
49                    this can run in head-less mode and receive requests from
50                    several emulators at the same time. It is the receiving
51                    end of all command streams.
52
53Modules under the test/ directory correspond to test programs that are useful
54to debug the various modules described above:
55
56  tests/EGL_host_wrapper  -> a small library used to dynamically load the
57                             desktop libEGL.so or a replacement named by the
58                             ANDROID_EGL_LIB environment variable. This lib
59                             provides all EGL entry points.
60
61  tests/emulator_test_renderer -> a small program to run the rendering library
62                                  in a single SDL window on the host desktop.
63
64  tests/gles_android_wrapper -> guest EGL / GLES libraries that are run on
65                                the device to run some tests. Replace the
66                                system/egl and system/GLESv1 modules for now.
67
68  tests/translator_tests/GLES_CM -> desktop GLESv1 translation unit test
69  tests/translator_tests/GLES_V2 -> desktop GLESv2 translation unit test
70  tests/translator_tests/MacCommon -> used by translation tests on Mac only.
71
72  tests/ut_rendercontrol_enc -> guest library used by tests/ut_renderer
73  tests/ut_rendercontrol_dec -> host library used by tests/ut_renderer
74  tests/ut_renderer          -> unit-test for render control and rendering library.
75
76
77II. Build system considerations:
78--------------------------------
79
80The dependencies on the more than 20 components described in the previous
81section are pretty sophisticated, involving lots of auto-generated code and
82non-trivial placement for guest/device libraries.
83
84To simplify the development and maintenance of these modules, a set of
85helper GNU Make function is defined in common.mk, and included from the
86Android.mk in this directory.
87
88These functions all begin with the "emugl-" prefix, and can be used to
89declare modules, what information they export to other modules, or import
90from them, and also what kind of auto-generated sources they depend on.
91
92Look at the comments inside common.mk and the Android.mk of the modules
93to better understand what's happening.
94
95