diff options
author | Peteri Andras <[email protected]> | 2009-07-13 08:03:16 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2009-07-13 08:04:08 -0600 |
commit | 680f7d09b00fdec0dbe5e357639d6b445bb9266e (patch) | |
tree | 7af192ae832c6cd2d3a6edacb92f93b9b43dca27 /src | |
parent | 022e8e582ee408845bc622d56487b220b27df9a6 (diff) |
r128: fix two-sided lighting segfault seen in GLUT's olight demo
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/dri/r128/r128_state.c | 5 | ||||
-rw-r--r-- | src/mesa/drivers/dri/r128/r128_tris.c | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/r128/r128_tris.h | 2 |
3 files changed, 7 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/r128/r128_state.c b/src/mesa/drivers/dri/r128/r128_state.c index 451dcd1b553..4ae7bf5b97d 100644 --- a/src/mesa/drivers/dri/r128/r128_state.c +++ b/src/mesa/drivers/dri/r128/r128_state.c @@ -771,6 +771,11 @@ static void r128DDLightModelfv( GLcontext *ctx, GLenum pname, FLUSH_BATCH( rmesa ); updateSpecularLighting(ctx); } + + if ( pname == GL_LIGHT_MODEL_TWO_SIDE ) { + FLUSH_BATCH( rmesa ); + r128ChooseRenderState( ctx ); + } } static void r128DDShadeModel( GLcontext *ctx, GLenum mode ) diff --git a/src/mesa/drivers/dri/r128/r128_tris.c b/src/mesa/drivers/dri/r128/r128_tris.c index bcc9ffa651e..5b91271d740 100644 --- a/src/mesa/drivers/dri/r128/r128_tris.c +++ b/src/mesa/drivers/dri/r128/r128_tris.c @@ -426,7 +426,7 @@ r128_fallback_point( r128ContextPtr rmesa, #define ANY_RASTER_FLAGS (DD_TRI_LIGHT_TWOSIDE|DD_TRI_OFFSET|DD_TRI_UNFILLED) #define _R128_NEW_RENDER_STATE (ANY_FALLBACK_FLAGS | ANY_RASTER_FLAGS) -static void r128ChooseRenderState(GLcontext *ctx) +void r128ChooseRenderState(GLcontext *ctx) { r128ContextPtr rmesa = R128_CONTEXT(ctx); GLuint flags = ctx->_TriangleCaps; diff --git a/src/mesa/drivers/dri/r128/r128_tris.h b/src/mesa/drivers/dri/r128/r128_tris.h index d90ca31534e..c0667edb61f 100644 --- a/src/mesa/drivers/dri/r128/r128_tris.h +++ b/src/mesa/drivers/dri/r128/r128_tris.h @@ -38,7 +38,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "main/mtypes.h" extern void r128InitTriFuncs( GLcontext *ctx ); - +extern void r128ChooseRenderState( GLcontext *ctx ); extern void r128Fallback( GLcontext *ctx, GLuint bit, GLboolean mode ); #define FALLBACK( rmesa, bit, mode ) r128Fallback( rmesa->glCtx, bit, mode ) |