summaryrefslogtreecommitdiff
path: root/docs/opengles.html
diff options
context:
space:
mode:
authorChia-I Wu <olvaffe@gmail.com>2010-01-11 18:25:03 +0800
committerChia-I Wu <olvaffe@gmail.com>2010-01-12 11:25:09 +0800
commitd8299af4ab6fe4b334292e3b6e69e4331c05d86f (patch)
tree2c78349db390fff9bcc361f5e66c636867ebc926 /docs/opengles.html
parent76e726515aedab426a55a389d0a1132456932856 (diff)
docs: Add documentation for OpenGL ES.opengl-es-v2
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Diffstat (limited to 'docs/opengles.html')
-rw-r--r--docs/opengles.html78
1 files changed, 78 insertions, 0 deletions
diff --git a/docs/opengles.html b/docs/opengles.html
new file mode 100644
index 0000000000..d460bccf6c
--- /dev/null
+++ b/docs/opengles.html
@@ -0,0 +1,78 @@
+<html>
+
+<title>OpenGL ES State Trackers</title>
+
+<head><link rel="stylesheet" type="text/css" href="mesa.css"></head>
+
+<body>
+
+<h1>OpenGL ES State Trackers</h1>
+
+<p>The current version of the OpenGL ES state trackers implement OpenGL ES 1.1 and OpenGL ES 2.0.
+More informations about OpenGL ES can be found at
+<a href="http://www.khronos.org/opengles/">http://www.khronos.org/opengles/</a>.</p>
+
+<p>The OpenGL ES state trackers depends on the Gallium architecture and a
+working EGL implementation.</p>
+
+
+<h2>Build the Libraries</h2>
+<ol>
+<li>Run <code>configure</code> with <code>--with-state-trackers=egl_g3d,es</code> and enable the Gallium driver for your hardware.</li>
+<li>Build and install Mesa as usual.</li>
+</ol>
+
+<p>It will install libGLESv1_CM, libGLESv2, libEGL, and one or more EGL drivers for your hardware.</p>
+<h2>Run the Demos</h2>
+
+<p>There are some demos in <code>progs/es1/</code> and <code>progs/es2/</code>. You can use them to test your build. For example,</p>
+
+<pre>
+ $ export EGL_DRIVER=/usr/local/lib/dri/egl_x11_i915.so # specify the EGL driver
+ $ cd progs/es1/xegl
+ $ make
+ $ ./torus
+</pre>
+
+<h2>Developers</h2>
+
+<p>The core of OpenGL ES state trackers is the ES overlay. It is located in
+<code>src/mesa/es/</code>.</p>
+
+<h3>Structure</h3>
+
+<p>The ES overlay uses as much code as possible from Mesa. It has its own glapi XMLs to describe the APIs of OpenGL ES. The ES overlay can be built parallelly with Mesa, and they will give</p>
+
+<table border="1">
+ <tr><td>Library Name</td><td>Usage</td><td>Source</td></tr>
+ <tr><td>libmesagallium.a</td><td>OpenGL state tracker</td><td>Mesa</td></tr>
+ <tr><td>libes1gallium.a</td><td>OpenGL ES 1.x state tracker</td><td>ES overlay</td></tr>
+ <tr><td>libes2gallium.a</td><td>OpenGL ES 2.x state tracker</td><td>ES overlay</td></tr>
+ <tr><td>libglapi.a</td><td>OpenGL API</td><td>Mesa</td></tr>
+ <tr><td>libes1api.a</td><td>OpenGL ES 1.x API</td><td>ES overlay</td></tr>
+ <tr><td>libes2api.a</td><td>OpenGL ES 2.x API</td><td>ES overlay</td></tr>
+</table>
+
+<p>The OpenGL ES state trackers and APIs are then used by <code>src/gallium/state_trackers/es/</code> to create the final libraries.</p>
+
+<h3>Dispatch Table</h3>
+
+<p>The ES overlay uses an additional indirection when dispatching fucntions</p>
+
+<pre>
+ Mesa: glFoo() --&gt; _mesa_Foo()
+ ES overlay: glFoo() --&gt; _es_Foo() --&gt; _mesa_Foo()
+</pre>
+
+<p>The indirection serves several purposes</p>
+
+<ul>
+<li>When a function is in Mesa and the type matches, it checks the arguments and calls the Mesa function.</li>
+<li>When a function is in Mesa but the type mismatches, it checks and converts the arguments before calling the Mesa function.</li>
+<li>When a function is not available in Mesa, or accepts arguments that are not available in OpenGL, it provides its own implementation.</li>
+</ul>
+
+<p>Other than the last case, the ES overlay uses <code>APIspec.xml</code> to generate functions to check and/or converts the arguments.</p>
+
+</body>
+</html>