diff options
author | Michel Dänzer <michel@tungstengraphics.com> | 2007-05-23 08:47:17 +0200 |
---|---|---|
committer | Michel Dänzer <michel@tungstengraphics.com> | 2007-05-23 08:47:17 +0200 |
commit | a6918280dfc83c3413fb394df91a547525a002d1 (patch) | |
tree | fea1a2b17d466cc53413d0cf6d166ffd1bea9c8d | |
parent | 28cbb077b8fd88656c74caa7900e1c95d6352b11 (diff) |
i915tex: Set frame mode to flushed before flushing old mode.
This avoids a recursive flush leading to a crash with several glxgears
instances. Hopefully this will also fix multi-context apps.
-rw-r--r-- | src/mesa/drivers/dri/i915tex/intel_frame_tracker.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/mesa/drivers/dri/i915tex/intel_frame_tracker.c b/src/mesa/drivers/dri/i915tex/intel_frame_tracker.c index 8f11a1bfff..be7c4ba160 100644 --- a/src/mesa/drivers/dri/i915tex/intel_frame_tracker.c +++ b/src/mesa/drivers/dri/i915tex/intel_frame_tracker.c @@ -181,16 +181,19 @@ void intel_frame_set_mode( struct intel_frame_tracker *ft, struct intel_context *intel = ft->intel; GLboolean discard_z_buffer = (new_mode == INTEL_FT_SWAP_BUFFERS); GLboolean ignore_buffer_contents = GL_FALSE; + GLuint old_mode = ft->mode; - if (ft->mode == new_mode) + if (old_mode == new_mode) return; if (INTEL_DEBUG & (DEBUG_RENDER|DEBUG_FALLBACKS|DEBUG_FRAME)) _mesa_printf("transiton %s -> %s\n", - mode_name[ft->mode], + mode_name[old_mode], mode_name[new_mode]); - switch (ft->mode) { + ft->mode = INTEL_FT_FLUSHED; + + switch (old_mode) { case INTEL_FT_SWAP_BUFFERS: ignore_buffer_contents = GL_TRUE; start_frame( ft ); @@ -228,8 +231,6 @@ void intel_frame_set_mode( struct intel_frame_tracker *ft, break; } - ft->mode = INTEL_FT_FLUSHED; - switch (new_mode) { case INTEL_FT_GL_FLUSH: case INTEL_FT_SWAP_BUFFERS: |