From fc72edebf875378459368c5383d9023730cbca54 Mon Sep 17 00:00:00 2001
From: marha
The autoconf generated configure script can be used to guess your
@@ -104,7 +103,6 @@ package metadata in
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.
-
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.
This is the default mode for building Mesa.
It uses Xlib as a software renderer to do all rendering. It corresponds
to the option This mode uses the DRI hardware drivers for
accelerated OpenGL rendering. Enable the DRI drivers with the option
- This option specifies the
location the DRI drivers will be installed to and the location libGL
will search for DRI drivers. The default is This option
allows a specific set of DRI drivers to be built. For example,
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.
-
+Enable Thread Local Storage (TLS) in
GLX.
-Compilation and Installation using Autoconf
-
-
-1. Basic Usage
+1. Basic Usage
/usr/X11R6
before the standard
directories.
-2. Driver Options
+2. Driver Options
-
-
-
Xlib
--with-driver=xlib
. The libX11 and libXext
libraries, as well as the X11 development headers, will be need to
support the Xlib driver.
-DRI
--with-driver=dri
. See the basic
installation instructions for details on prerequisites for the DRI
drivers.
-
-
---with-dri-driverdir=DIR
- This option specifies the
+
+
--with-dri-driverdir=DIR
+${libdir}/dri
.
---with-dri-drivers=DRIVER,DRIVER,...
- This option
+--with-dri-drivers=DRIVER,DRIVER,...
+--with-dri-drivers="swrast,i965,radeon,nouveau"
. By
default, the drivers will be chosen depending on the target platform.
See the directory src/mesa/drivers/dri
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.--disable-driglx-direct
- Disable direct rendering in
+--disable-driglx-direct
+--enable-glx-tls
- Enable Thread Local Storage (TLS) in
+--enable-glx-tls
--with-expat=DIR
- The DRI-enabled libGL uses expat to
+--with-expat=DIR
/etc/drirc
and
~/.drirc
. This option allows a specific expat installation
to be used. For example, --with-expat=/usr/local
will
search for expat headers and libraries in /usr/local/include
and /usr/local/lib
, respectively.
-
No libGL is built in this mode. Instead, the driver code is built into the Off-Screen Mesa (OSMesa) library. See the Off-Screen Rendering page for more details. -
-
--with-osmesa-bits=BITS
- This option allows the size
+--with-osmesa-bits=BITS
+ 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, --with-osmesa-bits=16
will create the libOSMesa16 library with a 16-bit color channel.
-
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 basic installation instructions. -
The libGLU library will be built by default
on all drivers. This can be disable with the option
--disable-glu
.
-
There are many demonstration programs in the MesaDemos tarball. If the
@@ -257,18 +235,16 @@ programs are available when ./configure
is run, a subset of
the programs will be built depending on the driver and library options
chosen. See the directory progs
for the full set of demos.
-
--with-demos=DEMOS,DEMOS,...
- This option allows a
+--with-demos=DEMOS,DEMOS,...
+ This option allows a
specific set of demo programs to be built. For example,
--with-demos="xdemos,slang"
. Beware that if this option is
used, it will not be ensured that the necessary GL libraries will be
available.
-
--without-demos
- This completely disables building the
+--without-demos
This completely disables building the
demo programs. It is equivalent to --with-demos=no
.
-
For more information about gamma correction see: - the Gamma FAQ
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; -- cgit v1.2.3