diff options
author | Keith Whitwell <[email protected]> | 1999-09-04 14:40:49 +0000 |
---|---|---|
committer | Keith Whitwell <[email protected]> | 1999-09-04 14:40:49 +0000 |
commit | 324beb95f34b29b53c8863af5591fb90393a157e (patch) | |
tree | 102808bdf40fe7e8382caae0b7ccc33f06463e12 /src/mesa/main/context.c | |
parent | da54ffc852996f94dcf46b0cdc40c5ff12b55496 (diff) |
fix for mga depthbuffer resize
Diffstat (limited to 'src/mesa/main/context.c')
-rw-r--r-- | src/mesa/main/context.c | 50 |
1 files changed, 29 insertions, 21 deletions
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 329cb336476..f227c9f4324 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -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) { |