blob: c6e97c68a62e5126ef9b11d14190eeee6b573bf3 [file] [log] [blame]
Andreas Bollecd5c7c2012-06-12 09:05:03 +02001<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2<html lang="en">
3<head>
4 <meta http-equiv="content-type" content="text/html; charset=utf-8">
5 <title>Development Notes</title>
6 <link rel="stylesheet" type="text/css" href="mesa.css">
7</head>
8<body>
Brian Paul0b27ace2003-03-08 17:38:57 +00009
Andreas Bollb5da52a2012-09-18 18:57:02 +020010<div class="header">
11 <h1>The Mesa 3D Graphics Library</h1>
12</div>
13
14<iframe src="contents.html"></iframe>
15<div class="content">
16
Andreas Bollecd5c7c2012-06-12 09:05:03 +020017<h1>Development Notes</h1>
Brian Paul0b27ace2003-03-08 17:38:57 +000018
19
Brian Paul51830612004-08-17 14:08:59 +000020<ul>
Brian Paul98f2f472015-05-25 09:13:09 -060021<li><a href="#extensions">Adding Extensions</a>
Brian Paul51830612004-08-17 14:08:59 +000022</ul>
Brian Paul0b27ace2003-03-08 17:38:57 +000023
Brian Paul98f2f472015-05-25 09:13:09 -060024<h2 id="extensions">Adding Extensions</h2>
25
26<p>
27To add a new GL extension to Mesa you have to do at least the following.
28
29<ul>
30<li>
31 If glext.h doesn't define the extension, edit include/GL/gl.h and add
32 code like this:
33 <pre>
34 #ifndef GL_EXT_the_extension_name
35 #define GL_EXT_the_extension_name 1
36 /* declare the new enum tokens */
37 /* prototype the new functions */
38 /* TYPEDEFS for the new functions */
39 #endif
40 </pre>
41</li>
42<li>
43 In the src/mapi/glapi/gen/ directory, add the new extension functions and
44 enums to the gl_API.xml file.
45 Then, a bunch of source files must be regenerated by executing the
46 corresponding Python scripts.
47</li>
48<li>
49 Add a new entry to the <code>gl_extensions</code> struct in mtypes.h
Nanley Cheryb7a0c0e2016-06-03 10:59:18 -070050 if the extension requires driver capabilities not already exposed by
51 another extension.
Brian Paul98f2f472015-05-25 09:13:09 -060052</li>
53<li>
Nanley Chery9e7de502016-06-03 10:58:05 -070054 Add a new entry to the src/mesa/main/extensions_table.h file.
Brian Paul98f2f472015-05-25 09:13:09 -060055</li>
56<li>
57 From this point, the best way to proceed is to find another extension,
58 similar to the new one, that's already implemented in Mesa and use it
59 as an example.
60</li>
61<li>
62 If the new extension adds new GL state, the functions in get.c, enable.c
63 and attrib.c will most likely require new code.
64</li>
65<li>
Nanley Cheryb7a0c0e2016-06-03 10:59:18 -070066 To determine if the new extension is active in the current context,
67 use the auto-generated _mesa_has_##name_str() function defined in
68 src/mesa/main/extensions.h.
69</li>
70<li>
Brian Paul98f2f472015-05-25 09:13:09 -060071 The dispatch tests check_table.cpp and dispatch_sanity.cpp
72 should be updated with details about the new extensions functions. These
73 tests are run using 'make check'
74</li>
75</ul>
Nanley Chery26b0f022016-06-03 10:56:46 -070076</p>
Brian Paul98f2f472015-05-25 09:13:09 -060077
78
79
80
Andreas Bollb5da52a2012-09-18 18:57:02 +020081</div>
Brian Paul0b27ace2003-03-08 17:38:57 +000082</body>
83</html>