blob: 82019c82d71b6136bb1652fe868c66e8c42753b5 [file] [log] [blame]
Erik Faye-Lund4d066832020-06-12 20:09:42 +02001Off-screen Rendering
2====================
3
4Mesa's off-screen interface is used for rendering into user-allocated
5memory without any sort of window system or operating system
6dependencies. That is, the GL_FRONT colorbuffer is actually a buffer in
7main memory, rather than a window on your display.
8
9The OSMesa API provides three basic functions for making off-screen
10renderings: OSMesaCreateContext(), OSMesaMakeCurrent(), and
11OSMesaDestroyContext(). See the Mesa/include/GL/osmesa.h header for more
12information about the API functions.
13
Eric Anholtee802372019-07-03 11:10:32 -070014The OSMesa interface may be used with the gallium software renderers:
Erik Faye-Lund4d066832020-06-12 20:09:42 +020015
16#. llvmpipe - this is the high-performance Gallium LLVM driver
17#. softpipe - this it the reference Gallium software driver
Erik Faye-Lund4d066832020-06-12 20:09:42 +020018
19There are several examples of OSMesa in the mesa/demos repository.
20
21Building OSMesa
22---------------
23
24Configure and build Mesa with something like:
25
26::
27
Eric Anholtee802372019-07-03 11:10:32 -070028 meson builddir -Dosmesa=true -Dgallium-drivers=swrast -Ddri-drivers=[] -Dvulkan-drivers=[] -Dprefix=$PWD/builddir/install
Erik Faye-Lund4d066832020-06-12 20:09:42 +020029 ninja -C builddir install
30
31Make sure you have LLVM installed first if you want to use the llvmpipe
32driver.
33
34When the build is complete you should find:
35
36::
37
Eric Anholt6ffc5612020-12-02 16:46:06 -080038 $PWD/builddir/install/lib/libOSMesa.so
Erik Faye-Lund4d066832020-06-12 20:09:42 +020039
40Set your LD_LIBRARY_PATH to point to $PWD/builddir/install to use the
41libraries
42
43When you link your application, link with -lOSMesa