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
This commit is contained in:
Eric Anholt 2005-06-26 21:57:23 +00:00
parent a4eb693b5f
commit 3f9839a52b
2 changed files with 14 additions and 2 deletions

View File

@ -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",

View File

@ -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",