194 lines
7.0 KiB
HTML
194 lines
7.0 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<html>
|
|
<head>
|
|
<meta name="generator" content=
|
|
"HTML Tidy for Linux/x86 (vers 1 September 2005), see www.w3.org">
|
|
<meta http-equiv="Content-Type" content=
|
|
"text/html; charset=us-ascii">
|
|
<title>Chapter 24. Using the X Composite
|
|
Extension</title>
|
|
<meta name="generator" content="DocBook XSL Stylesheets V1.68.1">
|
|
<link rel="start" href="index.html" title=
|
|
"NVIDIA Accelerated Linux Graphics Driver README and Installation Guide">
|
|
<link rel="up" href="installationandconfiguration.html" title=
|
|
"Part I. Installation and Configuration Instructions">
|
|
<link rel="prev" href="dynamicboost.html" title=
|
|
"Chapter 23. Dynamic Boost on Linux">
|
|
<link rel="next" href="nvidiasettings.html" title=
|
|
"Chapter 25. Using the nvidia-settings Utility">
|
|
</head>
|
|
<body>
|
|
<div class="navheader">
|
|
<table width="100%" summary="Navigation header">
|
|
<tr>
|
|
<th colspan="3" align="center">Chapter 24. Using the X
|
|
Composite Extension</th>
|
|
</tr>
|
|
<tr>
|
|
<td width="20%" align="left"><a accesskey="p" href=
|
|
"dynamicboost.html">Prev</a> </td>
|
|
<th width="60%" align="center">Part I. Installation and
|
|
Configuration Instructions</th>
|
|
<td width="20%" align="right"> <a accesskey="n" href=
|
|
"nvidiasettings.html">Next</a></td>
|
|
</tr>
|
|
</table>
|
|
<hr></div>
|
|
<div class="chapter" lang="en">
|
|
<div class="titlepage">
|
|
<div>
|
|
<div>
|
|
<h2 class="title"><a name="xcompositeextension" id=
|
|
"xcompositeextension"></a>Chapter 24. Using the X
|
|
Composite Extension</h2>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<p>X.Org X servers support an X protocol extension called
|
|
Composite. This extension allows windows to be drawn into pixmaps
|
|
instead of directly onto the screen. In conjunction with the Damage
|
|
and Render extensions, this allows a program called a composite
|
|
manager to blend windows together to draw the screen.</p>
|
|
<p>Performance will be degraded significantly if the <code class=
|
|
"computeroutput">RenderAccel</code> option is disabled in
|
|
xorg.conf. See <a href="xconfigoptions.html" title=
|
|
"Appendix B. X Config Options">Appendix B, <i>X
|
|
Config Options</i></a> for more details.</p>
|
|
<p>When the NVIDIA X driver is used and the Composite extension is
|
|
enabled, NVIDIA's OpenGL implementation interacts properly with the
|
|
Damage and Composite X extensions. This means that OpenGL rendering
|
|
is drawn into offscreen pixmaps and the X server is notified of the
|
|
Damage event when OpenGL renders to the pixmap. This allows OpenGL
|
|
applications to behave properly in a composited X desktop.</p>
|
|
<p>The Composite X extension is enabled by default. It can be
|
|
disabled with <span><strong class="command">nvidia-xconfig
|
|
--no-composite</strong></span>. See the nvidia-xconfig(1) man page
|
|
for details.</p>
|
|
<p>The Composite extension causes problems with some driver
|
|
components:</p>
|
|
<div class="itemizedlist">
|
|
<ul type="disc">
|
|
<li>
|
|
<p>Xv adaptors will ignore the sync-to-vblank option when drawing
|
|
into a redirected window.</p>
|
|
</li>
|
|
<li>
|
|
<p>Workstation overlays are incompatible with Composite.
|
|
Workstation overlays will be automatically disabled when Composite
|
|
is detected.</p>
|
|
</li>
|
|
<li>
|
|
<p>The NVIDIA Linux driver supports quad-buffered stereo together
|
|
with Composite. However, many composite managers will only texture
|
|
from and display the left eye content, effectively disabling the
|
|
stereo effect. Workarounds for this problem are either to use a
|
|
different composite manager that supports stereo or disable the
|
|
Composite extension.</p>
|
|
</li>
|
|
<li>
|
|
<p>The Composite extension is incompatible with Xinerama in X.Org X
|
|
servers prior to version 1.10. Composite will be automatically
|
|
disabled when Xinerama is enabled on those servers.</p>
|
|
</li>
|
|
<li>
|
|
<p>Prior to X.Org X server version 1.15, the Damage extension does
|
|
not properly report rendering events on all physical X screens in
|
|
Xinerama configurations. This prevents most composite mangers from
|
|
rendering correctly.</p>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<p></p>
|
|
<p>This NVIDIA Linux driver supports OpenGL rendering to 32-bit
|
|
ARGB windows. 32-bit visuals are only available on screens with
|
|
depths 24 or 30. If you are an application developer, you can use
|
|
these new visuals in conjunction with a composite manager to create
|
|
translucent OpenGL applications:</p>
|
|
<pre class="screen">
|
|
int attrib[] = {
|
|
GLX_RENDER_TYPE, GLX_RGBA_BIT,
|
|
GLX_DRAWABLE_TYPE, GLX_WINDOW_BIT,
|
|
GLX_RED_SIZE, 1,
|
|
GLX_GREEN_SIZE, 1,
|
|
GLX_BLUE_SIZE, 1,
|
|
GLX_ALPHA_SIZE, 1,
|
|
GLX_DOUBLEBUFFER, True,
|
|
GLX_DEPTH_SIZE, 1,
|
|
None };
|
|
GLXFBConfig *fbconfigs, fbconfig;
|
|
int numfbconfigs, render_event_base, render_error_base;
|
|
XVisualInfo *visinfo;
|
|
XRenderPictFormat *pictFormat;
|
|
|
|
/* Make sure we have the RENDER extension */
|
|
if(!XRenderQueryExtension(dpy, &render_event_base, &render_error_base)) {
|
|
fprintf(stderr, "No RENDER extension found\n");
|
|
exit(EXIT_FAILURE);
|
|
}
|
|
|
|
/* Get the list of FBConfigs that match our criteria */
|
|
fbconfigs = glXChooseFBConfig(dpy, scrnum, attrib, &numfbconfigs);
|
|
if (!fbconfigs) {
|
|
/* None matched */
|
|
exit(EXIT_FAILURE);
|
|
}
|
|
|
|
/* Find an FBConfig with a visual that has a RENDER picture format that
|
|
* has alpha */
|
|
for (i = 0; i < numfbconfigs; i++) {
|
|
visinfo = glXGetVisualFromFBConfig(dpy, fbconfigs[i]);
|
|
if (!visinfo) continue;
|
|
pictFormat = XRenderFindVisualFormat(dpy, visinfo->visual);
|
|
if (!pictFormat) continue;
|
|
|
|
if(pictFormat->direct.alphaMask > 0) {
|
|
fbconfig = fbconfigs[i];
|
|
break;
|
|
}
|
|
|
|
XFree(visinfo);
|
|
}
|
|
|
|
if (i == numfbconfigs) {
|
|
/* None of the FBConfigs have alpha. Use a normal (opaque)
|
|
* FBConfig instead */
|
|
fbconfig = fbconfigs[0];
|
|
visinfo = glXGetVisualFromFBConfig(dpy, fbconfig);
|
|
pictFormat = XRenderFindVisualFormat(dpy, visinfo->visual);
|
|
}
|
|
|
|
XFree(fbconfigs);
|
|
</pre>
|
|
<p></p>
|
|
<p>When rendering to a 32-bit window, keep in mind that composite
|
|
managers expect "premultiplied alpha" colors. This means that if
|
|
your color has components (r,g,b) and alpha value a, then you must
|
|
render (a*r, a*g, a*b, a) into the target window.</p>
|
|
<p>More information about Composite can be found at <a href=
|
|
"http://freedesktop.org/Software/CompositeExt" target=
|
|
"_top">http://freedesktop.org/Software/CompositeExt</a></p>
|
|
</div>
|
|
<div class="navfooter">
|
|
<hr>
|
|
<table width="100%" summary="Navigation footer">
|
|
<tr>
|
|
<td width="40%" align="left"><a accesskey="p" href=
|
|
"dynamicboost.html">Prev</a> </td>
|
|
<td width="20%" align="center"><a accesskey="u" href=
|
|
"installationandconfiguration.html">Up</a></td>
|
|
<td width="40%" align="right"> <a accesskey="n" href=
|
|
"nvidiasettings.html">Next</a></td>
|
|
</tr>
|
|
<tr>
|
|
<td width="40%" align="left" valign="top">
|
|
Chapter 23. Dynamic Boost on Linux </td>
|
|
<td width="20%" align="center"><a accesskey="h" href=
|
|
"index.html">Home</a></td>
|
|
<td width="40%" align="right" valign="top">
|
|
Chapter 25. Using the nvidia-settings Utility</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
</body>
|
|
</html>
|