diff options
author | Felix Kuehling <[email protected]> | 2005-02-23 20:51:27 +0000 |
---|---|---|
committer | Felix Kuehling <[email protected]> | 2005-02-23 20:51:27 +0000 |
commit | 7b7d00ca62d18c71cd3a14a81f5dc12e73248757 (patch) | |
tree | ddc3b660416be7ab582bf97e09b33d6037e7bfe5 /src/mesa/drivers | |
parent | 365a0a7c153da53c5e4fb6433751f9dab9a16fa4 (diff) |
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.
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r-- | src/mesa/drivers/dri/savage/savagetex.c | 17 |
1 files 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 { |