2012-06-12 15:05:03 +08:00
|
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
|
|
<html lang="en">
|
|
|
|
<head>
|
|
|
|
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
|
|
|
<title>Development Notes</title>
|
|
|
|
<link rel="stylesheet" type="text/css" href="mesa.css">
|
|
|
|
</head>
|
|
|
|
<body>
|
2003-03-09 01:38:57 +08:00
|
|
|
|
2012-09-19 00:57:02 +08:00
|
|
|
<div class="header">
|
2019-05-06 19:26:47 +08:00
|
|
|
The Mesa 3D Graphics Library
|
2012-09-19 00:57:02 +08:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<iframe src="contents.html"></iframe>
|
|
|
|
<div class="content">
|
|
|
|
|
2012-06-12 15:05:03 +08:00
|
|
|
<h1>Development Notes</h1>
|
2003-03-09 01:38:57 +08:00
|
|
|
|
2005-01-20 11:55:10 +08:00
|
|
|
|
2004-08-17 22:08:59 +08:00
|
|
|
<ul>
|
2015-05-25 23:13:09 +08:00
|
|
|
<li><a href="#extensions">Adding Extensions</a>
|
2004-08-17 22:08:59 +08:00
|
|
|
</ul>
|
2003-03-09 01:38:57 +08:00
|
|
|
|
2015-05-25 23:13:09 +08:00
|
|
|
<h2 id="extensions">Adding Extensions</h2>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
To add a new GL extension to Mesa you have to do at least the following.
|
2019-04-18 21:38:01 +08:00
|
|
|
</p>
|
2015-05-25 23:13:09 +08:00
|
|
|
|
|
|
|
<ul>
|
|
|
|
<li>
|
2019-05-28 19:14:03 +08:00
|
|
|
If <code>glext.h</code> doesn't define the extension, edit
|
|
|
|
<code>include/GL/gl.h</code> and add code like this:
|
2015-05-25 23:13:09 +08:00
|
|
|
<pre>
|
|
|
|
#ifndef GL_EXT_the_extension_name
|
|
|
|
#define GL_EXT_the_extension_name 1
|
|
|
|
/* declare the new enum tokens */
|
|
|
|
/* prototype the new functions */
|
|
|
|
/* TYPEDEFS for the new functions */
|
|
|
|
#endif
|
|
|
|
</pre>
|
|
|
|
</li>
|
|
|
|
<li>
|
2019-05-28 19:14:03 +08:00
|
|
|
In the <code>src/mapi/glapi/gen/</code> directory, add the new extension
|
|
|
|
functions and enums to the <code>gl_API.xml</code> file.
|
2015-05-25 23:13:09 +08:00
|
|
|
Then, a bunch of source files must be regenerated by executing the
|
|
|
|
corresponding Python scripts.
|
|
|
|
</li>
|
|
|
|
<li>
|
2019-05-28 19:14:03 +08:00
|
|
|
Add a new entry to the <code>gl_extensions</code> struct in
|
|
|
|
<code>mtypes.h</code> if the extension requires driver capabilities not
|
|
|
|
already exposed by another extension.
|
2015-05-25 23:13:09 +08:00
|
|
|
</li>
|
|
|
|
<li>
|
2019-05-28 19:14:03 +08:00
|
|
|
Add a new entry to the <code>src/mesa/main/extensions_table.h</code> file.
|
2015-05-25 23:13:09 +08:00
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
From this point, the best way to proceed is to find another extension,
|
|
|
|
similar to the new one, that's already implemented in Mesa and use it
|
|
|
|
as an example.
|
|
|
|
</li>
|
|
|
|
<li>
|
2019-06-06 16:16:36 +08:00
|
|
|
If the new extension adds new GL state, the functions in
|
|
|
|
<code>get.c</code>, <code>enable.c</code> and <code>attrib.c</code>
|
|
|
|
will most likely require new code.
|
2015-05-25 23:13:09 +08:00
|
|
|
</li>
|
2016-06-04 01:59:18 +08:00
|
|
|
<li>
|
|
|
|
To determine if the new extension is active in the current context,
|
2019-05-28 19:14:03 +08:00
|
|
|
use the auto-generated <code>_mesa_has_##name_str()</code> function
|
|
|
|
defined in <code>src/mesa/main/extensions.h</code>.
|
2016-06-04 01:59:18 +08:00
|
|
|
</li>
|
2015-05-25 23:13:09 +08:00
|
|
|
<li>
|
2019-06-06 16:16:36 +08:00
|
|
|
The dispatch tests <code>check_table.cpp</code> and
|
|
|
|
<code>dispatch_sanity.cpp</code> should be updated with details about
|
|
|
|
the new extensions functions. These tests are run using
|
|
|
|
<code>meson test</code>.
|
2015-05-25 23:13:09 +08:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
2012-09-19 00:57:02 +08:00
|
|
|
</div>
|
2003-03-09 01:38:57 +08:00
|
|
|
</body>
|
|
|
|
</html>
|