Clone of mesa.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. <HTML>
  2. <TITLE>Development Notes</TITLE>
  3. <link rel="stylesheet" type="text/css" href="mesa.css"></head>
  4. <BODY>
  5. <H1>Development Notes</H1>
  6. <H2>Adding Extentions</H2>
  7. <p>
  8. To add a new GL extension to Mesa you have to do at least the following.
  9. <ul>
  10. <li>
  11. If glext.h doesn't define the extension, edit include/GL/gl.h and add
  12. code like this:
  13. <pre>
  14. #ifndef GL_EXT_the_extension_name
  15. #define GL_EXT_the_extension_name 1
  16. /* declare the new enum tokens */
  17. /* prototype the new functions */
  18. /* TYPEDEFS for the new functions */
  19. #endif
  20. </pre>
  21. </li>
  22. <li>
  23. In the src/mesa/glapi/ directory, add the new extension functions and
  24. enums to the gl_API.xml file.
  25. Then, a bunch of source files must be regenerated by executing the
  26. corresponding Python scripts.
  27. </li>
  28. <li>
  29. Add a new entry to the <code>gl_extensions</code> struct in mtypes.h
  30. </li>
  31. <li>
  32. Update the <code>extensions.c</code> file.
  33. </li>
  34. <li>
  35. From this point, the best way to proceed is to find another extension,
  36. similar to the new one, that's already implemented in Mesa and use it
  37. as an example.
  38. </li>
  39. <li>
  40. If the new extension adds new GL state, the functions in get.c, enable.c
  41. and attrib.c will most likely require new code.
  42. </li>
  43. </ul>
  44. <H2>Coding Style</H2>
  45. <p>
  46. Mesa's code style has changed over the years. Here's the latest.
  47. </p>
  48. <p>
  49. Comment your code! It's extremely important that open-source code be
  50. well documented. Also, strive to write clean, easily understandable code.
  51. </p>
  52. <p>
  53. 3-space indentation
  54. </p>
  55. <p>
  56. If you use tabs, set them to 8 columns
  57. </p>
  58. <p>
  59. Brace example:
  60. </p>
  61. <pre>
  62. if (condition) {
  63. foo;
  64. }
  65. else {
  66. bar;
  67. }
  68. </pre>
  69. <p>
  70. Here's the GNU indent command which will best approximate my preferred style:
  71. </p>
  72. <pre>
  73. indent -br -i3 -npcs --no-tabs infile.c -o outfile.c
  74. </pre>
  75. <p>
  76. Local variable name example: localVarName (no underscores)
  77. </p>
  78. <p>
  79. Constants and macros are ALL_UPPERCASE, with _ between words
  80. </p>
  81. <p>
  82. Global variables are not allowed.
  83. </p>
  84. <p>
  85. Function name examples:
  86. </p>
  87. <pre>
  88. glFooBar() - a public GL entry point (in glapi_dispatch.c)
  89. _mesa_FooBar() - the internal immediate mode function
  90. save_FooBar() - retained mode (display list) function in dlist.c
  91. foo_bar() - a static (private) function
  92. _mesa_foo_bar() - an internal non-static Mesa function
  93. </pre>
  94. <H2>Making a New Mesa Release</H2>
  95. <p>
  96. These are the instructions for making a new Mesa release.
  97. </p>
  98. <H3>Get latest source files</H3>
  99. <p>
  100. Use git to get the latest Mesa files from the git repository, from whatever
  101. branch is relevant.
  102. </p>
  103. <H3>Verify and update version info</H3>
  104. <p>
  105. Create/edit the docs/relnotes-x.y.html file to document what's new in the release.
  106. Add the new relnotes-x.y.html file to <a href="relnotes.html">relnotes.html</a>.
  107. </p>
  108. <p>
  109. Update the MESA_MAJOR, MESA_MINOR and MESA_TINY version numbers in
  110. configs/default.
  111. Also update the VERSION line in the top-level Makefile.
  112. </p>
  113. <p>
  114. Make sure the values in src/mesa/main/version.h are correct.
  115. </p>
  116. <p>
  117. Update the docs/news.html file and docs/download.html files.
  118. </p>
  119. <p>
  120. Check in all updates to git.
  121. </p>
  122. <p>
  123. Tag the files with the release name (in the form <b>mesa_X_Y</b>)
  124. with: <code>git tag -a mesa_X_Y</code>
  125. Then: <code>git push origin mesa_X_Y</code>
  126. </p>
  127. <H3>Make the tarballs</H3>
  128. <p>
  129. Make a symbolic link from $(DIRECTORY) to 'Mesa'. For example,
  130. <code>ln -s Mesa Mesa-7.5</code>
  131. This is needed in order to make a correct tar file in the next step.
  132. </p>
  133. <p>
  134. Make the distribution files. From inside the Mesa directory:
  135. <pre>
  136. make tarballs
  137. </pre>
  138. <p>
  139. After the tarballs are created, the md5 checksums for the files will
  140. be computed.
  141. Add them to the docs/relnotes-X.Y.html file.
  142. </p>
  143. <p>
  144. Copy the distribution files to a temporary directory, unpack them,
  145. compile everything, and run some demos to be sure everything works.
  146. </p>
  147. <H3>Update the website and announce the release</H3>
  148. <p>
  149. Follow the directions on SourceForge for creating a new "release" and
  150. uploading the tarballs.
  151. </p>
  152. <p>
  153. Basically, to upload the tarball files with:
  154. <br>
  155. <code>
  156. rsync -avP ssh Mesa*-X.Y.* USERNAME@frs.sourceforge.net:uploads/
  157. </code>
  158. </p>
  159. <p>
  160. Update the web site by copying the docs/ directory's files to
  161. /home/users/b/br/brianp/mesa-www/htdocs/ with:
  162. <br>
  163. <code>
  164. sftp USERNAME,mesa3d@web.sourceforge.net
  165. </code>
  166. </p>
  167. <p>
  168. Make an announcement on the mailing lists:
  169. <em>m</em><em>e</em><em>s</em><em>a</em><em>3</em><em>d</em><em>-</em><em>d</em><em>e</em><em>v</em><em>@</em><em>l</em><em>i</em><em>s</em><em>t</em><em>s</em><em>.</em><em>s</em><em>f</em><em>.</em><em>n</em><em>e</em><em>t</em>,
  170. <em>m</em><em>e</em><em>s</em><em>a</em><em>3</em><em>d</em><em>-</em><em>u</em><em>s</em><em>e</em><em>r</em><em>s</em><em>@</em><em>l</em><em>i</em><em>s</em><em>t</em><em>s</em><em>.</em><em>s</em><em>f</em><em>.</em><em>n</em><em>e</em><em>t</em>
  171. and
  172. <em>m</em><em>e</em><em>s</em><em>a</em><em>3</em><em>d</em><em>-</em><em>a</em><em>n</em><em>n</em><em>o</em><em>u</em><em>n</em><em>c</em><em>e</em><em>@</em><em>l</em><em>i</em><em>s</em><em>t</em><em>s</em><em>.</em><em>s</em><em>f</em><em>.</em><em>n</em><em>e</em><em>t</em>
  173. </p>
  174. </body>
  175. </html>