summaryrefslogtreecommitdiffstats
path: root/docs/devinfo.html
blob: 62982f5b4f58d580ffbad513f6a85d7a41a74f8f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<!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>

<div class="header">
  <h1>The Mesa 3D Graphics Library</h1>
</div>

<iframe src="contents.html"></iframe>
<div class="content">

<h1>Development Notes</h1>


<ul>
<li><a href="#extensions">Adding Extensions</a>
</ul>

<h2 id="extensions">Adding Extensions</h2>

<p>
To add a new GL extension to Mesa you have to do at least the following.
</p>

<ul>
<li>
   If glext.h doesn't define the extension, edit include/GL/gl.h and add
   code like this:
   <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>
   In the src/mapi/glapi/gen/ directory, add the new extension functions and
   enums to the gl_API.xml file.
   Then, a bunch of source files must be regenerated by executing the
   corresponding Python scripts.
</li>
<li>
   Add a new entry to the <code>gl_extensions</code> struct in mtypes.h
   if the extension requires driver capabilities not already exposed by
   another extension.
</li>
<li>
   Add a new entry to the src/mesa/main/extensions_table.h file.
</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>
   If the new extension adds new GL state, the functions in get.c, enable.c
   and attrib.c will most likely require new code.
</li>
<li>
   To determine if the new extension is active in the current context,
   use the auto-generated _mesa_has_##name_str() function defined in
   src/mesa/main/extensions.h.
</li>
<li>
   The dispatch tests check_table.cpp and dispatch_sanity.cpp
   should be updated with details about the new extensions functions. These
   tests are run using 'meson test'
</li>
</ul>




</div>
</body>
</html>