From 7b7d00ca62d18c71cd3a14a81f5dc12e73248757 Mon Sep 17 00:00:00 2001 From: Felix Kuehling Date: Wed, 23 Feb 2005 20:51:27 +0000 Subject: [PATCH] Don't forget to update a heap's timestamp when a texture image is changed. Other drivers don't need to do this because they're swapping modified textures out of texture memory, which implies a timestamp update. --- src/mesa/drivers/dri/savage/savagetex.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/mesa/drivers/dri/savage/savagetex.c b/src/mesa/drivers/dri/savage/savagetex.c index 0badde9dac7..1b5b7901b58 100644 --- a/src/mesa/drivers/dri/savage/savagetex.c +++ b/src/mesa/drivers/dri/savage/savagetex.c @@ -1470,6 +1470,17 @@ static void savageTexEnv( GLcontext *ctx, GLenum target, } } +/* Update a heap's timestamp when a texture image is modified, so the + * new image is not uploaded while the old one is still in use. + * FIXME: this should be moved to ../common/texmem.c + */ +static void savageTexImageChanged (savageTexObjPtr t) { + /* Update the heap's time stamp, so the new image is not uploaded + * while the old one is still in use. */ + if (t->base.heap && t->base.timestamp > t->base.heap->timestamp) + t->base.heap->timestamp = t->base.timestamp; +} + static void savageTexImage1D( GLcontext *ctx, GLenum target, GLint level, GLint internalFormat, GLint width, GLint border, @@ -1480,7 +1491,7 @@ static void savageTexImage1D( GLcontext *ctx, GLenum target, GLint level, { savageTexObjPtr t = (savageTexObjPtr) texObj->DriverData; if (t) { - /* Do nothing. Marking the image as dirty below is sufficient. */ + savageTexImageChanged (t); } else { t = savageAllocTexObj(texObj); if (!t) { @@ -1509,6 +1520,7 @@ static void savageTexSubImage1D( GLcontext *ctx, savageTexObjPtr t = (savageTexObjPtr) texObj->DriverData; assert( t ); /* this _should_ be true */ if (t) { + savageTexImageChanged (t); savageMarkDirtyTiles(t, level, texImage->Width2, 1, xoffset, 0, width, 1); } else { @@ -1536,7 +1548,7 @@ static void savageTexImage2D( GLcontext *ctx, GLenum target, GLint level, { savageTexObjPtr t = (savageTexObjPtr) texObj->DriverData; if (t) { - /* Do nothing. Marking the image as dirty below is sufficient. */ + savageTexImageChanged (t); } else { t = savageAllocTexObj(texObj); if (!t) { @@ -1565,6 +1577,7 @@ static void savageTexSubImage2D( GLcontext *ctx, savageTexObjPtr t = (savageTexObjPtr) texObj->DriverData; assert( t ); /* this _should_ be true */ if (t) { + savageTexImageChanged (t); savageMarkDirtyTiles(t, level, texImage->Width2, texImage->Height2, xoffset, yoffset, width, height); } else { -- 2.30.2