diff -ruN mesa-7.4-orig/src/mesa/swrast/s_feedback.c mesa-7.4-patched/src/mesa/swrast/s_feedback.c --- mesa-7.4-orig/src/mesa/swrast/s_feedback.c 2009-03-13 04:28:49.000000000 +0100 +++ mesa-7.4-patched/src/mesa/swrast/s_feedback.c 2009-08-27 22:59:17.000000000 +0200 @@ -58,7 +58,7 @@ _swrast_feedback_triangle(GLcontext *ctx, const SWvertex *v0, const SWvertex *v1, const SWvertex *v2) { - if (_swrast_culltriangle(ctx, v0, v1, v2)) { + if (!_swrast_culltriangle(ctx, v0, v1, v2)) { FEEDBACK_TOKEN(ctx, (GLfloat) (GLint) GL_POLYGON_TOKEN); FEEDBACK_TOKEN(ctx, (GLfloat) 3); /* three vertices */ @@ -113,7 +113,7 @@ _swrast_select_triangle(GLcontext *ctx, const SWvertex *v0, const SWvertex *v1, const SWvertex *v2) { - if (_swrast_culltriangle(ctx, v0, v1, v2)) { + if (!_swrast_culltriangle(ctx, v0, v1, v2)) { const GLfloat zs = 1.0F / ctx->DrawBuffer->_DepthMaxF; _mesa_update_hitflag( ctx, v0->attrib[FRAG_ATTRIB_WPOS][2] * zs ); diff -ruN mesa-7.4-orig/src/mesa/swrast/s_triangle.c mesa-7.4-patched/src/mesa/swrast/s_triangle.c --- mesa-7.4-orig/src/mesa/swrast/s_triangle.c 2009-03-17 15:48:46.000000000 +0100 +++ mesa-7.4-patched/src/mesa/swrast/s_triangle.c 2009-08-27 22:57:24.000000000 +0200 @@ -44,7 +44,7 @@ /* - * Just used for feedback mode. + * Used for feedback and selection mode. Retrutns true if the triangle is to be culled */ GLboolean _swrast_culltriangle( GLcontext *ctx, @@ -58,7 +58,7 @@ GLfloat fy = v2->attrib[FRAG_ATTRIB_WPOS][1] - v0->attrib[FRAG_ATTRIB_WPOS][1]; GLfloat c = ex*fy-ey*fx; - if (c * SWRAST_CONTEXT(ctx)->_BackfaceCullSign > 0) + if (c * SWRAST_CONTEXT(ctx)->_BackfaceSign * SWRAST_CONTEXT(ctx)->_BackfaceCullSign < 0) return 0; return 1;