X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=docs%2Fosmesa.html;h=7ad512e28e7d77179f88e522e191621a92ed3ca6;hb=bc9cf6adff663889c3816b590e0b045956164ab0;hp=2207641eded8bb6920e5bfc0ef06cc04a62c5ed8;hpb=210a27d8c33634c6b676a8a1d35d5fec98213181;p=mesa.git diff --git a/docs/osmesa.html b/docs/osmesa.html index 2207641eded..7ad512e28e7 100644 --- a/docs/osmesa.html +++ b/docs/osmesa.html @@ -7,83 +7,74 @@ +
+ The Mesa 3D Graphics Library +
+ + +
+

Off-screen Rendering

-Mesa's off-screen rendering interface is used for rendering into -user-allocated blocks of memory. +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. -There are no window system or operating system dependencies. -One potential application is to use Mesa as an off-line, batch-style renderer.

-The OSMesa API provides three basic functions for making off-screen +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.

-There are several examples of OSMesa in the progs/osdemos/ -directory. +The OSMesa interface may be used with any of three software renderers:

+
    +
  1. llvmpipe - this is the high-performance Gallium LLVM driver +
  2. softpipe - this it the reference Gallium software driver +
  3. swrast - this is the legacy Mesa software rasterizer +
-

Deep color channels

-

-For some applications 8-bit color channels don't have sufficient -precision. -OSMesa supports 16-bit and 32-bit color channels through the OSMesa interface. -When using 16-bit channels, channels are GLushorts and RGBA pixels occupy -8 bytes. -When using 32-bit channels, channels are GLfloats and RGBA pixels occupy -16 bytes. +There are several examples of OSMesa in the mesa/demos repository.

-

-Before version 6.5.1, Mesa had to be recompiled to support exactly -one of 8, 16 or 32-bit channels. -With Mesa 6.5.1, Mesa can be compiled for either 8, 16 or 32-bit channels -and render into any of the smaller size channels. -For example, if Mesa's compiled for 32-bit channels, you can also render -16 and 8-bit channel images. -

+

Building OSMesa

-To build Mesa/OSMesa for 16 and 8-bit color channel support: +Configure and build Mesa with something like: +

-      make realclean
-      make linux-osmesa16
+meson builddir -Dosmesa=gallium -Dgallium-drivers=swrast -Ddri-drivers=[] -Dvulkan-drivers=[] -Dprefix=$PWD/builddir/install
+ninja -C builddir install
 

-To build Mesa/OSMesa for 32, 16 and 8-bit color channel support: -

-      make realclean
-      make linux-osmesa32
-
+Make sure you have LLVM installed first if you want to use the llvmpipe driver. +

-You'll wind up with a library named libOSMesa16.so or libOSMesa32.so. -Otherwise, most Mesa configurations build an 8-bit/channel libOSMesa.so library -by default. +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)
+

-If performance is important, compile Mesa for the channel size you're -most interested in. +Set your LD_LIBRARY_PATH to point to $PWD/builddir/install to use the libraries

-If you need to compile on a non-Linux platform, copy Mesa/configs/linux-osmesa16 -to a new config file and edit it as needed. Then, add the new config name to -the top-level Makefile. Send a patch to the Mesa developers too, if you're -inclined. +When you link your application, link with -lOSMesa

+