diff options
-rw-r--r-- | xc/lib/GL/mesa/src/drv/mga/mgatexmem.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/xc/lib/GL/mesa/src/drv/mga/mgatexmem.c b/xc/lib/GL/mesa/src/drv/mga/mgatexmem.c index db779b4ce..146852a88 100644 --- a/xc/lib/GL/mesa/src/drv/mga/mgatexmem.c +++ b/xc/lib/GL/mesa/src/drv/mga/mgatexmem.c @@ -254,8 +254,18 @@ void mgaAgeTextures( mgaContextPtr mmesa, int heap ) idx != MGA_NR_TEX_REGIONS && nr < MGA_NR_TEX_REGIONS ; idx = sarea->texList[heap][idx].prev, nr++) { + /* If switching texturing schemes, then the SAREA might not + * have been properly cleared, so we need to reset the + * global texture LRU. + */ + if ( idx * sz > mmesa->mgaScreen->textureSize[heap] ) { + nr = MGA_NR_TEX_REGIONS; + break; + } + if (sarea->texList[heap][idx].age > mmesa->texAge[heap]) { - mgaTexturesGone(mmesa, heap, idx * sz, sz, 1); + mgaTexturesGone(mmesa, heap, idx * sz, sz, + sarea->texList[heap][idx].in_use); } } |