aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-03-13 08:31:21 +0100
committermarha <marha@users.sourceforge.net>2012-03-13 08:31:21 +0100
commitfc72edebf875378459368c5383d9023730cbca54 (patch)
treeb34159309efdc9a43ebe4a32108e5c3ac051a05e
parent41bd254198b8b879a562a85f7dc868c3c0f7fbc1 (diff)
downloadvcxsrv-fc72edebf875378459368c5383d9023730cbca54.tar.gz
vcxsrv-fc72edebf875378459368c5383d9023730cbca54.tar.bz2
vcxsrv-fc72edebf875378459368c5383d9023730cbca54.zip
fontconfig mesa git update 13 Mar 2012
-rw-r--r--fontconfig/doc/fontconfig-user.sgml21
-rw-r--r--mesalib/docs/autoconf.html98
-rw-r--r--mesalib/docs/xlibdriver.html2
-rw-r--r--mesalib/src/mesa/drivers/common/driverfuncs.c3
-rw-r--r--mesalib/src/mesa/drivers/windows/gdi/wmesa.c47
-rw-r--r--mesalib/src/mesa/main/clear.c46
-rw-r--r--mesalib/src/mesa/main/dd.h7
-rw-r--r--mesalib/src/mesa/main/debug.c7
-rw-r--r--mesalib/src/mesa/main/depth.c2
-rw-r--r--mesalib/src/mesa/main/enable.c2
-rw-r--r--mesalib/src/mesa/main/errors.c4
-rw-r--r--mesalib/src/mesa/main/fbobject.c16
-rw-r--r--mesalib/src/mesa/main/light.c4
-rw-r--r--mesalib/src/mesa/main/mtypes.h50
-rw-r--r--mesalib/src/mesa/main/state.c22
-rw-r--r--mesalib/src/mesa/main/stencil.c4
-rw-r--r--mesalib/src/mesa/swrast/s_context.c6
-rw-r--r--mesalib/src/mesa/tnl/t_vertex.c3
18 files changed, 106 insertions, 238 deletions
diff --git a/fontconfig/doc/fontconfig-user.sgml b/fontconfig/doc/fontconfig-user.sgml
index 217feb97a..d5da6c03a 100644
--- a/fontconfig/doc/fontconfig-user.sgml
+++ b/fontconfig/doc/fontconfig-user.sgml
@@ -297,20 +297,21 @@ following structure:
</para>
<refsect2><title><literal>&lt;fontconfig&gt;</literal></title><para>
This is the top level element for a font configuration and can contain
-<literal>&lt;dir&gt;</literal>, <literal>&lt;cache&gt;</literal>, <literal>&lt;include&gt;</literal>, <literal>&lt;match&gt;</literal> and <literal>&lt;alias&gt;</literal> elements in any order.
+<literal>&lt;dir&gt;</literal>, <literal>&lt;cachedir&gt;</literal>, <literal>&lt;include&gt;</literal>, <literal>&lt;match&gt;</literal> and <literal>&lt;alias&gt;</literal> elements in any order.
</para></refsect2>
<refsect2><title><literal>&lt;dir&gt;</literal></title><para>
This element contains a directory name which will be scanned for font files
to include in the set of available fonts.
</para></refsect2>
- <refsect2><title><literal>&lt;cache&gt;</literal></title><para>
-This element contains a file name for the per-user cache of font
-information. If it starts with '~', it refers to a file in the users
-home directory. This file is used to hold information about fonts that
-isn't present in the per-directory cache files. It is automatically
-maintained by the fontconfig library. The default for this file
-is ``~/.fonts.cache-<literal>&lt;version&gt;</literal>'', where <literal>&lt;version&gt;</literal> is the font configuration
-file version number (currently 2).
+ <refsect2><title><literal>&lt;cachedir&gt;</literal></title><para>
+This element contains a directory name that is supposed to be stored or read
+the cache of font information. If multiple elements are specified in
+the configuration file, the directory that can be accessed first in the list
+will be used to store the cache files. If it starts with '~', it refers to
+a directory in the users home directory. The default directory is ``~/.fontconfig''
+and it contains the cache files named ``<literal>&lt;hash value&gt;</literal>-<literal>&lt;architecture&gt;</literal>.cache-<literal>&lt;version</literal>'',
+where <literal>&lt;version&gt;</literal> is the font configureation file
+version number (currently 3).
</para></refsect2>
<refsect2><title><literal>&lt;include ignore_missing="no"&gt;</literal></title><para>
This element contains the name of an additional configuration file or
@@ -686,7 +687,7 @@ is the conventional location for per-user font configuration, although the
actual location is specified in the global fonts.conf file.
</para>
<para>
-<emphasis> ~/.fonts.cache-*</emphasis>
+<emphasis> ~/.fontconfig/*.cache-*</emphasis>
is the conventional repository of font information that isn't found in the
per-directory caches. This file is automatically maintained by fontconfig.
</para>
diff --git a/mesalib/docs/autoconf.html b/mesalib/docs/autoconf.html
index 895cf665c..07a966e05 100644
--- a/mesalib/docs/autoconf.html
+++ b/mesalib/docs/autoconf.html
@@ -1,4 +1,4 @@
-<html>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" ><html LANG=en>
<title>Compilation and Installation using Autoconf</title>
@@ -10,23 +10,22 @@
<h1>Compilation and Installation using Autoconf</h1>
<ol>
-<li><a href="#basic">Basic Usage</a></li>
-<li><a href="#driver">Driver Options</a></li>
+<li><p ><a href="#basic">Basic Usage</a></li>
+<li><p ><a href="#driver">Driver Options</a>
<ul>
<li><a href="#xlib">Xlib Driver Options</a></li>
<li><a href="#dri">DRI Driver Options</a></li>
<li><a href="#osmesa">OSMesa Driver Options</a></li>
</ul>
-<li><a href="#library">Library Options</a></li>
+<li><p ><a href="#library">Library Options</a>
<ul>
<li><a href="#glu">GLU</a></li>
</ul>
-<li><a href="#demos">Demo Program Options</a></li>
+<li><p ><a href="#demos">Demo Program Options</a>
</ol>
-<a name="basic">
-<h2>1. Basic Usage</h2>
+<h2 id="basic">1. Basic Usage</h2>
<p>
The autoconf generated configure script can be used to guess your
@@ -104,7 +103,6 @@ package metadata in <code>/usr/X11R6</code> before the standard
directories.
</li>
</ul>
-</p>
<p>
There are also a few general options for altering the Mesa build:
@@ -139,11 +137,9 @@ to force 32- or 64-bit code generation as used on the x86 and x86_64
architectures.
</li>
</ul>
-</p>
-<a name="driver">
-<h2>2. Driver Options</h2>
+<h2 id="driver">2. Driver Options</h2>
<p>
There are several different driver modes that Mesa can use. These are
@@ -153,84 +149,70 @@ configure option --with-driver. There are currently three supported
options in the configure script.
</p>
-<ul>
-
-<a name="xlib">
-<li><b><em>Xlib</em></b> - This is the default mode for building Mesa.
+<h3 id="xlib">Xlib</h3 ><p >This is the default mode for building Mesa.
It uses Xlib as a software renderer to do all rendering. It corresponds
to the option <code>--with-driver=xlib</code>. The libX11 and libXext
libraries, as well as the X11 development headers, will be need to
support the Xlib driver.
-</li>
-<a name="dri">
-<li><b><em>DRI</em></b> - This mode uses the DRI hardware drivers for
+<h3 id="dri">DRI </h3 ><p >This mode uses the DRI hardware drivers for
accelerated OpenGL rendering. Enable the DRI drivers with the option
<code>--with-driver=dri</code>. See the <a href="install.html">basic
installation instructions</a> for details on prerequisites for the DRI
drivers.
-</li>
<!-- DRI specific options -->
-<p>
-<ul>
-<li><code>--with-dri-driverdir=DIR</code> - This option specifies the
+<dl>
+<dt><code>--with-dri-driverdir=DIR</code>
+<dd ><p > This option specifies the
location the DRI drivers will be installed to and the location libGL
will search for DRI drivers. The default is <code>${libdir}/dri</code>.
-</li>
-<li><code>--with-dri-drivers=DRIVER,DRIVER,...</code> - This option
+<dt><code>--with-dri-drivers=DRIVER,DRIVER,...</code>
+<dd ><p > This option
allows a specific set of DRI drivers to be built. For example,
<code>--with-dri-drivers="swrast,i965,radeon,nouveau"</code>. By
default, the drivers will be chosen depending on the target platform.
See the directory <code>src/mesa/drivers/dri</code> in the source tree
for available drivers. Beware that the swrast DRI driver is used by both
libGL and the X.Org xserver GLX module to do software rendering, so you
-may run into problems if it is not available.</li>
+may run into problems if it is not available.
<!-- This explanation might be totally bogus. Kristian? -->
-<li><code>--disable-driglx-direct</code> - Disable direct rendering in
+<dt><code>--disable-driglx-direct</code>
+<dd ><p > Disable direct rendering in
GLX. Normally, direct hardware rendering through the DRI drivers and
indirect software rendering are enabled in GLX. This option disables
direct rendering entirely. It can be useful on architectures where
kernel DRM modules are not available.
-</li>
-<li><code>--enable-glx-tls</code> - Enable Thread Local Storage (TLS) in
+<dt><code>--enable-glx-tls</code> <dd ><p >
+Enable Thread Local Storage (TLS) in
GLX.
-</li>
-<li><code>--with-expat=DIR</code> - The DRI-enabled libGL uses expat to
+<dt><code>--with-expat=DIR</code> <dd > The DRI-enabled libGL uses expat to
parse the DRI configuration files in <code>/etc/drirc</code> and
<code>~/.drirc</code>. This option allows a specific expat installation
to be used. For example, <code>--with-expat=/usr/local</code> will
search for expat headers and libraries in <code>/usr/local/include</code>
and <code>/usr/local/lib</code>, respectively.
-</li>
-</ul>
-</p>
+</dl>
-<a name="osmesa">
-<li><b><em>OSMesa</em></b> - No libGL is built in this
+<h3 id="osmesa">OSMesa </h3><p> No libGL is built in this
mode. Instead, the driver code is built into the Off-Screen Mesa
(OSMesa) library. See the <a href="osmesa.html">Off-Screen Rendering</a>
page for more details.
-</li>
<!-- OSMesa specific options -->
-<p>
-<ul>
-<li><code>--with-osmesa-bits=BITS</code> - This option allows the size
+<dl>
+<dt><code>--with-osmesa-bits=BITS</code>
+<dd><p> This option allows the size
of the color channel in bits to be specified. By default, an 8-bit
channel will be used, and the driver will be named libOSMesa. Other
options are 16- and 32-bit color channels, which will add the bit size
to the library name. For example, <code>--with-osmesa-bits=16</code>
will create the libOSMesa16 library with a 16-bit color channel.
-</li>
-</ul>
-</p>
-
-</ul>
+</dl>
+</dl>
-<a name="library">
-<h2>3. Library Options</h2>
+<h2 id="library">3. Library Options</h2>
<p>
The configure script provides more fine grained control over the GL
@@ -238,18 +220,14 @@ libraries that will be built. More details on the specific GL libraries
can be found in the <a href="install.html">basic installation
instructions</a>.
-<ul>
-<a name="glu">
-<li><b><em>GLU</em></b> - The libGLU library will be built by default
+<dl>
+<dt id="glu">GLU <dd><p> The libGLU library will be built by default
on all drivers. This can be disable with the option
<code>--disable-glu</code>.
-</li>
-</ul>
-</p>
+</dl>
-<a name="demos">
-<h2>4. Demo Program Options</h2>
+<h2 id="demos">4. Demo Program Options</h2>
<p>
There are many demonstration programs in the MesaDemos tarball. If the
@@ -257,18 +235,16 @@ programs are available when <code>./configure</code> is run, a subset of
the programs will be built depending on the driver and library options
chosen. See the directory <code>progs</code> for the full set of demos.
-<ul>
-<li><code>--with-demos=DEMOS,DEMOS,...</code> - This option allows a
+<dl>
+<dt><code>--with-demos=DEMOS,DEMOS,...</code>
+<dd><p> This option allows a
specific set of demo programs to be built. For example,
<code>--with-demos="xdemos,slang"</code>. Beware that if this option is
used, it will not be ensured that the necessary GL libraries will be
available.
-</li>
-<li><code>--without-demos</code> - This completely disables building the
+<dt><code>--without-demos</code> <dd><p> This completely disables building the
demo programs. It is equivalent to <code>--with-demos=no</code>.
-</li>
-</ul>
-</p>
+</dl>
</body>
</html>
diff --git a/mesalib/docs/xlibdriver.html b/mesalib/docs/xlibdriver.html
index d95f4d579..db03bc353 100644
--- a/mesalib/docs/xlibdriver.html
+++ b/mesalib/docs/xlibdriver.html
@@ -164,7 +164,7 @@ drawn with glDrawPixels.
<p>
For more information about gamma correction see:
-<a href="http://www.inforamp.net/~poynton/notes/colour_and_gamma/GammaFAQ.html"
+<a href="http://www.inforamp.net/~poynton/notes/colour_and_gamma/GammaFAQ.html">
the Gamma FAQ</a>
</p>
diff --git a/mesalib/src/mesa/drivers/common/driverfuncs.c b/mesalib/src/mesa/drivers/common/driverfuncs.c
index 1df838173..ca120578d 100644
--- a/mesalib/src/mesa/drivers/common/driverfuncs.c
+++ b/mesalib/src/mesa/drivers/common/driverfuncs.c
@@ -131,9 +131,6 @@ _mesa_init_driver_functions(struct dd_function_table *driver)
driver->BlendColor = NULL;
driver->BlendEquationSeparate = NULL;
driver->BlendFuncSeparate = NULL;
- driver->ClearColor = NULL;
- driver->ClearDepth = NULL;
- driver->ClearStencil = NULL;
driver->ClipPlane = NULL;
driver->ColorMask = NULL;
driver->ColorMaterial = NULL;
diff --git a/mesalib/src/mesa/drivers/windows/gdi/wmesa.c b/mesalib/src/mesa/drivers/windows/gdi/wmesa.c
index ba11998eb..93da05fe7 100644
--- a/mesalib/src/mesa/drivers/windows/gdi/wmesa.c
+++ b/mesalib/src/mesa/drivers/windows/gdi/wmesa.c
@@ -243,39 +243,9 @@ static void wmesa_flush(struct gl_context *ctx)
/***** CLEAR Functions *****/
/**********************************************************************/
-/* If we do not implement these, Mesa clears the buffers via the pixel
- * span writing interface, which is very slow for a clear operation.
- */
-
-/*
- * Set the color used to clear the color buffer.
- */
-static void clear_color(struct gl_context *ctx,
- const union gl_color_union color)
-{
- WMesaContext pwc = wmesa_context(ctx);
- GLubyte col[3];
-
- UNCLAMPED_FLOAT_TO_UBYTE(col[0], color.f[0]);
- UNCLAMPED_FLOAT_TO_UBYTE(col[1], color.f[1]);
- UNCLAMPED_FLOAT_TO_UBYTE(col[2], color.f[2]);
- pwc->clearColorRef = RGB(col[0], col[1], col[2]);
- DeleteObject(pwc->clearPen);
- DeleteObject(pwc->clearBrush);
- pwc->clearPen = CreatePen(PS_SOLID, 1, pwc->clearColorRef);
- pwc->clearBrush = CreateSolidBrush(pwc->clearColorRef);
-}
-
-
/*
- * Clear the specified region of the color buffer using the clear color
- * or index as specified by one of the two functions above.
- *
- * This procedure clears either the front and/or the back COLOR buffers.
- * Only the "left" buffer is cleared since we are not stereo.
- * Clearing of the other non-color buffers is left to the swrast.
+ * Clear the color/depth/stencil buffers.
*/
-
static void clear(struct gl_context *ctx, GLbitfield mask)
{
#define FLIP(Y) (ctx->DrawBuffer->Height - (Y) - 1)
@@ -298,6 +268,20 @@ static void clear(struct gl_context *ctx, GLbitfield mask)
return;
}
+ if (mask & BUFFER_BITS_COLOR) {
+ /* setup the clearing color */
+ const union gl_color_union color = ctx->Color.ClearColor;
+ GLubyte col[3];
+ UNCLAMPED_FLOAT_TO_UBYTE(col[0], color.f[0]);
+ UNCLAMPED_FLOAT_TO_UBYTE(col[1], color.f[1]);
+ UNCLAMPED_FLOAT_TO_UBYTE(col[2], color.f[2]);
+ pwc->clearColorRef = RGB(col[0], col[1], col[2]);
+ DeleteObject(pwc->clearPen);
+ DeleteObject(pwc->clearBrush);
+ pwc->clearPen = CreatePen(PS_SOLID, 1, pwc->clearColorRef);
+ pwc->clearBrush = CreateSolidBrush(pwc->clearColorRef);
+ }
+
/* Back buffer */
if (mask & BUFFER_BIT_BACK_LEFT) {
@@ -1095,7 +1079,6 @@ WMesaContext WMesaCreateContext(HDC hDC,
functions.GetBufferSize = wmesa_get_buffer_size;
functions.Flush = wmesa_flush;
functions.Clear = clear;
- functions.ClearColor = clear_color;
functions.ResizeBuffers = wmesa_resize_buffers;
functions.Viewport = wmesa_viewport;
diff --git a/mesalib/src/mesa/main/clear.c b/mesalib/src/mesa/main/clear.c
index e4df120d6..7cc204bc5 100644
--- a/mesalib/src/mesa/main/clear.c
+++ b/mesalib/src/mesa/main/clear.c
@@ -88,14 +88,6 @@ _mesa_ClearColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha )
FLUSH_VERTICES(ctx, _NEW_COLOR);
COPY_4V(ctx->Color.ClearColor.f, tmp);
-
- if (ctx->Driver.ClearColor) {
- /* it's OK to call glClearColor in CI mode but it should be a NOP */
- /* we pass the clamped color, since all drivers that need this don't
- * support GL_ARB_color_buffer_float
- */
- (*ctx->Driver.ClearColor)(ctx, ctx->Color.ClearColor);
- }
}
@@ -119,11 +111,6 @@ _mesa_ClearColorIiEXT(GLint r, GLint g, GLint b, GLint a)
FLUSH_VERTICES(ctx, _NEW_COLOR);
COPY_4V(ctx->Color.ClearColor.i, tmp);
-
- /* these should be NOP calls for drivers supporting EXT_texture_integer */
- if (ctx->Driver.ClearColor) {
- ctx->Driver.ClearColor(ctx, ctx->Color.ClearColor);
- }
}
@@ -147,11 +134,6 @@ _mesa_ClearColorIuiEXT(GLuint r, GLuint g, GLuint b, GLuint a)
FLUSH_VERTICES(ctx, _NEW_COLOR);
COPY_4V(ctx->Color.ClearColor.ui, tmp);
-
- /* these should be NOP calls for drivers supporting EXT_texture_integer */
- if (ctx->Driver.ClearColor) {
- ctx->Driver.ClearColor(ctx, ctx->Color.ClearColor);
- }
}
@@ -346,12 +328,8 @@ _mesa_ClearBufferiv(GLenum buffer, GLint drawbuffer, const GLint *value)
*/
const GLuint clearSave = ctx->Stencil.Clear;
ctx->Stencil.Clear = *value;
- if (ctx->Driver.ClearStencil)
- ctx->Driver.ClearStencil(ctx, *value);
ctx->Driver.Clear(ctx, BUFFER_BIT_STENCIL);
ctx->Stencil.Clear = clearSave;
- if (ctx->Driver.ClearStencil)
- ctx->Driver.ClearStencil(ctx, clearSave);
}
break;
case GL_COLOR:
@@ -369,14 +347,10 @@ _mesa_ClearBufferiv(GLenum buffer, GLint drawbuffer, const GLint *value)
clearSave = ctx->Color.ClearColor;
/* set color */
COPY_4V(ctx->Color.ClearColor.i, value);
- if (ctx->Driver.ClearColor)
- ctx->Driver.ClearColor(ctx, ctx->Color.ClearColor);
/* clear buffer(s) */
ctx->Driver.Clear(ctx, mask);
/* restore color */
ctx->Color.ClearColor = clearSave;
- if (ctx->Driver.ClearColor)
- ctx->Driver.ClearColor(ctx, clearSave);
}
}
break;
@@ -439,14 +413,10 @@ _mesa_ClearBufferuiv(GLenum buffer, GLint drawbuffer, const GLuint *value)
clearSave = ctx->Color.ClearColor;
/* set color */
COPY_4V(ctx->Color.ClearColor.ui, value);
- if (ctx->Driver.ClearColor)
- ctx->Driver.ClearColor(ctx, ctx->Color.ClearColor);
/* clear buffer(s) */
ctx->Driver.Clear(ctx, mask);
/* restore color */
ctx->Color.ClearColor = clearSave;
- if (ctx->Driver.ClearColor)
- ctx->Driver.ClearColor(ctx, clearSave);
}
}
break;
@@ -521,12 +491,8 @@ _mesa_ClearBufferfv(GLenum buffer, GLint drawbuffer, const GLfloat *value)
*/
const GLclampd clearSave = ctx->Depth.Clear;
ctx->Depth.Clear = *value;
- if (ctx->Driver.ClearDepth)
- ctx->Driver.ClearDepth(ctx, *value);
ctx->Driver.Clear(ctx, BUFFER_BIT_DEPTH);
ctx->Depth.Clear = clearSave;
- if (ctx->Driver.ClearDepth)
- ctx->Driver.ClearDepth(ctx, clearSave);
}
/* clear depth buffer to value */
break;
@@ -545,14 +511,10 @@ _mesa_ClearBufferfv(GLenum buffer, GLint drawbuffer, const GLfloat *value)
clearSave = ctx->Color.ClearColor;
/* set color */
COPY_4V_CAST(ctx->Color.ClearColor.f, value, GLclampf);
- if (ctx->Driver.ClearColor)
- ctx->Driver.ClearColor(ctx, ctx->Color.ClearColor);
/* clear buffer(s) */
ctx->Driver.Clear(ctx, mask);
/* restore color */
ctx->Color.ClearColor = clearSave;
- if (ctx->Driver.ClearColor)
- ctx->Driver.ClearColor(ctx, clearSave);
}
}
break;
@@ -637,10 +599,6 @@ _mesa_ClearBufferfi(GLenum buffer, GLint drawbuffer,
/* set new clear values */
ctx->Depth.Clear = depth;
ctx->Stencil.Clear = stencil;
- if (ctx->Driver.ClearDepth)
- ctx->Driver.ClearDepth(ctx, depth);
- if (ctx->Driver.ClearStencil)
- ctx->Driver.ClearStencil(ctx, stencil);
/* clear buffers */
ctx->Driver.Clear(ctx, mask);
@@ -648,9 +606,5 @@ _mesa_ClearBufferfi(GLenum buffer, GLint drawbuffer,
/* restore */
ctx->Depth.Clear = clearDepthSave;
ctx->Stencil.Clear = clearStencilSave;
- if (ctx->Driver.ClearDepth)
- ctx->Driver.ClearDepth(ctx, clearDepthSave);
- if (ctx->Driver.ClearStencil)
- ctx->Driver.ClearStencil(ctx, clearStencilSave);
}
}
diff --git a/mesalib/src/mesa/main/dd.h b/mesalib/src/mesa/main/dd.h
index 96311131a..582eb5d49 100644
--- a/mesalib/src/mesa/main/dd.h
+++ b/mesalib/src/mesa/main/dd.h
@@ -557,13 +557,6 @@ struct dd_function_table {
void (*BlendFuncSeparatei)(struct gl_context *ctx, GLuint buffer,
GLenum sfactorRGB, GLenum dfactorRGB,
GLenum sfactorA, GLenum dfactorA);
- /** Specify clear values for the color buffers */
- void (*ClearColor)(struct gl_context *ctx,
- const union gl_color_union color);
- /** Specify the clear value for the depth buffer */
- void (*ClearDepth)(struct gl_context *ctx, GLclampd d);
- /** Specify the clear value for the stencil buffer */
- void (*ClearStencil)(struct gl_context *ctx, GLint s);
/** Specify a plane against which all geometry is clipped */
void (*ClipPlane)(struct gl_context *ctx, GLenum plane, const GLfloat *equation );
/** Enable and disable writing of frame buffer color components */
diff --git a/mesalib/src/mesa/main/debug.c b/mesalib/src/mesa/main/debug.c
index 71d7f1ac6..f7b1f71f4 100644
--- a/mesalib/src/mesa/main/debug.c
+++ b/mesalib/src/mesa/main/debug.c
@@ -100,13 +100,11 @@ void
_mesa_print_tri_caps( const char *name, GLuint flags )
{
_mesa_debug(NULL,
- "%s: (0x%x) %s%s%s%s%s%s%s%s%s%s%s%s%s\n",
+ "%s: (0x%x) %s%s%s%s%s%s%s%s%s%s\n",
name,
flags,
- (flags & DD_FLATSHADE) ? "flat-shade, " : "",
(flags & DD_SEPARATE_SPECULAR) ? "separate-specular, " : "",
(flags & DD_TRI_LIGHT_TWOSIDE) ? "tri-light-twoside, " : "",
- (flags & DD_TRI_TWOSTENCIL) ? "tri-twostencil, " : "",
(flags & DD_TRI_UNFILLED) ? "tri-unfilled, " : "",
(flags & DD_TRI_STIPPLE) ? "tri-stipple, " : "",
(flags & DD_TRI_OFFSET) ? "tri-offset, " : "",
@@ -114,8 +112,7 @@ _mesa_print_tri_caps( const char *name, GLuint flags )
(flags & DD_LINE_SMOOTH) ? "line-smooth, " : "",
(flags & DD_LINE_STIPPLE) ? "line-stipple, " : "",
(flags & DD_POINT_SMOOTH) ? "point-smooth, " : "",
- (flags & DD_POINT_ATTEN) ? "point-atten, " : "",
- (flags & DD_TRI_CULL_FRONT_BACK) ? "cull-all, " : ""
+ (flags & DD_POINT_ATTEN) ? "point-atten, " : ""
);
}
diff --git a/mesalib/src/mesa/main/depth.c b/mesalib/src/mesa/main/depth.c
index 52c69a6bc..bb1625440 100644
--- a/mesalib/src/mesa/main/depth.c
+++ b/mesalib/src/mesa/main/depth.c
@@ -54,8 +54,6 @@ _mesa_ClearDepth( GLclampd depth )
FLUSH_VERTICES(ctx, _NEW_DEPTH);
ctx->Depth.Clear = depth;
- if (ctx->Driver.ClearDepth)
- (*ctx->Driver.ClearDepth)( ctx, ctx->Depth.Clear );
}
diff --git a/mesalib/src/mesa/main/enable.c b/mesalib/src/mesa/main/enable.c
index 2f0216b01..f6d37feae 100644
--- a/mesalib/src/mesa/main/enable.c
+++ b/mesalib/src/mesa/main/enable.c
@@ -822,10 +822,8 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
ctx->Stencil.TestTwoSide = state;
if (state) {
ctx->Stencil._BackFace = 2;
- ctx->_TriangleCaps |= DD_TRI_TWOSTENCIL;
} else {
ctx->Stencil._BackFace = 1;
- ctx->_TriangleCaps &= ~DD_TRI_TWOSTENCIL;
}
break;
diff --git a/mesalib/src/mesa/main/errors.c b/mesalib/src/mesa/main/errors.c
index 22561003a..fcf873f18 100644
--- a/mesalib/src/mesa/main/errors.c
+++ b/mesalib/src/mesa/main/errors.c
@@ -718,10 +718,10 @@ _mesa_DebugMessageControlARB(GLenum source, GLenum type, GLenum severity,
}
static void GLAPIENTRY
-_mesa_DebugMessageCallbackARB(GLvoid *callback, GLvoid *userParam)
+_mesa_DebugMessageCallbackARB(GLDEBUGPROCARB callback, GLvoid *userParam)
{
GET_CURRENT_CONTEXT(ctx);
- ctx->Debug.Callback = (GLDEBUGPROCARB)callback;
+ ctx->Debug.Callback = callback;
ctx->Debug.CallbackData = userParam;
}
diff --git a/mesalib/src/mesa/main/fbobject.c b/mesalib/src/mesa/main/fbobject.c
index 281b1ca2f..26ae1087c 100644
--- a/mesalib/src/mesa/main/fbobject.c
+++ b/mesalib/src/mesa/main/fbobject.c
@@ -1914,7 +1914,10 @@ reuse_framebuffer_texture_attachment(struct gl_framebuffer *fb,
/**
- * Common code called by glFramebufferTexture1D/2D/3DEXT().
+ * Common code called by glFramebufferTexture1D/2D/3DEXT() and
+ * glFramebufferTextureLayerEXT().
+ * Note: glFramebufferTextureLayerEXT() has no textarget parameter so we'll
+ * get textarget=0 in that case.
*/
static void
framebuffer_texture(struct gl_context *ctx, const char *caller, GLenum target,
@@ -1924,6 +1927,7 @@ framebuffer_texture(struct gl_context *ctx, const char *caller, GLenum target,
struct gl_renderbuffer_attachment *att;
struct gl_texture_object *texObj = NULL;
struct gl_framebuffer *fb;
+ GLenum maxLevelsTarget;
ASSERT_OUTSIDE_BEGIN_END(ctx);
@@ -1950,12 +1954,17 @@ framebuffer_texture(struct gl_context *ctx, const char *caller, GLenum target,
texObj = _mesa_lookup_texture(ctx, texture);
if (texObj != NULL) {
if (textarget == 0) {
- /* XXX what's the purpose of this? */
+ /* If textarget == 0 it means we're being called by
+ * glFramebufferTextureLayer() and textarget is not used.
+ * The only legal texture types for that function are 3D and
+ * 1D/2D arrays textures.
+ */
err = (texObj->Target != GL_TEXTURE_3D) &&
(texObj->Target != GL_TEXTURE_1D_ARRAY_EXT) &&
(texObj->Target != GL_TEXTURE_2D_ARRAY_EXT);
}
else {
+ /* Make sure textarget is consistent with the texture's type */
err = (texObj->Target == GL_TEXTURE_CUBE_MAP)
? !_mesa_is_cube_face(textarget)
: (texObj->Target != textarget);
@@ -1993,8 +2002,9 @@ framebuffer_texture(struct gl_context *ctx, const char *caller, GLenum target,
}
}
+ maxLevelsTarget = textarget ? textarget : texObj->Target;
if ((level < 0) ||
- (level >= _mesa_max_texture_levels(ctx, textarget))) {
+ (level >= _mesa_max_texture_levels(ctx, maxLevelsTarget))) {
_mesa_error(ctx, GL_INVALID_VALUE,
"glFramebufferTexture%sEXT(level)", caller);
return;
diff --git a/mesalib/src/mesa/main/light.c b/mesalib/src/mesa/main/light.c
index 962a3e689..7bc22e2fa 100644
--- a/mesalib/src/mesa/main/light.c
+++ b/mesalib/src/mesa/main/light.c
@@ -54,10 +54,6 @@ _mesa_ShadeModel( GLenum mode )
FLUSH_VERTICES(ctx, _NEW_LIGHT);
ctx->Light.ShadeModel = mode;
- if (mode == GL_FLAT)
- ctx->_TriangleCaps |= DD_FLATSHADE;
- else
- ctx->_TriangleCaps &= ~DD_FLATSHADE;
if (ctx->Driver.ShadeModel)
ctx->Driver.ShadeModel( ctx, mode );
diff --git a/mesalib/src/mesa/main/mtypes.h b/mesalib/src/mesa/main/mtypes.h
index 9b88f9938..f76096a49 100644
--- a/mesalib/src/mesa/main/mtypes.h
+++ b/mesalib/src/mesa/main/mtypes.h
@@ -3071,40 +3071,16 @@ struct gl_matrix_stack
* Set in the __struct gl_contextRec::_TriangleCaps bitfield.
*/
/*@{*/
-#define DD_FLATSHADE 0x1
-#define DD_SEPARATE_SPECULAR 0x2
-#define DD_TRI_CULL_FRONT_BACK 0x4 /* special case on some hw */
-#define DD_TRI_LIGHT_TWOSIDE 0x8
-#define DD_TRI_UNFILLED 0x10
-#define DD_TRI_SMOOTH 0x20
-#define DD_TRI_STIPPLE 0x40
-#define DD_TRI_OFFSET 0x80
-#define DD_LINE_SMOOTH 0x100
-#define DD_LINE_STIPPLE 0x200
-#define DD_POINT_SMOOTH 0x400
-#define DD_POINT_ATTEN 0x800
-#define DD_TRI_TWOSTENCIL 0x1000
-/*@}*/
-
-
-/**
- * \name Define the state changes under which each of these bits might change
- */
-/*@{*/
-#define _DD_NEW_FLATSHADE _NEW_LIGHT
-#define _DD_NEW_SEPARATE_SPECULAR (_NEW_LIGHT | _NEW_FOG | _NEW_PROGRAM)
-#define _DD_NEW_TRI_CULL_FRONT_BACK _NEW_POLYGON
-#define _DD_NEW_TRI_LIGHT_TWOSIDE _NEW_LIGHT
-#define _DD_NEW_TRI_UNFILLED _NEW_POLYGON
-#define _DD_NEW_TRI_SMOOTH _NEW_POLYGON
-#define _DD_NEW_TRI_STIPPLE _NEW_POLYGON
-#define _DD_NEW_TRI_OFFSET _NEW_POLYGON
-#define _DD_NEW_LINE_SMOOTH _NEW_LINE
-#define _DD_NEW_LINE_STIPPLE _NEW_LINE
-#define _DD_NEW_LINE_WIDTH _NEW_LINE
-#define _DD_NEW_POINT_SMOOTH _NEW_POINT
-#define _DD_NEW_POINT_SIZE _NEW_POINT
-#define _DD_NEW_POINT_ATTEN _NEW_POINT
+#define DD_SEPARATE_SPECULAR (1 << 0)
+#define DD_TRI_LIGHT_TWOSIDE (1 << 1)
+#define DD_TRI_UNFILLED (1 << 2)
+#define DD_TRI_SMOOTH (1 << 3)
+#define DD_TRI_STIPPLE (1 << 4)
+#define DD_TRI_OFFSET (1 << 5)
+#define DD_LINE_SMOOTH (1 << 6)
+#define DD_LINE_STIPPLE (1 << 7)
+#define DD_POINT_SMOOTH (1 << 8)
+#define DD_POINT_ATTEN (1 << 9)
/*@}*/
@@ -3117,6 +3093,12 @@ struct gl_matrix_stack
_NEW_POINT | \
_NEW_PROGRAM | \
_NEW_MODELVIEW)
+
+#define _MESA_NEW_SEPARATE_SPECULAR (_NEW_LIGHT | \
+ _NEW_FOG | \
+ _NEW_PROGRAM)
+
+
/*@}*/
diff --git a/mesalib/src/mesa/main/state.c b/mesalib/src/mesa/main/state.c
index 20fd17d06..b01926622 100644
--- a/mesalib/src/mesa/main/state.c
+++ b/mesalib/src/mesa/main/state.c
@@ -370,16 +370,13 @@ update_twoside(struct gl_context *ctx)
/*
- * Check polygon state and set DD_TRI_CULL_FRONT_BACK and/or DD_TRI_OFFSET
+ * Check polygon state and set DD_TRI_OFFSET
* in ctx->_TriangleCaps if needed.
*/
static void
update_polygon(struct gl_context *ctx)
{
- ctx->_TriangleCaps &= ~(DD_TRI_CULL_FRONT_BACK | DD_TRI_OFFSET);
-
- if (ctx->Polygon.CullFlag && ctx->Polygon.CullFaceMode == GL_FRONT_AND_BACK)
- ctx->_TriangleCaps |= DD_TRI_CULL_FRONT_BACK;
+ ctx->_TriangleCaps &= ~DD_TRI_OFFSET;
if ( ctx->Polygon.OffsetPoint
|| ctx->Polygon.OffsetLine
@@ -431,9 +428,6 @@ update_tricaps(struct gl_context *ctx, GLbitfield new_state)
if (ctx->Polygon.FrontMode != GL_FILL
|| ctx->Polygon.BackMode != GL_FILL)
ctx->_TriangleCaps |= DD_TRI_UNFILLED;
- if (ctx->Polygon.CullFlag
- && ctx->Polygon.CullFaceMode == GL_FRONT_AND_BACK)
- ctx->_TriangleCaps |= DD_TRI_CULL_FRONT_BACK;
if (ctx->Polygon.OffsetPoint ||
ctx->Polygon.OffsetLine ||
ctx->Polygon.OffsetFill)
@@ -445,16 +439,8 @@ update_tricaps(struct gl_context *ctx, GLbitfield new_state)
*/
if (ctx->Light.Enabled && ctx->Light.Model.TwoSide)
ctx->_TriangleCaps |= DD_TRI_LIGHT_TWOSIDE;
- if (ctx->Light.ShadeModel == GL_FLAT)
- ctx->_TriangleCaps |= DD_FLATSHADE;
if (_mesa_need_secondary_color(ctx))
ctx->_TriangleCaps |= DD_SEPARATE_SPECULAR;
-
- /*
- * Stencil
- */
- if (ctx->Stencil._TestTwoSide)
- ctx->_TriangleCaps |= DD_TRI_TWOSTENCIL;
}
#endif
@@ -534,7 +520,7 @@ _mesa_update_state_locked( struct gl_context *ctx )
if (new_state & _NEW_PIXEL)
_mesa_update_pixel( ctx, new_state );
- if (new_state & _DD_NEW_SEPARATE_SPECULAR)
+ if (new_state & _MESA_NEW_SEPARATE_SPECULAR)
update_separate_specular( ctx );
if (new_state & (_NEW_BUFFERS | _NEW_VIEWPORT))
@@ -551,7 +537,7 @@ _mesa_update_state_locked( struct gl_context *ctx )
#if 0
if (new_state & (_NEW_POINT | _NEW_LINE | _NEW_POLYGON | _NEW_LIGHT
- | _NEW_STENCIL | _DD_NEW_SEPARATE_SPECULAR))
+ | _NEW_STENCIL | _MESA_NEW_SEPARATE_SPECULAR))
update_tricaps( ctx, new_state );
#endif
diff --git a/mesalib/src/mesa/main/stencil.c b/mesalib/src/mesa/main/stencil.c
index b6993ff12..f47b57b8d 100644
--- a/mesalib/src/mesa/main/stencil.c
+++ b/mesalib/src/mesa/main/stencil.c
@@ -115,10 +115,6 @@ _mesa_ClearStencil( GLint s )
FLUSH_VERTICES(ctx, _NEW_STENCIL);
ctx->Stencil.Clear = (GLuint) s;
-
- if (ctx->Driver.ClearStencil) {
- ctx->Driver.ClearStencil( ctx, s );
- }
}
diff --git a/mesalib/src/mesa/swrast/s_context.c b/mesalib/src/mesa/swrast/s_context.c
index 63350b2e7..beb915879 100644
--- a/mesalib/src/mesa/swrast/s_context.c
+++ b/mesalib/src/mesa/swrast/s_context.c
@@ -312,7 +312,7 @@ _swrast_update_specular_vertex_add(struct gl_context *ctx)
_SWRAST_NEW_RASTERMASK| \
_NEW_LIGHT| \
_NEW_FOG | \
- _DD_NEW_SEPARATE_SPECULAR)
+ _MESA_NEW_SEPARATE_SPECULAR)
#define _SWRAST_NEW_LINE (_SWRAST_NEW_DERIVED | \
_NEW_RENDERMODE| \
@@ -321,7 +321,7 @@ _swrast_update_specular_vertex_add(struct gl_context *ctx)
_NEW_LIGHT| \
_NEW_FOG| \
_NEW_DEPTH | \
- _DD_NEW_SEPARATE_SPECULAR)
+ _MESA_NEW_SEPARATE_SPECULAR)
#define _SWRAST_NEW_POINT (_SWRAST_NEW_DERIVED | \
_NEW_RENDERMODE | \
@@ -329,7 +329,7 @@ _swrast_update_specular_vertex_add(struct gl_context *ctx)
_NEW_TEXTURE | \
_NEW_LIGHT | \
_NEW_FOG | \
- _DD_NEW_SEPARATE_SPECULAR)
+ _MESA_NEW_SEPARATE_SPECULAR)
#define _SWRAST_NEW_TEXTURE_SAMPLE_FUNC _NEW_TEXTURE
diff --git a/mesalib/src/mesa/tnl/t_vertex.c b/mesalib/src/mesa/tnl/t_vertex.c
index 6582949a0..580f95df3 100644
--- a/mesalib/src/mesa/tnl/t_vertex.c
+++ b/mesalib/src/mesa/tnl/t_vertex.c
@@ -269,7 +269,8 @@ void *_tnl_get_vertex( struct gl_context *ctx, GLuint nr )
void _tnl_invalidate_vertex_state( struct gl_context *ctx, GLuint new_state )
{
- if (new_state & (_DD_NEW_TRI_LIGHT_TWOSIDE|_DD_NEW_TRI_UNFILLED) ) {
+ /* if two-sided lighting changes or filled/unfilled polygon state changes */
+ if (new_state & (_NEW_LIGHT | _NEW_POLYGON) ) {
struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
vtx->new_inputs = ~0;
vtx->interp = choose_interp_func;