2012-06-12 08:05:03 +01:00
|
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
|
|
<html lang="en">
|
|
|
|
<head>
|
|
|
|
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
|
|
|
<title>Off-screen Rendering</title>
|
|
|
|
<link rel="stylesheet" type="text/css" href="mesa.css">
|
|
|
|
</head>
|
|
|
|
<body>
|
2003-03-08 17:38:57 +00:00
|
|
|
|
2012-09-18 17:57:02 +01:00
|
|
|
<div class="header">
|
2019-05-06 12:26:47 +01:00
|
|
|
The Mesa 3D Graphics Library
|
2012-09-18 17:57:02 +01:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<iframe src="contents.html"></iframe>
|
|
|
|
<div class="content">
|
|
|
|
|
2012-06-12 08:05:03 +01:00
|
|
|
<h1>Off-screen Rendering</h1>
|
2003-03-08 17:38:57 +00:00
|
|
|
|
|
|
|
|
|
|
|
<p>
|
2013-03-12 00:31:22 +00:00
|
|
|
Mesa's off-screen interface is used for rendering into user-allocated memory
|
|
|
|
without any sort of window system or operating system dependencies.
|
2006-05-19 04:42:16 +01:00
|
|
|
That is, the GL_FRONT colorbuffer is actually a buffer in main memory,
|
|
|
|
rather than a window on your display.
|
2003-03-08 17:38:57 +00:00
|
|
|
</p>
|
2006-05-19 04:42:16 +01:00
|
|
|
|
2003-03-08 17:38:57 +00:00
|
|
|
<p>
|
2013-03-12 00:31:22 +00:00
|
|
|
The OSMesa API provides three basic functions for making off-screen
|
2003-03-08 17:38:57 +00:00
|
|
|
renderings: OSMesaCreateContext(), OSMesaMakeCurrent(), and
|
|
|
|
OSMesaDestroyContext(). See the Mesa/include/GL/osmesa.h header for
|
2006-05-19 04:42:16 +01:00
|
|
|
more information about the API functions.
|
2003-03-08 17:38:57 +00:00
|
|
|
</p>
|
2006-05-19 04:42:16 +01:00
|
|
|
|
2003-03-08 17:38:57 +00:00
|
|
|
<p>
|
2013-03-12 00:31:22 +00:00
|
|
|
The OSMesa interface may be used with any of three software renderers:
|
2003-03-08 17:38:57 +00:00
|
|
|
</p>
|
2013-03-12 00:31:22 +00:00
|
|
|
<ol>
|
|
|
|
<li>llvmpipe - this is the high-performance Gallium LLVM driver
|
|
|
|
<li>softpipe - this it the reference Gallium software driver
|
|
|
|
<li>swrast - this is the legacy Mesa software rasterizer
|
|
|
|
</ol>
|
2003-03-08 17:38:57 +00:00
|
|
|
|
|
|
|
|
|
|
|
<p>
|
2013-03-12 00:31:22 +00:00
|
|
|
There are several examples of OSMesa in the mesa/demos repository.
|
2003-03-08 17:38:57 +00:00
|
|
|
</p>
|
2006-05-19 04:42:16 +01:00
|
|
|
|
2019-05-06 11:57:15 +01:00
|
|
|
<h2>Building OSMesa</h2>
|
2006-05-19 04:42:16 +01:00
|
|
|
|
|
|
|
<p>
|
2013-03-12 00:31:22 +00:00
|
|
|
Configure and build Mesa with something like:
|
|
|
|
|
2003-03-08 17:38:57 +00:00
|
|
|
<pre>
|
2019-06-19 13:29:49 +01:00
|
|
|
meson builddir -Dosmesa=gallium -Dgallium-drivers=swrast -Ddri-drivers=[] -Dvulkan-drivers=[] -Dprefix=$PWD/builddir/install
|
2019-04-08 20:56:51 +01:00
|
|
|
ninja -C builddir install
|
2003-03-08 17:38:57 +00:00
|
|
|
</pre>
|
|
|
|
|
2006-05-19 04:42:16 +01:00
|
|
|
<p>
|
2013-03-12 00:31:22 +00:00
|
|
|
Make sure you have LLVM installed first if you want to use the llvmpipe driver.
|
|
|
|
</p>
|
2003-03-08 17:38:57 +00:00
|
|
|
|
2003-05-02 16:05:02 +01:00
|
|
|
<p>
|
2013-03-12 00:31:22 +00:00
|
|
|
When the build is complete you should find:
|
2006-05-19 04:42:16 +01:00
|
|
|
</p>
|
2013-03-12 00:31:22 +00:00
|
|
|
<pre>
|
2019-04-08 20:56:51 +01:00
|
|
|
$PWD/builddir/install/lib/libOSMesa.so (swrast-based OSMesa)
|
|
|
|
$PWD/builddir/install/lib/gallium/libOSMsea.so (gallium-based OSMesa)
|
2013-03-12 00:31:22 +00:00
|
|
|
</pre>
|
2006-05-19 04:42:16 +01:00
|
|
|
|
|
|
|
<p>
|
2019-04-08 20:56:51 +01:00
|
|
|
Set your LD_LIBRARY_PATH to point to $PWD/builddir/install to use the libraries
|
2003-05-02 16:05:02 +01:00
|
|
|
</p>
|
|
|
|
|
2003-03-08 17:38:57 +00:00
|
|
|
<p>
|
2013-03-12 00:31:22 +00:00
|
|
|
When you link your application, link with -lOSMesa
|
2003-03-08 17:38:57 +00:00
|
|
|
</p>
|
2004-09-24 21:31:02 +01:00
|
|
|
|
2012-09-18 17:57:02 +01:00
|
|
|
</div>
|
2012-06-12 08:05:03 +01:00
|
|
|
</body>
|
|
|
|
</html>
|