summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2008-05-02 10:38:39 -0600
committerBrian Paul <[email protected]>2008-05-02 10:38:39 -0600
commit479d19f5a2bca79104f3b7f94147e94a52a27fea (patch)
treee48a5b673a84701c7ff7f1db82ad87e858da8d49 /src/mesa
parent3d53d38d5e35386de4793162b9dd32e171927059 (diff)
gallium: in st_finalize_texture() check texture dimensions
Check dimensions in addition to target, format, etc. Fixes a bug where we failed to detect a change in texture image sizes and wound up using the old texture data.
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/state_tracker/st_cb_texture.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c
index 80122546fce..1eabef6d924 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -1483,13 +1483,16 @@ st_finalize_texture(GLcontext *ctx,
}
/* Check texture can hold all active levels. Check texture matches
- * target, imageFormat, etc.
+ * target, imageFormat, dimensions, etc.
*/
if (stObj->pt &&
(stObj->pt->target != gl_target_to_pipe(stObj->base.Target) ||
stObj->pt->format !=
st_mesa_format_to_pipe_format(firstImage->base.TexFormat->MesaFormat) ||
stObj->pt->last_level < stObj->lastLevel ||
+ stObj->pt->width[0] != firstImage->base.Width2 ||
+ stObj->pt->height[0] != firstImage->base.Height2 ||
+ stObj->pt->depth[0] != firstImage->base.Depth2 ||
stObj->pt->cpp != cpp ||
stObj->pt->compressed != firstImage->base.IsCompressed)) {
pipe_texture_release(&stObj->pt);