Andreas Boll | ecd5c7c | 2012-06-12 09:05:03 +0200 | [diff] [blame] | 1 | <!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 Paul | 0b27ace | 2003-03-08 17:38:57 +0000 | [diff] [blame] | 9 | |
Andreas Boll | b5da52a | 2012-09-18 18:57:02 +0200 | [diff] [blame] | 10 | <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 Boll | ecd5c7c | 2012-06-12 09:05:03 +0200 | [diff] [blame] | 17 | <h1>Development Notes</h1> |
Brian Paul | 0b27ace | 2003-03-08 17:38:57 +0000 | [diff] [blame] | 18 | |
| 19 | |
Brian Paul | 5183061 | 2004-08-17 14:08:59 +0000 | [diff] [blame] | 20 | <ul> |
Brian Paul | 98f2f47 | 2015-05-25 09:13:09 -0600 | [diff] [blame] | 21 | <li><a href="#extensions">Adding Extensions</a> |
Brian Paul | 5183061 | 2004-08-17 14:08:59 +0000 | [diff] [blame] | 22 | </ul> |
Brian Paul | 0b27ace | 2003-03-08 17:38:57 +0000 | [diff] [blame] | 23 | |
Brian Paul | 98f2f47 | 2015-05-25 09:13:09 -0600 | [diff] [blame] | 24 | <h2 id="extensions">Adding Extensions</h2> |
| 25 | |
| 26 | <p> |
| 27 | To add a new GL extension to Mesa you have to do at least the following. |
Erik Faye-Lund | 92917e8 | 2019-04-18 15:38:01 +0200 | [diff] [blame^] | 28 | </p> |
Brian Paul | 98f2f47 | 2015-05-25 09:13:09 -0600 | [diff] [blame] | 29 | |
| 30 | <ul> |
| 31 | <li> |
| 32 | If glext.h doesn't define the extension, edit include/GL/gl.h and add |
| 33 | code like this: |
| 34 | <pre> |
| 35 | #ifndef GL_EXT_the_extension_name |
| 36 | #define GL_EXT_the_extension_name 1 |
| 37 | /* declare the new enum tokens */ |
| 38 | /* prototype the new functions */ |
| 39 | /* TYPEDEFS for the new functions */ |
| 40 | #endif |
| 41 | </pre> |
| 42 | </li> |
| 43 | <li> |
| 44 | In the src/mapi/glapi/gen/ directory, add the new extension functions and |
| 45 | enums to the gl_API.xml file. |
| 46 | Then, a bunch of source files must be regenerated by executing the |
| 47 | corresponding Python scripts. |
| 48 | </li> |
| 49 | <li> |
| 50 | Add a new entry to the <code>gl_extensions</code> struct in mtypes.h |
Nanley Chery | b7a0c0e | 2016-06-03 10:59:18 -0700 | [diff] [blame] | 51 | if the extension requires driver capabilities not already exposed by |
| 52 | another extension. |
Brian Paul | 98f2f47 | 2015-05-25 09:13:09 -0600 | [diff] [blame] | 53 | </li> |
| 54 | <li> |
Nanley Chery | 9e7de50 | 2016-06-03 10:58:05 -0700 | [diff] [blame] | 55 | Add a new entry to the src/mesa/main/extensions_table.h file. |
Brian Paul | 98f2f47 | 2015-05-25 09:13:09 -0600 | [diff] [blame] | 56 | </li> |
| 57 | <li> |
| 58 | From this point, the best way to proceed is to find another extension, |
| 59 | similar to the new one, that's already implemented in Mesa and use it |
| 60 | as an example. |
| 61 | </li> |
| 62 | <li> |
| 63 | If the new extension adds new GL state, the functions in get.c, enable.c |
| 64 | and attrib.c will most likely require new code. |
| 65 | </li> |
| 66 | <li> |
Nanley Chery | b7a0c0e | 2016-06-03 10:59:18 -0700 | [diff] [blame] | 67 | To determine if the new extension is active in the current context, |
| 68 | use the auto-generated _mesa_has_##name_str() function defined in |
| 69 | src/mesa/main/extensions.h. |
| 70 | </li> |
| 71 | <li> |
Brian Paul | 98f2f47 | 2015-05-25 09:13:09 -0600 | [diff] [blame] | 72 | The dispatch tests check_table.cpp and dispatch_sanity.cpp |
| 73 | should be updated with details about the new extensions functions. These |
Eric Engestrom | 46d6883 | 2019-04-24 13:16:57 +0100 | [diff] [blame] | 74 | tests are run using 'meson test' |
Brian Paul | 98f2f47 | 2015-05-25 09:13:09 -0600 | [diff] [blame] | 75 | </li> |
| 76 | </ul> |
| 77 | |
| 78 | |
| 79 | |
| 80 | |
Andreas Boll | b5da52a | 2012-09-18 18:57:02 +0200 | [diff] [blame] | 81 | </div> |
Brian Paul | 0b27ace | 2003-03-08 17:38:57 +0000 | [diff] [blame] | 82 | </body> |
| 83 | </html> |