Files
third_party_mesa3d/docs/devinfo.rst
Erik Faye-Lund 4d066836e3 docs: convert articles to reructuredtext
This uses the previously added scripts to convert the documentation to
reStructuredText, which is both easier to read offline, and can be used
to generate modern HTML for online documentation.

No modification to the generated results have been done.

Acked-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4630>
2020-06-13 10:42:00 +00:00

45 lines
1.7 KiB
ReStructuredText

Development Notes
=================
- `Adding Extensions <#extensions>`__
.. _extensions:
Adding Extensions
-----------------
To add a new GL extension to Mesa you have to do at least the following.
- If ``glext.h`` doesn't define the extension, edit ``include/GL/gl.h``
and add code like this:
::
#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
- 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.
- Add a new entry to the ``gl_extensions`` struct in ``mtypes.h`` if
the extension requires driver capabilities not already exposed by
another extension.
- Add a new entry to the ``src/mesa/main/extensions_table.h`` file.
- 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.
- If the new extension adds new GL state, the functions in ``get.c``,
``enable.c`` and ``attrib.c`` will most likely require new code.
- 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``.
- 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``.