summaryrefslogtreecommitdiff
path: root/docs/osmesa.rst
diff options
context:
space:
mode:
authorErik Faye-Lund <erik.faye-lund@collabora.com>2020-06-12 20:09:42 +0200
committerMarge Bot <eric+marge@anholt.net>2020-06-13 10:42:00 +0000
commit4d066836e3cf307431a74eafcc8a404ce5ccea69 (patch)
treeb0e3c39a971a564126b70368ae139a6e613d183f /docs/osmesa.rst
parent1df5dbf51659000f74ca9511a211a7b026bfa936 (diff)
downloadmesa-4d066836e3cf307431a74eafcc8a404ce5ccea69.tar.gz
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>
Diffstat (limited to 'docs/osmesa.rst')
-rw-r--r--docs/osmesa.rst45
1 files changed, 45 insertions, 0 deletions
diff --git a/docs/osmesa.rst b/docs/osmesa.rst
new file mode 100644
index 00000000000..0232aec03a0
--- /dev/null
+++ b/docs/osmesa.rst
@@ -0,0 +1,45 @@
+Off-screen Rendering
+====================
+
+Mesa's off-screen interface is used for rendering into user-allocated
+memory without any sort of window system or operating system
+dependencies. That is, the GL_FRONT colorbuffer is actually a buffer in
+main memory, rather than a window on your display.
+
+The OSMesa API provides three basic functions for making off-screen
+renderings: OSMesaCreateContext(), OSMesaMakeCurrent(), and
+OSMesaDestroyContext(). See the Mesa/include/GL/osmesa.h header for more
+information about the API functions.
+
+The OSMesa interface may be used with any of three software renderers:
+
+#. llvmpipe - this is the high-performance Gallium LLVM driver
+#. softpipe - this it the reference Gallium software driver
+#. swrast - this is the legacy Mesa software rasterizer
+
+There are several examples of OSMesa in the mesa/demos repository.
+
+Building OSMesa
+---------------
+
+Configure and build Mesa with something like:
+
+::
+
+ meson builddir -Dosmesa=gallium -Dgallium-drivers=swrast -Ddri-drivers=[] -Dvulkan-drivers=[] -Dprefix=$PWD/builddir/install
+ ninja -C builddir install
+
+Make sure you have LLVM installed first if you want to use the llvmpipe
+driver.
+
+When the build is complete you should find:
+
+::
+
+ $PWD/builddir/install/lib/libOSMesa.so (swrast-based OSMesa)
+ $PWD/builddir/install/lib/gallium/libOSMsea.so (gallium-based OSMesa)
+
+Set your LD_LIBRARY_PATH to point to $PWD/builddir/install to use the
+libraries
+
+When you link your application, link with -lOSMesa