blob: 489d263f2952f95610347bcde3933e8431b3f94b [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="#style">Coding Style</a>
22<li><a href="#submitting">Submitting Patches</a>
23<li><a href="#release">Making a New Mesa Release</a>
24<li><a href="#extensions">Adding Extensions</a>
Brian Paul51830612004-08-17 14:08:59 +000025</ul>
Brian Paul0b27ace2003-03-08 17:38:57 +000026
27
Brian Paul98f2f472015-05-25 09:13:09 -060028<h2 id="style">Coding Style</h2>
Brian Paul0b27ace2003-03-08 17:38:57 +000029
30<p>
Brian Paulc6184f82015-05-25 10:18:35 -060031Mesa is over 20 years old and the coding style has evolved over time.
32Some old parts use a style that's a bit out of date.
33If the guidelines below don't cover something, try following the format of
34existing, neighboring code.
Brian Paul0b27ace2003-03-08 17:38:57 +000035</p>
36
37<p>
Brian Paulc6184f82015-05-25 10:18:35 -060038Basic formatting guidelines
Brian Paul0b27ace2003-03-08 17:38:57 +000039</p>
40
Brian Paulc6184f82015-05-25 10:18:35 -060041<ul>
42<li>3-space indentation, no tabs.
43<li>Limit lines to 78 or fewer characters. The idea is to prevent line
44wrapping in 80-column editors and terminals. There are exceptions, such
45as if you're defining a large, static table of information.
46<li>Opening braces go on the same line as the if/for/while statement.
47For example:
Brian Paul0b27ace2003-03-08 17:38:57 +000048<pre>
Brian Paulc6184f82015-05-25 10:18:35 -060049 if (condition) {
50 foo;
51 } else {
52 bar;
53 }
Brian Paul0b27ace2003-03-08 17:38:57 +000054</pre>
55
Brian Paulc6184f82015-05-25 10:18:35 -060056<li>Put a space before/after operators. For example, <tt>a = b + c;</tt>
57and not <tt>a=b+c;</tt>
58
59<li>This GNU indent command generally does the right thing for formatting:
Brian Paul0b27ace2003-03-08 17:38:57 +000060<pre>
Brian Paulc6184f82015-05-25 10:18:35 -060061 indent -br -i3 -npcs --no-tabs infile.c -o outfile.c
Brian Paul0b27ace2003-03-08 17:38:57 +000062</pre>
63
Brian Paulc6184f82015-05-25 10:18:35 -060064<li>Use comments wherever you think it would be helpful for other developers.
65Several specific cases and style examples follow. Note that we roughly
66follow <a href="http://www.stack.nl/~dimitri/doxygen/">Doxygen</a> conventions.
67<br>
68<br>
69Single-line comments:
Brian Paul0b27ace2003-03-08 17:38:57 +000070<pre>
Brian Paulc6184f82015-05-25 10:18:35 -060071 /* null-out pointer to prevent dangling reference below */
72 bufferObj = NULL;
73</pre>
74Or,
75<pre>
76 bufferObj = NULL; /* prevent dangling reference below */
77</pre>
78Multi-line comment:
79<pre>
80 /* If this is a new buffer object id, or one which was generated but
81 * never used before, allocate a buffer object now.
82 */
83</pre>
84We try to quote the OpenGL specification where prudent:
85<pre>
86 /* Page 38 of the PDF of the OpenGL ES 3.0 spec says:
87 *
88 * "An INVALID_OPERATION error is generated for any of the following
89 * conditions:
90 *
91 * * <length> is zero."
92 *
93 * Additionally, page 94 of the PDF of the OpenGL 4.5 core spec
94 * (30.10.2014) also says this, so it's no longer allowed for desktop GL,
95 * either.
96 */
97</pre>
98Function comment example:
99<pre>
100 /**
101 * Create and initialize a new buffer object. Called via the
102 * ctx->Driver.CreateObject() driver callback function.
103 * \param name integer name of the object
104 * \param type one of GL_FOO, GL_BAR, etc.
105 * \return pointer to new object or NULL if error
106 */
107 struct gl_object *
108 _mesa_create_object(GLuint name, GLenum type)
109 {
110 /* function body */
111 }
Brian Paul0b27ace2003-03-08 17:38:57 +0000112</pre>
113
Brian Paulc6184f82015-05-25 10:18:35 -0600114<li>Put the function return type and qualifiers on one line and the function
115name and parameters on the next, as seen above. This makes it easy to use
116<code>grep ^function_name dir/*</code> to find function definitions. Also,
117the opening brace goes on the next line by itself (see above.)
118
119<li>Function names follow various conventions depending on the type of function:
120<pre>
121 glFooBar() - a public GL entry point (in glapi_dispatch.c)
122 _mesa_FooBar() - the internal immediate mode function
123 save_FooBar() - retained mode (display list) function in dlist.c
124 foo_bar() - a static (private) function
125 _mesa_foo_bar() - an internal non-static Mesa function
126</pre>
127
128<li>Constants, macros and enumerant names are ALL_UPPERCASE, with _ between
129words.
130<li>Mesa usually uses camel case for local variables (Ex: "localVarname")
131while gallium typically uses underscores (Ex: "local_var_name").
132<li>Global variables are almost never used because Mesa should be thread-safe.
133
134<li>Booleans. Places that are not directly visible to the GL API
135should prefer the use of <tt>bool</tt>, <tt>true</tt>, and
Kai Wasserbächdbec3a52011-08-23 10:48:58 +0200136<tt>false</tt> over <tt>GLboolean</tt>, <tt>GL_TRUE</tt>, and
137<tt>GL_FALSE</tt>. In C code, this may mean that
Kai Wasserbäche106d4c2011-08-27 17:51:47 +0200138<tt>#include &lt;stdbool.h&gt;</tt> needs to be added. The
Kai Wasserbächdbec3a52011-08-23 10:48:58 +0200139<tt>try_emit_</tt>* methods in src/mesa/program/ir_to_mesa.cpp and
Kai Wasserbäche106d4c2011-08-27 17:51:47 +0200140src/mesa/state_tracker/st_glsl_to_tgsi.cpp can serve as examples.
Brian Paulc6184f82015-05-25 10:18:35 -0600141
142</ul>
Kai Wasserbächdbec3a52011-08-23 10:48:58 +0200143
Brian Paul98f2f472015-05-25 09:13:09 -0600144
145<h2 id="submitting">Submitting patches</h2>
Timothy Arceri23820112013-09-05 02:54:00 -0600146
147<p>
Brian Pauld9598852015-05-25 09:42:04 -0600148The basic guidelines for submitting patches are:
149</p>
150
151<ul>
152<li>Patches should be sufficiently tested before submitting.
153<li>Code patches should follow Mesa coding conventions.
154<li>Whenever possible, patches should only effect individual Mesa/Gallium
155components.
156<li>Patches should never introduce build breaks and should be bisectable (see
157<code>git bisect</code>.)
158<li>Patches should be properly formatted (see below).
159<li>Patches should be submitted to mesa-dev for review using
160<code>git send-email</code>.
161<li>Patches should not mix code changes with code formatting changes (except,
162perhaps, in very trivial cases.)
163</ul>
164
165<h3>Patch formatting</h3>
166
167<p>
168The basic rules for patch formatting are:
169</p>
170
171<ul>
172<li>Lines should be limited to 75 characters or less so that git logs
173displayed in 80-column terminals avoid line wrapping. Note that git
174log uses 4 spaces of indentation (4 + 75 &lt; 80).
175<li>The first line should be a short, concise summary of the change prefixed
176with a module name. Examples:
177<pre>
178 mesa: Add support for querying GL_VERTEX_ATTRIB_ARRAY_LONG
179
180 gallium: add PIPE_CAP_DEVICE_RESET_STATUS_QUERY
181
182 i965: Fix missing type in local variable declaration.
183</pre>
184<li>Subsequent patch comments should describe the change in more detail,
185if needed. For example:
186<pre>
187 i965: Remove end-of-thread SEND alignment code.
188
189 This was present in Eric's initial implementation of the compaction code
190 for Sandybridge (commit 077d01b6). There is no documentation saying this
191 is necessary, and removing it causes no regressions in piglit on any
192 platform.
193</pre>
194<li>A "Signed-off-by:" line is not required, but not discouraged either.
195<li>If a patch address a bugzilla issue, that should be noted in the
196patch comment. For example:
197<pre>
198 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89689
199</pre>
200<li>If there have been several revisions to a patch during the review
201process, they should be noted such as in this example:
202<pre>
203 st/mesa: add ARB_texture_stencil8 support (v4)
204
205 if we support stencil texturing, enable texture_stencil8
206 there is no requirement to support native S8 for this,
207 the texture can be converted to x24s8 fine.
208
209 v2: fold fixes from Marek in:
210 a) put S8 last in the list
211 b) fix renderable to always test for d/s renderable
212 fixup the texture case to use a stencil only format
213 for picking the format for the texture view.
214 v3: hit fallback for getteximage
215 v4: put s8 back in front, it shouldn't get picked now (Ilia)
216</pre>
217<li>If someone tested your patch, document it with a line like this:
218<pre>
219 Tested-by: Joe Hacker &lt;jhacker@foo.com&gt;
220</pre>
221<li>If the patch was reviewed (usually the case) or acked by someone,
222that should be documented with:
223<pre>
224 Reviewed-by: Joe Hacker &lt;jhacker@foo.com&gt;
225 Acked-by: Joe Hacker &lt;jhacker@foo.com&gt;
226</pre>
227</ul>
228
229
230
231<h3>Testing Patches</h3>
232
233<p>
234It should go without saying that patches must be tested. In general,
235do whatever testing is prudent.
236</p>
237
238<p>
239You should always run the Mesa test suite before submitting patches.
240The test suite can be run using the 'make check' command. All tests
Timothy Arceri23820112013-09-05 02:54:00 -0600241must pass before patches will be accepted, this may mean you have
242to update the tests themselves.
243</p>
244
245<p>
Brian Pauld9598852015-05-25 09:42:04 -0600246Whenever possible and applicable, test the patch with
Timothy Arceri2ce2b802015-06-19 13:03:36 +1000247<a href="http://piglit.freedesktop.org">Piglit</a> to
Brian Pauld9598852015-05-25 09:42:04 -0600248check for regressions.
249</p>
250
251
252<h3>Mailing Patches</h3>
253
254<p>
Timothy Arceri23820112013-09-05 02:54:00 -0600255Patches should be sent to the Mesa mailing list for review.
256When submitting a patch make sure to use git send-email rather than attaching
257patches to emails. Sending patches as attachments prevents people from being
258able to provide in-line review comments.
259</p>
260
261<p>
262When submitting follow-up patches you can use --in-reply-to to make v2, v3,
263etc patches show up as replies to the originals. This usually works well
264when you're sending out updates to individual patches (as opposed to
265re-sending the whole series). Using --in-reply-to makes
266it harder for reviewers to accidentally review old patches.
267</p>
Brian Paul0b27ace2003-03-08 17:38:57 +0000268
Timothy Arceri2ce2b802015-06-19 13:03:36 +1000269<p>
270When submitting follow-up patches you should also login to
271<a href="https://patchwork.freedesktop.org">patchwork</a> and change the
272state of your old patches to Superseded.
273</p>
274
Brian Paul2ab0ca32015-05-26 11:30:22 -0600275<h3>Reviewing Patches</h3>
276
277<p>
278When you've reviewed a patch on the mailing list, please be unambiguous
279about your review. That is, state either
280<pre>
281 Reviewed-by: Joe Hacker &lt;jhacker@foo.com&gt;
282</pre>
283or
284<pre>
285 Acked-by: Joe Hacker &lt;jhacker@foo.com&gt;
286</pre>
287Rather than saying just "LGTM" or "Seems OK".
288</p>
289
290<p>
291If small changes are suggested, it's OK to say something like:
292<pre>
293 With the above fixes, Reviewed-by: Joe Hacker &lt;jhacker@foo.com&gt;
294</pre>
295which tells the patch author that the patch can be committed, as long
296as the issues are resolved first.
297</p>
298
299
Brian Paul98f2f472015-05-25 09:13:09 -0600300<h3>Marking a commit as a candidate for a stable branch</h3>
Andreas Bollf07784d2012-10-02 13:37:34 +0200301
302<p>
303If you want a commit to be applied to a stable branch,
304you should add an appropriate note to the commit message.
305</p>
306
307<p>
308Here are some examples of such a note:
309</p>
310<ul>
Carl Worthd6c83652013-12-12 23:07:26 -0800311 <li>CC: &lt;mesa-stable@lists.freedesktop.org&gt;</li>
312 <li>CC: "9.2 10.0" &lt;mesa-stable@lists.freedesktop.org&gt;</li>
313 <li>CC: "10.0" &lt;mesa-stable@lists.freedesktop.org&gt;</li>
Andreas Bollf07784d2012-10-02 13:37:34 +0200314</ul>
315
Carl Worthd6c83652013-12-12 23:07:26 -0800316Simply adding the CC to the mesa-stable list address is adequate to nominate
317the commit for the most-recently-created stable branch. It is only necessary
318to specify a specific branch name, (such as "9.2 10.0" or "10.0" in the
319examples above), if you want to nominate the commit for an older stable
320branch. And, as in these examples, you can nominate the commit for the older
321branch in addition to the more recent branch, or nominate the commit
322exclusively for the older branch.
323
324This "CC" syntax for patch nomination will cause patches to automatically be
325copied to the mesa-stable@ mailing list when you use "git send-email" to send
326patches to the mesa-dev@ mailing list. Also, if you realize that a commit
Nathan Kidd0691b372014-01-03 16:44:00 -0700327should be nominated for the stable branch after it has already been committed,
Carl Worthd6c83652013-12-12 23:07:26 -0800328you can send a note directly to the mesa-stable@lists.freedesktop.org where
329the Mesa stable-branch maintainers will receive it. Be sure to mention the
330commit ID of the commit of interest (as it appears in the mesa master branch).
Andreas Boll1f38fb22012-10-02 13:55:53 +0200331
Carl Worth4546b702014-04-30 16:27:03 -0700332The latest set of patches that have been nominated, accepted, or rejected for
333the upcoming stable release can always be seen on the
Carl Worth399b4e22014-08-21 09:46:57 -0700334<a href="http://cworth.org/~cworth/mesa-stable-queue/">Mesa Stable Queue</a>
Carl Worth4546b702014-04-30 16:27:03 -0700335page.
336
Brian Paul98f2f472015-05-25 09:13:09 -0600337<h3>Criteria for accepting patches to the stable branch</h3>
Andreas Boll1f38fb22012-10-02 13:55:53 +0200338
Carl Worth399b4e22014-08-21 09:46:57 -0700339Mesa has a designated release manager for each stable branch, and the release
340manager is the only developer that should be pushing changes to these
341branches. Everyone else should simply nominate patches using the mechanism
342described above.
343
344The stable-release manager will work with the list of nominated patches, and
345for each patch that meets the crtieria below will cherry-pick the patch with:
346<code>git cherry-pick -x &lt;commit&gt;</code>. The <code>-x</code> option is
347important so that the picked patch references the comit ID of the original
348patch.
349
350The stable-release manager may at times need to force-push changes to the
351stable branches, for example, to drop a previously-picked patch that was later
352identified as causing a regression). These force-pushes may cause changes to
353be lost from the stable branch if developers push things directly. Consider
354yourself warned.
355
356The stable-release manager is also given broad discretion in rejecting patches
357that have been nominated for the stable branch. The most basic rule is that
358the stable branch is for bug fixes only, (no new features, no
359regressions). Here is a non-exhaustive list of some reasons that a patch may
360be rejected:
361
362<ul>
363 <li>Patch introduces a regression. Any reported build breakage or other
364 regression caused by a particular patch, (game no longer work, piglit test
365 changes from PASS to FAIL), is justification for rejecting a patch.</li>
366
367 <li>Patch is too large, (say, larger than 100 lines)</li>
368
369 <li>Patch is not a fix. For example, a commit that moves code around with no
370 functional change should be rejected.</li>
371
372 <li>Patch fix is not clearly described. For example, a commit message
373 of only a single line, no description of the bug, no mention of bugzilla,
374 etc.</li>
375
376 <li>Patch has not obviously been reviewed, For example, the commit message
377 has no Reviewed-by, Signed-off-by, nor Tested-by tags from anyone but the
378 author.</li>
379
380 <li>Patch has not already been merged to the master branch. As a rule, bug
381 fixes should never be applied first to a stable branch. Patches should land
382 first on the master branch and then be cherry-picked to a stable
383 branch. (This is to avoid future releases causing regressions if the patch
384 is not also applied to master.) The only things that might look like
385 exceptions would be backports of patches from master that happen to look
386 significantly different.</li>
387
388 <li>Patch depends on too many other patches. Ideally, all stable-branch
389 patches should be self-contained. It sometimes occurs that a single, logical
390 bug-fix occurs as two separate patches on master, (such as an original
391 patch, then a subsequent fix-up to that patch). In such a case, these two
392 patches should be squashed into a single, self-contained patch for the
393 stable branch. (Of course, if the squashing makes the patch too large, then
394 that could be a reason to reject the patch.)</li>
395
396 <li>Patch includes new feature development, not bug fixes. New OpenGL
397 features, extensions, etc. should be applied to Mesa master and included in
398 the next major release. Stable releases are intended only for bug fixes.
399
400 Note: As an exception to this rule, the stable-release manager may accept
401 hardware-enabling "features". For example, backports of new code to support
402 a newly-developed hardware product can be accepted if they can be reasonably
403 determined to not have effects on other hardware.</li>
404
405 <li>Patch is a performance optimization. As a rule, performance patches are
406 not candidates for the stable branch. The only exception might be a case
407 where an application's performance was recently severely impacted so as to
408 become unusable. The fix for this performance regression could then be
409 considered for a stable branch. The optimization must also be
410 non-controversial and the patches still need to meet the other criteria of
411 being simple and self-contained</li>
412
413 <li>Patch introduces a new failure mode (such as an assert). While the new
414 assert might technically be correct, for example to make Mesa more
415 conformant, this is not the kind of "bug fix" we want in a stable
416 release. The potential problem here is that an OpenGL program that was
417 previously working, (even if technically non-compliant with the
418 specification), could stop working after this patch. So that would be a
419 regression that is unaacceptable for the stable branch.</li>
420</ul>
Andreas Boll1f38fb22012-10-02 13:55:53 +0200421
Brian Paul98f2f472015-05-25 09:13:09 -0600422
423<h2 id="release">Making a New Mesa Release</h2>
Brian Paul0b27ace2003-03-08 17:38:57 +0000424
425<p>
426These are the instructions for making a new Mesa release.
427</p>
428
Andreas Boll210a27d2012-06-12 09:05:36 +0200429<h3>Get latest source files</h3>
Brian Paul0b27ace2003-03-08 17:38:57 +0000430<p>
Brian Paul84c5e482009-06-23 19:21:04 -0600431Use git to get the latest Mesa files from the git repository, from whatever
Carl Worth619505a2014-08-21 10:44:35 -0700432branch is relevant. This document uses the convention X.Y.Z for the release
433being created, which should be created from a branch named X.Y.
Brian Paul0b27ace2003-03-08 17:38:57 +0000434</p>
435
Carl Worth619505a2014-08-21 10:44:35 -0700436<h3>Perform basic testing</h3>
Brian Paul65b79052004-11-22 17:49:15 +0000437<p>
Carl Worth619505a2014-08-21 10:44:35 -0700438The release manager should, at the very least, test the code by compiling it,
439installing it, and running the latest piglit to ensure that no piglit tests
440have regressed since the previous release.
Brian Paul65b79052004-11-22 17:49:15 +0000441</p>
442
443<p>
Carl Worth619505a2014-08-21 10:44:35 -0700444The release manager should do this testing with at least one hardware driver,
445(say, whatever is contained in the local development machine), as well as on
446both Gallium and non-Gallium software drivers. The software testing can be
447performed by running piglit with the following environment-variable set:
Andreas Bollb347bb52012-06-25 21:53:06 +0200448</p>
449
Brian Paul0b27ace2003-03-08 17:38:57 +0000450<pre>
Carl Worth619505a2014-08-21 10:44:35 -0700451LIBGL_ALWAYS_SOFTWARE=1
452</pre>
453
454And Gallium vs. non-Gallium software drivers can be obtained by using the
455following configure flags on separate builds:
456
457<pre>
458--with-dri-drivers=swrast
459--with-gallium-drivers=swrast
Brian Paul0b27ace2003-03-08 17:38:57 +0000460</pre>
461
462<p>
Carl Worth619505a2014-08-21 10:44:35 -0700463Note: If both options are given in one build, both swrast_dri.so drivers will
464be compiled, but only one will be installed. The following command can be used
465to ensure the correct driver is being tested:
466</p>
467
468<pre>
469LIBGL_ALWAYS_SOFTWARE=1 glxinfo | grep "renderer string"
470</pre>
471
472If any regressions are found in this testing with piglit, stop here, and do
473not perform a release until regressions are fixed.
474
475<h3>Update version in file VERSION</h3>
476
477<p>
478Increment the version contained in the file VERSION at Mesa's top-level, then
479commit this change.
480</p>
481
482<h3>Create release notes for the new release</h3>
483
484<p>
485Create a new file docs/relnotes/X.Y.Z.html, (follow the style of the previous
486release notes). Note that the sha256sums section of the release notes should
487be empty at this point.
Brian Paul65b79052004-11-22 17:49:15 +0000488</p>
489
490<p>
Carl Worth619505a2014-08-21 10:44:35 -0700491Two scripts are available to help generate portions of the release notes:
Brian Paul0b27ace2003-03-08 17:38:57 +0000492
Carl Worth619505a2014-08-21 10:44:35 -0700493<pre>
494 ./bin/bugzilla_mesa.sh
495 ./bin/shortlog_mesa.sh
496</pre>
497
Brian Paul0b27ace2003-03-08 17:38:57 +0000498<p>
Carl Worth619505a2014-08-21 10:44:35 -0700499The first script identifies commits that reference bugzilla bugs and obtains
500the descriptions of those bugs from bugzilla. The second script generates a
501log of all commits. In both cases, HTML-formatted lists are printed to stdout
502to be included in the release notes.
Brian Paul0b27ace2003-03-08 17:38:57 +0000503</p>
504
505<p>
Carl Worth619505a2014-08-21 10:44:35 -0700506Commit these changes
507</p>
508
509<h3>Make the release archives, signatures, and the release tag</h3>
510<p>
511From inside the Mesa directory:
512<pre>
513 ./autogen.sh
514 make -j1 tarballs
515</pre>
516
517<p>
518After the tarballs are created, the sha256 checksums for the files will
519be computed and printed. These will be used in a step below.
520</p>
521
522<p>
523It's important at this point to also verify that the constructed tar file
524actually builds:
525</p>
526
527<pre>
528 tar xjf MesaLib-X.Y.Z.tar.bz2
529 cd Mesa-X.Y.Z
530 ./configure --enable-gallium-llvm
531 make -j6
532 make install
533</pre>
534
535<p>
536Some touch testing should also be performed at this point, (run glxgears or
537more involved OpenGL programs against the installed Mesa).
538</p>
539
540<p>
541Create detached GPG signatures for each of the archive files created above:
542</p>
543
544<pre>
545 gpg --sign --detach MesaLib-X.Y.Z.tar.gz
546 gpg --sign --detach MesaLib-X.Y.Z.tar.bz2
547 gpg --sign --detach MesaLib-X.Y.Z.zip
548</pre>
549
550<p>
551Tag the commit used for the build:
552</p>
553
554<pre>
555 git tag -s mesa-X.Y.X -m "Mesa X.Y.Z release"
556</pre>
557
558<p>
559Note: It would be nice to investigate and fix the issue that causes the
560tarballs target to fail with multiple build process, such as with "-j4". It
561would also be nice to incorporate all of the above commands into a single
562makefile target. And instead of a custom "tarballs" target, we should
563incorporate things into the standard "make dist" and "make distcheck" targets.
564</p>
565
566<h3>Add the sha256sums to the release notes</h3>
567
568<p>
569Edit docs/relnotes/X.Y.Z.html to add the sha256sums printed as part of "make
570tarballs" in the previous step. Commit this change.
571</p>
572
Thomas Helland8d813d12015-05-26 12:14:00 -0600573<h3>Push all commits and the tag created above</h3>
Carl Worth619505a2014-08-21 10:44:35 -0700574
575<p>
576This is the first step that cannot easily be undone. The release is going
577forward from this point:
578</p>
579
580<pre>
581 git push origin X.Y --tags
582</pre>
583
584<h3>Install the release files and signatures on the distribution server</h3>
585
586<p>
587The following commands can be used to copy the release archive files and
588signatures to the freedesktop.org server:
589</p>
590
591<pre>
592 scp MesaLib-X.Y.Z* people.freedesktop.org:
593 ssh people.freedesktop.org
594 cd /srv/ftp.freedesktop.org/pub/mesa
595 mkdir X.Y.Z
596 cd X.Y.Z
597 mv ~/MesaLib-X.Y.Z* .
598</pre>
599
Thomas Helland8d813d12015-05-26 12:14:00 -0600600<h3>Back on mesa master, add the new release notes into the tree</h3>
Carl Worth619505a2014-08-21 10:44:35 -0700601
602<p>
603Something like the following steps will do the trick:
604</p>
605
606<pre>
607 cp docs/relnotes/X.Y.Z.html /tmp
608 git checkout master
609 cp /tmp/X.Y.Z.html docs/relnotes
610 git add docs/relnotes/X.Y.Z.html
611</pre>
612
613<p>
614Also, edit docs/relnotes.html to add a link to the new release notes, and edit
615docs/index.html to add a news entry. Then commit and push:
616</p>
617
618<pre>
619 git commit -a -m "docs: Import X.Y.Z release notes, add news item."
620 git push origin
621</pre>
622
623<h3>Update the mesa3d.org website</h3>
624
625<p>
626NOTE: The recent release managers have not been performing this step
627themselves, but leaving this to Brian Paul, (who has access to the
628sourceforge.net hosting for mesa3d.org). Brian is more than willing to grant
629the permission necessary to future release managers to do this step on their
630own.
Brian Paul84c5e482009-06-23 19:21:04 -0600631</p>
632
633<p>
Brian Paul65b79052004-11-22 17:49:15 +0000634Update the web site by copying the docs/ directory's files to
Brian Paul84c5e482009-06-23 19:21:04 -0600635/home/users/b/br/brianp/mesa-www/htdocs/ with:
636<br>
637<code>
638sftp USERNAME,mesa3d@web.sourceforge.net
639</code>
Brian Paul0b27ace2003-03-08 17:38:57 +0000640</p>
641
Carl Worth619505a2014-08-21 10:44:35 -0700642
643<h3>Announce the release</h3>
Brian Paul0b27ace2003-03-08 17:38:57 +0000644<p>
Brian Paulefe56712003-03-19 19:15:28 +0000645Make an announcement on the mailing lists:
Ian Romanick8f32c642010-06-16 14:28:08 -0700646
Kenneth Graunke7d24d1b2013-07-25 11:42:38 -0700647<em>mesa-dev@lists.freedesktop.org</em>,
Brian Paulefe56712003-03-19 19:15:28 +0000648and
Kenneth Graunke7d24d1b2013-07-25 11:42:38 -0700649<em>mesa-announce@lists.freedesktop.org</em>
Carl Worth619505a2014-08-21 10:44:35 -0700650
651Follow the template of previously-sent release announcements. The following
652command can be used to generate the log of changes to be included in the
653release announcement:
654
655<pre>
656 git shortlog mesa-X.Y.Z-1..mesa-X.Y.Z
657</pre>
Brian Paul0b27ace2003-03-08 17:38:57 +0000658</p>
659
Brian Paul98f2f472015-05-25 09:13:09 -0600660
661<h2 id="extensions">Adding Extensions</h2>
662
663<p>
664To add a new GL extension to Mesa you have to do at least the following.
665
666<ul>
667<li>
668 If glext.h doesn't define the extension, edit include/GL/gl.h and add
669 code like this:
670 <pre>
671 #ifndef GL_EXT_the_extension_name
672 #define GL_EXT_the_extension_name 1
673 /* declare the new enum tokens */
674 /* prototype the new functions */
675 /* TYPEDEFS for the new functions */
676 #endif
677 </pre>
678</li>
679<li>
680 In the src/mapi/glapi/gen/ directory, add the new extension functions and
681 enums to the gl_API.xml file.
682 Then, a bunch of source files must be regenerated by executing the
683 corresponding Python scripts.
684</li>
685<li>
686 Add a new entry to the <code>gl_extensions</code> struct in mtypes.h
Nanley Cheryb7a0c0e2016-06-03 10:59:18 -0700687 if the extension requires driver capabilities not already exposed by
688 another extension.
Brian Paul98f2f472015-05-25 09:13:09 -0600689</li>
690<li>
Nanley Chery9e7de502016-06-03 10:58:05 -0700691 Add a new entry to the src/mesa/main/extensions_table.h file.
Brian Paul98f2f472015-05-25 09:13:09 -0600692</li>
693<li>
694 From this point, the best way to proceed is to find another extension,
695 similar to the new one, that's already implemented in Mesa and use it
696 as an example.
697</li>
698<li>
699 If the new extension adds new GL state, the functions in get.c, enable.c
700 and attrib.c will most likely require new code.
701</li>
702<li>
Nanley Cheryb7a0c0e2016-06-03 10:59:18 -0700703 To determine if the new extension is active in the current context,
704 use the auto-generated _mesa_has_##name_str() function defined in
705 src/mesa/main/extensions.h.
706</li>
707<li>
Brian Paul98f2f472015-05-25 09:13:09 -0600708 The dispatch tests check_table.cpp and dispatch_sanity.cpp
709 should be updated with details about the new extensions functions. These
710 tests are run using 'make check'
711</li>
712</ul>
Nanley Chery26b0f022016-06-03 10:56:46 -0700713</p>
Brian Paul98f2f472015-05-25 09:13:09 -0600714
715
716
717
Andreas Bollb5da52a2012-09-18 18:57:02 +0200718</div>
Brian Paul0b27ace2003-03-08 17:38:57 +0000719</body>
720</html>