aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/i915/intel_tris.c3
-rw-r--r--src/mesa/drivers/dri/r200/r200_swtcl.c9
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_swtcl.c11
-rw-r--r--src/mesa/main/debug.c12
-rw-r--r--src/mesa/main/debug.h1
-rw-r--r--src/mesa/main/enable.c4
-rw-r--r--src/mesa/main/light.c4
-rw-r--r--src/mesa/main/mtypes.h10
-rw-r--r--src/mesa/main/state.c27
-rw-r--r--src/mesa/tnl/t_vertex.c12
10 files changed, 22 insertions, 71 deletions
diff --git a/src/mesa/drivers/dri/i915/intel_tris.c b/src/mesa/drivers/dri/i915/intel_tris.c
index 9a9c56f3eea..07c73f58519 100644
--- a/src/mesa/drivers/dri/i915/intel_tris.c
+++ b/src/mesa/drivers/dri/i915/intel_tris.c
@@ -943,6 +943,7 @@ intelFastRenderClippedPoly(struct gl_context * ctx, const GLuint * elts, GLuint
/**********************************************************************/
+#define DD_TRI_LIGHT_TWOSIDE (1 << 1)
#define DD_TRI_UNFILLED (1 << 2)
#define DD_TRI_STIPPLE (1 << 4)
#define DD_TRI_OFFSET (1 << 5)
@@ -958,6 +959,8 @@ intelChooseRenderState(struct gl_context * ctx)
TNLcontext *tnl = TNL_CONTEXT(ctx);
struct intel_context *intel = intel_context(ctx);
GLuint flags = ctx->_TriangleCaps |
+ ((ctx->Light.Enabled &&
+ ctx->Light.Model.TwoSide) ? DD_TRI_LIGHT_TWOSIDE : 0) |
((ctx->Polygon.FrontMode != GL_FILL ||
ctx->Polygon.BackMode != GL_FILL) ? DD_TRI_UNFILLED : 0) |
(ctx->Polygon.StippleFlag ? DD_TRI_STIPPLE : 0) |
diff --git a/src/mesa/drivers/dri/r200/r200_swtcl.c b/src/mesa/drivers/dri/r200/r200_swtcl.c
index fb92e751a1b..274e3386b4a 100644
--- a/src/mesa/drivers/dri/r200/r200_swtcl.c
+++ b/src/mesa/drivers/dri/r200/r200_swtcl.c
@@ -241,6 +241,7 @@ void r200ChooseVertexState( struct gl_context *ctx )
GLuint vap;
GLboolean unfilled = (ctx->Polygon.FrontMode != GL_FILL ||
ctx->Polygon.BackMode != GL_FILL);
+ GLboolean twosided = ctx->Light.Enabled && ctx->Light.Model.TwoSide;
/* We must ensure that we don't do _tnl_need_projected_coords while in a
* rasterization fallback. As this function will be called again when we
@@ -573,15 +574,17 @@ void r200ChooseRenderState( struct gl_context *ctx )
TNLcontext *tnl = TNL_CONTEXT(ctx);
r200ContextPtr rmesa = R200_CONTEXT(ctx);
GLuint index = 0;
- GLuint flags = ctx->_TriangleCaps;
GLboolean unfilled = (ctx->Polygon.FrontMode != GL_FILL ||
ctx->Polygon.BackMode != GL_FILL);
+ GLboolean twosided = ctx->Light.Enabled && ctx->Light.Model.TwoSide;
if (!rmesa->radeon.TclFallback || rmesa->radeon.Fallback)
return;
- if (flags & DD_TRI_LIGHT_TWOSIDE) index |= R200_TWOSIDE_BIT;
- if (unfilled) index |= R200_UNFILLED_BIT;
+ if (twosided)
+ index |= R200_TWOSIDE_BIT;
+ if (unfilled)
+ index |= R200_UNFILLED_BIT;
if (index != rmesa->radeon.swtcl.RenderIndex) {
tnl->Driver.Render.Points = rast_tab[index].points;
diff --git a/src/mesa/drivers/dri/radeon/radeon_swtcl.c b/src/mesa/drivers/dri/radeon/radeon_swtcl.c
index ed452df3f79..1e801627183 100644
--- a/src/mesa/drivers/dri/radeon/radeon_swtcl.c
+++ b/src/mesa/drivers/dri/radeon/radeon_swtcl.c
@@ -275,6 +275,7 @@ void radeonChooseVertexState( struct gl_context *ctx )
GLuint se_coord_fmt = rmesa->hw.set.cmd[SET_SE_COORDFMT];
GLboolean unfilled = (ctx->Polygon.FrontMode != GL_FILL ||
ctx->Polygon.BackMode != GL_FILL);
+ GLboolean twosided = ctx->Light.Enabled && ctx->Light.Model.TwoSide;
se_coord_fmt &= ~(RADEON_VTX_XY_PRE_MULT_1_OVER_W0 |
RADEON_VTX_Z_PRE_MULT_1_OVER_W0 |
@@ -294,7 +295,7 @@ void radeonChooseVertexState( struct gl_context *ctx )
if ((0 == (tnl->render_inputs_bitset &
(BITFIELD64_RANGE(_TNL_ATTRIB_TEX0, _TNL_NUM_TEX)
| BITFIELD64_BIT(_TNL_ATTRIB_COLOR1))))
- || (ctx->_TriangleCaps & DD_TRI_LIGHT_TWOSIDE)
+ || twosided
|| unfilled) {
rmesa->swtcl.needproj = GL_TRUE;
se_coord_fmt |= (RADEON_VTX_XY_PRE_MULT_1_OVER_W0 |
@@ -696,15 +697,17 @@ void radeonChooseRenderState( struct gl_context *ctx )
TNLcontext *tnl = TNL_CONTEXT(ctx);
r100ContextPtr rmesa = R100_CONTEXT(ctx);
GLuint index = 0;
- GLuint flags = ctx->_TriangleCaps;
GLboolean unfilled = (ctx->Polygon.FrontMode != GL_FILL ||
ctx->Polygon.BackMode != GL_FILL);
+ GLboolean twosided = ctx->Light.Enabled && ctx->Light.Model.TwoSide;
if (!rmesa->radeon.TclFallback || rmesa->radeon.Fallback)
return;
- if (flags & DD_TRI_LIGHT_TWOSIDE) index |= RADEON_TWOSIDE_BIT;
- if (unfilled) index |= RADEON_UNFILLED_BIT;
+ if (twosided)
+ index |= RADEON_TWOSIDE_BIT;
+ if (unfilled)
+ index |= RADEON_UNFILLED_BIT;
if (index != rmesa->radeon.swtcl.RenderIndex) {
tnl->Driver.Render.Points = rast_tab[index].points;
diff --git a/src/mesa/main/debug.c b/src/mesa/main/debug.c
index e8d850dff86..5dda766b934 100644
--- a/src/mesa/main/debug.c
+++ b/src/mesa/main/debug.c
@@ -96,18 +96,6 @@ _mesa_print_state( const char *msg, GLuint state )
-void
-_mesa_print_tri_caps( const char *name, GLuint flags )
-{
- _mesa_debug(NULL,
- "%s: (0x%x) %s\n",
- name,
- flags,
- (flags & DD_TRI_LIGHT_TWOSIDE) ? "tri-light-twoside, " : ""
- );
-}
-
-
/**
* Print information about this Mesa version and build options.
*/
diff --git a/src/mesa/main/debug.h b/src/mesa/main/debug.h
index 6bc536591ac..4fbfaff052a 100644
--- a/src/mesa/main/debug.h
+++ b/src/mesa/main/debug.h
@@ -42,7 +42,6 @@
struct gl_context;
struct gl_texture_image;
-extern void _mesa_print_tri_caps( const char *name, GLuint flags );
extern void _mesa_print_enable_flags( const char *msg, GLuint flags );
extern void _mesa_print_state( const char *msg, GLuint state );
extern void _mesa_print_info( void );
diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
index 22a75c8c5d1..fb2a1964fdd 100644
--- a/src/mesa/main/enable.c
+++ b/src/mesa/main/enable.c
@@ -419,10 +419,6 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
return;
FLUSH_VERTICES(ctx, _NEW_LIGHT);
ctx->Light.Enabled = state;
- if (ctx->Light.Enabled && ctx->Light.Model.TwoSide)
- ctx->_TriangleCaps |= DD_TRI_LIGHT_TWOSIDE;
- else
- ctx->_TriangleCaps &= ~DD_TRI_LIGHT_TWOSIDE;
break;
case GL_LINE_SMOOTH:
if (!_mesa_is_desktop_gl(ctx) && ctx->API != API_OPENGLES)
diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c
index c694bebe69b..41773d83c21 100644
--- a/src/mesa/main/light.c
+++ b/src/mesa/main/light.c
@@ -474,10 +474,6 @@ _mesa_LightModelfv( GLenum pname, const GLfloat *params )
return;
FLUSH_VERTICES(ctx, _NEW_LIGHT);
ctx->Light.Model.TwoSide = newbool;
- if (ctx->Light.Enabled && ctx->Light.Model.TwoSide)
- ctx->_TriangleCaps |= DD_TRI_LIGHT_TWOSIDE;
- else
- ctx->_TriangleCaps &= ~DD_TRI_LIGHT_TWOSIDE;
break;
case GL_LIGHT_MODEL_COLOR_CONTROL:
if (ctx->API != API_OPENGL_COMPAT)
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index d6c2b35c6cc..68afc240dd8 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -3162,16 +3162,6 @@ struct gl_matrix_stack
/**
- * \name A bunch of flags that we think might be useful to drivers.
- *
- * Set in the __struct gl_contextRec::_TriangleCaps bitfield.
- */
-/*@{*/
-#define DD_TRI_LIGHT_TWOSIDE (1 << 1)
-/*@}*/
-
-
-/**
* Composite state flags
*/
/*@{*/
diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c
index da7f713489d..01a7f958c64 100644
--- a/src/mesa/main/state.c
+++ b/src/mesa/main/state.c
@@ -315,27 +315,6 @@ update_twoside(struct gl_context *ctx)
/**
- * Update the ctx->_TriangleCaps bitfield.
- * XXX that bitfield should really go away someday!
- * This function must be called after other update_*() functions since
- * there are dependencies on some other derived values.
- */
-#if 0
-static void
-update_tricaps(struct gl_context *ctx, GLbitfield new_state)
-{
- ctx->_TriangleCaps = 0;
-
- /*
- * Lighting and shading
- */
- if (ctx->Light.Enabled && ctx->Light.Model.TwoSide)
- ctx->_TriangleCaps |= DD_TRI_LIGHT_TWOSIDE;
-}
-#endif
-
-
-/**
* Compute derived GL state.
* If __struct gl_contextRec::NewState is non-zero then this function \b must
* be called before rendering anything.
@@ -411,12 +390,6 @@ _mesa_update_state_locked( struct gl_context *ctx )
if (new_state & (_NEW_MULTISAMPLE | _NEW_BUFFERS))
update_multisample( ctx );
-#if 0
- if (new_state & (_NEW_POINT | _NEW_LINE | _NEW_POLYGON | _NEW_LIGHT
- | _NEW_STENCIL | _MESA_NEW_SEPARATE_SPECULAR))
- update_tricaps( ctx, new_state );
-#endif
-
/* ctx->_NeedEyeCoords is now up to date.
*
* If the truth value of this variable has changed, update for the
diff --git a/src/mesa/tnl/t_vertex.c b/src/mesa/tnl/t_vertex.c
index a42f46053fd..c7a745ed78c 100644
--- a/src/mesa/tnl/t_vertex.c
+++ b/src/mesa/tnl/t_vertex.c
@@ -158,9 +158,9 @@ static void choose_interp_func( struct gl_context *ctx,
struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
GLboolean unfilled = (ctx->Polygon.FrontMode != GL_FILL ||
ctx->Polygon.BackMode != GL_FILL);
- if (vtx->need_extras &&
- ((ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE) ||
- unfilled))) {
+ GLboolean twosided = ctx->Light.Enabled && ctx->Light.Model.TwoSide;
+
+ if (vtx->need_extras && (twosided || unfilled)) {
vtx->interp = _tnl_generic_interp_extras;
} else {
vtx->interp = _tnl_generic_interp;
@@ -176,9 +176,9 @@ static void choose_copy_pv_func( struct gl_context *ctx, GLuint edst, GLuint es
GLboolean unfilled = (ctx->Polygon.FrontMode != GL_FILL ||
ctx->Polygon.BackMode != GL_FILL);
- if (vtx->need_extras &&
- ((ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE) ||
- unfilled))) {
+ GLboolean twosided = ctx->Light.Enabled && ctx->Light.Model.TwoSide;
+
+ if (vtx->need_extras && (twosided || unfilled)) {
vtx->copy_pv = _tnl_generic_copy_pv_extras;
} else {
vtx->copy_pv = _tnl_generic_copy_pv;