@@ -1,4 +1,4 @@ | |||
/* $Id: context.c,v 1.4 1999/09/02 13:16:17 keithw Exp $ */ | |||
/* $Id: context.c,v 1.5 1999/09/04 14:40:49 keithw Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
@@ -1293,6 +1293,15 @@ GLcontext *gl_create_context( GLvisual *visual, | |||
ctx->Pixel.DriverReadBuffer = GL_FRONT_LEFT; | |||
} | |||
/* Fill in some driver defaults now. | |||
*/ | |||
ctx->Driver.AllocDepthBuffer = gl_alloc_depth_buffer; | |||
ctx->Driver.ReadDepthSpanFloat = gl_read_depth_span_float; | |||
ctx->Driver.ReadDepthSpanInt = gl_read_depth_span_int; | |||
#ifdef PROFILE | |||
init_timings( ctx ); | |||
#endif | |||
@@ -2173,31 +2182,30 @@ void gl_update_state( GLcontext *ctx ) | |||
} | |||
} | |||
/* | |||
* Update Device Driver interface | |||
/* The driver isn't managing the depth buffer. | |||
*/ | |||
ctx->Driver.AllocDepthBuffer = gl_alloc_depth_buffer; | |||
if (ctx->Depth.Mask) { | |||
switch (ctx->Depth.Func) { | |||
case GL_LESS: | |||
ctx->Driver.DepthTestSpan = gl_depth_test_span_less; | |||
ctx->Driver.DepthTestPixels = gl_depth_test_pixels_less; | |||
break; | |||
case GL_GREATER: | |||
ctx->Driver.DepthTestSpan = gl_depth_test_span_greater; | |||
ctx->Driver.DepthTestPixels = gl_depth_test_pixels_greater; | |||
break; | |||
default: | |||
if (ctx->Driver.AllocDepthBuffer == gl_alloc_depth_buffer) | |||
{ | |||
if (ctx->Depth.Mask) { | |||
switch (ctx->Depth.Func) { | |||
case GL_LESS: | |||
ctx->Driver.DepthTestSpan = gl_depth_test_span_less; | |||
ctx->Driver.DepthTestPixels = gl_depth_test_pixels_less; | |||
break; | |||
case GL_GREATER: | |||
ctx->Driver.DepthTestSpan = gl_depth_test_span_greater; | |||
ctx->Driver.DepthTestPixels = gl_depth_test_pixels_greater; | |||
break; | |||
default: | |||
ctx->Driver.DepthTestSpan = gl_depth_test_span_generic; | |||
ctx->Driver.DepthTestPixels = gl_depth_test_pixels_generic; | |||
} | |||
} | |||
else { | |||
ctx->Driver.DepthTestSpan = gl_depth_test_span_generic; | |||
ctx->Driver.DepthTestPixels = gl_depth_test_pixels_generic; | |||
} | |||
} | |||
else { | |||
ctx->Driver.DepthTestSpan = gl_depth_test_span_generic; | |||
ctx->Driver.DepthTestPixels = gl_depth_test_pixels_generic; | |||
} | |||
ctx->Driver.ReadDepthSpanFloat = gl_read_depth_span_float; | |||
ctx->Driver.ReadDepthSpanInt = gl_read_depth_span_int; | |||
} | |||
if (ctx->NewState & NEW_LIGHTING) { |
@@ -1,4 +1,4 @@ | |||
/* $Id: dlist.c,v 1.2 1999/08/26 14:50:49 keithw Exp $ */ | |||
/* $Id: dlist.c,v 1.3 1999/09/04 14:40:49 keithw Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
@@ -271,6 +271,7 @@ union node { | |||
/* Number of nodes of storage needed for each instruction: */ | |||
static GLuint InstSize[ OPCODE_END_OF_LIST+1 ]; | |||
void mesa_print_display_list( GLuint list ); | |||
/**********************************************************************/ | |||
@@ -2382,14 +2383,9 @@ void gl_compile_cassette( GLcontext *ctx ) | |||
return; | |||
} | |||
/* Do some easy optimizations of the cassette. If current value of | |||
* clip volume hint is GL_FASTEST, we are not clipping anyway, so | |||
* don't calculate the bounds. But - they will not be calculated | |||
* later even if the hint is changed, so this is a slightly odd | |||
* behaviour. | |||
/* Do some easy optimizations of the cassette. | |||
*/ | |||
if (ctx->Hint.ClipVolumeClipping != GL_FASTEST && | |||
im->v.Obj.size < 4 && | |||
if (im->v.Obj.size < 4 && | |||
im->Count > 15) | |||
{ | |||
im->Bounds = (GLfloat (*)[3]) malloc(6 * sizeof(GLfloat)); | |||
@@ -3063,13 +3059,15 @@ void gl_EndList( GLcontext *ctx ) | |||
(void) alloc_instruction( ctx, OPCODE_END_OF_LIST, 0 ); | |||
/* Destroy old list, if any */ | |||
gl_destroy_list(ctx, ctx->CurrentListNum); | |||
/* Install the list */ | |||
HashInsert(ctx->Shared->DisplayList, ctx->CurrentListNum, ctx->CurrentListPtr); | |||
if (MESA_VERBOSE & VERBOSE_DISPLAY_LIST) | |||
mesa_print_display_list(ctx->CurrentListNum); | |||
ctx->CurrentListNum = 0; | |||
ctx->CurrentListPtr = NULL; | |||
ctx->ExecuteFlag = GL_TRUE; | |||
@@ -3080,6 +3078,11 @@ void gl_EndList( GLcontext *ctx ) | |||
*/ | |||
free( ctx->input ); | |||
SET_IMMEDIATE( ctx, ctx->VB->IM ); | |||
gl_reset_input( ctx ); | |||
/* Haven't tracked down why this is needed. | |||
*/ | |||
ctx->NewState = ~0; | |||
ctx->API = ctx->Exec; /* Switch the API function pointers */ | |||
} |