From: Eric Anholt Date: Sun, 26 Jun 2005 21:57:23 +0000 (+0000) Subject: Fix crashes during rasterization fallback by avoiding _tnl_need_projected_coords X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3f9839a52b6152d349b5c6279cd7a3d3106b3999;p=mesa.git Fix crashes during rasterization fallback by avoiding _tnl_need_projected_coords during fallbacks. In one case, _swsetup_Wakeup had just been called, covering the need there, and in the other case, we can simply exit the entire radeonChooseVertexState function, knowing that it will be called again once we leave the fallback. Bugzilla #: 2516 Submitted by: sroland --- diff --git a/src/mesa/drivers/dri/r200/r200_swtcl.c b/src/mesa/drivers/dri/r200/r200_swtcl.c index fd1aa783f59..9d5a2f2924a 100644 --- a/src/mesa/drivers/dri/r200/r200_swtcl.c +++ b/src/mesa/drivers/dri/r200/r200_swtcl.c @@ -220,6 +220,13 @@ void r200ChooseVertexState( GLcontext *ctx ) r200ContextPtr rmesa = R200_CONTEXT( ctx ); TNLcontext *tnl = TNL_CONTEXT(ctx); + /* We must ensure that we don't do _tnl_need_projected_coords while in a + * rasterization fallback. As this function will be called again when we + * leave a rasterization fallback, we can just skip it for now. + */ + if (rmesa->Fallback != 0) + return; + GLuint vte = rmesa->hw.vte.cmd[VTE_SE_VTE_CNTL]; GLuint vap = rmesa->hw.vap.cmd[VAP_SE_VAP_CNTL]; @@ -675,7 +682,6 @@ void r200Fallback( GLcontext *ctx, GLuint bit, GLboolean mode ) R200_FIREVERTICES( rmesa ); TCL_FALLBACK( ctx, R200_TCL_FALLBACK_RASTER, GL_TRUE ); _swsetup_Wakeup( ctx ); - _tnl_need_projected_coords( ctx, GL_TRUE ); rmesa->swtcl.RenderIndex = ~0; if (R200_DEBUG & DEBUG_FALLBACKS) { fprintf(stderr, "R200 begin rasterization fallback: 0x%x %s\n", diff --git a/src/mesa/drivers/dri/radeon/radeon_swtcl.c b/src/mesa/drivers/dri/radeon/radeon_swtcl.c index 791b5e50fe9..f126e4982d3 100644 --- a/src/mesa/drivers/dri/radeon/radeon_swtcl.c +++ b/src/mesa/drivers/dri/radeon/radeon_swtcl.c @@ -241,6 +241,13 @@ void radeonChooseVertexState( GLcontext *ctx ) GLuint se_coord_fmt; + /* We must ensure that we don't do _tnl_need_projected_coords while in a + * rasterization fallback. As this function will be called again when we + * leave a rasterization fallback, we can just skip it for now. + */ + if (rmesa->Fallback != 0) + return; + /* HW perspective divide is a win, but tiny vertex formats are a * bigger one. */ @@ -887,7 +894,6 @@ void radeonFallback( GLcontext *ctx, GLuint bit, GLboolean mode ) RADEON_FIREVERTICES( rmesa ); TCL_FALLBACK( ctx, RADEON_TCL_FALLBACK_RASTER, GL_TRUE ); _swsetup_Wakeup( ctx ); - _tnl_need_projected_coords( ctx, GL_TRUE ); rmesa->swtcl.RenderIndex = ~0; if (RADEON_DEBUG & DEBUG_FALLBACKS) { fprintf(stderr, "Radeon begin rasterization fallback: 0x%x %s\n",