blob: a07d77823ff4202fc472e6e8ef15f171132ce8d4 [file] [log] [blame]
Erik Faye-Lund4d066832020-06-12 20:09:42 +02001OpenGL ES
2=========
3
4Mesa implements OpenGL ES 1.1 and OpenGL ES 2.0. More information about
5OpenGL ES can be found at https://www.khronos.org/opengles/.
6
Erik Faye-Lund9be0e2d2020-06-15 12:31:36 +02007OpenGL ES depends on a working EGL implementation. Please refer to
8:doc:`Mesa EGL <egl>` for more information about EGL.
Erik Faye-Lund4d066832020-06-12 20:09:42 +02009
10Build the Libraries
11-------------------
12
13#. Run ``meson configure`` with ``-D gles1=true -D gles2=true`` and
14 enable the Gallium driver for your hardware.
15#. Build and install Mesa as usual.
16
17Alternatively, if XCB-DRI2 is installed on the system, one can use
18``egl_dri2`` EGL driver with OpenGL|ES-enabled DRI drivers
19
20#. Run ``meson configure`` with ``-D gles1=true -D gles2=true``.
21#. Build and install Mesa as usual.
22
23Both methods will install libGLESv1_CM, libGLESv2, libEGL, and one or
24more EGL drivers for your hardware.
25
26Run the Demos
27-------------
28
29There are some demos in ``mesa/demos`` repository.
30
31Developers
32----------
33
34Dispatch Table
35~~~~~~~~~~~~~~
36
37OpenGL ES has an additional indirection when dispatching functions
38
39::
40
41 Mesa: glFoo() --> _mesa_Foo()
42 OpenGL ES: glFoo() --> _es_Foo() --> _mesa_Foo()
43
44The indirection serves several purposes
45
46- When a function is in Mesa and the type matches, it checks the
47 arguments and calls the Mesa function.
48- When a function is in Mesa but the type mismatches, it checks and
49 converts the arguments before calling the Mesa function.
50- When a function is not available in Mesa, or accepts arguments that
51 are not available in OpenGL, it provides its own implementation.
52
53Other than the last case, OpenGL ES uses ``APIspec.xml`` to generate
54functions to check and/or converts the arguments.