blob: 742182e76a3ff483e5b760377103f5a547717a6e [file] [log] [blame]
Chia-I Wud8299af2010-01-11 18:25:03 +08001<html>
2
Chia-I Wu2e3c4e42010-05-07 14:13:08 +08003<title>OpenGL ES</title>
Chia-I Wud8299af2010-01-11 18:25:03 +08004
5<head><link rel="stylesheet" type="text/css" href="mesa.css"></head>
6
7<body>
8
Chia-I Wu2e3c4e42010-05-07 14:13:08 +08009<h1>OpenGL ES</h1>
Chia-I Wud8299af2010-01-11 18:25:03 +080010
Chia-I Wu2e3c4e42010-05-07 14:13:08 +080011<p>Mesa implements OpenGL ES 1.1 and OpenGL ES 2.0. More informations about
12OpenGL ES can be found at <a href="http://www.khronos.org/opengles/"
13target="_parent"> http://www.khronos.org/opengles/</a>.</p>
Chia-I Wud8299af2010-01-11 18:25:03 +080014
Chia-I Wu2e3c4e42010-05-07 14:13:08 +080015<p>OpenGL ES depends on a working EGL implementation. Please refer to
16<a href="egl.html">Mesa EGL</a> for more information about EGL.</p>
Chia-I Wud8299af2010-01-11 18:25:03 +080017
18<h2>Build the Libraries</h2>
19<ol>
Chia-I Wu12583172011-01-07 17:24:16 +080020<li>Run <code>configure</code> with <code>--enable-gles1 --enable-gles2</code> and enable the Gallium driver for your hardware.</li>
Chia-I Wud8299af2010-01-11 18:25:03 +080021<li>Build and install Mesa as usual.</li>
22</ol>
23
Chia-I Wu2e3c4e42010-05-07 14:13:08 +080024Alternatively, if XCB-DRI2 is installed on the system, one can use
25<code>egl_dri2</code> EGL driver with OpenGL|ES-enabled DRI drivers
26
27<ol>
28<li>Run <code>configure</code> with <code>--enable-gles1 --enable-gles2</code>.</li>
29<li>Build and install Mesa as usual.</li>
30</ol>
31
32<p>Both methods will install libGLESv1_CM, libGLESv2, libEGL, and one or more
33EGL drivers for your hardware.</p>
34
Chia-I Wud8299af2010-01-11 18:25:03 +080035<h2>Run the Demos</h2>
36
Chia-I Wu2e3c4e42010-05-07 14:13:08 +080037<p>There are some demos in <code>progs/egl/</code>. You can use them to test
38your build. For example,</p>
Chia-I Wud8299af2010-01-11 18:25:03 +080039
40<pre>
Chia-I Wu2e3c4e42010-05-07 14:13:08 +080041 $ cd progs/egl/eglut
Chia-I Wud8299af2010-01-11 18:25:03 +080042 $ make
Chia-I Wu2e3c4e42010-05-07 14:13:08 +080043 $ cd ../opengles1
44 $ make
45 $ ./torus_x11
Chia-I Wud8299af2010-01-11 18:25:03 +080046</pre>
47
48<h2>Developers</h2>
49
Chia-I Wu2e3c4e42010-05-07 14:13:08 +080050<h3>Internal Libraries</h3>
Chia-I Wud8299af2010-01-11 18:25:03 +080051
Chia-I Wu2e3c4e42010-05-07 14:13:08 +080052<table border="1" style="text-align: center;">
53 <tr><td>Library Name</td><td>Used By</td><td>Enabled</td><td>OpenGL</td><td>OpenGL ES 1.x</td><td>OpenGL ES 2.x</td></tr>
Chia-I Wu87cc2da2010-05-12 14:17:17 +080054 <tr><td><code>libmesa.a</td><td>Classic DRI drivers</td><td>y</td><td>y</td><td>--enable-gles1</td><td>--enable-gles2</td></tr>
55 <tr><td><code>libmesagallium.a</td><td>Gallium EGL and DRI drivers</td><td>y</td><td>y</td><td>--enable-gles1</td><td>--enable-gles2</td></tr>
Chia-I Wud8299af2010-01-11 18:25:03 +080056</table>
57
Chia-I Wud8299af2010-01-11 18:25:03 +080058<h3>Dispatch Table</h3>
59
Chia-I Wu2e3c4e42010-05-07 14:13:08 +080060<p>OpenGL ES has an additional indirection when dispatching fucntions</p>
Chia-I Wud8299af2010-01-11 18:25:03 +080061
62<pre>
63 Mesa: glFoo() --&gt; _mesa_Foo()
Chia-I Wu2e3c4e42010-05-07 14:13:08 +080064 OpenGL ES: glFoo() --&gt; _es_Foo() --&gt; _mesa_Foo()
Chia-I Wud8299af2010-01-11 18:25:03 +080065</pre>
66
67<p>The indirection serves several purposes</p>
68
69<ul>
70<li>When a function is in Mesa and the type matches, it checks the arguments and calls the Mesa function.</li>
71<li>When a function is in Mesa but the type mismatches, it checks and converts the arguments before calling the Mesa function.</li>
72<li>When a function is not available in Mesa, or accepts arguments that are not available in OpenGL, it provides its own implementation.</li>
73</ul>
74
Chia-I Wu2e3c4e42010-05-07 14:13:08 +080075<p>Other than the last case, OpenGL ES uses <code>APIspec.xml</code> to generate functions to check and/or converts the arguments.</p>
Chia-I Wud8299af2010-01-11 18:25:03 +080076
77</body>
78</html>