r128: fix two-sided lighting segfault seen in GLUT's olight demo
This commit is contained in:
committed by
Brian Paul
parent
022e8e582e
commit
680f7d09b0
@@ -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 )
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 )
|
||||
|
||||
Reference in New Issue
Block a user