-/* $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
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
}
}
- /*
- * 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) {
-/* $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
/* Number of nodes of storage needed for each instruction: */
static GLuint InstSize[ OPCODE_END_OF_LIST+1 ];
+void mesa_print_display_list( GLuint list );
/**********************************************************************/
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));
(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;
*/
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 */
}