summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker/st_cb_texture.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2008-05-06 08:37:28 -0600
committerBrian Paul <brian.paul@tungstengraphics.com>2008-05-06 08:37:28 -0600
commit809dd9089bae70cf35cea6a75258e700e7455738 (patch)
treede04333b4445149426af3f52ac1ca36578e06367 /src/mesa/state_tracker/st_cb_texture.c
parentd0279fc4b38c72356a341173317bcd45d9093f45 (diff)
gallium: sync up texture/sampler changes with master
Diffstat (limited to 'src/mesa/state_tracker/st_cb_texture.c')
-rw-r--r--src/mesa/state_tracker/st_cb_texture.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c
index 1a1ab99f23..a77b16e0ab 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -1476,17 +1476,19 @@ st_finalize_texture(GLcontext *ctx,
/* If we already have a gallium texture, check that it matches the texture
* object's format, target, size, num_levels, 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->cpp != cpp ||
- stObj->pt->width[0] != firstImage->base.Width2 ||
- stObj->pt->height[0] != firstImage->base.Height2 ||
- stObj->pt->depth[0] != firstImage->base.Depth2 ||
- stObj->pt->compressed != firstImage->base.IsCompressed)) {
- pipe_texture_release(&stObj->pt);
+ if (stObj->pt) {
+ const enum pipe_format fmt =
+ st_mesa_format_to_pipe_format(firstImage->base.TexFormat->MesaFormat);
+ if (stObj->pt->target != gl_target_to_pipe(stObj->base.Target) ||
+ stObj->pt->format != fmt ||
+ 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);
+ }
}
/* May need to create a new gallium texture: