aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-03-13 08:34:09 +0100
committermarha <marha@users.sourceforge.net>2012-03-13 08:34:09 +0100
commit7d894e32566b710952c44cbc71939ad1d9e2fa8d (patch)
tree2c324c18b71f48bcb8bb2c4c35fa0fce1b02a5fb /mesalib/src/mesa
parent96276c847a5c266f9f51f3ec4ece8fe3f1381c96 (diff)
parentfc72edebf875378459368c5383d9023730cbca54 (diff)
downloadvcxsrv-7d894e32566b710952c44cbc71939ad1d9e2fa8d.tar.gz
vcxsrv-7d894e32566b710952c44cbc71939ad1d9e2fa8d.tar.bz2
vcxsrv-7d894e32566b710952c44cbc71939ad1d9e2fa8d.zip
Merge remote-tracking branch 'origin/released'
Diffstat (limited to 'mesalib/src/mesa')
-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
15 files changed, 57 insertions, 166 deletions
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;