Chia-I Wu | d8299af | 2010-01-11 18:25:03 +0800 | [diff] [blame] | 1 | <html> |
| 2 | |
Chia-I Wu | 2e3c4e4 | 2010-05-07 14:13:08 +0800 | [diff] [blame] | 3 | <title>OpenGL ES</title> |
Chia-I Wu | d8299af | 2010-01-11 18:25:03 +0800 | [diff] [blame] | 4 | |
| 5 | <head><link rel="stylesheet" type="text/css" href="mesa.css"></head> |
| 6 | |
| 7 | <body> |
| 8 | |
Chia-I Wu | 2e3c4e4 | 2010-05-07 14:13:08 +0800 | [diff] [blame] | 9 | <h1>OpenGL ES</h1> |
Chia-I Wu | d8299af | 2010-01-11 18:25:03 +0800 | [diff] [blame] | 10 | |
Chia-I Wu | 2e3c4e4 | 2010-05-07 14:13:08 +0800 | [diff] [blame] | 11 | <p>Mesa implements OpenGL ES 1.1 and OpenGL ES 2.0. More informations about |
| 12 | OpenGL ES can be found at <a href="http://www.khronos.org/opengles/" |
| 13 | target="_parent"> http://www.khronos.org/opengles/</a>.</p> |
Chia-I Wu | d8299af | 2010-01-11 18:25:03 +0800 | [diff] [blame] | 14 | |
Chia-I Wu | 2e3c4e4 | 2010-05-07 14:13:08 +0800 | [diff] [blame] | 15 | <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 Wu | d8299af | 2010-01-11 18:25:03 +0800 | [diff] [blame] | 17 | |
| 18 | <h2>Build the Libraries</h2> |
| 19 | <ol> |
Chia-I Wu | 2e3c4e4 | 2010-05-07 14:13:08 +0800 | [diff] [blame] | 20 | <li>Run <code>configure</code> with <code>--enable-gles-overlay</code> and enable the Gallium driver for your hardware.</li> |
Chia-I Wu | d8299af | 2010-01-11 18:25:03 +0800 | [diff] [blame] | 21 | <li>Build and install Mesa as usual.</li> |
| 22 | </ol> |
| 23 | |
Chia-I Wu | 2e3c4e4 | 2010-05-07 14:13:08 +0800 | [diff] [blame] | 24 | Alternatively, 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 |
| 33 | EGL drivers for your hardware.</p> |
| 34 | |
Chia-I Wu | d8299af | 2010-01-11 18:25:03 +0800 | [diff] [blame] | 35 | <h2>Run the Demos</h2> |
| 36 | |
Chia-I Wu | 2e3c4e4 | 2010-05-07 14:13:08 +0800 | [diff] [blame] | 37 | <p>There are some demos in <code>progs/egl/</code>. You can use them to test |
| 38 | your build. For example,</p> |
Chia-I Wu | d8299af | 2010-01-11 18:25:03 +0800 | [diff] [blame] | 39 | |
| 40 | <pre> |
Chia-I Wu | 2e3c4e4 | 2010-05-07 14:13:08 +0800 | [diff] [blame] | 41 | $ cd progs/egl/eglut |
Chia-I Wu | d8299af | 2010-01-11 18:25:03 +0800 | [diff] [blame] | 42 | $ make |
Chia-I Wu | 2e3c4e4 | 2010-05-07 14:13:08 +0800 | [diff] [blame] | 43 | $ cd ../opengles1 |
| 44 | $ make |
| 45 | $ ./torus_x11 |
Chia-I Wu | d8299af | 2010-01-11 18:25:03 +0800 | [diff] [blame] | 46 | </pre> |
| 47 | |
| 48 | <h2>Developers</h2> |
| 49 | |
Chia-I Wu | 2e3c4e4 | 2010-05-07 14:13:08 +0800 | [diff] [blame] | 50 | <h3>Internal Libraries</h3> |
Chia-I Wu | d8299af | 2010-01-11 18:25:03 +0800 | [diff] [blame] | 51 | |
Chia-I Wu | 2e3c4e4 | 2010-05-07 14:13:08 +0800 | [diff] [blame] | 52 | <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 Wu | 87cc2da | 2010-05-12 14:17:17 +0800 | [diff] [blame] | 54 | <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> |
| 56 | <tr><td><code>libes1gallium.a</td><td>Gallium EGL drivers</td><td>--enable-gles-overlay</td><td>n</td><td>y</td><td>n</td></tr> |
| 57 | <tr><td><code>libes2gallium.a</td><td>Gallium EGL drivers</td><td>--enable-gles-overlay</td><td>n</td><td>n</td><td>y</td></tr> |
Chia-I Wu | d8299af | 2010-01-11 18:25:03 +0800 | [diff] [blame] | 58 | </table> |
| 59 | |
Chia-I Wu | d8299af | 2010-01-11 18:25:03 +0800 | [diff] [blame] | 60 | <h3>Dispatch Table</h3> |
| 61 | |
Chia-I Wu | 2e3c4e4 | 2010-05-07 14:13:08 +0800 | [diff] [blame] | 62 | <p>OpenGL ES has an additional indirection when dispatching fucntions</p> |
Chia-I Wu | d8299af | 2010-01-11 18:25:03 +0800 | [diff] [blame] | 63 | |
| 64 | <pre> |
| 65 | Mesa: glFoo() --> _mesa_Foo() |
Chia-I Wu | 2e3c4e4 | 2010-05-07 14:13:08 +0800 | [diff] [blame] | 66 | OpenGL ES: glFoo() --> _es_Foo() --> _mesa_Foo() |
Chia-I Wu | d8299af | 2010-01-11 18:25:03 +0800 | [diff] [blame] | 67 | </pre> |
| 68 | |
| 69 | <p>The indirection serves several purposes</p> |
| 70 | |
| 71 | <ul> |
| 72 | <li>When a function is in Mesa and the type matches, it checks the arguments and calls the Mesa function.</li> |
| 73 | <li>When a function is in Mesa but the type mismatches, it checks and converts the arguments before calling the Mesa function.</li> |
| 74 | <li>When a function is not available in Mesa, or accepts arguments that are not available in OpenGL, it provides its own implementation.</li> |
| 75 | </ul> |
| 76 | |
Chia-I Wu | 2e3c4e4 | 2010-05-07 14:13:08 +0800 | [diff] [blame] | 77 | <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 Wu | d8299af | 2010-01-11 18:25:03 +0800 | [diff] [blame] | 78 | |
| 79 | </body> |
| 80 | </html> |