~mmach/netext73/mesa-haswell

« back to all changes in this revision

Viewing changes to docs/osmesa.rst

  • Committer: mmach
  • Date: 2022-09-22 19:56:13 UTC
  • Revision ID: netbit73@gmail.com-20220922195613-wtik9mmy20tmor0i
2022-09-22 21:17:09

Show diffs side-by-side

added added

removed removed

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